blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6d03945ac51a60c31953cd3bb926dc8ad37be631
|
498617fa9ec3642cff07a99d98799ac271fe393b
|
/src/esdeveniments/Persona.java
|
d012302d3fc902a8f03400350a7426a8732a2887
|
[] |
no_license
|
hecrj/ies
|
b2be4e9170358e24348089c447be2cc805a97533
|
816a71660217604334f2a55660b84277ac52eb70
|
refs/heads/master
| 2020-04-06T04:30:35.122764 | 2013-06-03T21:56:25 | 2013-06-03T21:56:25 | 10,321,120 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 685 |
java
|
package esdeveniments;
import ies.utils.Tuple;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
/**
*
* @author hector
*/
public class Persona
{
private String nom;
private List<Inscripcio> inscripcions;
public Tuple<Set<String>, Float> getPuntsAssistencia()
{
Tuple<Set<String>, Float> punts = new Tuple(new TreeSet(), 0);
for(Inscripcio inscripcio : inscripcions)
{
if(inscripcio.esCancelada())
punts.first.add(inscripcio.getNomOrganitzadorEsdeveniment());
punts.second += inscripcio.getPuntuacio();
}
return punts;
}
}
|
[
"[email protected]"
] | |
a5add05bbad719de3592f080ef871f9d35efb338
|
aac03528e097ef4a98b6f9827af804686516934e
|
/middleware/src/main/java/uk/ac/cam/seh208/middleware/core/comms/AddressBuilder.java
|
d82f799fc86e172185c1aebe8687674e3417e78c
|
[
"Apache-2.0"
] |
permissive
|
Homlet/middleware-android
|
28e0a5af6b1b3f284b00533731c02cefc25e901d
|
ed2852de74961ae33b9388d01ee39f7df4d7bc17
|
refs/heads/master
| 2021-09-14T20:05:20.863812 | 2018-05-18T14:57:41 | 2018-05-18T14:57:41 | 109,187,937 | 1 | 0 | null | 2018-05-18T14:57:42 | 2017-11-01T21:54:11 |
Java
|
UTF-8
|
Java
| false | false | 654 |
java
|
package uk.ac.cam.seh208.middleware.core.comms;
import uk.ac.cam.seh208.middleware.core.exception.MalformedAddressException;
/**
* Interface for builders of addresses that can be serialised to strings.
*/
public interface AddressBuilder {
/**
* Build the address from a string in the associated address language.
*
* @param string The address string.
*
* @return a reference to this.
*/
AddressBuilder fromString(String string) throws MalformedAddressException;
/**
* Return the immutable address.
*
* @return reference to a newly constructed Address object.
*/
Address build();
}
|
[
"[email protected]"
] | |
1cf62e50f24fc976972ac2ca3a43780d222c6776
|
e4a3add9181138f96ac167165dfcc6aa9565f172
|
/src/main/java/pl/szczawinski/encounter/data/ManagerRepository.java
|
6b253437457888beafae446eb991538d32de0f49
|
[] |
no_license
|
szczawinski/encounter
|
aa24300ebb8eab2aa2d52c17b5321de990d5b483
|
782f5036a4aa161c26be6920a2ecdcffeba35c10
|
refs/heads/master
| 2021-04-27T07:40:11.823904 | 2021-02-11T18:30:34 | 2021-02-11T18:30:34 | 122,637,716 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 439 |
java
|
//package pl.szczawinski.encounter.data;
//
//import org.springframework.data.repository.Repository;
//import org.springframework.data.rest.core.annotation.RepositoryRestResource;
//import pl.szczawinski.encounter.domain.Manager;
//
//@RepositoryRestResource(exported = false)
//public interface ManagerRepository extends Repository<Manager, Long> {
//
// Manager save(Manager manager);
//
// Manager findByName(String name);
//
//}
|
[
"[email protected]"
] | |
67ee5cc4ee8b07e9e55f7f3a23a2c257cfd6fad1
|
1ec0526bc690e4b04b0270a241fa10335b51ac58
|
/src/test/java/com/example/study/repository/OrderDetailRepositoryTest.java
|
ac7b5663f8ea9e25b5fcf653d7b3df7e5f1f5f19
|
[] |
no_license
|
jihoahn9303/SpringBoot_AdminPage
|
e53b5b0a69e85fe49c2d64398fbee7dfd29204e7
|
2b30d07e283b4c12db6ff7eee56be626b43e91c0
|
refs/heads/master
| 2021-04-16T09:03:41.501772 | 2020-03-19T09:04:46 | 2020-03-19T09:04:46 | 249,343,734 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,569 |
java
|
package com.example.study.repository;
import com.example.study.StudyApplicationTests;
import com.example.study.model.entity.Item;
import com.example.study.model.entity.OrderDetail;
import com.example.study.model.enumclass.OrderStatus;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Optional;
public class OrderDetailRepositoryTest extends StudyApplicationTests {
@Autowired
private OrderDetailRepository orderDetailRepository;
@Autowired
private ItemRepository itemRepository;
@Test
public void create() {
OrderDetail orderDetail = new OrderDetail();
int quantity = 1;
Long itemId = 1L;
Long orderGroupId = 1L;
BigDecimal totalPrice;
Optional<Item> item = itemRepository.findById(itemId);
totalPrice = BigDecimal.valueOf(item.map(i -> i.getPrice()).get().intValue() * quantity);
orderDetail.setStatus(OrderStatus.DEPOSIT_WAITING);
orderDetail.setArrivalDate(LocalDate.now().plusDays(2));
// orderDetail.setItemId(itemId);
orderDetail.setQuantity(quantity);
orderDetail.setTotalPrice(totalPrice);
// orderDetail.setOrderGroupId(orderGroupId); // 어떠한 장바구니에
// orderDetail.setItemId(itemId); // 어떠한 상품
OrderDetail newOrderDetail = orderDetailRepository.save(orderDetail);
Assertions.assertNotNull(newOrderDetail);
}
}
|
[
"[email protected]"
] | |
bd61c7ee71c597e5cc8a2d31a375b56cc0abae60
|
fb043628c7244036a16fdd444860ec4bba56b42d
|
/app/src/main/java/com/cyanbirds/momo/adapter/PhotosAdapter.java
|
d9c470e32c444ed7cb1903dc4164620b436f6810
|
[] |
no_license
|
wybilold1999/MOProject
|
0827d50bf3f8a0bf0b8b608a115c4ffae71f0cc7
|
cad2ee4d0c773eb239c608a578d64f27b6832223
|
refs/heads/master
| 2021-01-21T10:19:00.589451 | 2017-09-28T07:43:12 | 2017-09-28T07:43:12 | 91,684,524 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,238 |
java
|
package com.cyanbirds.momo.adapter;
import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import com.cyanbirds.momo.R;
import java.util.List;
/**
* @author Cloudsoar(wangyb)
* @datetime 2015-12-26 18:34 GMT+8
* @email [email protected]
*/
public class PhotosAdapter extends ArrayAdapter<String> implements
OnItemClickListener {
private OnImgItemClickListener mItemClickListener;
public PhotosAdapter(Context context, List<String> objects,
GridView imgGrid) {
super(context, 0, objects);
imgGrid.setOnItemClickListener(this);
}
@Override
public int getCount() {
return super.getCount();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(
R.layout.item_personal_photo, null);
holder = new ViewHolder();
holder.photo = (ImageView) convertView
.findViewById(R.id.photo);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
// holder.photo.setImageURI(Uri.parse(getItem(position)));
return convertView;
}
private class ViewHolder {
ImageView photo;
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
if (mItemClickListener != null) {
mItemClickListener.onImgItemClick(position);
}
}
/**
* 回调监听
*/
public interface OnImgItemClickListener {
void onImgItemClick(int position);
}
/**
* 设置监听
*
* @param listener
*/
public void setOnImgItemClickListener(OnImgItemClickListener listener) {
mItemClickListener = listener;
}
}
|
[
"[email protected]"
] | |
d8a482b10fa7851a51e9277b0d7316aacb0e2ef6
|
16fcd546152cf788af162eb3bbf08a60c5f46154
|
/src/com/rongji/websiteMonitor/dao/MonitoringPointDao.java
|
ff4bec6cbda96ffb373c7642a7ff0e5b894a1b35
|
[] |
no_license
|
MonitorDev/monitor
|
3b912f4de9eace411fdb8a3213830782144d9399
|
167b93f83d0fc3007322bd565ea522c0d2703273
|
refs/heads/master
| 2021-01-10T15:49:38.744922 | 2015-12-24T09:50:08 | 2015-12-24T09:50:08 | 48,536,571 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,142 |
java
|
package com.rongji.websiteMonitor.dao;
import java.util.List;
import com.rongji.dfish.base.Page;
import com.rongji.dfish.dao.PubCommonDAO;
import com.rongji.websiteMonitor.common.spl.SearchContainer;
import com.rongji.websiteMonitor.persistence.MonitoringPoint;
public interface MonitoringPointDao extends PubCommonDAO {
public List<MonitoringPoint> findMonitorPointsByPage(Page page,
boolean ignoreSearchConditions);
public MonitoringPoint getMonitoringPoint(String mpId);
public List<MonitoringPoint> findMonitorPoints(String mpName);
public void saveMonitorPoint(MonitoringPoint point);
public void updateMonitorPoint(MonitoringPoint point);
public List<MonitoringPoint> findMonitorPointByContainer(
SearchContainer container, Page page);
public boolean delete(MonitoringPoint point)throws Exception;
/**
* 根据网络类型分页查找
* @param page
* @param ignoreSearchConditions
* @param isExternal 网络类型(0:内部网络;1:外部网络)
* @return
*/
public List<MonitoringPoint> findMonitorPointsByPageAndIsExternal(Page page, boolean ignoreSearchConditions, String isExternal);
}
|
[
"[email protected]"
] | |
0b5bdc4f70c862ab6fd1b31e0522369e4232a262
|
714a1d3230c66c57285f7da234b94b505ef964c9
|
/src/main/java/com/toceansoft/permission/service/UserService.java
|
7ef774af02d1e6376b50db834a7f26d0ced980c2
|
[] |
no_license
|
narci2010/permission
|
ffbadf138686618f09cc40aefcd616155f9dbcac
|
0ecf69668295fdb65c3a0da4a501c30b8560f22a
|
refs/heads/master
| 2021-01-21T21:38:13.540481 | 2017-07-27T09:51:44 | 2017-07-27T09:51:44 | 98,519,230 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,059 |
java
|
package com.toceansoft.permission.service;
import com.toceansoft.permission.entity.User;
import java.util.List;
import java.util.Set;
/**
* <p>User: Narci Lee
* <p>Date: 17-7-27
* <p>Version: 1.0
*/
public interface UserService {
/**
* 创建用户
* @param user
*/
public User createUser(User user);
public User updateUser(User user);
public void deleteUser(Long userId);
/**
* 修改密码
* @param userId
* @param newPassword
*/
public void changePassword(Long userId, String newPassword);
User findOne(Long userId);
List<User> findAll();
/**
* 根据用户名查找用户
* @param username
* @return
*/
public User findByUsername(String username);
/**
* 根据用户名查找其角色
* @param username
* @return
*/
public Set<String> findRoles(String username);
/**
* 根据用户名查找其权限
* @param username
* @return
*/
public Set<String> findPermissions(String username);
}
|
[
"[email protected]"
] | |
e8dc8dbe604cd07e8f455a3cedc0f815e8d82fb7
|
4910e6cc81ce60aded43f357512604cb492a94ce
|
/src/main/java/com/bw/controller/HelloTest.java
|
c8f68d058c651c0089a8984cef8b6cc9dee9bca0
|
[] |
no_license
|
0507chen/test03
|
851825b5426b60a12fbddfa1714ebd9d5c8c026a
|
215c5fbb0f8cd6ead26ffa27c9fd38cbb31289a3
|
refs/heads/master
| 2020-05-14T14:20:49.306488 | 2019-04-17T06:12:34 | 2019-04-17T06:12:34 | 181,830,971 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 179 |
java
|
package com.bw.controller;
public class HelloTest {
public void test1() {
System.out.println("测试HelloTest++++++++++++++++++++++++++++++++++++++++++++++");
}
}
|
[
"[email protected]"
] | |
1fcd90dfc9b7b9f0ddd4e57b4662d7dd01296eae
|
9910f2f2ebede570670b4507a261c9331ec69640
|
/src/main/java/com/rocantonio/Repository/EquipoRepository.java
|
ec8dbdde5d77ee7c7db0749f03df498d01689cad
|
[] |
no_license
|
rocantonio/ligaBaloncesto2
|
4a5fa4b398738743515be9ed8e4dfc08aa2adb34
|
8a24ad1f2aa3f5d207758d427a9392df60bbd195
|
refs/heads/master
| 2021-01-10T04:23:57.306573 | 2015-10-27T19:31:09 | 2015-10-27T19:31:09 | 44,627,414 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 415 |
java
|
package com.rocantonio.Repository;
import com.rocantonio.Model.Equipo;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
* Created by rocag on 08/10/2015.
*/
public interface EquipoRepository extends PagingAndSortingRepository<Equipo, Long> {
List<Equipo> findByNombreContaining(String name);
List<Equipo> findByLocalidadContaining(String localidad);
}
|
[
"[email protected]"
] | |
81ac030f6916011d961f2cf3d1677c0d32a57569
|
cb85e1fad060beac0c86e7c7f9610182e18a825b
|
/src/test/java/stepDefinition/Reservation2Test.java
|
bf03ebf43fba604849a132de0b34b758e1edbc0f
|
[] |
no_license
|
monaTheQA/NewToursTestsAutomation
|
54563c37ec1b1d6121b4e77893d53db628193638
|
b9866eed250e68a04c8ce4aa7b8e4e3bd2c69d5f
|
refs/heads/master
| 2022-07-13T04:40:16.182636 | 2019-10-12T21:18:30 | 2019-10-12T21:18:30 | 214,649,242 | 0 | 0 | null | 2022-06-29T17:42:16 | 2019-10-12T13:09:42 |
HTML
|
UTF-8
|
Java
| false | false | 550 |
java
|
package stepDefinition;
import org.testng.annotations.Test;
import Base.BasePage;
import Pages.Reservation2Page;
import Pages.ReservationPage;
public class Reservation2Test extends BasePage{
public Reservation2Page reservation2Page;
@Test(priority = 7)
public void goToRegervation2Page() {
reservation2Page = new Reservation2Page(getDriver());
}
@Test(priority = 8)
public void FlightesDetails() {
reservation2Page.selectFlight();
}
@Test(priority = 9)
public void Continue2() {
reservation2Page.ClickContinueButton();
}
}
|
[
"[email protected]"
] | |
74f850feb086dbba310284b049148d34172ca839
|
4c03a77de32fed8492a3a4c73191060311d34f70
|
/src/main/java/com/cinema/mvc/dao/DashboardDaoImpl.java
|
5265f7f80492e7f264b5ee0c9bf6996ce1e7f398
|
[] |
no_license
|
ESSAFIF/Gestion_Cinema
|
ce446397c4b66392b1387bddf03b8d92a8deab7b
|
b33becbdbcf0a259243962a734a7374cc9cf4725
|
refs/heads/master
| 2022-12-22T07:07:58.312251 | 2020-12-20T21:56:28 | 2020-12-20T21:56:28 | 213,173,341 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,678 |
java
|
package com.cinema.mvc.dao;
import com.cinema.mvc.dashboard.ListFilm;
import com.cinema.mvc.dashboard.StatCine;
import com.cinema.mvc.dashboard.StatFilm;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.persistence.StoredProcedureQuery;
import org.springframework.beans.factory.annotation.Autowired;
public class DashboardDaoImpl implements DashboardDao {
@PersistenceContext
EntityManager em;
@Override
public List<List<Map<Object, Object>>> getHistjsChartData() {
Map<Object,Object> map = null;
List<List<Map<Object,Object>>> list= new ArrayList<List<Map<Object,Object>>>();
List<Map<Object,Object>> dataPoints = new ArrayList<Map<Object,Object>>();
try
{
StoredProcedureQuery storedProcedure1 = em.createStoredProcedureQuery("delete_statfilm");
storedProcedure1.execute();
StoredProcedureQuery storedProcedure2 = em.createStoredProcedureQuery("stat_film");
storedProcedure2.execute();
}
catch (Exception e) {
e.printStackTrace();
}
Query query1 = em.createQuery("select t from statfilm t");
List<StatFilm>stat1= query1.getResultList();
for(int i=0;i<stat1.size();i++ )
{
StatFilm canvas = stat1.get(i);
map = new HashMap<Object, Object>();
map.put("label", canvas.getKind());
map.put("y", canvas.getNb_film());
dataPoints.add(map);
}
list.add(dataPoints);
return list;
}
@Override
public List<List<Map<Object, Object>>> getPiejsChartData(){
Map<Object,Object> map = null;
List<List<Map<Object,Object>>> list= new ArrayList<List<Map<Object,Object>>>();
List<Map<Object,Object>> dataPoints = new ArrayList<Map<Object,Object>>();
try
{
StoredProcedureQuery storedProcedure3 = em.createStoredProcedureQuery("delete_statcine");
storedProcedure3.execute();
StoredProcedureQuery storedProcedure4 = em.createStoredProcedureQuery("stat_cine");
storedProcedure4.execute();
}
catch (Exception e) {
e.printStackTrace();
}
Query query2 = em.createQuery("select t from statcine t");
List<StatCine>stat2= query2.getResultList();
for(int i=0;i<stat2.size();i++ )
{
final StatCine canvas = stat2.get(i);
map = new HashMap<Object, Object>();
map.put("label", canvas.getCine());
map.put("y", canvas.getNb_film());
dataPoints.add(map);
}
list.add(dataPoints);
return list;
}
@Override
public List<ListFilm> findAll(){
try
{
StoredProcedureQuery storedProcedure5 = em.createStoredProcedureQuery("delete_listfilm");
storedProcedure5.execute();
StoredProcedureQuery storedProcedure6 = em.createStoredProcedureQuery("listFilm");
storedProcedure6.execute();
}
catch (Exception e) {
e.printStackTrace();
}
Query query3 = em.createQuery("select t from listfilm t");
return query3.getResultList();
}
@Override
public List<ListFilm> listCine(){
try
{
StoredProcedureQuery storedProcedure7 = em.createStoredProcedureQuery("listFilm");
storedProcedure7.execute();
}
catch (Exception e) {
e.printStackTrace();
}
Query query4 = em.createQuery("SELECT name, num_cine from listfilm group by name, num_cine");
return query4.getResultList();
}
}
|
[
"[email protected]"
] | |
72db2b46f6e8f482ec0d75929829b5eb557f5a6a
|
b0d1dd5611bd6deb4cd5549dc778d7c6cd77477a
|
/sams-fee-0.0.8/src/com/narendra/sams/fee/service/impl/FeePaymentServiceImpl.java
|
bdef85c85063108fc084044981453586e4346701
|
[] |
no_license
|
kajubaba/kamlesh
|
a28496e4bb8a277532ed01c9c9e0ced31b27b064
|
3419fd55afe8044660948cd6ed5342ed025b81e8
|
refs/heads/master
| 2021-07-06T16:22:47.738261 | 2017-10-02T06:59:23 | 2017-10-02T06:59:23 | 105,502,681 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,470 |
java
|
package com.narendra.sams.fee.service.impl;
import com.narendra.sams.admission.dao.FeePaymentDAO;
import com.narendra.sams.admission.dao.StudentDAO;
import com.narendra.sams.admission.domain.FeeTransaction;
import com.narendra.sams.admission.domain.Student;
import com.narendra.sams.admission.service.StudentIdGeneratorService;
import com.narendra.sams.admission.service.StudentService;
import com.narendra.sams.communication.service.SmsSender;
import com.narendra.sams.core.domain.AcademicYear;
import com.narendra.sams.core.domain.AcademicYearAdmissionCount;
import com.narendra.sams.core.domain.InstituteSetting;
import com.narendra.sams.core.domain.StudentStatus;
import com.narendra.sams.core.exception.OperationCanNotSucceedException;
import com.narendra.sams.core.service.AcademicYearFeeService;
import com.narendra.sams.core.service.InstituteSettingService;
import com.narendra.sams.fee.domain.PayFeeReturn;
import com.narendra.sams.fee.service.CustomizeStudentFeeService;
import com.narendra.sams.fee.service.FeePaymentService;
import com.narendra.sams.fee.service.StudentActivityService;
public class FeePaymentServiceImpl implements FeePaymentService {
private AcademicYearFeeService academicYearFeeService;
private CustomizeStudentFeeService customizeStudentFeeService;
private FeePaymentDAO feePaymentDAO;
private InstituteSettingService instituteSettingService;
private SmsSender smsSender;
private StudentActivityService studentActivityService;
private StudentDAO studentDAO;
private StudentIdGeneratorService studentIdGeneratorService;
private StudentService studentService;
public FeePaymentDAO getFeePaymentDAO() {
return this.feePaymentDAO;
}
public void setFeePaymentDAO(FeePaymentDAO feePaymentDAO) {
this.feePaymentDAO = feePaymentDAO;
}
public StudentDAO getStudentDAO() {
return this.studentDAO;
}
public void setStudentDAO(StudentDAO studentDAO) {
this.studentDAO = studentDAO;
}
public StudentActivityService getStudentActivityService() {
return this.studentActivityService;
}
public void setStudentActivityService(StudentActivityService studentActivityService) {
this.studentActivityService = studentActivityService;
}
public StudentService getStudentService() {
return this.studentService;
}
public void setStudentService(StudentService studentService) {
this.studentService = studentService;
}
public AcademicYearFeeService getAcademicYearFeeService() {
return this.academicYearFeeService;
}
public void setAcademicYearFeeService(AcademicYearFeeService academicYearFeeService) {
this.academicYearFeeService = academicYearFeeService;
}
public CustomizeStudentFeeService getCustomizeStudentFeeService() {
return this.customizeStudentFeeService;
}
public void setCustomizeStudentFeeService(CustomizeStudentFeeService customizeStudentFeeService) {
this.customizeStudentFeeService = customizeStudentFeeService;
}
public SmsSender getSmsSender() {
return this.smsSender;
}
public void setSmsSender(SmsSender smsSender) {
this.smsSender = smsSender;
}
public InstituteSettingService getInstituteSettingService() {
return this.instituteSettingService;
}
public void setInstituteSettingService(InstituteSettingService instituteSettingService) {
this.instituteSettingService = instituteSettingService;
}
public StudentIdGeneratorService getStudentIdGeneratorService() {
return this.studentIdGeneratorService;
}
public void setStudentIdGeneratorService(StudentIdGeneratorService studentIdGeneratorService) {
this.studentIdGeneratorService = studentIdGeneratorService;
}
public synchronized PayFeeReturn payFee(FeeTransaction feeTransaction, Long userId) {
PayFeeReturn payFeeReturn;
if (feeTransaction == null) {
payFeeReturn = null;
} else {
if (feeTransaction.getCustomizeInstallment() != null) {
feeTransaction.setAcademicYear(this.customizeStudentFeeService.getCustomizeInstallment(feeTransaction.getCustomizeInstallment().getId()).getAcademicYearFee().getAcademicYear());
} else {
feeTransaction.setAcademicYear(this.academicYearFeeService.getAcademicYearFeeInstallment(feeTransaction.getAcademicYearFeeInstallment().getId()).getAcademicYearFee().getAcademicYear());
}
Student student = this.studentDAO.getStudentById(feeTransaction.getStudent().getId());
feeTransaction.setInstitute(student.getInstitute());
AcademicYearAdmissionCount academicYearAdmissionCount = this.studentDAO.loadAcademicYearAdmissionCount(feeTransaction.getAcademicYear().getId());
String transactionId = prepareTransactionId(academicYearAdmissionCount.getTransactionCount(), feeTransaction.getAcademicYear());
feeTransaction.setTransactionId(transactionId);
InstituteSetting instituteSetting = this.instituteSettingService.getInstituteSetting(student.getInstitute().getId());
long recieptNo = instituteSetting.getFeeSettings().getLastFeeReceiptNo().longValue() + 1;
Long dbTransactionId = this.feePaymentDAO.payFee(feeTransaction, userId);
this.smsSender.sendFeeDepositSMS(student.getId(), feeTransaction.getFeeSum(), feeTransaction.getPaymentDate());
academicYearAdmissionCount.setTransactionCount(Long.valueOf(academicYearAdmissionCount.getTransactionCount().longValue() + 1));
instituteSetting.getFeeSettings().setLastFeeReceiptNo(Long.valueOf(recieptNo));
feeTransaction.setRecieptNo(Long.valueOf(recieptNo));
if (!StudentStatus.CONFIRMED.equals(student.getStudentStatus().getId())) {
try {
this.studentActivityService.updateStudentStatus(student.getId(), StudentStatus.CONFIRMED, userId, "System automtically confirmed student on fee payment");
} catch (OperationCanNotSucceedException e) {
e.printStackTrace();
}
}
this.studentIdGeneratorService.generateStudentId(student.getId());
payFeeReturn = new PayFeeReturn();
payFeeReturn.setRecieptNo(Long.valueOf(recieptNo));
payFeeReturn.setTransactionId(transactionId);
payFeeReturn.setDbTransactionId(dbTransactionId);
}
return payFeeReturn;
}
private synchronized String prepareTransactionId(Long transactionCount, AcademicYear academicYear) {
StringBuffer sb;
sb = new StringBuffer();
long count = transactionCount.longValue() + 1;
sb.append(academicYear.getName().trim().substring(2, 4));
if (count < 10) {
sb.append("0000000");
} else if (count < 100) {
sb.append("000000");
} else if (count < 1000) {
sb.append("00000");
} else if (count < 10000) {
sb.append("0000");
} else if (count < 100000) {
sb.append("000");
} else if (count < 1000000) {
sb.append("00");
} else if (count < 10000000) {
sb.append("0");
} else if (count < 100000000) {
sb.append("");
}
sb.append(count);
return sb.toString();
}
}
|
[
"[email protected]"
] | |
5f306260d9e4d040d8f4d6445637c2b2f52a7704
|
6253283b67c01a0d7395e38aeeea65e06f62504b
|
/decompile/app/HwDeskClock/src/main/java/android/support/v4/app/NotificationCompatSideChannelService.java
|
470e41e2105fe6c973cf9131d5a278651b8bc24e
|
[] |
no_license
|
sufadi/decompile-hw
|
2e0457a0a7ade103908a6a41757923a791248215
|
4c3efd95f3e997b44dd4ceec506de6164192eca3
|
refs/heads/master
| 2023-03-15T15:56:03.968086 | 2017-11-08T03:29:10 | 2017-11-08T03:29:10 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,828 |
java
|
package android.support.v4.app;
import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.os.Build.VERSION;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.v4.app.INotificationSideChannel.Stub;
public abstract class NotificationCompatSideChannelService extends Service {
private class NotificationSideChannelStub extends Stub {
private NotificationSideChannelStub() {
}
public void notify(String packageName, int id, String tag, Notification notification) throws RemoteException {
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), packageName);
long idToken = clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.notify(packageName, id, tag, notification);
} finally {
restoreCallingIdentity(idToken);
}
}
public void cancel(String packageName, int id, String tag) throws RemoteException {
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), packageName);
long idToken = clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.cancel(packageName, id, tag);
} finally {
restoreCallingIdentity(idToken);
}
}
public void cancelAll(String packageName) {
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), packageName);
long idToken = clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.cancelAll(packageName);
} finally {
restoreCallingIdentity(idToken);
}
}
}
public abstract void cancel(String str, int i, String str2);
public abstract void cancelAll(String str);
public abstract void notify(String str, int i, String str2, Notification notification);
public IBinder onBind(Intent intent) {
if (!intent.getAction().equals("android.support.BIND_NOTIFICATION_SIDE_CHANNEL") || VERSION.SDK_INT > 19) {
return null;
}
return new NotificationSideChannelStub();
}
private void checkPermission(int callingUid, String packageName) {
String[] packagesForUid = getPackageManager().getPackagesForUid(callingUid);
int i = 0;
int length = packagesForUid.length;
while (i < length) {
if (!packagesForUid[i].equals(packageName)) {
i++;
} else {
return;
}
}
throw new SecurityException("NotificationSideChannelService: Uid " + callingUid + " is not authorized for package " + packageName);
}
}
|
[
"[email protected]"
] | |
c7c23a1e5ced77ebe30f89b5d7a33acb9dbf7029
|
d2be253ee85849e1bcc17546c58c57ffb4f62848
|
/paymentWalletApplication/src/test/java/com/capg/walletapp/service/ApplicationDataValidateTest.java
|
6d48d3fa211e24763ef3dc17b427567fa81c949c
|
[] |
no_license
|
RithishBathula/PaymentWalletApplication
|
50b7e5294e721609a0c2fe7c29e47fc31f2c2bb4
|
f83f46db175bcecb4c16198f4c99f632cfa9bb30
|
refs/heads/master
| 2020-03-23T12:42:21.741978 | 2018-07-19T12:40:11 | 2018-07-19T12:40:11 | 140,437,429 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,203 |
java
|
package com.capg.walletapp.service;
import com.capg.walletapp.bean.WalletApplication;
import junit.framework.TestCase;
public class ApplicationDataValidateTest extends TestCase {
WalletApplication bean = new WalletApplication();
ApplicationDataValidate validate = new ApplicationDataValidate();
public void testValidateAge() {
assertEquals(true, validate.validateAge(21));
assertEquals(false, validate.validateAge(10));
}
public void testValidateMail() {
assertEquals(true, validate.validateMail("[email protected]"));
assertEquals(false, validate.validateMail("rithish@gmail"));
assertEquals(false, validate.validateMail(""));
}
public void testValidateUsername() {
assertEquals(true, validate.validateUsername("rithish"));
assertEquals(false, validate.validateUsername(" rithish"));
assertEquals(false, validate.validateUsername(""));
}
public void testValidatePassword() {
assertEquals(true, validate.validatePassword("12345678"));
assertEquals(false, validate.validatePassword("123"));
assertEquals(false, validate.validatePassword(" 1235678"));
assertEquals(false, validate.validatePassword(""));
}
public void testValidateContact() {
assertEquals(true, validate.validateContact("9876543212"));
assertEquals(false, validate.validateContact("987652"));
assertEquals(false, validate.validateContact(""));
}
public void testValidateGender() {
assertEquals(true, validate.validateGender("male"));
assertEquals(true, validate.validateGender("m"));
assertEquals(true, validate.validateGender("female"));
assertEquals(true, validate.validateGender("f"));
assertEquals(false, validate.validateGender("ma3"));
}
public void testValidateAmount() {
assertEquals(true, validate.validateBalance(123));
assertEquals(false, validate.validateBalance(-123));
}
public void testValidateCustomerName() {
assertEquals(true, validate.validateCustomerName("rithish"));
assertEquals(false, validate.validateCustomerName("7rithish"));
assertEquals(false, validate.validateCustomerName("@rithish"));
assertEquals(false, validate.validateCustomerName(""));
}
}
|
[
"[email protected]"
] | |
7f7ede92c6b579a4385dcde8c6a0e7bde8ec117b
|
9c5eb79a09f9d1c1fb55865b0e284610dbd00127
|
/BA105G1-final/src/com/man_aut/model/Man_autDAO_Interface.java
|
c09783a41c693783332d0127518a6c9bc46ee8a1
|
[] |
no_license
|
fred-wu-gt/ba105
|
767a05c8cb062cd12249afb2957b34eff54e106b
|
3b0ee1e244d257021b6bb0b56995b255eb7b01b1
|
refs/heads/master
| 2021-09-06T22:28:46.616565 | 2018-02-12T16:06:35 | 2018-02-12T16:06:35 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 297 |
java
|
package com.man_aut.model;
import java.util.List;
public interface Man_autDAO_Interface {
void add(Man_autVO man_autVO);
void delete(String mf_no, String man_no);
List<Man_autVO> findByMf_no(String mf_no);
List<Man_autVO> findByMan_no(String man_no);
List<Man_autVO> getAll();
}
|
[
"fred8@DESKTOP-FUHPI3P"
] |
fred8@DESKTOP-FUHPI3P
|
8154f0a4d708c3568383acdde53970218f11fd03
|
c10810b55415d81f0c6c712815d56e2ac5bb352a
|
/files/gen/PathTile.java
|
0f383be82da89c44078b24c4da8a048297500310
|
[] |
no_license
|
Sh1tonfire/kore-bot
|
0df1a3ce59fe92856ab3d2b3386c3f8fcb6cf68e
|
559db0241841ba7804491d71e8f3ece42e828f2d
|
refs/heads/main
| 2023-03-16T13:15:25.798176 | 2021-03-04T23:23:39 | 2021-03-04T23:23:39 | 344,398,273 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,808 |
java
|
/*
* Decompiled with CFR 0.151.
*/
package mindustry.gen;
public final class PathTile {
public static int health(int pathtile) {
return (int)((long)(pathtile >>> 0) & 0xFFL);
}
public static int health(int pathtile, int value) {
return (int)((long)pathtile & 0xFFL | (long)(value << 0));
}
public static int team(int pathtile) {
return (int)((long)(pathtile >>> 8) & 0xFFL);
}
public static int team(int pathtile, int value) {
return (int)((long)pathtile & 0xFF00L | (long)(value << 8));
}
public static boolean solid(int pathtile) {
return ((long)pathtile & 0x10000L) != 0L;
}
public static int solid(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFFEFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFFEFFFFL | 0x10000L);
}
public static boolean liquid(int pathtile) {
return ((long)pathtile & 0x20000L) != 0L;
}
public static int liquid(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFFDFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFFDFFFFL | 0x20000L);
}
public static boolean legSolid(int pathtile) {
return ((long)pathtile & 0x40000L) != 0L;
}
public static int legSolid(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFFBFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFFBFFFFL | 0x40000L);
}
public static boolean nearLiquid(int pathtile) {
return ((long)pathtile & 0x80000L) != 0L;
}
public static int nearLiquid(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFF7FFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFF7FFFFL | 0x80000L);
}
public static boolean nearGround(int pathtile) {
return ((long)pathtile & 0x100000L) != 0L;
}
public static int nearGround(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFEFFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFEFFFFFL | 0x100000L);
}
public static boolean nearSolid(int pathtile) {
return ((long)pathtile & 0x200000L) != 0L;
}
public static int nearSolid(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFDFFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFDFFFFFL | 0x200000L);
}
public static boolean deep(int pathtile) {
return ((long)pathtile & 0x400000L) != 0L;
}
public static int deep(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFFBFFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFFBFFFFFL | 0x400000L);
}
public static boolean damages(int pathtile) {
return ((long)pathtile & 0x800000L) != 0L;
}
public static int damages(int pathtile, boolean value) {
if (value) {
return (int)((long)pathtile & 0xFFFFFFFFFF7FFFFFL);
}
return (int)((long)pathtile & 0xFFFFFFFFFF7FFFFFL | 0x800000L);
}
public static int get(int health, int team, boolean solid, boolean liquid, boolean legSolid, boolean nearLiquid, boolean nearGround, boolean nearSolid, boolean deep, boolean damages) {
return (int)((long)(health << 0) & 0xFFL | (long)(team << 8) & 0xFF00L | (solid ? 65536L : 0L) | (liquid ? 131072L : 0L) | (legSolid ? 262144L : 0L) | (nearLiquid ? 524288L : 0L) | (nearGround ? 0x100000L : 0L) | (nearSolid ? 0x200000L : 0L) | (deep ? 0x400000L : 0L) | (damages ? 0x800000L : 0L));
}
}
|
[
"[email protected]"
] | |
fe79aec1bb9df2ceef876884e7793d59d15d1a1a
|
4067aae882a8669f949b67b60bbcf6ba50032261
|
/src/jardin/silla/SentarseSillaPlan.java
|
8f9b223c90e7ec63dff3d9fb688125f18d03b669
|
[] |
no_license
|
Romeorubiko/SimsAgents
|
df7e837eb9b08974048f06a31dd25452c5b74204
|
f912b3a0df5105a3934b46af07e3b35383b40155
|
refs/heads/master
| 2021-09-04T04:12:55.719024 | 2018-01-15T17:37:31 | 2018-01-15T17:37:31 | 107,550,548 | 2 | 3 | null | 2018-01-15T18:17:39 | 2017-10-19T13:32:44 |
Java
|
UTF-8
|
Java
| false | false | 1,381 |
java
|
package jardin.silla;
import ontologia.Accion;
import ontologia.acciones.*;
import jadex.runtime.*;
import jadex.adapter.fipa.SFipa;
import jadex.runtime.impl.RMessageEvent;
public class SentarseSillaPlan extends Plan {
public void body(){
RMessageEvent peticion = ((RMessageEvent)getInitialEvent());
Boolean ocupado = (Boolean)getBeliefbase().getBelief("ocupado").getFact();
if(ocupado.booleanValue()) {
IMessageEvent refuse = createMessageEvent("silla_ocupada");
refuse.getParameterSet(SFipa.RECEIVERS).addValue(peticion.getParameterSet(SFipa.SENDER).getValues());
sendMessage(refuse);
}
else {
getBeliefbase().getBelief("ocupado").setFact(Boolean.TRUE);
IMessageEvent agree = createMessageEvent("silla_no_ocupada");
agree.getParameterSet(SFipa.RECEIVERS).addValue(peticion.getParameterSet(SFipa.SENDER).getValues());
sendMessage(agree);
getBeliefbase().getBelief("mensaje_sentarse_silla").setFact(peticion);
int end_timer = (int) System.currentTimeMillis() + Accion.TIEMPO_CORTO;
getBeliefbase().getBelief("tiempo_fin_sentarse_silla").setFact(new Integer(end_timer));
IGoal goal= createGoal("terminar_sentarse_silla");
dispatchSubgoal(goal);
}
}
}
|
[
"[email protected]"
] | |
df9721fa9c09451975a1d75535db68542ad462ed
|
8f17729d23e887136ec0daaff9dd0d7a13fa3514
|
/den_storozhenko/src/main/java/FxAsyncChat/Client.java
|
d15867dcafb366b0f8b0af466bbe95143db9043e
|
[] |
no_license
|
RAZER-KIEV/proff25
|
e3901518ac9655255abf9245c4c2f861ac1c5c9d
|
7e0c8811aad538d8ec67a77558a12f85f691edf6
|
refs/heads/master
| 2021-01-10T16:08:45.373377 | 2015-08-18T16:13:08 | 2015-08-18T16:13:08 | 47,151,116 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 984 |
java
|
package FxAsyncChat;
import javafx.scene.control.TextField;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
public class Client{
private TextField messageText;
private SocketChannel channel;
public Client(String ip, int port, TextField messageText) throws IOException {
channel = SocketChannel.open(new InetSocketAddress(ip, port));
this.messageText = messageText;
}
public void send() throws IOException {
ByteBuffer buffer = ByteBuffer.allocate(1000);
String text;
if (!(text = messageText.getText()).equals("exit")) {
buffer.put(text.getBytes());
buffer.flip();
while (buffer.hasRemaining())
channel.write(buffer);
buffer.clear();
}
else
channel.close();
}
public boolean isAvaible(){
return channel.isConnected();
}
}
|
[
"[email protected]"
] | |
566bfa06c20630bc31123aef3d5dc934db119355
|
717389f493576981fdba40f4e1f539c8caa6ec7a
|
/test1/src/main/java/cn/rivamed/entity/RoleUser.java
|
cbced254e0b40c4b0ba09ba7c8793b2df242af29
|
[] |
no_license
|
taogedada/jpa-test
|
f20053cb5de2487dc55674e795d629562d278966
|
669cf1b3748911eebc3f3a85d94074bac465a1a8
|
refs/heads/master
| 2022-12-01T21:00:57.256803 | 2019-06-25T03:02:40 | 2019-06-25T03:02:40 | 181,397,032 | 0 | 0 | null | 2022-11-24T07:01:44 | 2019-04-15T02:17:33 |
Java
|
UTF-8
|
Java
| false | false | 900 |
java
|
package cn.rivamed.entity;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
@Data
@Entity
@Table(name = "sys_role_user")
@DynamicInsert(true)
@DynamicUpdate(true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RoleUser implements Serializable {
private static final long serialVersionUID = 1L;
@Id
//MySQL设置主键自增,如果设置成GenerationType.AUTO会报错java.sql.SQLSyntaxErrorException: Table 'a2.hibernate_sequence' doesn't exist
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Integer id;
@Column(name = "user_id")
private Integer userId;
@Column(name = "role_id")
private Integer roleId;
public RoleUser(){}
}
|
[
"[email protected]"
] | |
721a16c112b03095831918e4a6fa7af9885e9c31
|
7a19d47a76913dad7dc9883f93797528235eb98c
|
/graphql/src/main/java/com/github/twilliams1504/interviewtask/AppointmentResolver.java
|
6539a5474b0d9ee4258b5a72cb91984e930aafe5
|
[
"MIT"
] |
permissive
|
twilliams1504/interview
|
020fd60de4aca17c9b3814d5fb7ea0ae320fb864
|
3877a5b4b7f3499ee1dd616ee4141e7ae1358878
|
refs/heads/master
| 2020-09-22T17:00:37.953636 | 2019-12-05T17:23:55 | 2019-12-05T17:23:55 | 225,279,429 | 0 | 0 | null | 2019-12-02T03:42:47 | 2019-12-02T03:42:47 | null |
UTF-8
|
Java
| false | false | 540 |
java
|
package com.github.twilliams1504.interviewtask;
import com.coxautodev.graphql.tools.GraphQLResolver;
import java.util.*;
public class AppointmentResolver implements GraphQLResolver<Appointment> {
private final AttendeeRepository attendeeRepository;
AppointmentResolver(AttendeeRepository attendeeRepository) {
this.attendeeRepository = attendeeRepository;
}
public List<Attendee> attendees(Appointment appointment) {
return attendeeRepository.findByIds(appointment.getAttendeeIds());
}
}
|
[
"[email protected]"
] | |
b9c6e3e4f3dbc324714010d8709af4a5f1271e38
|
a9df7ed871fdb1d2bba1b629ab412915fd0575f8
|
/src/main/java/com/mudryk/simplejooq/businesslayer/util/DateUtils.java
|
cf2f4a07a816aa63f62bc26f220f6f437acebe89
|
[] |
no_license
|
coders-guild/JCG-26-11-16-Mydruk-jOOQ
|
09167bd732bbea9d00ada56617bc5e0462ec75bd
|
f99e2d050c789d19adc813902fa15da22c53e8aa
|
refs/heads/master
| 2020-06-11T12:35:52.247003 | 2016-11-20T22:34:55 | 2016-11-20T22:34:55 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 521 |
java
|
package com.mudryk.simplejooq.businesslayer.util;
import org.joda.time.LocalDateTime;
import java.sql.Timestamp;
/**
* @author Volodymyr
* Date: 18.11.2016.
*/
public class DateUtils {
public static LocalDateTime timestamp2jodaLocalDateTime(Timestamp date) {
return date != null ? LocalDateTime.fromDateFields(date) : null;
}
public static Timestamp jodaLocalDateTime2timestamp(LocalDateTime date) {
return date != null ? new Timestamp(date.toDate().getTime()) : null;
}
}
|
[
"[email protected]"
] | |
ee675c92970ce023ec82a565c1a40996c250f4d4
|
5a8f5a920830155f8ed98c61aac9ce41446a3812
|
/login-service/src/main/java/com/ecochain/user/entity/BaseEntity.java
|
c2c143b384bbeb0d8c00aada34fa0b3145198695
|
[] |
no_license
|
tonels/RBAC
|
8fea0d2446fda34d192cd2bbae3508b92cacd62d
|
4b5b0c574e044cce653be6a934476a72050da4e8
|
refs/heads/master
| 2023-01-13T01:04:14.966331 | 2020-04-16T06:41:07 | 2020-04-16T06:41:07 | 226,763,305 | 2 | 0 | null | 2023-01-12T12:18:45 | 2019-12-09T01:57:20 |
JavaScript
|
UTF-8
|
Java
| false | false | 214 |
java
|
package com.ecochain.user.entity;
import java.io.Serializable;
public class BaseEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = -2040361328380381222L;
}
|
[
"[email protected]"
] | |
ee9c1e32fc690118eeed323adaac08c8001288bc
|
71b183a47b44be4f564192f1f815d616e9b4b9e2
|
/app/src/main/java/com/maymanm/weathermap/MapsActivity.java
|
76b4cd01d9c9a4a9c31569dafcfe9e56fe02754f
|
[] |
no_license
|
MahmoudAymann/WeatherMap
|
a6cc98e0170d4c0923d48db807b80a13cc0bc886
|
2e6e590067b2735ceadcb5e1e27cf5250ccca96d
|
refs/heads/master
| 2020-06-03T00:46:56.589799 | 2019-06-11T12:24:01 | 2019-06-11T12:24:01 | 191,366,268 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,763 |
java
|
package com.maymanm.weathermap;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.ViewModelProviders;
import android.graphics.Color;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.maps.android.PolyUtil;
import com.maymanm.weathermap.viewmodel.DirectionsViweModel;
import java.util.Objects;
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, LocationListener, GoogleMap.OnMapClickListener {
private GoogleMap mMap;
private LocationManager locationManager;
private String locationProvider;
private static final String TAG = "MapsActivity";
private Location lastLocation;
private double lastLong, lastLat;
private Marker currentMarker, targetMarker;
private DirectionsViweModel directionsViweModel;
private Polyline[] polyLineArray;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
if (mapFragment != null) {
mapFragment.getMapAsync(this);
}
}
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
settingUpTheMap();
mMap.setOnMapClickListener(this);
}
private void settingUpTheMap() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission(ACCESS_FINE_LOCATION) != PERMISSION_GRANTED &&
checkSelfPermission(ACCESS_COARSE_LOCATION) != PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{ACCESS_COARSE_LOCATION,
ACCESS_FINE_LOCATION},
111);
return;
}
}
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
locationProvider = locationManager.getBestProvider(new Criteria(), false);
locationManager.requestLocationUpdates(Objects.requireNonNull(locationProvider), 1, 10, MapsActivity.this);
mMap.setMyLocationEnabled(true); //set a point to my location
mMap.getUiSettings().setMyLocationButtonEnabled(true); // button current loc
mMap.getUiSettings().setZoomControlsEnabled(true); //set zoom buttons
lastLocation = locationManager.getLastKnownLocation(locationProvider);
settingMarkers();
}
private void settingMarkers() {
if (lastLocation != null) {
currentMarker = mMap.addMarker(new MarkerOptions()
.position(new LatLng(lastLocation.getLatitude(), lastLocation.getLongitude()))
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));
}
}
@Override
public void onLocationChanged(Location location) {
lastLocation = location;
lastLat = location.getLatitude();
lastLong = location.getLongitude();
currentMarker.setPosition(new LatLng(location.getLatitude(), location.getLongitude()));
}
@Override
public void onStatusChanged(String s, int i, Bundle bundle) {
}
@Override
public void onProviderEnabled(String s) {
}
@Override
public void onProviderDisabled(String s) {
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
switch (requestCode) {
case 111:
if (grantResults.length > 0 &&
grantResults[0] == PERMISSION_GRANTED) {
Log.d(TAG, "onRequestPermissionsResult: " + grantResults[0]);
onMapReady(mMap);
} else {
//permission denied
// array is zero
Toast.makeText(this, "denied", Toast.LENGTH_SHORT).show();
}
break;
default:
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
@Override
public void onMapClick(LatLng latLng) {
if (targetMarker != null) targetMarker.remove();
targetMarker = mMap.addMarker(new MarkerOptions()
.position(latLng)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));
Location targetLoc = new Location("");
targetLoc.setLatitude(latLng.latitude);
targetLoc.setLongitude(latLng.longitude);
float distance = lastLocation.distanceTo(targetLoc);
Log.d(TAG, "onMapClick: " + distance + "meters away");
directionsViweModel = ViewModelProviders.of(this).get(DirectionsViweModel.class);
directionsViweModel.getDirectionsLiveData(lastLocation.getLatitude() + "," + lastLocation.getLongitude(),
latLng.latitude + "," + latLng.longitude,
getString(R.string.google_maps_key)
).observe(this, directionsModel -> {
if (directionsModel != null){
Log.d(TAG, "onMapClick: "+directionsModel.getStatus());
}
directionsViweModel.getPolyLineLiveData(directionsModel).observe(this, polylines -> {
if (polyLineArray != null){
for (Polyline polyline: polyLineArray){
polyline.remove();
}
}
if (polylines!= null){
polyLineArray = new Polyline[polylines.length];
Log.d(TAG, "onMapClick: "+"reached here");
for (int i = 0; i< polylines.length;i++){
PolylineOptions options = new PolylineOptions();
options.color(Color.RED);
options.width(10);
options.addAll(PolyUtil.decode(polylines[i]));
polyLineArray[i] = mMap.addPolyline(options);
}
}
});
});
}
}
|
[
"[email protected]"
] | |
16c258ff058e9da2516e410b01f256e92ec58a54
|
99d0de428ff582a8fd6d2ce8067421a786ab0939
|
/src/main/java/interview/PrintLinkListReverse.java
|
5bc0e3fc8a796d74120be4ba27bff3e4001e8281
|
[] |
no_license
|
himanshusharma184/HackRankPrograms
|
4bf239a3db75503e7aea48e305f41498410801e1
|
cf9256820599f5deac1d5a3d57a7ea3d0aad0b13
|
refs/heads/master
| 2021-12-21T16:02:39.331949 | 2021-12-17T17:00:47 | 2021-12-17T17:00:47 | 32,266,564 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 609 |
java
|
package interview;
import java.util.Scanner;
public class PrintLinkListReverse {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int[] s = new int[a];
for (int i = 0; i < a; i++) {
s[i] = scanner.nextInt();
}
LinkedListNode node = new LinkedListNode();
LinkedListNode head = node.buildList(s);
int val = head.data;
reverse(head.next);
System.out.println(val);
}
private static void reverse(LinkedListNode next) {
if (next == null) {
return;
}
reverse(next.next);
System.out.print(next.data + " ");
}
}
|
[
"[email protected]"
] | |
5d7aa362b540809063c7ff4ac2f650214990cc3a
|
a7af5183e11a5f3d850d74215a3975f3e4b5ebe3
|
/src/Behavioral/Command/Client.java
|
487f189133801f976dc4eaa3202ac7cf618edeb4
|
[] |
no_license
|
Szymon2112g/DesignPatterns
|
377751578ebc750b1c6e5885662ed10e0cfc2a7d
|
cf0fa70870ab3534d1fc5a727a1ef6b4e486269e
|
refs/heads/master
| 2022-12-07T20:36:52.487313 | 2020-09-02T11:32:40 | 2020-09-02T11:32:40 | 290,480,431 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 506 |
java
|
package Behavioral.Command;
public class Client {
public static void main(String[] args) {
Light light = new Light();
Command switchOn = light::turnOn; // new SwitchOnCommand(lamp) // functional interface
Command switchOff = light::turnOff; // new SwitchOffCommand(lamp)
Switch mySwitch = new Switch();
mySwitch.register("on", switchOn);
mySwitch.register("off", switchOff);
mySwitch.execute("on");
mySwitch.execute("off");
}
}
|
[
"[email protected]"
] | |
d1473c0205f8289de60e4015a4403d5375c20b23
|
e175eb50cc5b29a766344ecc1fb5a3e1c32e16f2
|
/Android_Dev/Hackaton_Project/.svn/pristine/d1/d1473c0205f8289de60e4015a4403d5375c20b23.svn-base
|
357308fa7e4358890a5c12ebed595b7657b25787
|
[] |
no_license
|
rajpalparyani/RajRepo
|
28fddd8eef7cc83b2194ba25105628ee7fd887ca
|
5f3e215bcf39f0a7542b3bb8dfc458854ae25cde
|
refs/heads/master
| 2020-04-12T18:25:07.276246 | 2013-12-09T22:41:51 | 2013-12-09T22:41:51 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 943 |
/**
*
* Copyright 2012 TeleNav, Inc. All rights reserved.
* HttpController.java
*
*/
package com.telenav.carconnect.provider.tnlink.module.http;
import com.telenav.carconnect.CarConnectManager;
import com.telenav.navsdk.events.HttpProxyEvents.HttpProxyResponse;
/**
*@author xiangli
*@date 2012-3-1
*/
public class HttpController
{
public static void sendResponse(int id, String headers, byte[] data, int responseCode)
{
HttpProxyResponse.Builder builder = HttpProxyResponse.newBuilder();
builder.setHeaders(headers);
com.google.protobuf.ByteString payLoad = com.google.protobuf.ByteString.copyFrom(data);
builder.setPayload(payLoad);
builder.setRequestId(id);
builder.setHttpResponseCode(responseCode);
HttpProxyResponse response = builder.build();
CarConnectManager.getEventBus().broadcast("HttpProxyResponse", response);
}
}
|
[
"x"
] |
x
|
|
33f48c1e4412016cd5035fda8dad13b53160c766
|
36641a4081634f62caeb45802cdac2eaadb20cdf
|
/src/main/java/com/jujumarket/member/service/MailService.java
|
d90f1f046ecc0a49554d3b5ddf887e1969402663
|
[] |
no_license
|
csesese/JUJU-Market
|
55197967061f291be3892b5a664cc6447e321b84
|
e55cf07d5f007b8eda3005aa23e3f2be4ba5e970
|
refs/heads/master
| 2023-06-26T01:04:12.244869 | 2023-06-11T08:31:33 | 2023-06-11T08:31:33 | 288,053,231 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,177 |
java
|
package com.jujumarket.member.service;
import java.io.UnsupportedEncodingException;
import javax.mail.MessagingException;
import org.springframework.beans.factory.annotation.Autowired;
import com.jujumarket.member.mail.MailHandler;
import com.jujumarket.member.mail.TempKey;
import lombok.extern.log4j.Log4j;
@Log4j
public class MailService {
final static String FROM = "[email protected]";
@Autowired
private MailHandler mailHandler;
public String sendMail(String userEmail) {
String authKey = setKey();
try {
mailHandler.init();
mailHandler.setSubject("[주주마켓 회원가입] 이메일인증하기");
mailHandler.setText("인증번호는 ["+authKey+"] 입니다.");
// mailHandler.setFrom("[email protected]", "juju");
mailHandler.setFrom(FROM, "juju");
mailHandler.setTo(userEmail);
mailHandler.send();
} catch (MessagingException | UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return authKey;
}
public String setKey() {
TempKey tempKey = new TempKey();
String key= tempKey.getKey(6, false);
log.info("@@@@@@@@@@"+key);
return key;
}
}
|
[
"[email protected]"
] | |
ef2315540e96ecaf4015a69cfbf2c2285b502a50
|
527b0bd21896c9c0cb810a0566a020383c9d974e
|
/service-hello-service/src/main/java/com/ylf/service/ReginService.java
|
9e00e0283c1dd2ef2612971aeac60c83c864aa10
|
[] |
no_license
|
yanglangfei/service-hello
|
d05f4514f957de896aae5bc56801c6cb318cb73f
|
dcf3a18705790c1f4a6154a6f321e539a745296c
|
refs/heads/master
| 2021-07-23T03:33:53.172679 | 2017-10-31T05:24:43 | 2017-10-31T05:24:43 | 108,625,990 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 127 |
java
|
package com.ylf.service;
/**
* @Author YangLF
* @Date 2017/10/31
*/
public interface ReginService {
String regin();
}
|
[
"[email protected]"
] | |
4438bad7f18408a0f35115739e3b9aa33c6290de
|
2e86c8ff6c58b8d307fed7441dfbc2ce8e5e1160
|
/src/backends/gdx-cpp-backend-android/android_support/src/com/badlogic/gdx/backends/android/AndroidAudio.java
|
1e6c737c481c2c5dff3e82096fc8de2729563cc7
|
[
"Apache-2.0"
] |
permissive
|
NoiSek/libgdx-cpp
|
dbe9448983ff84090e62e5b59b4cb48076d6aac3
|
d7f5fd5e690659f381d3945a128eaf93dab35d79
|
refs/heads/master
| 2021-01-16T21:02:59.297514 | 2011-11-02T01:39:24 | 2011-11-02T01:39:24 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,004 |
java
|
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package com.badlogic.gdx.backends.android;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.SoundPool;
import com.badlogic.gdx.Audio;
import com.badlogic.gdx.Files.FileType;
import com.badlogic.gdx.audio.AudioDevice;
import com.badlogic.gdx.audio.AudioRecorder;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.utils.GdxRuntimeException;
/**
* An implementation of the {@link Audio} interface for Android.
*
* @author mzechner
* @author scooterman
*/
public final class AndroidAudio {
private SoundPool soundPool;
private final AudioManager manager;
protected final List<AndroidMusic> musics = new ArrayList<AndroidMusic>();
protected final List<Boolean> wasPlaying = new ArrayList<Boolean>();
private AssetManager assets;
public native void registerAudioEngine(AndroidAudio self);
public AndroidAudio (Activity context) {
soundPool = new SoundPool(16, AudioManager.STREAM_MUSIC, 100);
manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
context.setVolumeControlStream(AudioManager.STREAM_MUSIC);
assets = context.getAssets();
}
public void pause () {
synchronized(musics) {
wasPlaying.clear();
for (AndroidMusic music : musics) {
if (music.isPlaying()) {
music.pause();
wasPlaying.add(true);
} else
wasPlaying.add(false);
}
}
}
public void resume () {
synchronized(musics) {
for (int i = 0; i < musics.size(); i++) {
if (wasPlaying.get(i)) musics.get(i).play();
}
}
}
/**
* {@inheritDoc}
*/
public AudioDevice newAudioDevice (int samplingRate, boolean isMono) {
return new AndroidAudioDevice(samplingRate, isMono);
}
/**
* {@inheritDoc}
*/
public Music newMusic (String path, int fileType) {
AndroidFileHandle file = new AndroidFileHandle(assets, path, FileType.values()[fileType]);
MediaPlayer mediaPlayer = new MediaPlayer();
if (file.type() == FileType.Internal) {
try {
AssetFileDescriptor descriptor = file.assets.openFd(file.path());
mediaPlayer.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength());
descriptor.close();
mediaPlayer.prepare();
AndroidMusic music = new AndroidMusic(this, mediaPlayer);
synchronized(musics) {
musics.add(music);
}
return music;
} catch (Exception ex) {
return null;
}
} else {
try {
mediaPlayer.setDataSource(file.path());
mediaPlayer.prepare();
AndroidMusic music = new AndroidMusic(this, mediaPlayer);
musics.add(music);
return music;
} catch (Exception ex) {
return null;
}
}
}
/**
* {@inheritDoc}
*/
public Sound newSound (String path, int fileType) {
AndroidFileHandle file = new AndroidFileHandle(assets, path, FileType.values()[fileType]);
if (file.type() == FileType.Internal) {
try {
AssetFileDescriptor descriptor = file.assets.openFd(file.path());
AndroidSound sound = new AndroidSound(soundPool, manager, soundPool.load(descriptor, 1));
descriptor.close();
return sound;
} catch (IOException ex) {
return null;
}
} else {
try {
return new AndroidSound(soundPool, manager, soundPool.load(file.path(), 1));
} catch (Exception ex) {
return null;
}
}
}
/**
* {@inheritDoc}
*/
public AudioRecorder newAudioRecoder (int samplingRate, boolean isMono) {
return new AndroidAudioRecorder(samplingRate, isMono);
}
/**
* Kills the soundpool and all other resources
*/
public void dispose () {
synchronized(musics) {
// gah i hate myself.... music.dispose() removes the music from the list...
ArrayList<AndroidMusic> musicsCopy = new ArrayList<AndroidMusic>(musics);
for (AndroidMusic music : musicsCopy) {
music.dispose();
}
}
soundPool.release();
}
}
|
[
"[email protected]"
] | |
9be03c75280f341e4f95a486308efca05e239210
|
3152668f32a56b8380d029cc8edf42ab64ac6f1f
|
/Excel/src/test/java/Hire_Team_Member.java
|
de6e906dd72d009413c62be9bc5950d122fefffc
|
[] |
no_license
|
TejaReddy-4/Git---Test
|
b13e125439b3afad0cb191d821043b6268f75874
|
67adb6b3368e9cd17333fc0db03818b1b6b2a18b
|
refs/heads/master
| 2022-05-29T04:05:53.940138 | 2020-05-01T21:25:37 | 2020-05-01T21:25:37 | 260,544,388 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 82,254 |
java
|
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.interactions.Coordinates;
import org.openqa.selenium.interactions.Locatable;
import org.openqa.selenium.remote.RemoteWebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import com.google.common.collect.Iterables;
public class Hire_Team_Member {
static int min;
static int max;
static int random_int;
static String task;
static String nextAwaitingStep;
static String Employee;
static String nextAwaitingStep1="D$mmy Var!able";
static WebElement inbox_list;
static int nextstep=1;
static String[] field1;
static String input;
static String field;
static String fieldm[];
static String field12;
static String field13;
static String field4;
static String input4;
static String[] fieldn3;
static String field3;
static String input3;
static String[] fieldn2;
static String[] fieldn;
static String Person2;
static String onBehalfOf22;
static String[] onBehalfOf12;
static String onBehalfof2;
static int ghj=0;
static String[] inboxselection;
static String ListoftasksAwaiting1;
static List<String> ListoftasksAwaiting=new ArrayList<String>();
static ArrayList<String> Enter1 =new ArrayList<String>();
public static void main(String[] args) throws InterruptedException, IOException {
// TODO Auto-generated method stub
//System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Chrome Driver\\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"/chromedriver");
WebDriver driver=new ChromeDriver();
Actions a=new Actions(driver);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 25);
driver.manage().window().maximize();
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
Login.credentials(driver, "Hire");
StartProxy.TeamMember(driver, "Hire");
task = Task.EnterTask(driver, "Hire Team Member");
inbox.SupervisoryOrganization(driver, "Hire", "Supervisory Organization");
Employee = inbox.input(driver, "Hire", "Pre-Hire");
driver.findElement(By.xpath("//*[@title = 'OK']")).click();
input(driver);
Thread.sleep(2000); driver.findElement(By.xpath("//*[@title = 'Submit']")).click(); wait.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//*[@title = 'Submit']"))));
inbox(driver, "Hire", Employee, "Hire");
}
public static void input(WebDriver driver) throws InterruptedException, IOException
{
Enter1 = inbox.getExcelData("Hire", "Title", "Job Details");
String PreHire = Enter1.get(0);
String [] PreHireSplit = PreHire.split(":");
String Title=PreHireSplit[0];
String[] PreHireSplit2 = PreHireSplit[1].split("&");
Enter1.clear();
Enter1.add(Title);
for(String J: PreHireSplit2)
{
Enter1.add(J);
}
String[] Enter = new String[Enter1.size()];
for(int j =0;j<Enter1.size();j++){
Enter[j] = Enter1.get(j);
}
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 5);
if (Enter.length >=2) {
if(driver.findElements(By.xpath("//*[text()='"+Enter[0]+"']/parent::div/following-sibling::button")).size()>0) {
driver.findElement(By.xpath("//*[text()='"+Enter[0]+"']/parent::div/following-sibling::button")).click();
}}
if(Enter.length == 0) {}
else {
int ctr=0;
for(String i: Enter) {
if (ctr>0) {
String[] field1= i.split("=");
String field= field1[0];
String input= field1[1];
driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[text()='"+Enter[0]+"']/parent::div/parent::div //*[text()='"+field+"']")).size()>0) {
WebElement Task = driver.findElement(By.xpath("//*[text()='"+Enter[0]+"']/parent::div/parent::div //*[text()='"+field+"']"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field+"']")));
}
}
else { WebElement Task = driver.findElement(By.xpath("//*[text()='"+field+"']"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field+"']")));
}
}
if(field.equalsIgnoreCase("Team Member Type")) {driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);}
else {driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);}
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div[1]/following-sibling::div/ul/li")).size()>0) {}
else {
if(field.equalsIgnoreCase("Type")) {
driver.findElement(By.xpath("//*[text()='"+Enter[0]+"']/parent::div/parent::div //*[text()='"+field+"']/parent::div/parent::li //*[@placeholder='Search']")).click();
driver.findElement(By.xpath("//*[text()='"+Enter[0]+"']/parent::div/parent::div //*[text()='"+field+"']/parent::div/parent::li //*[@placeholder='Search']")).sendKeys(input);
}
else {
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).size()>0) {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).clear();
Thread.sleep(2000);
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(input);
}
else if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).size()>0) {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).click();
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).sendKeys(input, Keys.ENTER);
if (field.equalsIgnoreCase("Position")) {
try { WebDriverWait wait1 = new WebDriverWait(driver, 8);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { WebDriverWait wait2 = new WebDriverWait(driver, 7);
wait2.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }}
else {try { WebDriverWait wait3 = new WebDriverWait(driver, 2);
wait3.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { WebDriverWait wait4 = new WebDriverWait(driver, 7);
wait4.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }}
driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else {
driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click(); }}}}
}//if ctr>0
ctr++;
}//for-each
}}
public static void inbox(WebDriver driver, String Efield, String Employee, String task) throws InterruptedException, IOException
{
WebDriverWait wait = new WebDriverWait(driver, 25);
Actions a=new Actions(driver);
Enter1 = inbox.getExcelData(Efield, Efield, Efield+" "+"-"+"Task");
System.out.println(Enter1);
nextAwaitingStep1= "D$mmy Var!able";
while (nextstep != 0) {
//inbox
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[@data-automation-id='inbox_preview']/div")));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@data-automation-id='inbox_preview']/div")));
Thread.sleep(2000);
driver.findElement(By.xpath("//button[@data-automation-id='inbox_preview']/div")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[contains(@data-automation-id, 'inbox_list') and @data-automation-inbox-list-frosting='false']")));
inbox_list = driver.findElement(By.xpath("//div[contains(@data-automation-id, 'inbox_list')]"));
nextAwaitingStep = Employee;
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]")).size()>0) {} //by employee name
else if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep1+"')]")).size()>0) { nextAwaitingStep = nextAwaitingStep1;} //by task
else if (driver.findElements(By.xpath("//*[contains(text(), '"+task+"')]")).size()>0) { nextAwaitingStep = task;} //by task
else {String[] inboxselection= nextAwaitingStep1.split(" "); // task separeated by space
for(String d:inboxselection) {
nextAwaitingStep=d;
if (inbox_list.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"') and @data-automation-id='inbox_row_title']")).size()>0)
{ break;}
}
}
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
try {a.moveToElement(inbox_list.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))).click().build().perform();}
catch(Exception jki) {a.moveToElement(inbox_list.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))).click().build().perform();}
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-inbox-detail-frosting='false']")));
//---------------------------------Inbox Tasks--------------------------------------------------
WebDriverWait waitBoxes = new WebDriverWait(driver, 7);
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
waitBoxes.until(ExpectedConditions.or(
ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='Submit']")),
ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='Done']")),
ExpectedConditions.presenceOfElementLocated(By.xpath("//button[@data-automation-id='thirdPartyConnection']")),
ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='OK']"))));
Thread.sleep(1000);
Boxes(driver);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
//----------------------------------------------Archive--------------------------------
//Inox
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@data-automation-id='inbox_preview']/div")));
//driver.findElement(By.xpath("//button[@data-automation-id='inbox_preview']/div")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[contains(@data-automation-id, 'inbox_list') and @data-automation-inbox-list-frosting='false']")));
WebElement inbox_list_Archive2 = driver.findElement(By.xpath("//div[contains(@data-automation-id, 'inbox_list')]"));
//Archive
Thread.sleep(1500);
try{driver.findElement(By.xpath("//*[contains(text(), 'Archive')]")).click();}
catch(Exception num10) {driver.findElement(By.xpath("//*[contains(text(), 'Archive')]")).click();}
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[contains(@data-automation-id, 'inbox_list') and @data-automation-inbox-list-frosting='false']")));
//choosing the task
nextAwaitingStep = Employee;
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]")).size()>0) {} //by employee name
else if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep1+"')]")).size()>0) { nextAwaitingStep = nextAwaitingStep1;} //by task
else if (driver.findElements(By.xpath("//*[contains(text(), '"+task+"')]")).size()>0) { nextAwaitingStep = task;} //by task
else {inboxselection= nextAwaitingStep1.split(" "); // task separeated by space
for(String d:inboxselection) {
nextAwaitingStep=d;
if (inbox_list.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"') and @data-automation-id='inbox_row_title']")).size()>0)
{ break;}
}
}
System.out.println("Acrchive ="+nextAwaitingStep+" ");;
//$x("//*[contains(text(), 'Allison Hirte') and @data-automation-id='inbox_row_title']")
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
Thread.sleep(1000);
try {a.moveToElement(inbox_list.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"') and @data-automation-id='inbox_row_title']"))).click().build().perform();}
catch(Exception ede) {Thread.sleep(1000);
a.moveToElement(inbox_list.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"') and @data-automation-id='inbox_row_title']"))).click().build().perform();}
//WebElement ArchiveTest=inbox_list_Archive2.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"));
//Overall Process
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[contains(@data-automation-id, 'inbox_task_view') and @data-automation-inbox-detail-frosting='false']")));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']")));
Thread.sleep(2000);
//wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']"))));
try {driver.findElement(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']")).click();}
catch(Exception ede) {Thread.sleep(1000);
driver.findElement(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']")).click();}
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-automation-id='tabContent']")));
WebElement TabContent2 = driver.findElement(By.xpath("//*[@data-automation-id='tabContent']"));
WebElement Process2 = driver.findElement(By.xpath("//*[text() = 'Process']"));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Process2);
Thread.sleep(2000);
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]"))));
Thread.sleep(2000);
try {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
catch(Exception eccs) {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
//Awaiting Action
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-automation-id='tabContent'and @aria-label='Process'] ")));
//TabContent.findElement(By.xpath("//*[text()='Awaiting Action']"));
Thread.sleep(2000);
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
if(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()==0) {
if(driver.findElements(By.xpath("//*[text()='In Progress']")).size()>0) {
while(!(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()>0)) {
driver.navigate().refresh();
Thread.sleep(8000); }
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
multipleAwaitingActions(driver);
}
//if not inprogress, scroll down to the end
else {
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).click().perform();
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).sendKeys(Keys.CONTROL, Keys.END).perform();
Thread.sleep(1000);
wait.until(ExpectedConditions.presenceOfElementLocated((By.xpath("//div[@data-automation-loadingpanelhidden='true']"))));
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).click().perform();
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).sendKeys(Keys.CONTROL, Keys.END).perform();
Thread.sleep(1500);
wait.until(ExpectedConditions.presenceOfElementLocated((By.xpath("//div[@data-automation-loadingpanelhidden='true']"))));
if(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()==0) {
if(driver.findElements(By.xpath("//*[text()='In Progress']")).size()>0) {
while(!(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()>0)) {
driver.navigate().refresh();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='tabContent']")));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text() = 'Process']")));
Thread.sleep(2000);
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]"))));
Thread.sleep(2000);
try {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
catch(Exception eccs) {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
//Process Tab
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-automation-id='tabContent'and @aria-label='Process'] ")));
Thread.sleep(15000); }
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
multipleAwaitingActions(driver);
}}
else {
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
multipleAwaitingActions(driver);
}
} //else CTRL A + END
} //if Awaiting Actons = 0 (Main)
//Main Else
else {
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();
//------------------------------------------------if(nextstep>1)--------------------------------------------------------
multipleAwaitingActions(driver);
}//else
}//while
} //static
public static void SupervisoryOrganization(WebDriver driver, String Name, String SuperOrg)
{
WebDriverWait wait = new WebDriverWait(driver, 25);
Actions a=new Actions(driver);
String selectedItem = driver.findElement(By.xpath("//div[@data-automation-id='selectedItem']")).getText();
if(selectedItem.contains(SuperOrg))
{
//Submit
//driver.findElement(By.xpath("//div[@data-automation-id='dropDownCommandButton']")).click();
} else {
driver.findElement(By.xpath("//div[@data-automation-id='DELETE_charm']")).click();
driver.findElement(By.xpath("//input[@data-automation-id='searchBox']")).sendKeys(Name, Keys.ENTER);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(@data-automation-label, '"+SuperOrg+"')]")));
a.moveToElement(driver.findElement(By.xpath("//*[contains(@data-automation-label, '"+SuperOrg+"')]"))).click().build().perform();
}
}
public static void multipleAwaitingActions(WebDriver driver) throws InterruptedException
{
WebDriverWait wait = new WebDriverWait(driver, 25);
Actions a=new Actions(driver);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
if(nextstep>1) {
//List<WebElement> NoofAwaitinginproxy = driver.findElements(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]"));
try {
for(int m=0; m<nextstep; m++) {
String ProxyNameinAwating = driver.findElements(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).get(m).getText();
if (ProxyNameinAwating.contains(onBehalfof2)) {
ListoftasksAwaiting1 =driver.findElements(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).get(m).getText();
ListoftasksAwaiting.add(ListoftasksAwaiting1);
}
}
}
catch(Exception IndexOutOfBounds) {ListoftasksAwaiting.clear();
for(int m=0; m<nextstep; m++) {
String ProxyNameinAwating = driver.findElements(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).get(m).getText();
if (ProxyNameinAwating.contains(onBehalfof2)) {
ListoftasksAwaiting1 =driver.findElements(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).get(m).getText();
ListoftasksAwaiting.add(ListoftasksAwaiting1);
}
}
}
System.out.println(ListoftasksAwaiting);
for(String n:ListoftasksAwaiting) {
n=nextAwaitingStep1;
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[@data-automation-id='inbox_preview']/div")));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@data-automation-id='inbox_preview']/div")));
Thread.sleep(2000);
driver.findElement(By.xpath("//button[@data-automation-id='inbox_preview']/div")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[contains(@data-automation-id, 'inbox_list') and @data-automation-inbox-list-frosting='false']")));
inbox_list = driver.findElement(By.xpath("//div[contains(@data-automation-id, 'inbox_list')]"));
nextAwaitingStep = Employee;
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]")).size()>0) {} //by employee name
else if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep1+"')]")).size()>0) { nextAwaitingStep = nextAwaitingStep1;} //by task
else if (driver.findElements(By.xpath("//*[contains(text(), '"+task+"')]")).size()>0) { nextAwaitingStep = task;} //by task
else {String[] inboxselection= nextAwaitingStep1.split(" "); // task separeated by space
for(String d:inboxselection) {
nextAwaitingStep=d;
if (inbox_list.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"') and @data-automation-id='inbox_row_title']")).size()>0)
{ break;}
}
}
System.out.println(nextAwaitingStep);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
try {a.moveToElement(inbox_list.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))).click().build().perform();}
catch(Exception jki) {a.moveToElement(inbox_list.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))).click().build().perform();}
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-inbox-detail-frosting='false']")));
WebDriverWait waitBoxes = new WebDriverWait(driver, 3);
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
waitBoxes.until(ExpectedConditions.or(
ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='Submit']")),
ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='Done']")),
ExpectedConditions.presenceOfElementLocated(By.xpath("//button[@data-automation-id='thirdPartyConnection']")),
ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='OK']"))));
Thread.sleep(1500);
Boxes(driver);
} //'for' each tasks in the same proxy
if(ListoftasksAwaiting.size() >0) {
//----------------------------------------------Archive--------------------------------
//Inbox
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@data-automation-id='inbox_preview']/div")));
//driver.findElement(By.xpath("//button[@data-automation-id='inbox_preview']/div")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[contains(@data-automation-id, 'inbox_list') and @data-automation-inbox-list-frosting='false']")));
WebElement inbox_list_Archive2 = driver.findElement(By.xpath("//div[contains(@data-automation-id, 'inbox_list')]"));
//Archive
driver.findElement(By.xpath("//*[contains(text(), 'Archive')]")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[contains(@data-automation-id, 'inbox_list') and @data-automation-inbox-list-frosting='false']")));
//choosing the task
nextAwaitingStep = Employee;
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]")).size()>0) {} //by employee name
else if (driver.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep1+"')]")).size()>0) { nextAwaitingStep = nextAwaitingStep1;} //by task
else if (driver.findElements(By.xpath("//*[contains(text(), '"+task+"')]")).size()>0) { nextAwaitingStep = task;} //by task
else {String[] inboxselection= nextAwaitingStep1.split(" "); // task separeated by space
for(String d:inboxselection) {
nextAwaitingStep=d;
if (inbox_list.findElements(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"') and @data-automation-id='inbox_row_title']")).size()>0)
{ break;}
}
}
System.out.println("Acrchive ="+nextAwaitingStep+" ");;
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
Thread.sleep(3000);
//wait.until(ExpectedConditions.stalenessOf(driver.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))));
try {a.moveToElement(inbox_list_Archive2.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))).click().build().perform();}
catch(Exception ede) {Thread.sleep(1000);
a.moveToElement(inbox_list_Archive2.findElement(By.xpath("//*[contains(text(), '"+nextAwaitingStep+"')]"))).click().build().perform();}
//Overall Process
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']")));
Thread.sleep(2000);
//wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']"))));
try {driver.findElement(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']")).click();}
catch(Exception ede) {Thread.sleep(1000);
driver.findElement(By.xpath("//*[contains(text(), 'Overall Process')]/parent::div/parent::li //*[@data-automation-id='promptOption']")).click();}
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='tabContent']")));
//TabContent2 = driver.findElement(By.xpath("//*[@data-automation-id='tabContent']"));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text() = 'Process']")));
Thread.sleep(2000);
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]"))));
Thread.sleep(2000);
try {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
catch(Exception eccs) {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
//Awaiting Action
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-automation-id='tabContent'and @aria-label='Process'] ")));
//TabContent.findElement(By.xpath("//*[text()='Awaiting Action']"));
Thread.sleep(2000);
driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
if(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()==0) {
if(driver.findElements(By.xpath("//*[text()='In Progress']")).size()>0) {
while(!(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()>0)) {
//a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
//Thread.sleep(5000);
driver.navigate().refresh();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='tabContent']")));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text() = 'Process']")));
Thread.sleep(2000);
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]"))));
Thread.sleep(2000);
try {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
catch(Exception eccs) {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
//Process Tab
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-automation-id='tabContent'and @aria-label='Process'] ")));
Thread.sleep(15000);
}
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
if (Person2.contains(onBehalfof2)) {
}
else {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Security Profile']"))).build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Start Proxy']"))).click().build().perform();
driver.findElement(By.xpath("//button[@data-automation-id='wd-CommandButton_uic_okButton']")).click();}
//String Step2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[@data-automation-id='landingPageWelcomeCardHeading']")));
}
else {
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).click().perform();
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).sendKeys(Keys.CONTROL, Keys.END).perform();
Thread.sleep(1000);
wait.until(ExpectedConditions.presenceOfElementLocated((By.xpath("//div[@data-automation-loadingpanelhidden='true']"))));
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).click().perform();
a.moveToElement(driver.findElement(By.xpath("//*[text()='Process History']/parent::table/tbody/tr[1]/td[3]"))).sendKeys(Keys.CONTROL, Keys.END).perform();
Thread.sleep(1500);
wait.until(ExpectedConditions.presenceOfElementLocated((By.xpath("//div[@data-automation-loadingpanelhidden='true']"))));
if(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()==0) {
if(driver.findElements(By.xpath("//*[text()='In Progress']")).size()>0) {
while(!(driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size()>0)) {
driver.navigate().refresh();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='tabContent']")));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text() = 'Process']")));
Thread.sleep(2000);
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]"))));
Thread.sleep(2000);
try {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
catch(Exception eccs) {driver.findElement(By.xpath("//*[@data-automation-id='tabLabel' and contains(text(),'Process')]")).click();}
//Awaiting Action
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-automation-id='tabContent'and @aria-label='Process'] ")));
Thread.sleep(15000); }
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
if (Person2.contains(onBehalfof2)) {
}
else {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Security Profile']"))).build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Start Proxy']"))).click().build().perform();
driver.findElement(By.xpath("//button[@data-automation-id='wd-CommandButton_uic_okButton']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[@data-automation-id='landingPageWelcomeCardHeading']")));
}
}
}
else {
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
//String Step2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]")).getText();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
if (Person2.contains(onBehalfof2)) {
}
else {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Security Profile']"))).build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Start Proxy']"))).click().build().perform();
driver.findElement(By.xpath("//button[@data-automation-id='wd-CommandButton_uic_okButton']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[@data-automation-id='landingPageWelcomeCardHeading']")));
}
}
}
} //if awaiting =0
else {
//start proxy
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Awaiting Action']")));
nextstep= driver.findElements(By.xpath("//*[text()='Awaiting Action']")).size();
Person2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]")).getText();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
//String Step2 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]")).getText();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
if (Person2.contains(onBehalfof2)) {
}
else {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Security Profile']"))).build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Start Proxy']"))).click().build().perform();
driver.findElement(By.xpath("//button[@data-automation-id='wd-CommandButton_uic_okButton']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[@data-automation-id='landingPageWelcomeCardHeading']")));
}
}
}//if list >0
else {
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
if (Person2.contains(onBehalfof2)) {
}
else {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Security Profile']"))).build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Start Proxy']"))).click().build().perform();
driver.findElement(By.xpath("//button[@data-automation-id='wd-CommandButton_uic_okButton']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[@data-automation-id='landingPageWelcomeCardHeading']")));
}
}
}
else {
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='banner'][2]")));
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
try {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[1]/div")).getText();}
catch(Exception jhv) {nextAwaitingStep1 = driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/preceding-sibling::td[2]/div")).getText();}
if (Person2.contains(onBehalfof2)) {
}
else {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
a.moveToElement(driver.findElement(By.xpath("//*[text()='Awaiting Action']/parent::div/parent::td/following-sibling::td[3]/div //*[@data-automation-id='RELATED_TASK_charm']/parent::li"))).click().build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Security Profile']"))).build().perform();
a.moveToElement(driver.findElement(By.xpath("//div[@data-automation-label='Start Proxy']"))).click().build().perform();
driver.findElement(By.xpath("//button[@data-automation-id='wd-CommandButton_uic_okButton']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h1[@data-automation-id='landingPageWelcomeCardHeading']")));
}
}
}
public static void Boxes(WebDriver driver) throws InterruptedException
{
WebDriverWait wait = new WebDriverWait(driver, 25);
Actions a=new Actions(driver);
if(Enter1.size() == 0) {}
else {
for(String i:Enter1) {
if (i.contains(":")){
continue;
}
field1= i.split("=");
field= field1[0];
input= field1[1];
//Java Script executor
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[text()='"+field+"']")).size()>0) {
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field+"']"));
Thread.sleep(2000);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field+"']")));
}
// Boxes
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
//--------------------------------------Enter Input Box----------------------------------------------------
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).size()>0) {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(Keys.CONTROL, "a", Keys.DELETE);
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(input);
}
//--------------------------------------------------Searchbox-----------------------------------------------
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).size()>0) {
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/following-sibling::div/ul/li")).size()>0) {}
else{driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).click();
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).sendKeys(input, Keys.ENTER);
//wait time
try { WebDriverWait wait1 = new WebDriverWait(driver, 3);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }
//Reselecting the option
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else {
driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click();
}}}
//----------------------------------------------------Veteran status---------------------------------------------
if (driver.findElements(By.xpath("//*[text()='"+field+"']/parent::div/following-sibling::div //input[@placeholder='Search']")).size()>0)
{driver.findElement(By.xpath("//*[text()='"+field+"']/parent::div/following-sibling::div //input[@placeholder='Search']")).click();
System.out.println(input);
driver.findElement(By.xpath("//*[text()='"+field+"']/parent::div/following-sibling::div //input[@placeholder='Search']")).sendKeys(input, Keys.ENTER);
//Reselecting the option
try { WebDriverWait wait1 = new WebDriverWait(driver, 3);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else {
driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click(); }
}
//----------------------------------------Search box with pencil icon edit---------------------------------------------
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if (driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field+"')] //*[contains(@class, 'container')]")).size() >0) {
if (driver.findElements(By.xpath("//*[@data-automation-id='formLabelRequired'] //label[contains(text(), '"+field+"')]/parent::div/following-sibling::div //*[@style='visibility: visible;']")).size() >0) {}
else { driver.findElement(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field+"')] //*[contains(@class, 'container')]")).click();
//driver.findElement(By.xpath("//*[text() = '"+field+"' and @data-automation-id='formLabel']/parent::div/following-sibling::div/div")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text() = '"+field+"' and @data-automation-id='formLabel']/parent::div/following-sibling::div/div //input[@data-automation-id= 'searchBox']")));
driver.findElement(By.xpath("//*[text() = '"+field+"' and @data-automation-id='formLabel']/parent::div/following-sibling::div/div //input[@data-automation-id= 'searchBox']")).sendKeys(input, Keys.ENTER);
//Reselecting the option
try { WebDriverWait wait1 = new WebDriverWait(driver, 3);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else {
driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click(); }
}
}
}
//---------------------------------------------------------------calendar----------------------------------------------------------
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field+"')] //*[contains(@class, 'container')]")).size()>0)
{
driver.findElement(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field+"')] //*[contains(@class, 'container')]")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div //*[@class='wd-icon-container']")));
Thread.sleep(1000);
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div //*[@data-automation-id='dateSectionMonth']")).size()>0)
{
String[] spaces = input.split("/");
String Month= spaces[0];
String Day = spaces[1];
String year = spaces[2];
a.moveToElement(driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div //*[@data-automation-id='dateSectionMonth']"))).click().sendKeys(Month).build().perform();
a.moveToElement(driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div //*[@data-automation-id='dateSectionDay']"))).click().sendKeys(Day).build().perform();
a.moveToElement(driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div //*[@data-automation-id='dateSectionYear']"))).click().sendKeys(year).build().perform();
}
}
//-------------------------------------------------------------------Adobe----------------------------------------------------
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//button[@data-automation-id='thirdPartyConnection']")).size()>0) {
onBehalfOf22 = driver.findElement(By.xpath("//*[@data-automation-id='banner'][2]")).getText();
onBehalfOf12= onBehalfOf22.split(":");
onBehalfof2 = onBehalfOf12[1].trim();
String[] sign= onBehalfof2.split(" ");
String signFN=sign[0];
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//button[@data-automation-id='thirdPartyConnection']")));
driver.findElement(By.xpath("//button[@data-automation-id='thirdPartyConnection']")).click();
driver.switchTo().frame(driver.findElement(By.xpath("//iframe[@class='gwt-Frame WDLH WELH']")));
Thread.sleep(12500);
driver.findElement(By.xpath("//button[@class='popover coachmark down left sticky']")).click();
Thread.sleep(1000);
driver.findElement(By.xpath("//div[@aria-label='Click here to sign']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@aria-label='Type your signature here']")));
a.moveToElement(driver.findElement(By.xpath("//input[@aria-label='Type your signature here']"))).click().build().perform();
Thread.sleep(2000);
a.moveToElement(driver.findElement(By.xpath("//input[@aria-label='Type your signature here']"))).sendKeys(signFN).build().perform();
Thread.sleep(2000);
driver.findElement(By.xpath("//button[text()='Apply']")).click();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
try {
driver.findElement(By.xpath("//button[text()='Click to Sign']")).click();}
catch(Exception kjnj) {
a.moveToElement(driver.findElement(By.xpath("//input[@aria-label='Type your signature here']"))).click().build().perform();
Thread.sleep(2000);
a.moveToElement(driver.findElement(By.xpath("//input[@aria-label='Type your signature here']"))).sendKeys(signFN).build().perform();
Thread.sleep(2000);
driver.findElement(By.xpath("//button[text()='Apply']")).click();
}
driver.switchTo().defaultContent();
driver.findElement(By.xpath("//*[text()='Submit']")).click();
wait.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//*[text()='Submit']"))));
Thread.sleep(1500);
break;
}
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
//Paycard or I Agree
if (driver.findElements(By.xpath("//label[text()='I Agree']/parent::div/following-sibling::div/div/div/div")).size()>0)
{ ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//label[text()='I Agree']/parent::div/following-sibling::div/div/div/div")));
Thread.sleep(1000); driver.findElement(By.xpath("//label[text()='I Agree']/parent::div/following-sibling::div/div/div/div")).click();
break;}
//Payment Election
if (driver.findElements(By.xpath("//label[text()='Check']/preceding-sibling::input")).size()>0)
{((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//label[text()='Check']/preceding-sibling::input")));
Thread.sleep(1000);
driver.findElement(By.xpath("//label[text()='Check']/preceding-sibling::input")).click();
break;}
//Photo Change
if (driver.findElements(By.xpath("//*[text()='Change My Photo']/parent::h2/parent::div/parent::div //*[@class='wd-icon-gear wd-icon']")).size()>0)
{driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[text()='Change My Photo']/parent::h2/parent::div/parent::div //*[@class='wd-icon-gear wd-icon']")).click();
Thread.sleep(1500);
a.moveToElement(driver.findElement(By.xpath("//div[text()='Skip This Task']/parent::li"))).click().build().perform();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//textarea[@data-automation-id='textAreaField']")));
Thread.sleep(1500);
driver.findElement(By.xpath("//textarea[@data-automation-id='textAreaField']")).click();
a.moveToElement(driver.findElement(By.xpath("//textarea[@data-automation-id='textAreaField']"))).sendKeys("Test").build().perform();
break;}
}//for1 loop
for(String i:Enter1) {
if (i.contains("&")){
continue;
}
if (i.contains(":")){
fieldm= i.split(":");
field12= fieldm[0];
field13= fieldm[1];
fieldn= field13.split("=");
field= fieldn[0];
input= fieldn[1];
//Java Script executor
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@title='Legal Name Change']")).size()>0) { }
else {
//Pencil Icon
if(driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]")).size()>0) {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field12+"']"));
Thread.sleep(2000);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field12+"']")));
}
if (driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]")).size() >0)
{driver.findElement(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]")).click();
Thread.sleep(2500); }}
//Add button
else if(driver.findElements(By.xpath("//*[text()='"+field12+"']/parent::div/following-sibling::div[2] //*[@title='Add']")).size()>0) {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field12+"']"));
Thread.sleep(2000);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field12+"']")));
}
if (driver.findElements(By.xpath("//*[text()='"+field12+"']/parent::div/following-sibling::div[2] //*[@title='Add']")).size() >0)
{driver.findElement(By.xpath("//*[text()='"+field12+"']/parent::div/following-sibling::div[2] //*[@title='Add']")).click();
Thread.sleep(2500); }
}
//Java Script executor
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[text()='"+field+"']")).size()>0) {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field+"']"));
Thread.sleep(2000);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field+"']")));
}
//input into the box
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
//Enter Input Box
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).size()>0) {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(Keys.CONTROL, "a", Keys.DELETE);
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(input);
}
//Searchbox
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).size()>0) {
if(driver.findElements(By.xpath("//label[text()='field']//parent::div/following-sibling::div/div/div/div/div/div/div[1]/following-sibling::div/ul/li")).size()>0) {}
else {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).click();
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).sendKeys(input, Keys.ENTER);
//Reselecting the option
try { WebDriverWait wait1 = new WebDriverWait(driver, 3);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else {
driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click();
}}}
//Search box with pencil icon edit
else if (driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field+"')] //*[contains(@class, 'container')]")).size() >0) {
if (driver.findElements(By.xpath("//*[@data-automation-id='formLabelRequired'] //label[contains(text(), '"+field+"')]/parent::div/following-sibling::div //*[@style='visibility: visible;']")).size() >0) {}
else { driver.findElement(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field+"')] //*[contains(@class, 'container')]")).click();
//driver.findElement(By.xpath("//*[text() = '"+field+"' and @data-automation-id='formLabel']/parent::div/following-sibling::div/div")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text() = '"+field+"' and @data-automation-id='formLabel']/parent::div/following-sibling::div/div //input[@data-automation-id= 'searchBox']")));
driver.findElement(By.xpath("//*[text() = '"+field+"' and @data-automation-id='formLabel']/parent::div/following-sibling::div/div //input[@data-automation-id= 'searchBox']")).sendKeys(input, Keys.ENTER);
//Reselecting the option
try { WebDriverWait wait1 = new WebDriverWait(driver, 3);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else { driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click(); }
}
}
}
}//Legal name change
}
}//for2 loop
for(String i:Enter1) {
if (i.contains("&")){
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
fieldm= i.split(":");
field12= fieldm[0];
field13= fieldm[1];
//Java Script executor
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@title='Legal Name Change']")).size()>0) { }
else {
//Pencil Icon
if(driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]")).size()>0) {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field12+"']"));
Thread.sleep(500);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field12+"']")));
}
if (driver.findElements(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]")).size() >0)
{ try{driver.findElement(By.xpath("//div[contains(@title, 'Edit' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]")).click();}
catch(Exception jhbhj) {}
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[contains(@title, 'Undo' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]"))); }}
//Add button
else if(driver.findElements(By.xpath("//*[text()='"+field12+"']/parent::div/following-sibling::div[2] //*[@title='Add']")).size()>0) {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field12+"']"));
Thread.sleep(500);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field12+"']")));
}
if (driver.findElements(By.xpath("//*[text()='"+field12+"']/parent::div/following-sibling::div[2] //*[@title='Add']")).size() >0)
{driver.findElement(By.xpath("//*[text()='"+field12+"']/parent::div/following-sibling::div[2] //*[@title='Add']")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[contains(@title, 'Undo' ) and contains(@title, '"+field12+"')] //*[contains(@class, 'container')]"))); }
}
for(int hj=0; hj<10; hj++) {
fieldn3= field13.split("&");
try {field3= fieldn3[hj];}
catch(Exception IndexFor) {break;}
if(field3 ==null) {break;}
fieldn= field3.split("=");
field= fieldn[0];
input= fieldn[1];
//Java Script executor
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[text()='"+field+"']")).size()>0) {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebElement Task = driver.findElement(By.xpath("//*[text()='"+field+"']"));
Thread.sleep(500);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", Task);
Boolean h = false;
while(h==false)
{
h= isVisibleInViewport.isVisibleInViewport(driver.findElement(By.xpath("//*[text()='"+field+"']")));
}
//input into the box
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
//Enter Input Box
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).size()>0) {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(Keys.CONTROL, "a", Keys.DELETE);
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/input")).sendKeys(input);
}
//Searchbox
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).size()>0) {
if(driver.findElements(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div[1]/following-sibling::div/ul/li")).size()>0) {}
else {
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).click();
driver.findElement(By.xpath("//label[text()='"+field+"']//parent::div/following-sibling::div/div/div/div/div/div/div/input")).sendKeys(input, Keys.ENTER);
//Reselecting the option
try { WebDriverWait wait1 = new WebDriverWait(driver, 3);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")));}
catch(Exception e) { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@aria-label='Search Results']"))); }
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).size()>0) {
Thread.sleep(1000);
driver.findElement(By.xpath("//*[@data-automation-id='selectedItem' and contains(@title,'"+input+"')]")).click();}
else { driver.findElement(By.xpath("//*[contains(text(),'"+input+"')]")).click();
}}}
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
//Government IDS
if( driver.findElements(By.xpath("//*[contains(text(),'Proposed IDs')]")).size()>0) {
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
if( driver.findElements(By.xpath("//div[@data-automation-id='selectedItem']")).size()> 0) {break;}
if(ghj==0) {
a.moveToElement(driver.findElement(By.xpath("//button[@data-automation-id='addRow']/div"))).click().build().perform();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//td[contains(@headers, 'columnheader1')] //input[@placeholder='Search']")));
ghj++;}
if(field.contains("Country")){
a.moveToElement(driver.findElement(By.xpath("//td[contains(@headers, 'columnheader1')] //input[@placeholder='Search']"))).click().sendKeys(input, Keys.ENTER).build().perform();}
if(field.equalsIgnoreCase("National ID Type")){
a.moveToElement(driver.findElement(By.xpath("//td[contains(@headers, 'columnheader2')] //input[@placeholder='Search']"))).click().sendKeys(input, Keys.ENTER).build().perform();
; }
if(field.equalsIgnoreCase("Add/Edit ID")){
if(input.equalsIgnoreCase("Random")) { min = 100000000; max = 999999999; random_int= (int)(Math.random() * (max - min + 1) + min);
WebElement wb =driver.findElement(By.xpath("//td[contains(@headers, 'columnheader4')] //input[@data-automation-id='textInputBox']"));
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("arguments[0].value='"+random_int+"';", wb);}
else {
WebElement wb =driver.findElement(By.xpath("//td[contains(@headers, 'columnheader4')] //input[@data-automation-id='textInputBox']"));
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("arguments[0].value='"+input+"';", wb);}
}
if(field.contains("Issued Date")){
String[] spaces = input.split("/");
String Month= spaces[0];
String Day = spaces[1];
String year = spaces[2];
WebElement columndriver1 = driver.findElement(By.xpath("//td[contains(@headers, 'columnheader8')]"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView()", columndriver1);
Thread.sleep(1000);
//columndriver.findElement(By.xpath("//td[contains(@headers, 'columnheader8')]")).sendKeys(Keys.CONTROL, Keys.HOME);
((JavascriptExecutor) driver)
.executeScript("window.scrollTo(0, -document.body.scrollHeight)");
Thread.sleep(2000);
WebElement columndriver = driver.findElement(By.xpath("//td[contains(@headers, 'columnheader5')]"));
a.moveToElement(columndriver.findElement(By.xpath("//*[@data-automation-id='dateSectionMonth']"))).click().sendKeys(Month).build().perform();
a.moveToElement(columndriver.findElement(By.xpath("//*[@data-automation-id='dateSectionDay']"))).click().sendKeys(Day).build().perform();
a.moveToElement(columndriver.findElement(By.xpath("//*[@data-automation-id='dateSectionYear']"))).click().sendKeys(year).build().perform();
}
if(field.contains("Expiration Date")){
String[] spaces = input.split("/");
String Month= spaces[0];
String Day = spaces[1];
String year = spaces[2];
a.moveToElement(driver.findElement(By.xpath("(//*[@data-automation-id='dateSectionMonth'])[2]"))).click().sendKeys(Month).build().perform();
a.moveToElement(driver.findElement(By.xpath("(//*[@data-automation-id='dateSectionDay'])[2]"))).click().sendKeys(Day).build().perform();
a.moveToElement(driver.findElement(By.xpath("(//*[@data-automation-id='dateSectionYear'])[2]"))).click().sendKeys(year).build().perform();
}
}
}
}
}//inside for loop
}//if contains ","
}//for3 loop
}//else loop
//Submit
Thread.sleep(500);
driver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);
if(driver.findElements(By.xpath("//*[text()='Submit']")).size()>0) {
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Submit']")));
driver.findElement(By.xpath("//*[text()='Submit']")).click();
if(driver.findElements(By.xpath("//*[contains(text(),'Alert')]")).size()>0){
driver.findElement(By.xpath("//*[text()='Submit']")).click();
}
wait.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//*[text()='Submit']"))));
Thread.sleep(2000);
driver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);}
else if(driver.findElements(By.xpath("//*[text()='Done']")).size()>0)
{ ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Done']")));
driver.findElement(By.xpath("//*[text()='Done']")).click();
wait.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//*[text()='Done']"))));
Thread.sleep(2000); driver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);}
else {
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='OK']")));
driver.findElement(By.xpath("//*[text()='OK']")).click();
wait.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//*[text()='OK']"))));
Thread.sleep(2000); driver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);}
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
if(driver.findElements(By.xpath("//*[contains(text(), 'Submit') and not(contains(@title, 'Actions'))]")).size()>0) {
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(By.xpath("//*[text()='Submit']")));
driver.findElement(By.xpath("//*[text()='Submit']")).click();
wait.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//*[text()='Submit']"))));
Thread.sleep(2000);
driver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);}
}
//inbox.input(driver, "Hire", "Hire Date");
//inbox.input(driver, "Hire", "Reason");
//inbox.input(driver, "Hire", "Team Member Type");
//inbox.input(driver, "Hire", "Job Profile");
//inbox.input(driver, "Hire", "Time Type");
//inbox.input(driver, "Hire", "Location");
}
|
[
"[email protected]"
] | |
7f683dfb651b451c228d6c7da87a90bc089464ad
|
3adbd206e87e391569e9bddb41eeb47d096f26d4
|
/LN-APIAutomation/src/test/java/Utils/URLUTF8Encoder.java
|
166e0b98d0d8b549897e8f67e3b4f7feb55e504a
|
[] |
no_license
|
lptommyjohnson/LN-APIAutomation
|
a858a05f68361cfc3a61e53536d2ff0fe8587c0e
|
cac359c8ec7cfa3086f2598287a13e074e756b02
|
refs/heads/main
| 2023-01-24T04:38:07.711960 | 2020-11-30T01:24:59 | 2020-11-30T01:24:59 | 313,566,652 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,335 |
java
|
package Utils;
public class URLUTF8Encoder {
/** Description of the Field */
final static String[] hex = {
"%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
"%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e", "%0f",
"%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
"%18", "%19", "%1a", "%1b", "%1c", "%1d", "%1e", "%1f",
"%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27",
"%28", "%29", "%2a", "%2b", "%2c", "%2d", "%2e", "%2f",
"%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37",
"%38", "%39", "%3a", "%3b", "%3c", "%3d", "%3e", "%3f",
"%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47",
"%48", "%49", "%4a", "%4b", "%4c", "%4d", "%4e", "%4f",
"%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57",
"%58", "%59", "%5a", "%5b", "%5c", "%5d", "%5e", "%5f",
"%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67",
"%68", "%69", "%6a", "%6b", "%6c", "%6d", "%6e", "%6f",
"%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77",
"%78", "%79", "%7a", "%7b", "%7c", "%7d", "%7e", "%7f",
"%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
"%88", "%89", "%8a", "%8b", "%8c", "%8d", "%8e", "%8f",
"%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
"%98", "%99", "%9a", "%9b", "%9c", "%9d", "%9e", "%9f",
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7",
"%a8", "%a9", "%aa", "%ab", "%ac", "%ad", "%ae", "%af",
"%b0", "%b1", "%b2", "%b3", "%b4", "%b5", "%b6", "%b7",
"%b8", "%b9", "%ba", "%bb", "%bc", "%bd", "%be", "%bf",
"%c0", "%c1", "%c2", "%c3", "%c4", "%c5", "%c6", "%c7",
"%c8", "%c9", "%ca", "%cb", "%cc", "%cd", "%ce", "%cf",
"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
"%d8", "%d9", "%da", "%db", "%dc", "%dd", "%de", "%df",
"%e0", "%e1", "%e2", "%e3", "%e4", "%e5", "%e6", "%e7",
"%e8", "%e9", "%ea", "%eb", "%ec", "%ed", "%ee", "%ef",
"%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7",
"%f8", "%f9", "%fa", "%fb", "%fc", "%fd", "%fe", "%ff"
};
/**
* Encode a string to the "x-www-form-urlencoded" form, enhanced with the
* UTF-8-in-URL proposal. This is what happens: <p/>
*
*
* <ul>
* <li> <p>
*
* The ASCII characters 'a' through 'z', 'A' through 'Z', and '0' through
* '9' remain the same. <p/>
*
*
* <li> <p>
*
* The unreserved characters - _ . ! ~ * ' ( ) remain the same. <p/>
*
*
* <li> <p>
*
* The space character ' ' is converted into a plus sign '+'. <p/>
*
*
* <li> <p>
*
* All other ASCII characters are converted into the 3-character string
* "%xy", where xy is the two-digit hexadecimal representation of the
* character code <p/>
*
*
* <li> <p>
*
* All non-ASCII characters are encoded in two steps: first to a sequence
* of 2 or 3 bytes, using the UTF-8 algorithm; secondly each of these
* bytes is encoded as "%xx".
* </ul>
*
*
* @param s The string to be encoded
* @return The encoded string
*/
public static String encode( String s ) {
StringBuffer sbuf = new StringBuffer();
int len = s.length();
for ( int i = 0; i < len; i++ ) {
int ch = s.charAt( i );
append( sbuf, ch );
}
return sbuf.toString();
}
/**
* Description of the Method
*
* @param chars PARAM
* @return Returns
*/
public static String encode( char[] chars ) {
StringBuffer sbuf = new StringBuffer();
int len = chars.length;
for ( int i = 0; i < len; i++ ) {
int ch = chars[i];
append( sbuf, ch );
}
return sbuf.toString();
}
/**
* Description of the Method
*
* @param sbuf PARAM
* @param ch PARAM
*/
private static void append( StringBuffer sbuf, int ch ) {
if ( 'A' <= ch && ch <= 'Z' ) {// 'A'..'Z'
sbuf.append( (char)ch );
} else if ( 'a' <= ch && ch <= 'z' ) {// 'a'..'z'
sbuf.append( (char)ch );
} else if ( '0' <= ch && ch <= '9' ) {// '0'..'9'
sbuf.append( (char)ch );
} else if ( ch == ' ' ) {// space
sbuf.append( '+' );
} else if ( ch == '-' || ch == '_' // unreserved
|| ch == '.' || ch == '!'
|| ch == '~' || ch == '*'
|| ch == '\'' || ch == '('
|| ch == ')' ) {
sbuf.append( (char)ch );
} else if ( ch <= 0x007f ) {// other ASCII
sbuf.append( hex[ch] );
} else if ( ch <= 0x07FF ) {// non-ASCII <= 0x7FF
sbuf.append( hex[0xc0 | ( ch >> 6 )] );
sbuf.append( hex[0x80 | ( ch & 0x3F )] );
} else {// 0x7FF < ch <= 0xFFFF
sbuf.append( hex[0xe0 | ( ch >> 12 )] );
sbuf.append( hex[0x80 | ( ( ch >> 6 ) & 0x3F )] );
sbuf.append( hex[0x80 | ( ch & 0x3F )] );
}
}
}
|
[
"[email protected]"
] | |
b31adb382c72fb063d021f8f012cedf7cf64e59e
|
2f8b4cd86d6fae37dcfe186ec8fc34df098b363f
|
/src/main/java/com/brad/LanguageMapper.java
|
5daace477a0789346752730afe1af16b5ceef160
|
[] |
no_license
|
bradleycreech/quote-getter
|
3392ed20994b8322be570e586cb0d442d002a937
|
fe8ca50b303328bb595fd2f6cf4af3ee497e351b
|
refs/heads/main
| 2023-03-06T10:38:19.938158 | 2021-02-18T01:08:37 | 2021-02-18T01:08:37 | 339,886,094 | 0 | 0 | null | 2021-02-18T01:08:38 | 2021-02-17T23:48:28 |
Java
|
UTF-8
|
Java
| false | false | 364 |
java
|
package com.brad;
public class LanguageMapper {
public static String map(String language){
if( language.equalsIgnoreCase("english")){
return "en";
}
else if( language.equalsIgnoreCase("russian")){
return "ru";
}
else{
throw new IllegalArgumentException(language);
}
}
}
|
[
"[email protected]"
] | |
2032fc99a3920aa8d0f9b57efc0a2a23983b1a60
|
a587577cac1dff03b032cc305819f5241be156ff
|
/Pedido/src/estabelecimento/Pessoa.java
|
74fa8cd178ff27066706399a627f5c63329ddc9c
|
[] |
no_license
|
luciojb/pedidos-com-listas
|
85df3f74a73552a6569b2f7b24f1fea9f4997102
|
424a04c41b7bae7e55829ee6a51d86808c3d7d45
|
refs/heads/master
| 2021-01-12T11:11:11.835920 | 2017-08-17T02:24:15 | 2017-08-17T02:24:15 | 72,860,166 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 819 |
java
|
package estabelecimento;
public class Pessoa {
private int codigo;
private String nome, email;
public int getCodigo() {
return codigo;
}
public void setCodigo(int codigo) {
if (codigo>0)
this.codigo = codigo;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
if (email.length()>0)
this.email = email;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
if (nome.length()>0)
this.nome = nome;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Cliente [codigo=");
builder.append(codigo);
builder.append(", nome=");
builder.append(nome);
builder.append(", email=");
builder.append(email);
builder.append("]");
return builder.toString();
}
}
|
[
"lucio@Luciojb"
] |
lucio@Luciojb
|
ed7312e518be568737c447caecb94ed206d47b4f
|
3c4763922cda3f3a990b74cdba6f8a30b07467de
|
/src/main/java/students/bogdans_pavlovs/lesson_9/level_6/FraudRule2.java
|
7a6855f48101adb04fe6df7e135ae3bb82d3174b
|
[] |
no_license
|
VitalyPorsev/JavaGuru1
|
07db5a0cc122b097a20e56c9da431cd49d3c01ea
|
f3c25b6357309d4e9e8ac0047e51bb8031d14da8
|
refs/heads/main
| 2023-05-10T15:35:55.419713 | 2021-05-15T18:48:12 | 2021-05-15T18:48:12 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 258 |
java
|
package students.bogdans_pavlovs.lesson_9.level_6;
class FraudRule2 extends FraudRule {
public FraudRule2(String ruleName) {
super(ruleName);
}
public boolean isFraud(Transaction t) {
return (t.getAmount() > 1000000);
}
}
|
[
"[email protected]"
] | |
98da1b0e537c2265822ff69a7ecfb18e404f5f2e
|
6e15bd5d9ea3be77311446c0eb862872f4d79a01
|
/src/main/java/ait/sistemas/proyecto/activos/view/para/tiposact/VTiposactM.java
|
630efb9b9f118c059e1cb0ba448480b97e469d7c
|
[] |
no_license
|
franzemil/proyecto_ait
|
c872447473035d371f73eed384adfc9193bd9ce1
|
379703104ec77eb83de5ab0c2b182cf2cec3a414
|
refs/heads/master
| 2021-05-29T17:08:50.769966 | 2015-10-15T23:01:27 | 2015-10-15T23:01:27 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,913 |
java
|
package ait.sistemas.proyecto.activos.view.para.tiposact;
import java.util.List;
import ait.sistemas.proyecto.activos.data.model.Tipos_Activo;
import ait.sistemas.proyecto.activos.data.service.Impl.TiposactImpl;
import ait.sistemas.proyecto.common.component.BarMessage;
import ait.sistemas.proyecto.common.component.Messages;
import com.vaadin.event.SelectionEvent;
import com.vaadin.event.SelectionEvent.SelectionListener;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.server.Responsive;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Notification.Type;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
public class VTiposactM extends VerticalLayout implements View, ClickListener, SelectionListener {
private static final long serialVersionUID = 1L;
public static final String ID = "/act/para/tiposact/m";
private FormTiposact frm_tiposact;
private CssLayout hl_errores;
private Button btn_limpiar;
private Button btn_modificar;
private GridTiposact grid_tiposact;
private final TiposactImpl tiposact_impl = new TiposactImpl();
public VTiposactM() {
this.frm_tiposact = new FormTiposact();
this.btn_limpiar = new Button("Limpiar");
this.btn_modificar = new Button("Modificar");
this.btn_modificar.addClickListener(this);
this.btn_limpiar.addClickListener(this);
this.grid_tiposact = new GridTiposact();
this.grid_tiposact.addSelectionListener(this);
this.hl_errores = new CssLayout();
addComponent(buildNavBar());
addComponent(buildFormContent());
addComponent(buildButtonBar());
}
private Component buildFormContent() {
VerticalLayout formContent = new VerticalLayout();
formContent.setSpacing(true);
Panel frmPanel = new Panel();
frmPanel.setWidth("100%");
frmPanel.setCaption("Datos a modificar");
frmPanel.setContent(this.frm_tiposact);
formContent.setMargin(true);
formContent.addComponent(frmPanel);
Panel gridPanel = new Panel();
gridPanel.setWidth("100%");
gridPanel.setCaption("Tipos de Activos Registrados");
gridPanel.setContent(this.grid_tiposact);
formContent.setMargin(true);
formContent.addComponent(gridPanel);
formContent.addComponent(frmPanel);
this.frm_tiposact.update();
Responsive.makeResponsive(formContent);
return formContent;
}
private Component buildNavBar() {
Panel navPanel = new Panel();
HorizontalLayout nav = new HorizontalLayout();
nav.addStyleName("ait-content-nav");
nav.addComponent(new Label("Activos>>"));
nav.addComponent(new Label("Parametros>>"));
nav.addComponent(new Label("Tipos de Activos>>"));
nav.addComponent(new Label("<strong>Modificar</strong>", ContentMode.HTML));
navPanel.setContent(nav);
return navPanel;
}
private Component buildButtonBar() {
CssLayout buttonContent = new CssLayout();
this.btn_modificar.setStyleName("ait-buttons-btn");
buttonContent.addComponent(this.btn_modificar);
this.btn_limpiar.setStyleName("ait-buttons-btn");
buttonContent.addStyleName("ait-buttons");
buttonContent.addComponent(this.btn_limpiar);
Responsive.makeResponsive(buttonContent);
return buttonContent;
}
@Override
public void enter(ViewChangeEvent event) {
}
private void buildMessages(List<BarMessage> mensages) {
this.hl_errores.removeAllComponents();
hl_errores.addStyleName("ait-error-bar");
this.addComponent(this.hl_errores);
for (BarMessage barMessage : mensages) {
Label lbError = new Label(barMessage.getComponetName() + ":" + barMessage.getErrorName());
lbError.setStyleName(barMessage.getType());
this.hl_errores.addComponent(lbError);
}
}
@Override
public void select(SelectionEvent event) {
if ((Tipos_Activo) this.grid_tiposact.getSelectedRow() != null) {
this.frm_tiposact.setData((Tipos_Activo) this.grid_tiposact.getSelectedRow());
}
}
@Override
public void buttonClick(ClickEvent event) {
if (event.getButton() == this.btn_modificar) {
if (this.frm_tiposact.validate()) {
this.tiposact_impl.update(this.frm_tiposact.getData());
this.frm_tiposact.update();
this.grid_tiposact.update();
Notification.show(Messages.SUCCESS_MESSAGE);
} else {
Notification.show(Messages.NOT_SUCCESS_MESSAGE, Type.ERROR_MESSAGE);
}
buildMessages(this.frm_tiposact.getMensajes());
this.frm_tiposact.clearMessages();
}
if (event.getButton() == this.btn_limpiar) {
this.frm_tiposact.update();
}
}
}
|
[
"[email protected]"
] | |
ee0cf49db11a65e8483bd2bf1695714e72455aeb
|
81719679e3d5945def9b7f3a6f638ee274f5d770
|
/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/transform/ListFunctionDefinitionsResultJsonUnmarshaller.java
|
faae49128ff314418c2fdeeb1051e5e0effc83be
|
[
"Apache-2.0"
] |
permissive
|
ZeevHayat1/aws-sdk-java
|
1e3351f2d3f44608fbd3ff987630b320b98dc55c
|
bd1a89e53384095bea869a4ea064ef0cf6ed7588
|
refs/heads/master
| 2022-04-10T14:18:43.276970 | 2020-03-07T12:15:44 | 2020-03-07T12:15:44 | 172,681,373 | 1 | 0 |
Apache-2.0
| 2019-02-26T09:36:47 | 2019-02-26T09:36:47 | null |
UTF-8
|
Java
| false | false | 3,283 |
java
|
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.greengrass.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.greengrass.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* ListFunctionDefinitionsResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListFunctionDefinitionsResultJsonUnmarshaller implements Unmarshaller<ListFunctionDefinitionsResult, JsonUnmarshallerContext> {
public ListFunctionDefinitionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
ListFunctionDefinitionsResult listFunctionDefinitionsResult = new ListFunctionDefinitionsResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return listFunctionDefinitionsResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("Definitions", targetDepth)) {
context.nextToken();
listFunctionDefinitionsResult.setDefinitions(new ListUnmarshaller<DefinitionInformation>(DefinitionInformationJsonUnmarshaller
.getInstance()).unmarshall(context));
}
if (context.testExpression("NextToken", targetDepth)) {
context.nextToken();
listFunctionDefinitionsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return listFunctionDefinitionsResult;
}
private static ListFunctionDefinitionsResultJsonUnmarshaller instance;
public static ListFunctionDefinitionsResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new ListFunctionDefinitionsResultJsonUnmarshaller();
return instance;
}
}
|
[
""
] | |
0d3106707a0477de8c2d1c46a2db7283123df077
|
08b9d0932c710e1b15007b0119964ed04f996da3
|
/bird-trace/bird-trace-client/src/main/java/com/bird/trace/client/configure/TraceClientAutoConfigurer.java
|
59ae58e6f21549091edbb33e97c0b90c403fb15b
|
[
"MIT"
] |
permissive
|
leihtg/bird-java
|
0b9ec6ac97ae5a460044ef78a14c85181aad0c6a
|
6cbb23766852c358ae036b6c0dc46f7054cedb2b
|
refs/heads/master
| 2021-05-17T14:29:31.078892 | 2020-04-03T10:36:59 | 2020-04-03T10:36:59 | 250,822,319 | 0 | 0 |
MIT
| 2020-03-28T14:58:13 | 2020-03-28T14:58:13 | null |
UTF-8
|
Java
| false | false | 3,428 |
java
|
package com.bird.trace.client.configure;
import com.alibaba.druid.pool.DruidDataSource;
import com.bird.trace.client.TraceContext;
import com.bird.trace.client.aspect.ITraceLogCustomizer;
import com.bird.trace.client.aspect.TraceableAspect;
import com.bird.trace.client.dispatch.DefaultTraceLogDispatcher;
import com.bird.trace.client.dispatch.IDefaultTraceLogStore;
import com.bird.trace.client.dispatch.ITraceLogDispatcher;
import com.bird.trace.client.sql.druid.DruidDataSourcePostProcessor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import java.util.List;
/**
* @author liuxx
* @date 2019/8/5
*/
@Slf4j
@Configuration
@EnableConfigurationProperties(TraceProperties.class)
@AutoConfigureBefore(DataSourceAutoConfiguration.class)
@ConditionalOnProperty(value = "bird.trace.client.enabled", matchIfMissing = true)
public class TraceClientAutoConfigurer {
private final ApplicationContext applicationContext;
private final List<ITraceLogCustomizer> logCustomizers;
public TraceClientAutoConfigurer(ApplicationContext applicationContext, ObjectProvider<List<ITraceLogCustomizer>> logCustomizersProvider) {
this.applicationContext = applicationContext;
this.logCustomizers = logCustomizersProvider.getIfAvailable();
}
/**
* 日志拦截切面
*
* @return 切面
*/
@Bean
public TraceableAspect traceableAspect(TraceProperties traceProperties) {
TraceableAspect traceableAspect = new TraceableAspect();
traceableAspect.setDefaultSQLTypes(traceProperties.getSqlTypes());
traceableAspect.setLogCustomizers(logCustomizers);
return traceableAspect;
}
@Bean
@ConditionalOnMissingBean({ITraceLogDispatcher.class, IDefaultTraceLogStore.class})
public IDefaultTraceLogStore defaultTraceLogStore() {
return logs -> log.warn("未注入IDefaultTraceLogStore实例,丢弃跟踪日志信息");
}
@Bean
@ConditionalOnMissingBean(ITraceLogDispatcher.class)
public ITraceLogDispatcher traceLogDispatcher(IDefaultTraceLogStore defaultTraceLogStore) {
return new DefaultTraceLogDispatcher(defaultTraceLogStore);
}
/**
* 初始化跟踪日志发送器
*/
@PostConstruct
public void initTraceContext() {
ITraceLogDispatcher logDispatcher = applicationContext.getBean(ITraceLogDispatcher.class);
TraceContext.init(logDispatcher);
}
@Configuration
@ConditionalOnClass(DruidDataSource.class)
static class DruidDataSourcePostProcessorConfiguration{
@Bean
public DruidDataSourcePostProcessor druidDataSourcePostProcessor() {
return new DruidDataSourcePostProcessor();
}
}
}
|
[
"[email protected]"
] | |
d2d43eb194cff5f7f3086f10f7477075c484a2fc
|
f5563fb44a03a4b71bb4ef32ba12f7906f4320f1
|
/src/main/java/com/hsbc/poc/cloudui/model/BootDisk.java
|
91f26180a7a403ea3b5cd3530f0c4d52fad2258b
|
[] |
no_license
|
pnkjkumar07/clouduipoc
|
39105efd976eacde01893b42effea83d021899e3
|
295026f15b5606fb74b43b3ce3616cca93d143f5
|
refs/heads/main
| 2023-03-04T06:05:13.095048 | 2021-02-15T05:30:43 | 2021-02-15T05:30:43 | 329,931,650 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 588 |
java
|
package com.hsbc.poc.cloudui.model;
import java.io.Serializable;
public class BootDisk implements Serializable {
private static final long serialVersionUID = -299482035708790409L;
private String source;
public BootDisk(String source) {
this.source = source;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
@Override
public String toString() {
return "\r\n boot_disk {" +
"\r\n source=" + source +
"\r\n }";
}
}
|
[
"[email protected]"
] | |
b87b6cd7fa1d62370ae86cb34c654b50a94b8399
|
49996b5a950bca6707baacb094a212648414446a
|
/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/src/test/java/org/xwiki/mail/internal/RecipientConverterTest.java
|
59227218927965a102889dc7483e3e3ac47a53cb
|
[] |
no_license
|
toannh/xwiki-platform
|
09cbe140ac114ca37746e5a20d8db3f2e925c16b
|
8e34825faf02ea9e2a08aa99b8af63e33b86072c
|
refs/heads/master
| 2020-12-29T00:56:30.029730 | 2015-01-26T10:11:39 | 2015-01-26T10:11:39 | 29,856,505 | 0 | 1 | null | 2015-01-26T10:38:41 | 2015-01-26T10:38:41 | null |
UTF-8
|
Java
| false | false | 2,606 |
java
|
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.mail.internal;
import javax.mail.Message;
import javax.mail.internet.MimeMessage;
import org.junit.Rule;
import org.junit.Test;
import org.xwiki.properties.converter.ConversionException;
import org.xwiki.test.mockito.MockitoComponentMockingRule;
import static org.junit.Assert.*;
/**
* Unit tests for {@link org.xwiki.mail.internal.RecipientConverter}.
*
* @version $Id$
* @since 6.1RC1
*/
public class RecipientConverterTest
{
@Rule
public MockitoComponentMockingRule<RecipientConverter> mocker =
new MockitoComponentMockingRule<>(RecipientConverter.class);
@Test
public void convert() throws Exception
{
assertEquals(Message.RecipientType.TO,
this.mocker.getComponentUnderTest().convert(Message.RecipientType.class, "to"));
assertEquals("To",
this.mocker.getComponentUnderTest().convert(String.class, Message.RecipientType.TO));
assertEquals(Message.RecipientType.CC,
this.mocker.getComponentUnderTest().convert(Message.RecipientType.class, "cc"));
assertEquals(Message.RecipientType.BCC,
this.mocker.getComponentUnderTest().convert(Message.RecipientType.class, "bcc"));
assertEquals(MimeMessage.RecipientType.NEWSGROUPS,
this.mocker.getComponentUnderTest().convert(Message.RecipientType.class, "newsgroups"));
try {
this.mocker.getComponentUnderTest().convert(Message.RecipientType.class, "something");
fail("Should have thrown an exception here");
} catch (ConversionException e) {
assertEquals("Cannot convert [something] to [javax.mail.Message$RecipientType]", e.getMessage());
}
}
}
|
[
"[email protected]"
] | |
175817b18d509d9cc40603387b9bdc350da5d4f2
|
5d2726b0658d0f80d9dcc92875dca020bb7a362a
|
/chapter_001/src/test/java/ru/job4j/design/srp/ReportEngineTest.java
|
5c8a49f2a0083b68add84e3f922ec1b2963b0e25
|
[] |
no_license
|
RVohmin/job4j_design
|
4a1a018a5715db5d577806aaf6ce53d21e3a264a
|
84e779d14b10b6fcc935a1cad1a712d44d110761
|
refs/heads/master
| 2021-03-17T18:41:33.491082 | 2020-10-14T05:18:45 | 2020-10-14T05:18:45 | 247,009,809 | 0 | 0 | null | 2020-10-14T05:18:46 | 2020-03-13T07:13:44 |
Java
|
UTF-8
|
Java
| false | false | 2,410 |
java
|
package ru.job4j.design.srp;
import org.junit.Test;
import java.util.Calendar;
import static org.junit.Assert.assertEquals;
public class ReportEngineTest {
@Test
public void whenForHRDepGeneratedThenTextReport() {
MemStore store = new MemStore();
Calendar now = Calendar.getInstance();
Employer worker1 = new Employer("Ivan", now, now, 100);
store.add(worker1);
Report hrText = new ReportText();
Department hrDep = new HRDep();
ReportEngine engine = new ReportEngine(store);
String expect = "name: " + worker1.getName()
+ System.lineSeparator()
+ "salary: " + worker1.getSalary() + " euros;\n";
assertEquals(expect, engine.generate(em -> true, hrText, hrDep));
}
@Test
public void whenForHRDepGeneratedThenHTMLReport() {
MemStore store = new MemStore();
Calendar now = Calendar.getInstance();
Employer worker1 = new Employer("Ivan", now, now, 100);
store.add(worker1);
Report reportHtml = new ReportHtml();
Department hrDep = new HRDep();
ReportEngine engine = new ReportEngine(store);
String html = "<!DOCTYPE html>"
+ System.lineSeparator()
+ "<html lang=\"ru\">"
+ System.lineSeparator()
+ "<head>"
+ System.lineSeparator()
+ "<meta charset=\"UTF-8\">"
+ System.lineSeparator()
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
+ System.lineSeparator()
+ "<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">"
+ System.lineSeparator()
+ "<title>Document</title>"
+ System.lineSeparator()
+ "</head>"
+ System.lineSeparator()
+ "<body>"
+ System.lineSeparator()
+ "<p>" + "name: " + worker1.getName() + "</p>\n"
+ "<p>" + "salary: " + worker1.getSalary() + " euros;</p>"
+ System.lineSeparator()
+ System.lineSeparator()
+ "</body>"
+ System.lineSeparator()
+ "</html>"
+ System.lineSeparator();
assertEquals(html, engine.generate(em -> true, reportHtml, hrDep));
}
}
|
[
"[email protected]"
] | |
5d1f50c9c50bba16dde02e6ece78584040ae1ac1
|
fd788168bf16156330c5509ae59addeeff9ef111
|
/integration/src/test/java/org/hibernate/validator/integration/wildfly/xml/JaxpContainedInDeploymentIT.java
|
9813abefd65a6892e76752bb220d25098a3ababb
|
[
"LicenseRef-scancode-dco-1.1",
"Apache-2.0"
] |
permissive
|
vootan/hibernate-validator
|
0f3c8e1593818be55e8dc03abe870c01508bbbf3
|
8c60b9938f7c18666e266067c45a69d5f78e7878
|
refs/heads/main
| 2023-07-07T21:36:20.669362 | 2021-08-10T20:04:47 | 2021-08-10T20:04:47 | 394,723,290 | 0 | 0 |
NOASSERTION
| 2021-08-10T17:09:27 | 2021-08-10T17:09:27 | null |
UTF-8
|
Java
| false | false | 4,064 |
java
|
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package org.hibernate.validator.integration.wildfly.xml;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Set;
import javax.inject.Inject;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.integration.AbstractArquillianIT;
import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.asset.Asset;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.api.validationConfiguration11.ValidationConfigurationDescriptor;
import org.jboss.shrinkwrap.descriptor.api.validationMapping11.ValidationMappingDescriptor;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.testng.annotations.Test;
/**
* Test for https://hibernate.atlassian.net/browse/HV-1280. To reproduce the issue, the deployment must be done twice
* (it will only show up during the 2nd deploy), which is why the test is managing the deployment itself via client-side
* test methods.
*
* @author Gunnar Morling
*/
public class JaxpContainedInDeploymentIT extends AbstractArquillianIT {
private static final String WAR_FILE_NAME = JaxpContainedInDeploymentIT.class.getSimpleName() + ".war";
@ArquillianResource
private Deployer deployer;
@Inject
private Validator validator;
@Deployment(name = "jaxpit", managed = false)
public static Archive<?> createTestArchive() {
return buildTestArchive( WAR_FILE_NAME )
.addClass( Camera.class )
.addAsResource( validationXml(), "META-INF/validation.xml" )
.addAsResource( mappingXml(), "META-INF/my-mapping.xml" )
.addAsLibrary( Maven.resolver().resolve( "xerces:xercesImpl:2.9.1" ).withoutTransitivity().asSingleFile() )
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" );
}
private static Asset validationXml() {
String validationXml = Descriptors.create( ValidationConfigurationDescriptor.class )
.version( "1.1" )
.constraintMapping( "META-INF/my-mapping.xml" )
.exportAsString();
return new StringAsset( validationXml );
}
private static Asset mappingXml() {
String mappingXml = Descriptors.create( ValidationMappingDescriptor.class )
.version( "1.1" )
.createBean()
.clazz( Camera.class.getName() )
.createField()
.name( "brand" )
.createConstraint()
.annotation( "jakarta.validation.constraints.NotNull" )
.up()
.up()
.up()
.exportAsString();
return new StringAsset( mappingXml );
}
@Test
@RunAsClient
public void deploy1() throws Exception {
deployer.deploy( "jaxpit" );
}
@Test(dependsOnMethods = "deploy1")
public void test1() throws Exception {
doTest();
}
@Test(dependsOnMethods = "test1")
@RunAsClient
public void undeploy1() throws Exception {
deployer.undeploy( "jaxpit" );
}
@Test(dependsOnMethods = "undeploy1")
@RunAsClient
public void deploy2() throws Exception {
deployer.deploy( "jaxpit" );
}
@Test(dependsOnMethods = "deploy2")
public void test2() throws Exception {
doTest();
}
@Test(dependsOnMethods = "test2")
@RunAsClient
public void undeploy2() throws Exception {
deployer.undeploy( "jaxpit" );
}
private void doTest() {
Set<ConstraintViolation<Camera>> violations = validator.validate( new Camera() );
assertThat( violations ).hasSize( 1 );
assertThat( violations.iterator()
.next()
.getConstraintDescriptor()
.getAnnotation()
.annotationType()
).isSameAs( NotNull.class );
}
}
|
[
"[email protected]"
] | |
df163e05ff36660d8861630f980a66552f38da8a
|
d7452b9df968de07286903ea5f541f9ff680eeb0
|
/cosmetic-core/src/main/java/com/cyberlink/core/service/impl/RedisBasedCacheService.java
|
30bac0ffe3c0ed740118a8f576b4ba58ba49c5c9
|
[
"Apache-2.0"
] |
permissive
|
datree-demo/bcserver_demo
|
21075c94726932d325b291fb0c26b82cacc26b5b
|
852a8d4780d3724236e1d5069cccf2dbe7a4dce9
|
refs/heads/master
| 2020-04-07T08:28:28.382766 | 2017-03-14T03:16:35 | 2017-03-14T03:16:35 | 158,215,647 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,014 |
java
|
package com.cyberlink.core.service.impl;
import org.springframework.cache.Cache;
import org.springframework.cache.Cache.ValueWrapper;
import org.springframework.data.redis.cache.RedisCacheManager;
import com.cyberlink.core.service.AbstractService;
import com.cyberlink.core.service.CacheService;
public class RedisBasedCacheService<K, V> extends AbstractService implements
CacheService<K, V> {
private final Cache cache;
public RedisBasedCacheService(RedisCacheManager manager, String cacheName) {
this.cache = manager.getCache(cacheName);
}
@SuppressWarnings("unchecked")
@Override
public V get(K k) {
ValueWrapper vw = cache.get(k);
if (vw == null) {
return null;
}
return (V) vw.get();
}
@Override
public void put(K k, V v) {
cache.put(k, v);
}
@Override
public void remove(K k) {
cache.evict(k);
}
@Override
public void removeAll() {
cache.clear();
}
}
|
[
"[email protected]"
] | |
741a4bc432fcfcad80743f15ea2b2a61d02c7ce8
|
b282ba335310f7ee2a4dc86b27be24376b9d73e6
|
/src/java/recipemix/models/GroupFlag.java
|
c899228620329f39c3c919fac1ab406546738b82
|
[] |
no_license
|
dabusharsystems/RecipeMix
|
a98a3a8dd175419558d03a16b441283d258a175b
|
dc718522e227e8ea3bc1fab52f023c5780d70e38
|
refs/heads/master
| 2020-07-13T03:04:36.020338 | 2013-05-23T08:50:47 | 2013-05-23T08:50:47 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,712 |
java
|
/*
* Copyright (C) 2013 Alex Chavez <[email protected]>, Jairo Lopez <[email protected]>,
* Steven Paz <[email protected]>, Gustavo Rosas <[email protected]>
*
* RecipeMix ALL RIGHTS RESERVED
*
* This program is distributed to users in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
package recipemix.models;
import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Jairo Lopez <[email protected]>
*/
@Entity
@Table(name = "GROUP_FLAG")
@IdClass(GroupFlagId.class)
@XmlRootElement
public class GroupFlag implements Serializable {
// ======================================
// = Attributes =
// ======================================
private static final long serialVersionUID = 1L;
@Id
@ManyToOne
@JoinColumn (name = "GROUP_ID")
private Groups flaggedGroup;
@Id
@ManyToOne
@JoinColumn(name = "USER_NAME")
private Users flagger;
@Column(name = "FLAGGING_DATE")
private long flaggingDate;
// ======================================
// = Getters & Setters =
// ======================================
/**
* returns the username of the user who flagged the recipe
* @return string username of flagger
*/
public Users getFlagger() {
return flagger;
}
/**
* sets flagger to the username of the user who flagge the recipe
* @param flagger string value of username of the user who flagged the recipe
*/
public void setFlagger(Users flagger) {
this.flagger = flagger;
}
/**
* returns the date when the flag was done
* @return date glaggingDate as a long integer
*/
/**
* sets the flagging date to flaggingDate
* @param flaggingDate date when the flagging took place as a long integer
*/
public long getFlaggingDate() {
return flaggingDate;
}
/**
* sets the flagging date to flaggingDate
* @param flaggingDate date when the flagging took place as a long integer
*/
public void setFlaggingDate(long flaggingDate) {
this.flaggingDate = flaggingDate;
}
/**
* returns the group that is flagged
* @return Groups flaggedGroup
*/
public Groups getFlaggedGroup() {
return flaggedGroup;
}
/**
* sets the flagged
* @param flaggedGroup
*/
public void setFlaggedGroup(Groups flaggedGroup) {
this.flaggedGroup = flaggedGroup;
}
}
|
[
"[email protected]"
] | |
4e2635f718228656e5212c7cddd0ed065ecc2d2b
|
ffa68d024f31a1a635e92ec21d7c6f8ff63e46e5
|
/asakusafw-spi/src/main/java/jp/hishidama/asakusafw_spi/dmdl/template/driver/beans/TemplatePropertyBean.java
|
aeb1a2a7174537b2b22e2f5f830d928d4415eb3a
|
[] |
no_license
|
hishidama/asakusafw-spi
|
966e4c6d8739b0223c7d8484a58a1e48506d6eb8
|
8681b34915774103261825a8726b8ff6eab4d28a
|
refs/heads/master
| 2021-01-24T16:10:22.882159 | 2018-12-03T10:47:28 | 2018-12-03T10:47:28 | 39,774,096 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,866 |
java
|
package jp.hishidama.asakusafw_spi.dmdl.template.driver.beans;
import jp.hishidama.asakusafw_spi.dmdl.template.driver.TemplateFieldTrait;
import jp.hishidama.asakusafw_spi.dmdl.template.driver.TemplateFieldTraits;
import com.asakusafw.dmdl.model.AstDescription;
import com.asakusafw.dmdl.semantics.PropertyDeclaration;
public class TemplatePropertyBean extends AbstractTemplateBean {
protected final PropertyDeclaration declaration;
public TemplatePropertyBean(TemplateRootBean root, PropertyDeclaration declaration) {
super(root);
this.declaration = declaration;
}
public String getName() {
return declaration.getName().identifier;
}
public String getCamelName() {
return TemplateBeanUtil.toCamelCase(getName());
}
public String getDescription() {
AstDescription d = declaration.getDescription();
if (d == null) {
return null;
}
return d.getText();
}
private TemplateTypeBean typeBean;
public TemplateTypeBean getType() {
if (typeBean == null) {
typeBean = factory().createTypeBean(rootBean, declaration.getType());
}
return typeBean;
}
public String getJavaType() {
return getType().getJavaClass().getSimpleName();
}
public String getJavaTypeAs() {
String type = getType().getName();
if ("TEXT".equals(type)) {
return "String";
} else {
return getJavaType();
}
}
public String getOptionType() {
return getType().getOptionClass().getSimpleName();
}
public String getGetter() {
return "get" + getCamelName();
}
public String getSetter() {
return "set" + getCamelName();
}
public String getGetterAs() {
String type = getType().getName();
if ("TEXT".equals(type)) {
return getGetterAsString();
} else {
return getGetter();
}
}
public String getSetterAs() {
String type = getType().getName();
if ("TEXT".equals(type)) {
return getSetterAsString();
} else {
return getSetter();
}
}
public String getGetterOption() {
return "get" + getCamelName() + "Option";
}
public String getSetterOption() {
return "set" + getCamelName() + "Option";
}
public String getGetterAsString() {
return "get" + getCamelName() + "AsString";
}
public String getSetterAsString() {
return "set" + getCamelName() + "AsString";
}
public String getRole() {
TemplateFieldTraits traits = declaration.getTrait(TemplateFieldTraits.class);
if (traits == null) {
return null;
}
String modelId = modelTrait().getConfiguration().getId();
for (TemplateFieldTrait trait : traits) {
String id = trait.getConfiguration().getId();
if (modelId == null || id == null || modelId.equals(id)) {
return trait.getConfiguration().getRole();
}
}
return null;
}
@Override
public String toString() {
return getName();
}
}
|
[
"[email protected]"
] | |
7cd17b792ccf0d66a06faff6b28bf606f70ec52e
|
8923540295f71edf845866c87d0b5b433d96e54e
|
/NewProject/src/module-info.java
|
d5b162079f23a33b0e0e30de28019681d6766bb3
|
[] |
no_license
|
khandaker71/khandaker
|
242a4767fc8b5b3f48123e17a1aa90e1b78efac3
|
b228b9296377e7b1fd6c74a42462b190e3e12de3
|
refs/heads/master
| 2021-08-18T04:32:35.651006 | 2020-05-01T07:39:23 | 2020-05-01T07:39:23 | 174,513,096 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 61 |
java
|
/**
*
*/
/**
* @author humay
*
*/
module newProject {
}
|
[
"[email protected]"
] | |
b90c53fac258634d2307b3c3115dc4c932e046f9
|
e87fb11a840388dcb9629ab93df7ea12a3bbbca8
|
/Tema06/ejercicio13.java
|
d966541a7374f94f04801da8a9b551a7030300b4
|
[] |
no_license
|
IvanVillena/ejercicios
|
7a73517c0aa1556f4bbbeb1d165a4e0b2cb3257f
|
ec32e37db5e359d6e709fe0d817d5a8b41c4d6f4
|
refs/heads/master
| 2020-07-31T23:25:42.477188 | 2019-11-14T09:31:21 | 2019-11-14T09:31:21 | 210,785,688 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 320 |
java
|
public class ejercicio13 {
public static void main(String[] args) {
int dado1;
int dado2;
do {
dado1 = (int)(Math.random()*6)+1;
dado2 = (int)(Math.random()*6)+1;
System.out.println(" Dado 1 : " + dado1 + " | Dado 2 : " + dado2 );
} while ( dado1 != dado2 );
}
}
|
[
"[email protected]"
] | |
63ee3e13b1ffe5e59c97a6f52650ac4d90f17e60
|
f390c75a61ee099ef6b11167fbfa08fc35e18990
|
/spotify/src/main/java/com/bootcamp/spotify/service/ITrackService.java
|
ac039551855cddfc7cf66cdb49ca65983cf50cb4
|
[] |
no_license
|
felipearias2024/spotify-service
|
2d15a003fd5c28d49b6da59a8759c8b31f9d5f92
|
1ed2d77045a75bb4a62b37cd28b792f9eb728854
|
refs/heads/main
| 2023-09-05T12:40:16.663189 | 2021-11-11T19:27:52 | 2021-11-11T19:27:52 | 424,594,817 | 0 | 0 | null | 2021-11-12T04:39:34 | 2021-11-04T12:53:16 |
Java
|
UTF-8
|
Java
| false | false | 511 |
java
|
package com.bootcamp.spotify.service;
import com.bootcamp.spotify.controller.request.AlbumRequest;
import com.bootcamp.spotify.controller.request.TrackRequest;
import com.bootcamp.spotify.domain.model.Album;
import com.bootcamp.spotify.domain.model.Track;
import java.util.List;
public interface ITrackService {
Track getTrack(Long id);
List<Track> getTracks();
Track createTrack(TrackRequest request);
Track editTrack(TrackRequest request, Long id);
Track deleteTrack(Long id);
}
|
[
"[email protected]"
] | |
952a42bf3933d3bf040da4a3cd43f94e7c3f3980
|
082e26b011e30dc62a62fae95f375e4f87d9e99c
|
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/voiceprint/ui/VoiceCreateUI.java
|
2ca80bfab428e72bdf19bb96fdcc87a4ba712f9f
|
[] |
no_license
|
xsren/AndroidReverseNotes
|
9631a5aabc031006e795a112b7ac756a8edd4385
|
9202c276fe9f04a978e4e08b08e42645d97ca94b
|
refs/heads/master
| 2021-04-07T22:50:51.072197 | 2019-07-16T02:24:43 | 2019-07-16T02:24:43 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 12,743 |
java
|
package com.tencent.mm.plugin.voiceprint.ui;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.TranslateAnimation;
import android.widget.Button;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.R;
import com.tencent.mm.ai.m;
import com.tencent.mm.g.a.ud;
import com.tencent.mm.model.aw;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.plugin.voiceprint.model.d;
import com.tencent.mm.plugin.voiceprint.model.f;
import com.tencent.mm.plugin.voiceprint.model.l;
import com.tencent.mm.plugin.voiceprint.model.l.a;
import com.tencent.mm.plugin.voiceprint.model.o;
import com.tencent.mm.sdk.b.b;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
public class VoiceCreateUI extends BaseVoicePrintUI implements a {
private View kIe = null;
private int sLr = 1;
private l sMe;
private o sMf = null;
private View sMg;
private NoiseDetectMaskView sMh;
private Button sMi = null;
private int sMj = 0;
private c sMk = new c<ud>() {
{
AppMethodBeat.i(26159);
this.xxI = ud.class.getName().hashCode();
AppMethodBeat.o(26159);
}
public final /* synthetic */ boolean a(b bVar) {
AppMethodBeat.i(26160);
ab.d("MicroMsg.VoiceCreateUI", "detect finish, noise:%b", Boolean.valueOf(((ud) bVar).cQm.cQn));
if (((ud) bVar).cQm.cQn) {
VoiceCreateUI.a(VoiceCreateUI.this);
} else {
VoiceCreateUI.b(VoiceCreateUI.this);
}
AppMethodBeat.o(26160);
return false;
}
};
public void onWindowFocusChanged(boolean z) {
super.onWindowFocusChanged(z);
AppMethodBeat.at(this, z);
}
public VoiceCreateUI() {
AppMethodBeat.i(26168);
AppMethodBeat.o(26168);
}
static /* synthetic */ void d(VoiceCreateUI voiceCreateUI) {
AppMethodBeat.i(26182);
voiceCreateUI.start();
AppMethodBeat.o(26182);
}
static /* synthetic */ void e(VoiceCreateUI voiceCreateUI) {
AppMethodBeat.i(26183);
voiceCreateUI.cIb();
AppMethodBeat.o(26183);
}
/* Access modifiers changed, original: protected|final */
public final void cHU() {
AppMethodBeat.i(26169);
ab.d("MicroMsg.VoiceCreateUI", "sendVoice, filename:%s", this.sLO);
if (!bo.isNullOrNil(this.sLO)) {
this.sLJ.setEnabled(false);
this.sLM.bQs();
l lVar;
m fVar;
if (this.sLr == 1) {
lVar = this.sMe;
fVar = new f(this.sLO, 71, lVar.sLt, 0);
fVar.sLb = true;
aw.Rg().a(fVar, 0);
lVar.sLr = 71;
AppMethodBeat.o(26169);
return;
} else if (this.sLr == 2) {
lVar = this.sMe;
fVar = new f(this.sLO, 72, lVar.sLt, lVar.sLf);
fVar.sLb = true;
aw.Rg().a(fVar, 0);
lVar.sLr = 72;
}
}
AppMethodBeat.o(26169);
}
/* Access modifiers changed, original: protected|final */
public final void bKm() {
AppMethodBeat.i(26170);
this.sMe = new l(this);
findViewById(R.id.bma).setVisibility(8);
this.sLM.setTitleText((int) R.string.f2u);
this.sLM.cIf();
this.sLJ.setEnabled(false);
this.sMf = new o();
this.sMg = findViewById(R.id.f22);
this.sMh = (NoiseDetectMaskView) findViewById(R.id.e7u);
this.kIe = findViewById(R.id.bn8);
this.sMi = (Button) findViewById(R.id.bma);
this.sMi.setVisibility(8);
this.sMi.setOnClickListener(new OnClickListener() {
public final void onClick(View view) {
AppMethodBeat.i(26162);
VoiceCreateUI.this.cHS();
a.a(VoiceCreateUI.this.sLM, new a.a() {
public final void cHV() {
AppMethodBeat.i(26161);
VoiceCreateUI.this.sMi.setVisibility(8);
VoiceCreateUI.this.sLM.setTitleText((int) R.string.f2u);
VoiceCreateUI.this.sLM.poi.setVisibility(0);
VoiceCreateUI.this.sLJ.setEnabled(true);
VoiceCreateUI.this.sLJ.setVisibility(0);
AppMethodBeat.o(26161);
}
public final void cHW() {
}
});
AppMethodBeat.o(26162);
}
});
this.sMh.setOnClickRetryCallback(new NoiseDetectMaskView.b() {
public final void cHY() {
AppMethodBeat.i(26163);
h.pYm.e(11390, Integer.valueOf(5));
VoiceCreateUI.d(VoiceCreateUI.this);
AppMethodBeat.o(26163);
}
});
this.sMh.setOnCancelDetectCallback(new NoiseDetectMaskView.a() {
public final void cHX() {
AppMethodBeat.i(26164);
VoiceCreateUI.e(VoiceCreateUI.this);
o f = VoiceCreateUI.this.sMf;
ab.d("MicroMsg.VoicePrintNoiseDetector", "stopDetect");
f.sLw.EB();
f.sLx.stopTimer();
VoiceCreateUI.this.finish();
AppMethodBeat.o(26164);
}
});
com.tencent.mm.sdk.b.a.xxA.c(this.sMk);
this.kIe.setOnClickListener(new OnClickListener() {
public final void onClick(View view) {
AppMethodBeat.i(26165);
VoiceCreateUI.e(VoiceCreateUI.this);
VoiceCreateUI.this.finish();
AppMethodBeat.o(26165);
}
});
start();
AppMethodBeat.o(26170);
}
private void start() {
AppMethodBeat.i(26171);
ab.d("MicroMsg.VoiceCreateUI", "start create");
this.sMf.reset();
this.sMh.reset();
cIa();
AppMethodBeat.o(26171);
}
private void cIa() {
AppMethodBeat.i(26172);
ab.d("MicroMsg.VoiceCreateUI", "start noise detect");
this.kIe.setVisibility(4);
this.sMg.setVisibility(4);
this.sLK.setVisibility(4);
this.sMh.setVisibility(0);
this.sMf.cHP();
AppMethodBeat.o(26172);
}
public final void abS(String str) {
AppMethodBeat.i(26173);
ab.d("MicroMsg.VoiceCreateUI", "onGetFirstText");
cHR();
this.sLs = str;
this.sLM.bQt();
this.sLM.cIe();
this.sLM.setTipText(str);
this.sLJ.setEnabled(true);
AppMethodBeat.o(26173);
}
public final void abT(String str) {
AppMethodBeat.i(26174);
ab.d("MicroMsg.VoiceCreateUI", "onGetSecondText");
this.sLs = str;
this.sLM.bQt();
this.sLM.cIe();
this.sLM.setTipText(str);
this.sLJ.setEnabled(true);
AppMethodBeat.o(26174);
}
public final void E(boolean z, int i) {
AppMethodBeat.i(26175);
ab.d("MicroMsg.VoiceCreateUI", "onCreate, result:%b, step:%d", Boolean.valueOf(z), Integer.valueOf(i));
if (z) {
switch (i) {
case 71:
ab.d("MicroMsg.VoiceCreateUI", "finish create step 1");
this.sLJ.setEnabled(false);
this.sLr = 2;
cHS();
a.a(this.sLM, new a.a() {
public final void cHV() {
AppMethodBeat.i(26167);
VoiceCreateUI.this.sLM.reset();
VoiceCreateUI.this.sLM.cIe();
VoiceCreateUI.this.sLM.cIf();
VoiceCreateUI.this.sLJ.setVisibility(4);
VoiceCreateUI.this.sLM.setTitleText((int) R.string.f2r);
VoiceCreateUI.this.sMi.setVisibility(0);
VoiceCreateUI.this.sLM.bQt();
AppMethodBeat.o(26167);
}
public final void cHW() {
}
});
AppMethodBeat.o(26175);
return;
case com.tencent.mm.plugin.appbrand.jsapi.contact.c.CTRL_INDEX /*72*/:
this.sMj = 0;
ab.d("MicroMsg.VoiceCreateUI", "finish create step 2");
Intent intent = new Intent();
intent.putExtra("KIsCreateSuccess", true);
setResult(-1, intent);
intent = new Intent();
intent.setClass(this, VoicePrintFinishUI.class);
intent.putExtra("kscene_type", 72);
startActivity(intent);
finish();
break;
}
AppMethodBeat.o(26175);
return;
}
switch (i) {
case 71:
AppMethodBeat.o(26175);
return;
case com.tencent.mm.plugin.appbrand.jsapi.contact.c.CTRL_INDEX /*72*/:
cIb();
this.sMj++;
if (this.sMj < 2) {
this.sLJ.setEnabled(true);
this.sLM.bQt();
this.sLM.setErr((int) R.string.f2w);
this.sLM.cIg();
break;
}
ab.d("MicroMsg.VoiceCreateUI", "in second step, verify two times failed");
this.sMj = 0;
startActivity(new Intent(this, VoiceReCreatePromptUI.class));
overridePendingTransition(R.anim.df, R.anim.dc);
finish();
AppMethodBeat.o(26175);
return;
}
AppMethodBeat.o(26175);
}
public final void cHM() {
AppMethodBeat.i(26176);
cHT();
cIb();
AppMethodBeat.o(26176);
}
private void cIb() {
AppMethodBeat.i(26177);
Intent intent = new Intent();
intent.putExtra("KIsCreateSuccess", false);
setResult(-1, intent);
AppMethodBeat.o(26177);
}
public void onDestroy() {
AppMethodBeat.i(26178);
super.onDestroy();
com.tencent.mm.ai.f fVar = this.sMe;
aw.Rg().b(611, fVar);
aw.Rg().b(612, fVar);
fVar.sLu = null;
com.tencent.mm.sdk.b.a.xxA.d(this.sMk);
AppMethodBeat.o(26178);
}
public void onBackPressed() {
AppMethodBeat.i(26179);
super.onBackPressed();
cIb();
AppMethodBeat.o(26179);
}
static /* synthetic */ void a(VoiceCreateUI voiceCreateUI) {
AppMethodBeat.i(26180);
h.pYm.e(11390, Integer.valueOf(4));
NoiseDetectMaskView noiseDetectMaskView = voiceCreateUI.sMh;
if (noiseDetectMaskView.gHA != null) {
noiseDetectMaskView.gHA.setVisibility(8);
}
noiseDetectMaskView.mMV.setText(R.string.f2t);
noiseDetectMaskView.sLY.setVisibility(0);
AppMethodBeat.o(26180);
}
static /* synthetic */ void b(VoiceCreateUI voiceCreateUI) {
AppMethodBeat.i(26181);
voiceCreateUI.kIe.setVisibility(0);
voiceCreateUI.sMg.setVisibility(0);
voiceCreateUI.sLK.setVisibility(0);
NoiseDetectMaskView noiseDetectMaskView = voiceCreateUI.sMh;
AnonymousClass6 anonymousClass6 = new a.a() {
public final void cHV() {
}
public final void cHW() {
AppMethodBeat.i(26166);
VoiceCreateUI.this.sMh.setVisibility(8);
VoiceCreateUI.h(VoiceCreateUI.this);
AppMethodBeat.o(26166);
}
};
TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 1, -1.0f, 1, 0.0f, 1, 0.0f);
translateAnimation.setDuration(200);
translateAnimation.setFillAfter(true);
translateAnimation.setRepeatCount(0);
translateAnimation.setAnimationListener(new com.tencent.mm.plugin.voiceprint.ui.a.AnonymousClass6(anonymousClass6));
noiseDetectMaskView.startAnimation(translateAnimation);
AppMethodBeat.o(26181);
}
static /* synthetic */ void h(VoiceCreateUI voiceCreateUI) {
AppMethodBeat.i(26184);
voiceCreateUI.sLM.bQs();
voiceCreateUI.sLr = 1;
voiceCreateUI.sMe.sLr = 71;
aw.Rg().a(new d(71, ""), 0);
AppMethodBeat.o(26184);
}
}
|
[
"[email protected]"
] | |
abca021e27df6313d8b2c7218504de2882d7e161
|
1fd42ba538470df5b0f1995e451c9ac7c0f01ee5
|
/src/api/java/mekanism/api/gas/GasTags.java
|
5def816801316ee27e79ffbfe4d471199a6b2906
|
[
"MIT"
] |
permissive
|
owmii/Mekanism
|
3cf248b9def64fb4be4dfd656db5c54a5e25ca3b
|
47c4df4817da613d482b8cb7060f467a93dd652c
|
refs/heads/master
| 2021-02-10T22:59:17.280490 | 2020-02-25T17:10:18 | 2020-02-25T17:10:18 | 244,426,819 | 1 | 0 |
MIT
| 2020-03-02T17:03:25 | 2020-03-02T17:03:24 | null |
UTF-8
|
Java
| false | false | 2,057 |
java
|
package mekanism.api.gas;
import java.util.Collection;
import java.util.Optional;
import javax.annotation.Nonnull;
import net.minecraft.tags.Tag;
import net.minecraft.tags.TagCollection;
import net.minecraft.util.ResourceLocation;
public class GasTags {
private static TagCollection<Gas> collection = new TagCollection<>(location -> Optional.empty(), "", false, "");
private static int generation;
public static void setCollection(TagCollection<Gas> collectionIn) {
collection = collectionIn;
generation++;
}
public static TagCollection<Gas> getCollection() {
return collection;
}
public static int getGeneration() {
return generation;
}
public static class Wrapper extends Tag<Gas> {
private int lastKnownGeneration = -1;
private Tag<Gas> cachedTag;
public Wrapper(ResourceLocation resourceLocation) {
super(resourceLocation);
}
@Override
public boolean contains(@Nonnull Gas gas) {
if (this.lastKnownGeneration != GasTags.generation) {
this.cachedTag = GasTags.collection.getOrCreate(this.getId());
this.lastKnownGeneration = GasTags.generation;
}
return this.cachedTag.contains(gas);
}
@Nonnull
@Override
public Collection<Gas> getAllElements() {
if (this.lastKnownGeneration != GasTags.generation) {
this.cachedTag = GasTags.collection.getOrCreate(this.getId());
this.lastKnownGeneration = GasTags.generation;
}
return this.cachedTag.getAllElements();
}
@Nonnull
@Override
public Collection<Tag.ITagEntry<Gas>> getEntries() {
if (this.lastKnownGeneration != GasTags.generation) {
this.cachedTag = GasTags.collection.getOrCreate(this.getId());
this.lastKnownGeneration = GasTags.generation;
}
return this.cachedTag.getEntries();
}
}
}
|
[
"[email protected]"
] | |
7194a11f90d08b61d4dab62a95689b2e60257cd6
|
241db9bad68834655cea88697754f7f5652732e0
|
/LTKF/src/com/ferrari/finances/dk/rki/CreditRator.java
|
154781079c3574c8c2cc5e4abab9b23b356279da
|
[] |
no_license
|
Neller300/FF
|
031236d4aaa405ce1a9e03d88fc3aa6286138126
|
58fa9d9c94c84e03201d4fbd55034c171257dabb
|
refs/heads/master
| 2020-03-16T01:05:31.951474 | 2018-05-07T08:52:07 | 2018-05-07T08:52:07 | 132,432,639 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,269 |
java
|
package com.ferrari.finances.dk.rki;
import java.util.Random;
/**
* Information Expert for credit rating.
* This class provides a (Singleton) link to RKI,
* which can be used to access information about individual credit scores.<p/>
*
* For testing purposes, the following invalid (but working) CPR numbers
* can be used to retrieve a specific credit rating:<p/>
*
* A: 0000000000<br/>
* B: 0000000001<br/>
* C: 0000000002<br/>
* D: 0000000003
*
* @see #rate(String)
*/
public class CreditRator {
private static CreditRator instance = null;
private static Random rnd = new Random();
private static Rating[] ratingValues = Rating.values();
/**
* Restricted constructor for Singleton creation.
*/
private CreditRator() {}
/**
* Provides a credit rating for specific individual.
* The assessment may take several seconds to complete.
*
* @param cpr of the individual to rate
* @return A credit rating for the specified individual
* @see Rating
*/
// PRE: cpr.length == 10 && cpr[i] is a digit
public Rating rate( String cpr ) { if (cpr.length() != 10)
throw new NumberFormatException(exceptionMessage(cpr));
try {
randomDelay( 2.0, 5.0 );
int rating = sumOfTheDigits( cpr ) % ratingValues.length;
return ratingValues[ rating ];
}
catch ( Exception e ) {
throw new NumberFormatException(exceptionMessage(cpr));
}
}
private String exceptionMessage(String cpr) {
return "Illegal CPR number format: \"" + cpr + "\"";
}
private int sumOfTheDigits( String number ) {
int sum=0;
for ( int i=0; i<10; i++ )
sum += Integer.parseInt( "" + number.charAt( i ) );
return sum;
}
// min, max in secs
private void randomDelay( double min, double max ) {
try {
double delaySecs = rnd.nextDouble() * ( max - min ) + min;
Thread.sleep( (long) ( delaySecs * 1000 ) );
}
catch ( InterruptedException e ) {
// ignore
}
}
/**
* @return The Singleton instance
*/
public static CreditRator i() {
if ( instance == null )
instance = new CreditRator();
return instance;
}
}
|
[
"[email protected]"
] | |
3c3bb63e3e0675757cd40c983fac3c9d6a3d0218
|
f97af34913376a181d53398878934d7b578ef6d5
|
/src/com/company/TrenerPokemonaCharmanderTest.java
|
37a31c1f17c1e9fa2912e65b7bfcb2ae0fa254a6
|
[] |
no_license
|
dmar625/TestAutomationMockito
|
4d81b9de3c912191be796b0ac2968ce2ab4652d4
|
64735b8dff8d15c109ecfec2a03b36263bba1214
|
refs/heads/master
| 2022-11-10T18:46:50.743049 | 2020-06-23T13:49:39 | 2020-06-23T13:49:39 | 274,417,226 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,123 |
java
|
package com.company;
import org.junit.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
public class TrenerPokemonaCharmanderTest {
@Test
public void sprawdzCzyWykonanoPolecenieAtaku(){
PokemonCharmander pokemon_ognisty = mock(PokemonCharmander.class);
TrenerPokemonaCharmander trener = new TrenerPokemonaCharmander();
trener.wykonajKomendeAtaku(pokemon_ognisty);
verify(pokemon_ognisty).atakuj();
}
@Test
public void sprawdzCzyWykonanoPolecenieUniku(){
PokemonCharmander pokemon_ognisty = mock(PokemonCharmander.class);
TrenerPokemonaCharmander trener = new TrenerPokemonaCharmander();
trener.wykonajKomendeUniku(pokemon_ognisty);
verify(pokemon_ognisty).wykonaj_unik();
}
@Test
public void sprawdzCzyPokemonEwoluowal(){
PokemonCharmander pokemon_ognisty = mock(PokemonCharmander.class);
TrenerPokemonaCharmander trener = new TrenerPokemonaCharmander();
trener.trenujPokemona(pokemon_ognisty);
verify(pokemon_ognisty).czy_ewoluował();
}
}
|
[
"[email protected]"
] | |
0ced9099b094c775dc29837bab6cdc32d7ffe081
|
3b95714f872d70c070d69f32f259e593d8f7527a
|
/src/main/java/com/xzg/controller/TenMinuteTutorial.java
|
b97c724f8028080fda23cd2aeca9df54d36e548c
|
[] |
no_license
|
ztreble/SSM_Redis_Activitiy
|
0ea288a57fa55bd7fabc0a2454f7b83107c5b5af
|
c26591b6c1a120c094cb3a48e93b9fda1a66e221
|
refs/heads/master
| 2021-09-06T14:24:14.266750 | 2018-02-07T13:32:50 | 2018-02-07T13:32:50 | null | 0 | 0 | null | null | null | null |
GB18030
|
Java
| false | false | 2,814 |
java
|
/**
*
*/
package com.xzg.controller;
import java.util.List;
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.task.Task;
/**
* @author hasee
* @TIME 2016年12月19日
* 注意类的隐藏和实例创建
*/
public class TenMinuteTutorial {
public static void main(String[] args) { // 创建 Activiti 流程引擎
ProcessEngine processEngine = ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration()
.buildProcessEngine();
// 取得 Activiti 服务
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
// 部署流程定义
repositoryService.createDeployment()
.addClasspathResource("FinancialReportProcess.bpmn20.xml")
.deploy();
// 启动流程实例
String procId = runtimeService.startProcessInstanceByKey("financialReport").getId();
// 获得第一个任务
TaskService taskService = processEngine.getTaskService();
List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("accountancy").list();
for (Task task : tasks) {
System.out.println("Following task is available for accountancy group: " + task.getName());
// 认领任务
taskService.claim(task.getId(), "fozzie");
}
// 查看 Fozzie 现在是否能够获取到该任务
tasks = taskService.createTaskQuery().taskAssignee("fozzie").list();
for (Task task : tasks) {
System.out.println("Task for fozzie: " + task.getName());
// 完成任务
taskService.complete(task.getId());
}
System.out.println("Number of tasks for fozzie: "
+ taskService.createTaskQuery().taskAssignee("fozzie").count());
// 获取 并 认领 第二个任务
tasks = taskService.createTaskQuery().taskCandidateGroup("management").list();
for (Task task : tasks) {
System.out.println("Following task is available for accountancy group: " + task.getName());
taskService.claim(task.getId(), "kermit");
}
// 完成第二个任务结束结束流程
for (Task task : tasks) {
taskService.complete(task.getId());
}
// 核实流程是否结束
HistoryService historyService = processEngine.getHistoryService();
HistoricProcessInstance historicProcessInstance =
historyService.createHistoricProcessInstanceQuery().processInstanceId(procId).singleResult();
System.out.println("Process instance end time: " + historicProcessInstance.getEndTime());
}
}
|
[
"[email protected]"
] | |
b89b639de5ce24b78236902fec5eb7cb11ef92fe
|
d4768b40184bffa014cb28416185ce19e6b932b6
|
/src/lab2/ex7.java
|
0ee36b434466da6eb3fdb8f27b89ed317713049a
|
[] |
no_license
|
bowbome2537/OOP358411110063
|
be0e0234afca006096ef3b002cb3f28f1fc859b2
|
726df4ca0b917e556ca97f65db117768d7e4262e
|
refs/heads/master
| 2020-04-07T07:52:17.575295 | 2019-03-04T09:28:50 | 2019-03-04T09:28:50 | 158,192,104 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 202 |
java
|
package lab2;
public class ex7 {
public static void main(String[] args) {
int x =1;
do {
System.out.println("Hello."+x);
}while (++x<=10);
}//main
}//class
|
[
"[email protected]"
] | |
351ecf5be72719b47f17ce23be1c35720ed814fc
|
e0db8bc9256925af1540d4b2d2781656891d29f9
|
/shopping-cart/src/test/java/one/digital/innovation/shoppingcart/ShoppingCartApplicationTests.java
|
c559bc3a9d1438fb77feaece60451d1d1f997d4b
|
[] |
no_license
|
roberiomoreira/microsservices
|
9a48c22a955f1bf5412a5b5d88b39a15aeceda85
|
e4d52612bbd486c9572fb7663da213cb46dcf0d8
|
refs/heads/main
| 2023-07-21T16:34:54.910174 | 2021-09-05T22:02:08 | 2021-09-05T22:02:08 | 403,420,932 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 255 |
java
|
package one.digital.innovation.shoppingcart;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ShoppingCartApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"[email protected]"
] | |
66cf76d94d80f9a690330a6cefd97dbedc87bdab
|
493e22e36fab488972a28045382c860acbe92dd1
|
/src/main/java/com/dedavid/locadora/service/UserService.java
|
ef805296d94ba7729ec0ae8f2933f5b3138f4fe7
|
[] |
no_license
|
isagiongo/locadora-api-rest
|
a81159b72727cd9a53786181d75304e33c8193bd
|
0c59a7cfc432d1921bc5d2da1afa3d93e1385336
|
refs/heads/master
| 2020-04-28T01:50:59.691246 | 2019-03-05T23:08:29 | 2019-03-05T23:08:29 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,037 |
java
|
package com.dedavid.locadora.service;
import com.dedavid.locadora.model.User;
import com.dedavid.locadora.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class UserService {
@Autowired
UserRepository userRepository;
public List<User> findAll() {
return userRepository.findAll();
}
public Optional<User> findById(Long id) {
return userRepository.findById(id);
}
public User save(User user) {
return userRepository.save(user);
}
public User update(Long id, User user) {
User novo = this.findById(id).orElseThrow(IllegalArgumentException::new);
novo.builder()
.nome(user.getNome())
.telefone(user.getTelefone())
.build();
return userRepository.save(novo);
}
public void delete(Long id) {
userRepository.deleteById(id);
}
}
|
[
"[email protected]"
] | |
87cf0449a963a6c951e7b4c624d6e2b79d4cd786
|
12b5bf729b199c7cccd2faf0c3e50e0e2d6963ec
|
/src/main/java/com/abnamro/transactionreporting/services/processor/ReportProcessorImpl.java
|
73e1cb293c588f6a5fc7751b88b7204790606c6f
|
[] |
no_license
|
SorabhG/client-transaction-reporting
|
43b07ae77a64c022b9f1faa84fad5644b1424a7a
|
c347352e151edfed811196f2c6f3bb01d9c3b378
|
refs/heads/master
| 2023-01-14T16:19:33.988236 | 2020-11-16T01:28:40 | 2020-11-16T01:28:40 | 312,499,190 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,831 |
java
|
package com.abnamro.transactionreporting.services.processor;
import com.abnamro.transactionreporting.model.dataObjects.ReportModel;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy;
/**
* This class is responsible for formatting the report (grouping and summing fields)
*/
@Slf4j
@Component
public class ReportProcessorImpl implements ReportProcessor {
public Logger getLogger() {
return log;
}
/**
* @param reportFeilds {@link ReportModel}
* @return
*/
@Override
public List<ReportModel> formatReport(final List<ReportModel> reportFeilds) {
getLogger().info("Report Formatting :: Started");
List<ReportModel> formattedReport = reportFeilds.stream().collect(
groupingBy(
ReportModel::getClientInformation,
groupingBy(
ReportModel::getProductInformation,
Collectors.reducing(
BigDecimal.ZERO,
ReportModel::getTransactionAmount,
BigDecimal::add)
)
)
).entrySet()
.stream()
.flatMap(entry1 -> entry1.getValue()
.entrySet()
.stream()
.map(entry2 -> new ReportModel(entry1.getKey(), entry2.getKey(), entry2.getValue())))
.collect(Collectors.toList());
getLogger().info("Report Formatting :: Finished");
return formattedReport;
}
}
|
[
"[email protected]"
] | |
b8b8010086d8b85fd8021e142e97e4a3e5ed89a4
|
ff407cfbd05d4dce057f9c1c0d82d0a7d57c01c1
|
/maxpath_maze.java
|
c15ee617a27f53230143a97cc4f2fb7028ff04bb
|
[] |
no_license
|
beingash22/Technical
|
f21bfcd87621c1061f4cf4ee7bfc31b11191bf64
|
f8f430874d230d9b16f7cb2fd5fb85474c48e9fd
|
refs/heads/master
| 2020-04-07T07:50:26.593694 | 2018-11-19T09:03:07 | 2018-11-19T09:03:07 | 158,190,885 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,038 |
java
|
import java.io.*;
class maze
{
static int arr2[][]= { {0, 0, 0},
{0, 0, 0},
{0, 0, 0}};
static int arr3[][]= { {0, 0, 0},
{0, 0, 0},
{0, 0, 0}};
static int max=0, flag=1;
static void display(int arr[][])
{
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
{
if (arr3[i][j]==1)
System.out.print (arr[i][j]);
else
System.out.print(0);
}
System.out.println ();
}
}
static void copy()
{
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
arr3[i][j]=arr2[i][j];
}
}
static void maxpath(int arr[][],int i,int j,int cost)
{
if(i==2 && j==2)
{
arr2[i][j]=1;
cost+=arr[i][j];
if (max<cost)
{
max=cost;
copy();
}
return ;
}
else if(i>3 && j>3)
{
return ;
}
else
{
if(i<3 && j<3 && )
{
cost+=arr[i][j];
arr2[i][j]=1;
maxpath(arr,i+1,j,cost);
maxpath(arr,i,j+1,cost);
maxpath(arr,i+1,j+1,cost);
arr2[i][j]=0;
/* if(i>=1 && arr2[i-1][j]!=1)
{
path(arr,i-1,j,cost,temp);
}
if(j>=1 && arr2[i][j-1]!=1)
{
path(arr,i,j-1,cost,temp);
}
*/
}
}
}
public static void main (String args[])
{
int a[][]={{2,1,3},
{4,5,6},
{8,1,7}};
maxpath(a, 0, 0, 0);
System.out.println (max);
display(a);
}
}
|
[
"[email protected]"
] | |
91e85047d5bb50bdd98db6c8c08acc75955aa4dc
|
c945e4e2ed5f7a2ed43cef6ec2b13b49757905d0
|
/extras/perst/src/main/java/at/jku/isse/ecco/storage/perst/dao/PerstAbstractGenericDao.java
|
dd542cb3a9060fbc2efda559f18b6c9e269211dc
|
[] |
no_license
|
jku-isse/ecco
|
8c879df0b8621ce268b792529c29db935e780370
|
370c975416bd38d883463093d1bf13ace6946430
|
refs/heads/master
| 2023-09-06T01:08:30.444151 | 2023-09-04T23:13:13 | 2023-09-05T00:19:49 | 49,525,917 | 12 | 17 | null | 2023-09-14T20:44:09 | 2016-01-12T20:08:57 |
Java
|
UTF-8
|
Java
| false | false | 2,600 |
java
|
package at.jku.isse.ecco.storage.perst.dao;
import at.jku.isse.ecco.dao.GenericDao;
import at.jku.isse.ecco.dao.Persistable;
import com.google.inject.Inject;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstract generic perst dao that initializes the database and indexers.
*
* @param <T> type of the key
* @author Hannes Thaller
* @version 1.0
*/
public abstract class PerstAbstractGenericDao<T extends Persistable> implements GenericDao {
protected PerstTransactionStrategy transactionStrategy;
// protected final String connectionString;
// protected Storage database = null;
// protected boolean initialized = false;
/**
* Constructs a new AbstractGenericDao with the given connection string that contains the path to the database file. If no database file exists on the given path than a new
* database will be initialized.
*
* @param transactionStrategy the transaction strategy
*/
@Inject
public PerstAbstractGenericDao(PerstTransactionStrategy transactionStrategy) {
checkNotNull(transactionStrategy);
this.transactionStrategy = transactionStrategy;
}
@Override
public void init() {
// if (!this.initialized) {
// database = StorageFactory.getInstance().createStorage();
//
// database.open(connectionString);
// if (database.getRoot() == null) {
// database.setRoot(createDatabaseRoot());
// }
// database.close();
//
// initialized = true;
// }
}
@Override
public void open() {
//this.openDatabase();
}
@Override
public void close() {
//this.closeDatabase();
}
// /**
// * Creates a new root object for a new initialized database.
// *
// * @return The root of the database.
// */
// private DatabaseRoot createDatabaseRoot() {
//
// final FieldIndex<PerstFeature> featureIndex = database.<PerstFeature>createFieldIndex(PerstFeature.class, "name", true);
// final FieldIndex<PerstAssociation> associationIndex = database.<PerstAssociation>createFieldIndex(PerstAssociation.class, "id", true);
// final FieldIndex<PerstCommit> commitIndex = database.<PerstCommit>createFieldIndex(PerstCommit.class, "id", true);
// final FieldIndex<PerstVariant> variantIndex = database.<PerstVariant>createFieldIndex(PerstVariant.class, "name", true);
//
// return new DatabaseRoot(associationIndex, featureIndex, commitIndex, variantIndex);
// }
//
// protected void closeDatabase() {
// if (this.database.isOpened())
// this.database.close();
// }
//
// protected DatabaseRoot openDatabase() {
// if (!database.isOpened())
// database.open(connectionString);
// return database.getRoot();
// }
}
|
[
"[email protected]"
] | |
fa62c65931b39ec93efde2f65e6f5b798fb56b3c
|
0dc3cdbd1c7187ac384c5bc95ce7aa70a4df65ca
|
/hellol/src/kimja2/VarEx6.java
|
fdf8c4948b29b92afd29e85c120fc422635ea32b
|
[] |
no_license
|
c789cch/hanbitjse
|
bde2a036fefda5e977b72eaf6922d6f72eb72b18
|
cf601be180b3608a512019e441b92d3171c1cf19
|
refs/heads/master
| 2021-01-19T00:52:12.173339 | 2016-06-09T08:13:39 | 2016-06-09T08:13:39 | 60,753,864 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 496 |
java
|
package kimja2;
import java.util.Scanner;
/**
* @date :2016. 6. 8.
* @author :주현호
* @file :VarEx6.java
* @story :정수탑 int 더하기 예제
*/
public class VarEx6 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x=0,y=0,z=0;
System.out.println("정수x:[ ]");
x = scanner.nextInt();
System.out.println("정수y:[ ]");
y = scanner.nextInt();
z = x % y;
System.out.println("x%y:"+z);
}
}
|
[
"USER@hb1030"
] |
USER@hb1030
|
de3e6fc573afc3d5ea666b27095671c903f5210c
|
4f9e8b1e75e5a8ae568530f3641f19c6838c8588
|
/src/main/java/com/wongs/repository/QuantityRepository.java
|
044037aa712a4b7504a6a8514bb9ffcc0f83f30e
|
[] |
no_license
|
chicheong/mall
|
95e7fcf90b7d634b2fed0a0533e5f4e39d9d9475
|
efe835c9706e22813f669e82ba57f6422e1069e9
|
refs/heads/master
| 2023-05-01T21:23:10.187641 | 2020-12-09T10:21:09 | 2020-12-09T10:21:09 | 92,903,879 | 0 | 0 | null | 2023-04-18T13:37:51 | 2017-05-31T04:21:52 |
Java
|
UTF-8
|
Java
| false | false | 345 |
java
|
package com.wongs.repository;
import com.wongs.domain.Quantity;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the Quantity entity.
*/
@SuppressWarnings("unused")
@Repository
public interface QuantityRepository extends JpaRepository<Quantity, Long> {
}
|
[
"[email protected]"
] | |
5fdb05f22db83eb011629fcd9ba0539a1464f4ff
|
47befa5e0bba4cf030a7b475b81fe944111f8acf
|
/ChipsLayoutManager/src/main/java/com/beloo/widget/chipslayoutmanager/util/LayoutManagerUtil.java
|
72656cef32217f6447773cf63317b16cbd7e1a60
|
[
"Apache-2.0"
] |
permissive
|
AlexKorRnd/ChipsLayoutManager
|
0908e29c0c9477730d0f3bce1b42ff8d671152b5
|
5869cda1bce9341147e1e98423d60efa954c82db
|
refs/heads/master
| 2020-03-18T01:53:43.406683 | 2018-06-01T04:18:27 | 2018-06-01T04:18:27 | 134,164,786 | 1 | 1 |
Apache-2.0
| 2018-05-20T15:56:04 | 2018-05-20T15:56:04 | null |
UTF-8
|
Java
| false | false | 533 |
java
|
package com.beloo.widget.chipslayoutmanager.util;
import android.support.v7.widget.RecyclerView;
public class LayoutManagerUtil {
/**
* perform changing layout with playing RecyclerView animations
*/
public static void requestLayoutWithAnimations(final RecyclerView.LayoutManager lm) {
lm.postOnAnimation(new Runnable() {
@Override
public void run() {
lm.requestLayout();
lm.requestSimpleAnimationsInNextLayout();
}
});
}
}
|
[
"[email protected]"
] | |
d688f0a0f662c8b840a7f0081f5d3197fb01049a
|
dc532b390a5b77aefa0b892e01b9396296f59c66
|
/src/main/java/com/example/demo/repository/FlightInfoUpdateRepository.java
|
8dd1cfa941fa38e82ca6996bd9b64cc349a1082b
|
[] |
no_license
|
connorMurray/aodb
|
a736bf6ba7dc209d2406f021d43a0e05dd720b61
|
a9c99409cea15a86a5f03ec61adf3ec826ac6919
|
refs/heads/master
| 2021-01-01T05:55:51.200561 | 2017-07-19T21:04:19 | 2017-07-19T21:04:19 | 97,310,097 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 397 |
java
|
package com.example.demo.repository;
import com.example.demo.domain.FlightInfoUpdate;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Repository
public interface FlightInfoUpdateRepository extends CrudRepository<FlightInfoUpdate, Long> {
}
|
[
"[email protected]"
] | |
8406716f99e102cd09983a2285fd3673bbc21a3a
|
b0aaa170833d76157f74fa1f11734869de47f77c
|
/src/JsonClient/src/main/java/examples/urlshortener/GoogleGetResponse.java
|
90d37c9ef13548933baeb687236bf16d06c816a6
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] |
permissive
|
cityindex-attic/CIAPI.Java
|
2000f961178d1746adf356f44a839bd4effb7715
|
b8b1d968941bf305502d7bdedd2dc0778cd167fd
|
refs/heads/master
| 2021-01-13T12:54:29.548069 | 2014-02-10T16:34:44 | 2014-02-10T16:34:44 | 1,227,050 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 597 |
java
|
package examples.urlshortener;
/**
*
* @author Justin Nelson
*
*/
public class GoogleGetResponse {
private String kind;
private String id;
private String longUrl;
private String status;
public GoogleGetResponse() {
}
public GoogleGetResponse(String kind, String id, String longUrl, String status) {
this.kind = kind;
this.id = id;
this.longUrl = longUrl;
this.status = status;
}
public String getKind() {
return kind;
}
public String getId() {
return id;
}
public String getLongUrl() {
return longUrl;
}
public String getStatus() {
return status;
}
}
|
[
"justin@justin-MS-7376.(none)"
] |
justin@justin-MS-7376.(none)
|
069e8824ca7aa3a69369b68461a9610d95d1e722
|
25f541b5a426d1c4626cd443602cee92f858b73e
|
/app/src/main/java/au/edu/uts/redylog/redylog/Models/History.java
|
e31f402e9d54e105087121612940cf4a1584a138
|
[] |
no_license
|
joe0807/Group14App
|
c6b085d75cefb72a9d89bdc9f304e32f601bbb50
|
8a4b352689c0d3eff9ecbf0b3ad14910cf2cffd1
|
refs/heads/master
| 2021-06-25T05:58:57.121655 | 2017-09-13T10:26:16 | 2017-09-13T10:26:16 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,546 |
java
|
package au.edu.uts.redylog.redylog.Models;
import java.util.Date;
/**
* Created by Hayden on 23-Aug-17.
*/
public class History {
long _historyId;
long _entryId;
String _title;
String _content;
Date _changedDate;
public History(long _historyId, long _entryId, String _title, String _content, Date _changedDate) {
this._historyId = _historyId;
this._entryId = _entryId;
this._title = _title;
this._content = _content;
this._changedDate = _changedDate;
}
public History(long _entryId, String _title, String _content, Date _changedDate) {
this._entryId = _entryId;
this._title = _title;
this._content = _content;
this._changedDate = _changedDate;
}
public long get_historyId() {
return _historyId;
}
public void set_historyId(long _historyId) {
this._historyId = _historyId;
}
public long get_entryId() {
return _entryId;
}
public void set_entryId(long _entryId) {
this._entryId = _entryId;
}
public String get_title() {
return _title;
}
public void set_title(String _title) {
this._title = _title;
}
public String get_content() {
return _content;
}
public void set_content(String _content) {
this._content = _content;
}
public Date get_changedDate() {
return _changedDate;
}
public void set_changedDate(Date _changedDate) {
this._changedDate = _changedDate;
}
}
|
[
"[email protected]"
] | |
ac2d18b4dc50ffeba39b369739f92c54f75d3674
|
2fd9d77d529e9b90fd077d0aa5ed2889525129e3
|
/DecompiledViberSrc/app/src/main/java/com/yandex/mobile/ads/impl/gi.java
|
b6d71069f90377165f5bcae5e033da490317dfc4
|
[] |
no_license
|
cga2351/code
|
703f5d49dc3be45eafc4521e931f8d9d270e8a92
|
4e35fb567d359c252c2feca1e21b3a2a386f2bdb
|
refs/heads/master
| 2021-07-08T15:11:06.299852 | 2021-05-06T13:22:21 | 2021-05-06T13:22:21 | 60,314,071 | 1 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 446 |
java
|
package com.yandex.mobile.ads.impl;
public abstract interface gi
{
public abstract ge a(ds paramds, dn paramdn, gp paramgp, dr paramdr);
public abstract gf a(ds paramds, dn paramdn);
public abstract gf a(ds paramds, dn paramdn, dk paramdk);
}
/* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_4_dex2jar.jar
* Qualified Name: com.yandex.mobile.ads.impl.gi
* JD-Core Version: 0.6.2
*/
|
[
"[email protected]"
] | |
c51fb9e72a5cdc2953d759e72c5a8365c30039a2
|
6dee1a3a66548fbd47858296eea66b7616cb3614
|
/src/EpislonExecuter/src/epsilonExecuter/executers/eol/EolExecuter.java
|
0f3ed4727d9f21c70b7961dfd8a66d4215a848d8
|
[
"MIT"
] |
permissive
|
KuehneThomas/model-to-model-transformation-generator
|
f21723671f6b3f0300ffc7c3bfc7c9a88a90b968
|
086e82c169767a651aa5b28f8bd68ceffacd49fd
|
refs/heads/master
| 2021-01-10T16:48:30.434324 | 2016-04-24T13:33:18 | 2016-04-24T13:33:18 | 55,289,835 | 1 | 0 | null | 2016-04-24T13:29:47 | 2016-04-02T10:47:49 | null |
UTF-8
|
Java
| false | false | 1,405 |
java
|
package epsilonExecuter.executers.eol;
/*******************************************************************************
* Copyright (c) 2008 The University of York.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dimitrios Kolovos - initial API and implementation
******************************************************************************/
import java.util.ArrayList;
import javax.inject.Inject;
import org.eclipse.epsilon.eol.EolModule;
import org.eclipse.epsilon.eol.models.IModel;
import com.google.inject.assistedinject.Assisted;
import common.util.interfaces.ILogger;
import common.util.interfaces.IPrettyPrinter;
import common.util.interfaces.IStringResource;
import epsilonExecuter.executers.base.EpsilonExecuter;
import epsilonExecuter.executers.eol.interfaces.IEolExecuter;
public class EolExecuter extends EpsilonExecuter implements IEolExecuter {
@SuppressWarnings("serial")
@Inject
public EolExecuter(ILogger logger, IPrettyPrinter prettyPrinter, @Assisted IStringResource source, @Assisted final IModel model) throws Exception {
super(logger, prettyPrinter, new EolModule(), source, new ArrayList<IModel>() {
{
add(model);
}
});
}
}
|
[
"[email protected]"
] | |
21bbb0f273b601f1c359ace9728547ad48e70990
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XRENDERING-418-15-27-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener_ESTest.java
|
2065cec5cf619095c5b602deee79a4d2f683d8df
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 612 |
java
|
/*
* This file was automatically generated by EvoSuite
* Sat Apr 04 04:20:23 UTC 2020
*/
package org.xwiki.rendering.internal.parser.xhtml.wikimodel;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XHTMLXWikiGeneratorListener_ESTest extends XHTMLXWikiGeneratorListener_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"[email protected]"
] | |
dfbc6dbbaf38fa21cde12270ca5f5bfc3ecc7fc5
|
3205557ce2608fad804f49594378018c60b6db9b
|
/Clase5 Parte1/src/Clase5/Clase5Test.java
|
de8ad86a581b01cf2704e98c468477c3e7dcb6df
|
[] |
no_license
|
josemaoj/JavaNivelICedesistemas
|
9d48236cfe0b2f9ad9732228787f8b1beb5e20f4
|
e3539260d43d5b2e38377a19e87af00110fe19ba
|
refs/heads/main
| 2023-01-22T05:20:08.553636 | 2020-12-02T22:04:04 | 2020-12-02T22:04:04 | 308,372,036 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 548 |
java
|
package Clase5;
public class Clase5Test {
public static void main(String[] args) {
System.out.println("Operación Suma");
Suma suma1=new Suma();
suma1.cargar1();
suma1.cargar2();
suma1.operar();
System.out.print("El resultado de la suma es:");
suma1.mostrarResultado();
System.out.println("Operación Resta");
Resta resta1=new Resta();
resta1.cargar1();
resta1.cargar2();
resta1.operar();
System.out.print("El resultado de la resta es:");
resta1.mostrarResultado();
}
}
|
[
"[email protected]"
] | |
7352bbc8aa391b79ee2de2621fc8e791e78683b2
|
d214afa3334f1d3c588c514f2fc748cc30f5ff6a
|
/app/src/main/java/ca/uhn/fhir/android/ListCitizensActivity.java
|
af6103e56dcec5a31b58bcb48f808f801da3b39b
|
[
"Apache-2.0"
] |
permissive
|
jpventura/hapi-fhir-android-integration-test
|
8a403f6d34a25aaa898b263fe29be65647283ba3
|
b550f627df65fed4ad071268a471cd20955cd76a
|
refs/heads/master
| 2022-07-29T13:27:41.949666 | 2017-10-28T21:38:06 | 2017-10-28T21:38:06 | 266,544,225 | 0 | 0 |
Apache-2.0
| 2020-05-24T13:15:01 | 2020-05-24T13:15:00 | null |
UTF-8
|
Java
| false | false | 2,177 |
java
|
package ca.uhn.fhir.android;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
import java.util.List;
import ca.uhn.fhir.android.test.PatientFhirHelper;
import ca.uhn.fhir.android.test.R;
import ca.uhn.fhir.model.dstu2.resource.Patient;
public class ListCitizensActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_citizens);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final TextView tv = (TextView) findViewById(R.id.textview);
tv.setTextSize(20);
tv.setText("Fetching data...");
AsyncTask<Void, Object, List<Patient>> as = new AsyncTask<Void, Object, List<Patient>>() {
@Override
protected List<Patient> doInBackground(Void... voids) {
PatientFhirHelper gcm = new PatientFhirHelper();
return gcm.getPatients();
}
@Override
protected void onPostExecute(List<Patient> patients) {
StringBuilder b = new StringBuilder("Found the following patients...").append('\n');
for (Patient patient : patients) {
b.append(patient.getText().getDiv().getValueAsString()).append('\n');
}
tv.setText(Html.fromHtml("<html>"+b.toString()+"</html>"));
}
};
as.execute();
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
}
|
[
"[email protected]"
] | |
5cbdfe8ee4f5b2e0ef2598db15111149f8bba7b6
|
a34eaec6909395c21681cf99de317ed62866d3e3
|
/src/main/java/com/cimctht/thtzxt/system/Impl/UserServiceImpl.java
|
78596db680dee1b2f14b2fa1e15ef8cdaa501d60
|
[] |
no_license
|
WalterZhai/tht-zxt
|
ee253da02471e2bff7b4a81a9a4e6737100cd785
|
6c911381ced51acda9651c0dc0369265d5e436d3
|
refs/heads/master
| 2023-06-29T09:48:06.243326 | 2021-07-26T01:02:38 | 2021-07-26T01:02:38 | 347,883,836 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 570 |
java
|
package com.cimctht.thtzxt.system.Impl;
import com.cimctht.thtzxt.common.entity.TableEntity;
import java.util.Map;
/**
* @author Walter(翟笑天)
* @date 2020/10/10
*/
public interface UserServiceImpl {
TableEntity userTableData(String loginName, String name, Integer page, Integer limit);
TableEntity onlineUserData(Integer page, Integer limit);
void editPassword(String username,String pwd1,String pwd2,String pwd3);
void updateIsLockedById(String id,Integer isLocked);
Map<String,Object> ajaxLoadTransferUserRelRole(String userid);
}
|
[
"[email protected]"
] | |
df4992ea480857df355d391114fed77812affbee
|
47536c8eaa240b266f51391cf74996fb29f30791
|
/src/test/java/br/gov/bomdestino/apigateway/repository/CustomAuditEventRepositoryIT.java
|
293245aeb3980eec3b1b9a638544f3976ceb6b6f
|
[] |
no_license
|
llvaleriano/pos-arquitetura-puc-gateway
|
3cf60beb00054ec5c3077f5773e42957a31cdb34
|
0070dca9711904727e3bfeaa09bca2c92b4c7677
|
refs/heads/master
| 2023-03-31T14:30:33.933200 | 2021-04-11T17:47:05 | 2021-04-11T17:47:05 | 347,975,856 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,620 |
java
|
package br.gov.bomdestino.apigateway.repository;
import br.gov.bomdestino.apigateway.GatewayApp;
import br.gov.bomdestino.apigateway.config.Constants;
import br.gov.bomdestino.apigateway.config.audit.AuditEventConverter;
import br.gov.bomdestino.apigateway.domain.PersistentAuditEvent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpSession;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static br.gov.bomdestino.apigateway.repository.CustomAuditEventRepository.EVENT_DATA_COLUMN_MAX_LENGTH;
/**
* Integration tests for {@link CustomAuditEventRepository}.
*/
@SpringBootTest(classes = GatewayApp.class)
@Transactional
public class CustomAuditEventRepositoryIT {
@Autowired
private PersistenceAuditEventRepository persistenceAuditEventRepository;
@Autowired
private AuditEventConverter auditEventConverter;
private CustomAuditEventRepository customAuditEventRepository;
@BeforeEach
public void setup() {
customAuditEventRepository = new CustomAuditEventRepository(persistenceAuditEventRepository, auditEventConverter);
persistenceAuditEventRepository.deleteAll();
Instant oneHourAgo = Instant.now().minusSeconds(3600);
PersistentAuditEvent testUserEvent = new PersistentAuditEvent();
testUserEvent.setPrincipal("test-user");
testUserEvent.setAuditEventType("test-type");
testUserEvent.setAuditEventDate(oneHourAgo);
Map<String, String> data = new HashMap<>();
data.put("test-key", "test-value");
testUserEvent.setData(data);
PersistentAuditEvent testOldUserEvent = new PersistentAuditEvent();
testOldUserEvent.setPrincipal("test-user");
testOldUserEvent.setAuditEventType("test-type");
testOldUserEvent.setAuditEventDate(oneHourAgo.minusSeconds(10000));
PersistentAuditEvent testOtherUserEvent = new PersistentAuditEvent();
testOtherUserEvent.setPrincipal("other-test-user");
testOtherUserEvent.setAuditEventType("test-type");
testOtherUserEvent.setAuditEventDate(oneHourAgo);
}
@Test
public void addAuditEvent() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("test-value");
assertThat(persistentAuditEvent.getAuditEventDate().truncatedTo(ChronoUnit.MILLIS))
.isEqualTo(event.getTimestamp().truncatedTo(ChronoUnit.MILLIS));
}
@Test
public void addAuditEventTruncateLargeData() {
Map<String, Object> data = new HashMap<>();
StringBuilder largeData = new StringBuilder();
for (int i = 0; i < EVENT_DATA_COLUMN_MAX_LENGTH + 10; i++) {
largeData.append("a");
}
data.put("test-key", largeData);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
String actualData = persistentAuditEvent.getData().get("test-key");
assertThat(actualData.length()).isEqualTo(EVENT_DATA_COLUMN_MAX_LENGTH);
assertThat(actualData).isSubstringOf(largeData);
assertThat(persistentAuditEvent.getAuditEventDate().truncatedTo(ChronoUnit.MILLIS))
.isEqualTo(event.getTimestamp().truncatedTo(ChronoUnit.MILLIS));
}
@Test
public void testAddEventWithWebAuthenticationDetails() {
HttpSession session = new MockHttpSession(null, "test-session-id");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(session);
request.setRemoteAddr("1.2.3.4");
WebAuthenticationDetails details = new WebAuthenticationDetails(request);
Map<String, Object> data = new HashMap<>();
data.put("test-key", details);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("remoteAddress")).isEqualTo("1.2.3.4");
assertThat(persistentAuditEvent.getData().get("sessionId")).isEqualTo("test-session-id");
}
@Test
public void testAddEventWithNullData() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", null);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("null");
}
@Test
public void addAuditEventWithAnonymousUser() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent(Constants.ANONYMOUS_USER, "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
@Test
public void addAuditEventWithAuthorizationFailureType() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "AUTHORIZATION_FAILURE", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
}
|
[
"[email protected]"
] | |
d395dfb19553feaa4fd4e97b9506a56ec3776fc1
|
e43048b47455d928f0107af7978d9413fc425ad9
|
/HelloGithub.java
|
e1d5b4841169ee1ce44cd283a5516d6297d8e57d
|
[] |
no_license
|
Omca19/Web-Design-shtuff
|
8093154a7ee1acc180f1c6b4cf151ec50df93120
|
0641230bab561d69728782c58e8f0f3f4360d87e
|
refs/heads/master
| 2016-09-06T04:47:35.623894 | 2015-03-09T17:41:04 | 2015-03-09T17:41:04 | 30,652,551 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 112 |
java
|
public class HelloGithub{
public static void main(String[] args){
System.out.println("I made it!!!!");
}
}
|
[
"[email protected]"
] | |
eb5d26bf94d25207576e060597b5155c893b229c
|
8d42aafcd100257c7ec77f512341c28dc08793a0
|
/app/src/main/java/com/apps/scit/tabibihon/GCMRegistrationIntentService.java
|
5bc026e7d59c3e11f52b095be9f518d33999c0e1
|
[] |
no_license
|
HASANDEEB/test
|
dfe5c54804ff4c850230f38abcc27c1189b6a576
|
7d0fbd756377d8b790912a832d021f953ef977de
|
refs/heads/master
| 2020-01-23T21:28:42.949659 | 2016-12-01T22:05:30 | 2016-12-01T22:05:30 | 66,114,079 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,873 |
java
|
package com.apps.scit.tabibihon;
import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.apps.scit.tabibihon.MainActivity;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import com.google.android.gms.iid.InstanceID;
/**
* Created by AL_deeb on 07/14/2016.
*/
public class GCMRegistrationIntentService extends IntentService {
public static int profile=-1;
public static String role="";
public static final String REGISTRATION_SUCCESS = "RegistrationSuccess";
public static final String REGISTRATION_ERROR = "RegistrationError";
public static final String TAG = "GCMTOKEN";
public static final String ROLE = "GCMROLE";
public GCMRegistrationIntentService() {
super("");
}
@Override
protected void onHandleIntent(Intent intent) {
registerGCM();
}
private void registerGCM() {
SharedPreferences sharedPreferences = getSharedPreferences("GCM", Context.MODE_PRIVATE);//Define shared reference file name
SharedPreferences.Editor editor = sharedPreferences.edit();
Intent registrationComplete = null;
String token = null;
try {
InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
token = instanceID.getToken("125341980305", GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
//Log.w("GCMRegIntentService", "token:" + token);
//notify to UI that registration complete success
registrationComplete = new Intent(REGISTRATION_SUCCESS);
registrationComplete.putExtra("token", token);
String oldToken = sharedPreferences.getString(TAG, "");//Return "" when error or key not exists
String oldRole = sharedPreferences.getString(ROLE, "");//Return "" when error or key not exists
//Only request to save token when token is new
if(!"".equals(token) && (!oldToken.equals(token)||!role.equals(oldRole))) {
if(profile==0)
MainActivity.updateToken(token);
else
if(profile==1)
my_profile.updateToken(token);
//Save new token to shared reference
editor.putString(TAG, token);
editor.putString(ROLE, role);
editor.commit();
} else {
Log.w("GCMRegistrationService", "Old token");
}
} catch (Exception e) {
Log.w("GCMRegIntentService", "Registration error");
registrationComplete = new Intent(REGISTRATION_ERROR);
}
//Send broadcast
LocalBroadcastManager.getInstance(this).sendBroadcast(registrationComplete);
}
}
|
[
"aldeeb,[email protected]"
] |
aldeeb,[email protected]
|
5186956d40589d208f8ef1e92ad2de8d0b561144
|
4ca50716c813ccf337d6cef20bc9eb4752b5f96c
|
/RestaurantRecommenderSystem/src/edu/neu/sentimentanalysisofuserreviews/SentimentAnalysis.java
|
3d16ee6af8230eb83cf932c3ef3ebb2277c2cfb0
|
[] |
no_license
|
arshpreet/User-to-restaurant-based-on-location-and-taste
|
c2e9b5cb23f17103e32133abca68772d1405c1c3
|
9356ba771ce1091f17d4c7dc9e001d9baf07299f
|
refs/heads/master
| 2020-04-15T05:44:06.079415 | 2019-01-07T13:23:17 | 2019-01-07T13:23:17 | 164,435,377 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,152 |
java
|
package edu.neu.sentimentanalysisofuserreviews;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class SentimentAnalysis {
public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException, URISyntaxException {
Configuration conf = new Configuration();
Job job = Job.getInstance(conf, "Sentiment Analysis of Reviews");
job.addCacheFile(new URI("/input/lexicon/positive-lexicon.txt"));
job.addCacheFile(new URI("/input/lexicon/negative-lexicon.txt"));
job.setMapperClass(SentimentAnalysisMapper.class);
job.setNumReduceTasks(0);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
|
[
"[email protected]"
] | |
62f8672c6e2cd59eed585ed416eb3da677ff4bf2
|
063f3b313356c366f7c12dd73eb988a73130f9c9
|
/erp_ejb/src_inventario/com/bydan/erp/inventario/business/dataaccess/EmpaqueDataAccess.java
|
7bfe9e8e331742e36bdb6c8a24cac7fe9abc3171
|
[
"Apache-2.0"
] |
permissive
|
bydan/pre
|
0c6cdfe987b964e6744ae546360785e44508045f
|
54674f4dcffcac5dbf458cdf57a4c69fde5c55ff
|
refs/heads/master
| 2020-12-25T14:58:12.316759 | 2016-09-01T03:29:06 | 2016-09-01T03:29:06 | 67,094,354 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 49,100 |
java
|
/*
*AVISO LEGAL
© Copyright
*Este programa esta protegido por la ley de derechos de autor.
*La reproduccion o distribucion ilicita de este programa o de cualquiera de
*sus partes esta penado por la ley con severas sanciones civiles y penales,
*y seran objeto de todas las sanciones legales que correspondan.
*Su contenido no puede copiarse para fines comerciales o de otras,
*ni puede mostrarse, incluso en una version modificada, en otros sitios Web.
Solo esta permitido colocar hipervinculos al sitio web.
*/
package com.bydan.erp.inventario.business.dataaccess;
import java.util.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.sql.ResultSetMetaData;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.HashMap;
import java.io.File;
import java.lang.reflect.Field;
//COMODIN
import javax.persistence.EntityManagerFactory;
import com.bydan.framework.erp.business.entity.GeneralEntity;
import com.bydan.framework.erp.business.entity.DatoGeneral;
import com.bydan.framework.erp.business.entity.DatoGeneralMinimo;
import com.bydan.framework.erp.business.entity.DatoGeneralMaximo;
import com.bydan.framework.erp.business.entity.Classe;
import com.bydan.framework.erp.business.logic.DatosCliente;
import com.bydan.framework.erp.business.logic.QueryWhereSelectParameters;
import com.bydan.framework.erp.business.logic.ParameterSelectionGeneral;
import com.bydan.framework.erp.business.dataaccess.ConstantesSql;
import com.bydan.framework.erp.business.dataaccess.DataAccessHelper;
import com.bydan.framework.erp.business.dataaccess.DataAccessHelperBase;
import com.bydan.framework.erp.business.dataaccess.DataAccessHelper;
import com.bydan.framework.erp.util.*;
import com.bydan.erp.inventario.business.entity.*;
import com.bydan.erp.inventario.util.*;//EmpaqueConstantesFunciones;
import com.bydan.erp.seguridad.business.entity.*;
import com.bydan.erp.facturacion.business.entity.*;
import com.bydan.erp.seguridad.business.dataaccess.*;
import com.bydan.erp.facturacion.business.dataaccess.*;
import com.bydan.erp.seguridad.util.*;
import com.bydan.erp.facturacion.util.*;
@SuppressWarnings("unused")
final public class EmpaqueDataAccess extends EmpaqueDataAccessAdditional{ //EmpaqueDataAccessAdditional,DataAccessHelper<Empaque>
//static Logger logger = Logger.getLogger(EmpaqueDataAccess.class);
public static String SCHEMA="bydan_erp";
public static String TABLENAME="empaque";
//POSTGRES
public static String QUERYINSERT="insert into "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+"(version_row,id_empresa,valor,descripcion)values(current_timestamp,?,?,?)";
public static String QUERYUPDATE="update "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+" set version_row=current_timestamp,id_empresa=?,valor=?,descripcion=? where id=? AND version_row=?";
public static String QUERYDELETE="delete from "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+" where id=?";
public static String QUERYSELECT="select empaque from "+EmpaqueConstantesFunciones.SPERSISTENCENAME+" empaque";
public static String QUERYSELECTNATIVE="select "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".id,"+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".version_row,"+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".id_empresa,"+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".valor,"+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".descripcion from "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME;//+" as "+EmpaqueConstantesFunciones.TABLENAME;
public static String QUERYSELECTNATIVEFORFOREINGKEY="select "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".id,"+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".version_row,"+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+".descripcion from "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME;//+" as "+EmpaqueConstantesFunciones.TABLENAME;
//MYSQL
public static String QUERYINSERT_MYSQL="insert into "+EmpaqueConstantesFunciones.SCHEMA+"."+EmpaqueConstantesFunciones.TABLENAME+" set version_row=current_timestamp,id_empresa=?,valor=?,descripcion=?";
public static String STOREPROCEDUREINSERT="call SP_EMPAQUE_INSERT(?,?,?,?)";
public static String STOREPROCEDUREUPDATE="call SP_EMPAQUE_UPDATE(?,?,? ,? ,?,?)";
public static String STOREPROCEDUREDELETE="call SP_EMPAQUE_DELETE(?,?)";
public static String STOREPROCEDURESELECT="call SP_EMPAQUE_SELECT(?,?)";
public static Boolean ISDELETECASCADE=false;
public static boolean ISWITHSCHEMA=true;
public static boolean ISWITHSTOREPROCEDURES=false;
protected Boolean isForForeingKeyData=false;
protected Boolean isForForeingsKeysDataRelationships=false;
protected ConnexionType connexionType;
protected ParameterDbType parameterDbType;
private Object entityObject;
private List<Object> entitiesObject;
protected DatosCliente datosCliente;
protected EmpaqueDataAccessAdditional empaqueDataAccessAdditional=null;
public EmpaqueDataAccessAdditional getEmpaqueDataAccessAdditional() {
return this.empaqueDataAccessAdditional;
}
public void setEmpaqueDataAccessAdditional(EmpaqueDataAccessAdditional empaqueDataAccessAdditional) {
try {
this.empaqueDataAccessAdditional=empaqueDataAccessAdditional;
} catch(Exception e) {
;
}
}
public EmpaqueDataAccess() {
this.entityObject=new Object();
this.entitiesObject=new ArrayList<Object>();
this.isForForeingKeyData=false;
this.isForForeingsKeysDataRelationships=false;
this.datosCliente=new DatosCliente();
}
public Boolean getIsForForeingKeyData() {
return this.isForForeingKeyData;
}
public void setIsForForeingKeyData(Boolean isForForeingKeyData) {
this.isForForeingKeyData = isForForeingKeyData;
}
public Boolean getIsForForeingsKeysDataRelationships() {
return this.isForForeingsKeysDataRelationships;
}
public void setIsForForeingsKeysDataRelationships(Boolean isForForeingsKeysDataRelationships) {
this.isForForeingsKeysDataRelationships = isForForeingsKeysDataRelationships;
}
public static boolean getISWITHSCHEMA() {
return ISWITHSCHEMA;
}
public static void setISWITHSCHEMA(boolean ANISWITHSCHEMA) {
ISWITHSCHEMA = ANISWITHSCHEMA;
}
public static boolean getISWITHSTOREPROCEDURES() {
return ISWITHSTOREPROCEDURES;
}
public static void setISWITHSTOREPROCEDURES(boolean ANISWITHSTOREPROCEDURES) {
ISWITHSTOREPROCEDURES =ANISWITHSTOREPROCEDURES;
}
public static String getTABLENAME() {
return TABLENAME;
}
public static void setTABLENAME(String sTABLENAME) {
EmpaqueDataAccess.TABLENAME = sTABLENAME;
}
public static String getSCHEMA() {
return SCHEMA;
}
public static void setSCHEMA(String aSCHEMA) {
EmpaqueDataAccess.SCHEMA = aSCHEMA;
}
public static Boolean getISDELETECASCADE() {
return ISDELETECASCADE;
}
public static void setISDELETECASCADE(Boolean ANISDELETECASCADE) {
EmpaqueDataAccess.ISDELETECASCADE = ANISDELETECASCADE;
}
public List<Object> getEntitiesObject() {
return this.entitiesObject;
}
public void setEntitiesObject(List<Object> entitiesObject) {
this.entitiesObject= entitiesObject;
}
public Object getEntityObject() {
return this.entityObject;
}
public void setEntityObject(Object entityObject) {
this.entityObject= entityObject;
}
public static ParametersMaintenance getParametersMaintenance(GeneralEntity generalEntity) {
ParametersMaintenance parametersMaintenance=new ParametersMaintenance();
int orderParameter;
return parametersMaintenance;
}
public ConnexionType getConnexionType() {
return connexionType;
}
public void setConnexionType(ConnexionType connexionType) {
this.connexionType = connexionType;
}
public ParameterDbType getParameterDbType() {
return parameterDbType;
}
public void setParameterDbType(ParameterDbType parameterDbType) {
this.parameterDbType = parameterDbType;
}
//COMODIN
public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {
}
public DatosCliente getDatosCliente() {
return datosCliente;
}
public void setDatosCliente(DatosCliente datosCliente) {
this.datosCliente = datosCliente;
}
public void setEmpaqueOriginal(Empaque empaque)throws Exception {
empaque.setEmpaqueOriginal((Empaque)empaque.clone());
}
public void setEmpaquesOriginal(List<Empaque> empaques)throws Exception {
for(Empaque empaque:empaques){
empaque.setEmpaqueOriginal((Empaque)empaque.clone());
}
}
public static void setEmpaqueOriginalStatic(Empaque empaque)throws Exception {
empaque.setEmpaqueOriginal((Empaque)empaque.clone());
}
public static void setEmpaquesOriginalStatic(List<Empaque> empaques)throws Exception {
for(Empaque empaque:empaques){
empaque.setEmpaqueOriginal((Empaque)empaque.clone());
}
}
public void executeQuery(Connexion connexion, String sQueryExecute) throws Exception {
try {
if(this.connexionType.equals(ConnexionType.JDBC32)) {
this.executeQueryJdbc(connexion, sQueryExecute);
} else {
//this.executeQueryHibernate(connexion, sQueryExecute);
}
} catch(Exception e) {
throw e;
}
}
public void executeQueryJdbc(Connexion connexion, String sQueryExecute) throws Exception {
try {
PreparedStatement preparedStatement = connexion.getConnection().prepareStatement(sQueryExecute);
preparedStatement.executeUpdate();
preparedStatement.close();
} catch(Exception e) {
throw e;
}
}
public Empaque getEntity(Connexion connexion, Long id) throws SQLException,Exception {
Empaque entity = new Empaque();
try {
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entity =this.getEntityJdbc(connexion, id);
} else {
}
}
catch(Exception e) {
throw e;
}
return entity;
}
public Empaque getEntityJdbc(Connexion connexion, Long id) throws SQLException,Exception {
Empaque entity = new Empaque();
try {
String sQuerySelect="";
Statement statement = connexion.getConnection().createStatement();
if(!this.isForForeingKeyData) {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVE;
} else {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;
}
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuerySelect + " WHERE id="+id);
}
ResultSet resultSet = statement.executeQuery(sQuerySelect + " WHERE id="+id);//Inventario.Empaque.isActive=1 AND
if(resultSet.next()) {
entity.setEmpaqueOriginal(new Empaque());
entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=this.getEntityEmpaque("",entity,resultSet);
//entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
//entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
} else {
entity =null;
}
if(entity!=null) {
this.setIsNewIsChangedFalseEmpaque(entity);
}
statement.close();
}
catch(Exception e) {
throw e;
}
return entity;
}
public Empaque getEntity(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters) throws SQLException,Exception {
Empaque entity = new Empaque();
try {
queryWhereSelectParameters.setConnexionType(this.connexionType);
queryWhereSelectParameters.setDbType(this.parameterDbType);
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entity =this.getEntityJdbc(connexion,queryWhereSelectParameters);
} else {
}
}
catch(Exception e) {
throw e;
}
return entity;
}
public Empaque getEntityJdbc(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters) throws SQLException,Exception {
Empaque entity = new Empaque();
try {
String sQuery="";
String sQuerySelect="";
Statement statement = connexion.getConnection().createStatement();
if(!this.isForForeingKeyData) {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVE;
} else {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;
}
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,EmpaqueDataAccess.TABLENAME+".",queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet = statement.executeQuery(sQuery);//Inventario.Empaque.isActive=1
if(resultSet.next()) {
entity.setEmpaqueOriginal(new Empaque());
entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=this.getEntityEmpaque("",entity,resultSet);
//entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
//entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
} else {
entity =null;
}
if(entity!=null) {
this.setIsNewIsChangedFalseEmpaque(entity);
}
statement.close();
}
catch(Exception e) {
throw e;
}
return entity;
}
//PARA SQL ESCALAR O QUE TRAIGA 1 FILA Y POCOS CAMPOS
public DatoGeneralMinimo getEntityDatoGeneralMinimoGenerico(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters,ArrayList<Classe> classes) throws SQLException,Exception { //Empaque
DatoGeneralMinimo datoGeneralMinimo= new DatoGeneralMinimo();
Empaque entity = new Empaque();
try {
String sQuery="";
String sQuerySelect="";
Statement statement = connexion.getConnection().createStatement();
if(!queryWhereSelectParameters.getSelectQuery().equals("")) {
sQuerySelect=queryWhereSelectParameters.getSelectQuery();
} else {
if(!this.isForForeingKeyData) {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVE;
} else {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;
}
}
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,EmpaqueDataAccess.TABLENAME+".",queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet = statement.executeQuery(sQuery);//Inventario.Empaque.isActive=1
//ResultSetMetaData metadata = resultSet.getMetaData();
//int iTotalCountColumn = metadata.getColumnCount();
//if(queryWhereSelectParameters.getIsGetGeneralObjects()) {
if(resultSet.next()) {
for(Classe classe:classes) {
DataAccessHelperBase.setFieldDynamic(datoGeneralMinimo,classe,resultSet);
}
/*
int iIndexColumn = 1;
while(iIndexColumn <= iTotalCountColumn) {
//arrayListObject.add(resultSet.getObject(iIndexColumn++));
}
*/
} else {
entity =null;
}
//}
if(entity!=null) {
//this.setIsNewIsChangedFalseEmpaque(entity);
}
statement.close();
}
catch(Exception e) {
throw e;
}
//return entity;
return datoGeneralMinimo;
}
public List<Empaque> getEntities(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters) throws Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
try {
queryWhereSelectParameters.setConnexionType(this.connexionType);
queryWhereSelectParameters.setDbType(this.parameterDbType);
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entities =this.getEntitiesJdbc(connexion,queryWhereSelectParameters);
} else {
}
} catch(Exception e) {
throw e;
}
return entities;
}
public List<Empaque> getEntitiesJdbc(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters) throws Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
String sQuerySelect="";
try {
Statement statement = connexion.getConnection().createStatement();
if(!this.isForForeingKeyData) {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVE;
} else {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;
}
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,EmpaqueDataAccess.TABLENAME+".",queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet= statement.executeQuery(sQuery);
while (resultSet.next()) {
entity = new Empaque();
entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=this.getEntityEmpaque("",entity,resultSet);
//entity.setEmpaqueOriginal( new Empaque());
//entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
//entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
entities.add(entity);
}
this.setIsNewIsChangedFalseEmpaques(entities);
statement.close();
if(this.datosCliente.getIsConExportar()) {
this.generarExportarEmpaque(connexion,sQuery,queryWhereSelectParameters);
}
} catch(Exception e) {
throw e;
}
return entities;
}
public List<Empaque> getEntities(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters,List<String> listColumns,DeepLoadType deepLoadType,Boolean conMapGenerico) throws SQLException,Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
try {
queryWhereSelectParameters.setConnexionType(this.connexionType);
queryWhereSelectParameters.setDbType(this.parameterDbType);
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entities =this.getEntitiesJdbc(connexion,sQuerySelect,queryWhereSelectParameters,listColumns,deepLoadType,conMapGenerico);
} else {
//entities =this.getEntitiesHibernate(connexion,sQuerySelect,queryWhereSelectParameters,listColumns,conMapGenerico);
}
} catch(Exception e) {
throw e;
}
return entities;
}
public List<Empaque> getEntitiesJdbc(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters,List<String> listColumns,DeepLoadType deepLoadType,Boolean conMapGenerico) throws SQLException,Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
try {
Statement statement = connexion.getConnection().createStatement();
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet = statement.executeQuery(sQuery);
while (resultSet.next()) {
entity = new Empaque();
if(conMapGenerico) {
entity.inicializarMapEmpaque();
//entity.setMapEmpaque(new HashMap<String,Object>());
for(String sColumn:listColumns) {
entity.setMapEmpaqueValue(sColumn, resultSet.getObject(sColumn));
//entity.getMapEmpaque().put(sColumn, resultSet.getObject(sColumn));
}
} else {
//entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=EmpaqueDataAccess.getEntityEmpaque("",entity,resultSet,listColumns,deepLoadType);
////entity.setEmpaqueOriginal( new Empaque());
////entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
////entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
}
entities.add(entity);
}
this.setIsNewIsChangedFalseEmpaques(entities);
statement.close();
if(this.datosCliente.getIsConExportar()) {
this.generarExportarEmpaque(connexion,sQuery,queryWhereSelectParameters);
}
} catch(Exception e) {
throw e;
}
return entities;
}
public Empaque getEntity(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters,List<String> listColumns,DeepLoadType deepLoadType,Boolean conMapGenerico) throws SQLException,Exception {
Empaque entity = new Empaque();
String sQuery="";
try {
queryWhereSelectParameters.setConnexionType(this.connexionType);
queryWhereSelectParameters.setDbType(this.parameterDbType);
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entity =this.getEntityJdbc(connexion,sQuerySelect,queryWhereSelectParameters,listColumns,deepLoadType,conMapGenerico);
} else {
//entity =this.getEntityHibernate(connexion,sQuerySelect,queryWhereSelectParameters,listColumns,conMapGenerico);
}
} catch(Exception e) {
throw e;
}
return entity;
}
public Empaque getEntityJdbc(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters,List<String> listColumns,DeepLoadType deepLoadType,Boolean conMapGenerico) throws SQLException,Exception {
Empaque entity = new Empaque();
String sQuery="";
try {
Statement statement = connexion.getConnection().createStatement();
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet = statement.executeQuery(sQuery);
while (resultSet.next()) {
entity = new Empaque();
if(conMapGenerico) {
entity.inicializarMapEmpaque();
//entity.setMapEmpaque(new HashMap<String,Object>());
for(String sColumn:listColumns) {
entity.setMapEmpaqueValue(sColumn, resultSet.getObject(sColumn));
//entity.getMapEmpaque().put(sColumn, resultSet.getObject(sColumn));
}
} else {
//entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=EmpaqueDataAccess.getEntityEmpaque("",entity,resultSet,listColumns,deepLoadType);
////entity.setEmpaqueOriginal( new Empaque());
////entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
////entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
}
//entities.add(entity);
}
this.setIsNewIsChangedFalseEmpaque(entity);
statement.close();
if(this.datosCliente.getIsConExportar()) {
this.generarExportarEmpaque(connexion,sQuery,queryWhereSelectParameters);
}
} catch(Exception e) {
throw e;
}
return entity;
}
public static Empaque getEntityEmpaque(String strPrefijo,Empaque entity,ResultSet resultSet,List<String> listColumns,DeepLoadType deepLoadType) throws Exception {
try {
if(deepLoadType.equals(DeepLoadType.NONE) || deepLoadType.equals(DeepLoadType.INCLUDE)) {
for(String sColumn:listColumns) {
Field field =null;
try {
field = Empaque.class.getDeclaredField(sColumn);//getField
field.setAccessible(true);
} catch(Exception e) {
field = Empaque.class.getSuperclass().getDeclaredField(sColumn);//getField
field.setAccessible(true);
}
EmpaqueDataAccess.setFieldReflectionEmpaque(field,strPrefijo,sColumn,entity,resultSet);
//field.set(entity, resultSet.getLong(strPrefijo+"id_opcion"));
}
} else if(deepLoadType.equals(DeepLoadType.EXCLUDE)) {
List<String> listTiposColumnasEmpaque=EmpaqueConstantesFunciones.getTodosTiposColumnasEmpaque();
Boolean existe=false;
for(String sColumn:listTiposColumnasEmpaque) {
existe=false;
for(String sColumnExlude:listColumns) {
if(sColumn.equals(sColumnExlude)) {
existe=true;
break;
}
}
if(!existe) {
//ESTE PROCESO ES REPETIDO DE INCLUDE
Field field =null;
try {
field = Empaque.class.getDeclaredField(sColumn);//getField
field.setAccessible(true);
} catch(Exception e) {
field = Empaque.class.getSuperclass().getDeclaredField(sColumn);//getField
field.setAccessible(true);
}
EmpaqueDataAccess.setFieldReflectionEmpaque(field,strPrefijo,sColumn,entity,resultSet);
//field.set(entity, resultSet.getLong(strPrefijo+"id_opcion"));
}
}
}
} catch(Exception e) {
throw e;
}
return entity;
}
public static void setFieldReflectionEmpaque(Field field,String strPrefijo,String sColumn,Empaque entity,ResultSet resultSet) throws Exception {
try {
String sCampo=strPrefijo+sColumn;
switch(sColumn) {
case EmpaqueConstantesFunciones.ID:
field.set(entity,resultSet.getLong(sCampo));
break;
case EmpaqueConstantesFunciones.VERSIONROW:
field.set(entity,resultSet.getString(sCampo));
break;
case EmpaqueConstantesFunciones.IDEMPRESA:
field.set(entity,resultSet.getLong(sCampo));
break;
case EmpaqueConstantesFunciones.VALOR:
field.set(entity,resultSet.getDouble(sCampo));
break;
case EmpaqueConstantesFunciones.DESCRIPCION:
field.set(entity,resultSet.getString(sCampo));
break;
default:
//CUANDO SE UTILIZA CAMPOS DIFERENCTES A LOS ORIGINALMENTE DEFINIDOS(ADDITIONAL)
DataAccessHelperBase.setFieldDynamic(entity,sCampo,field,resultSet);
break;
/*
case "id":
field.set(entity, resultSet.getLong(sCampo));
break;
*/
}
} catch(Exception e) {
throw e;
}
}
public ArrayList<DatoGeneralMaximo> getEntitiesDatoGeneralMaximoGenerico(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters,ArrayList<Classe> classes) throws Exception { //List<Empaque>
ArrayList<DatoGeneralMaximo> datoGeneralMaximos = new ArrayList<DatoGeneralMaximo>();
DatoGeneralMaximo datoGeneralMaximo=new DatoGeneralMaximo();
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
String sQuerySelect="";
try {
Statement statement = connexion.getConnection().createStatement();
if(!queryWhereSelectParameters.getSelectQuery().equals("")) {
sQuerySelect=queryWhereSelectParameters.getSelectQuery();
} else {
if(!this.isForForeingKeyData) {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVE;
} else {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;
}
}
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,EmpaqueDataAccess.TABLENAME+".",queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet= statement.executeQuery(sQuery);
//ResultSetMetaData metadata = resultSet.getMetaData();
//int iTotalCountColumn = metadata.getColumnCount();
//if(queryWhereSelectParameters.getIsGetGeneralObjects()) {
//this.entitiesObject=query.getResultList();
while (resultSet.next()) {
datoGeneralMaximo=new DatoGeneralMaximo();
for(Classe classe:classes) {
DataAccessHelperBase.setFieldDynamic(datoGeneralMaximo,classe,resultSet);
}
//int iIndexColumn = 1;
/*
while(iIndexColumn <= iTotalCountColumn) {
arrayListObject.add(resultSet.getObject(iIndexColumn++));
}
*/
datoGeneralMaximos.add(datoGeneralMaximo);
//arrayListObjects.add(arrayListObject);
/*
entity = new Empaque();
entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=this.getEntityEmpaque("",entity,resultSet);
//entity.setEmpaqueOriginal( new Empaque());
//entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
//entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
entities.add(entity);
*/
}
//}
//this.setIsNewIsChangedFalseEmpaques(entities);
statement.close();
/*
if(this.datosCliente.getIsConExportar()) {
this.generarExportarEmpaque(connexion,sQuery,queryWhereSelectParameters);
}
*/
} catch(Exception e) {
throw e;
}
//return entities;
return datoGeneralMaximos;
}
public ArrayList<DatoGeneral> getEntitiesDatoGeneralGenerico(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters,ArrayList<Classe> classes) throws Exception { //List<Empaque>
ArrayList<DatoGeneral> datoGenerals = new ArrayList<DatoGeneral>();
DatoGeneral datoGeneral=new DatoGeneral();
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
String sQuerySelect="";
try {
Statement statement = connexion.getConnection().createStatement();
if(!queryWhereSelectParameters.getSelectQuery().equals("")) {
sQuerySelect=queryWhereSelectParameters.getSelectQuery();
} else {
if(!this.isForForeingKeyData) {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVE;
} else {
sQuerySelect=EmpaqueDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;
}
}
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,EmpaqueDataAccess.TABLENAME+".",queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet= statement.executeQuery(sQuery);
//ResultSetMetaData metadata = resultSet.getMetaData();
//int iTotalCountColumn = metadata.getColumnCount();
//if(queryWhereSelectParameters.getIsGetGeneralObjects()) {
//this.entitiesObject=query.getResultList();
while (resultSet.next()) {
datoGeneral=new DatoGeneral();
for(Classe classe:classes) {
DataAccessHelperBase.setFieldDynamic(datoGeneral,classe,resultSet);
}
datoGenerals.add(datoGeneral);
}
//}
statement.close();
} catch(Exception e) {
throw e;
}
//return entities;
return datoGenerals;
}
public List<Empaque> getEntities(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters) throws SQLException,Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
try {
queryWhereSelectParameters.setConnexionType(this.connexionType);
queryWhereSelectParameters.setDbType(this.parameterDbType);
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entities =this.getEntitiesJdbc(connexion,sQuerySelect,queryWhereSelectParameters);
} else {
}
} catch(Exception e) {
throw e;
}
return entities;
}
public List<Empaque> getEntitiesJdbc(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters) throws SQLException,Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
try {
Statement statement = connexion.getConnection().createStatement();
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet = statement.executeQuery(sQuery);
while (resultSet.next()) {
entity = new Empaque();
entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=this.getEntityEmpaque("",entity,resultSet);
//entity.setEmpaqueOriginal( new Empaque());
//entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
//entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
entities.add(entity);
}
this.setIsNewIsChangedFalseEmpaques(entities);
statement.close();
if(this.datosCliente.getIsConExportar()) {
this.generarExportarEmpaque(connexion,sQuery,queryWhereSelectParameters);
}
} catch(Exception e) {
throw e;
}
return entities;
}
public List<Empaque> getEntitiesSimpleQueryBuild(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters) throws SQLException,Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
try {
queryWhereSelectParameters.setConnexionType(this.connexionType);
queryWhereSelectParameters.setDbType(this.parameterDbType);
if(this.connexionType.equals(ConnexionType.JDBC32)) {
entities =this.getEntitiesSimpleQueryBuildJdbc(connexion,sQuerySelect,queryWhereSelectParameters);
} else {
}
} catch(Exception e) {
throw e;
}
return entities;
}
public List<Empaque> getEntitiesSimpleQueryBuildJdbc(Connexion connexion,String sQuerySelect,QueryWhereSelectParameters queryWhereSelectParameters) throws SQLException,Exception {
List<Empaque> entities = new ArrayList<Empaque>();
Empaque entity = new Empaque();
String sQuery="";
try {
Statement statement = connexion.getConnection().createStatement();
sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesSimpleQueryBuildJDBC(queryWhereSelectParameters,sQuerySelect);
if(Constantes2.ISDEVELOPING_SQL) {
Funciones2.mostrarMensajeDeveloping(sQuery);
}
ResultSet resultSet = statement.executeQuery(sQuery);
while (resultSet.next()) {
entity = new Empaque();
entity=super.getEntity("",entity,resultSet,EmpaqueDataAccess.ISWITHSCHEMA);
entity=this.getEntityEmpaque("",entity,resultSet);
//entity.setEmpaqueOriginal( new Empaque());
//entity.setEmpaqueOriginal(super.getEntity("",entity.getEmpaqueOriginal(),resultSet,EmpaqueDataAccess.ISWITHSCHEMA));
//entity.setEmpaqueOriginal(this.getEntityEmpaque("",entity.getEmpaqueOriginal(),resultSet));
entities.add(entity);
}
this.setIsNewIsChangedFalseEmpaques(entities);
statement.close();
} catch(Exception e) {
throw e;
}
return entities;
}
public Empaque getEntityEmpaque(String strPrefijo,Empaque entity,ResultSet resultSet) throws Exception {
try {
if(!this.isForForeingKeyData) {
entity.setid_empresa(resultSet.getLong(strPrefijo+EmpaqueConstantesFunciones.IDEMPRESA));
entity.setvalor(resultSet.getDouble(strPrefijo+EmpaqueConstantesFunciones.VALOR));
entity.setdescripcion(resultSet.getString(strPrefijo+EmpaqueConstantesFunciones.DESCRIPCION));
} else {
entity.setdescripcion(resultSet.getString(strPrefijo+EmpaqueConstantesFunciones.DESCRIPCION));
}
} catch(Exception e) {
throw e;
}
return entity;
}
public Timestamp getSetVersionRowEmpaque(Connexion connexion, Long id) throws SQLException,Exception {
Timestamp timestampVersionRow=null;
try {
if(connexion.getConnexionType().equals(ConnexionType.HIBERNATE)) {
}
} catch(Exception e) {
throw e;
}
return timestampVersionRow;
}
public static void save(Empaque entity,Connexion connexion)throws SQLException,Exception {
try {
ParametersType parametersType=null;
String sQuerySave="";
if (entity.getIsDeleted()) {
parametersType=ParametersType.DELETE;
sQuerySave=EmpaqueDataAccess.QUERYDELETE;
} else if (entity.getIsChanged()) {
if(entity.getIsNew()) {
parametersType=ParametersType.INSERT;
sQuerySave=EmpaqueDataAccess.QUERYINSERT;
} else {
parametersType=ParametersType.UPDATE;
sQuerySave=EmpaqueDataAccess.QUERYUPDATE;
}
}
ParametersMaintenance parametersMaintenance=new ParametersMaintenance();
if(connexion.getConnexionType().equals(ConnexionType.JDBC32)) {
parametersMaintenance=EmpaqueDataAccess.buildParametersMaintenance(connexion.getDbType(), parametersType, entity);
}
connexion.setFuncionAuxiliar(EmpaqueConstantesFunciones.SQL_SECUENCIAL);
DataAccessHelper.save(entity, connexion,parametersMaintenance,sQuerySave,EmpaqueDataAccess.TABLENAME,EmpaqueDataAccess.ISWITHSTOREPROCEDURES);
EmpaqueDataAccess.setEmpaqueOriginalStatic(entity);
} catch(Exception e) {
throw e;
}
}
public Empresa getEmpresa(Connexion connexion,Empaque relempaque)throws SQLException,Exception {
Empresa empresa= new Empresa();
try {
EmpresaDataAccess empresaDataAccess=new EmpresaDataAccess();
empresaDataAccess.setIsForForeingKeyData(this.isForForeingsKeysDataRelationships);
empresaDataAccess.setConnexionType(this.connexionType);
empresaDataAccess.setParameterDbType(this.parameterDbType);
empresa=empresaDataAccess.getEntity(connexion,relempaque.getid_empresa());
} catch(SQLException e) {
throw e;
} catch(Exception e) {
throw e;
}
return empresa;
}
public List<DetaNotaCredito> getDetaNotaCreditos(Connexion connexion,Empaque empaque)throws SQLException,Exception {
List<DetaNotaCredito> detanotacreditos= new ArrayList<DetaNotaCredito>();
try {
String sQuery="";
if(this.connexionType.equals(ConnexionType.JDBC32)) {
sQuery=" INNER JOIN "+EmpaqueConstantesFunciones.SCHEMA+".empaque ON "+DetaNotaCreditoConstantesFunciones.SCHEMA+".deta_nota_credito.id_empaque="+EmpaqueConstantesFunciones.SCHEMA+".empaque.id WHERE "+EmpaqueConstantesFunciones.SCHEMA+".empaque.id="+String.valueOf(empaque.getId());
} else {
sQuery=" INNER JOIN detanotacredito.Empaque WHERE detanotacredito.Empaque.id="+String.valueOf(empaque.getId());
}
QueryWhereSelectParameters queryWhereSelectParameters=new QueryWhereSelectParameters();
queryWhereSelectParameters.setFinalQuery(sQuery);
DetaNotaCreditoDataAccess detanotacreditoDataAccess=new DetaNotaCreditoDataAccess();
detanotacreditoDataAccess.setConnexionType(this.connexionType);
detanotacreditoDataAccess.setParameterDbType(this.parameterDbType);
detanotacreditos=detanotacreditoDataAccess.getEntities(connexion,queryWhereSelectParameters);
} catch(SQLException e) {
throw e;
} catch(Exception e) {
throw e;
}
return detanotacreditos;
}
public List<DetalleProforma> getDetalleProformas(Connexion connexion,Empaque empaque)throws SQLException,Exception {
List<DetalleProforma> detalleproformas= new ArrayList<DetalleProforma>();
try {
String sQuery="";
if(this.connexionType.equals(ConnexionType.JDBC32)) {
sQuery=" INNER JOIN "+EmpaqueConstantesFunciones.SCHEMA+".empaque ON "+DetalleProformaConstantesFunciones.SCHEMA+".detalle_proforma.id_empaque="+EmpaqueConstantesFunciones.SCHEMA+".empaque.id WHERE "+EmpaqueConstantesFunciones.SCHEMA+".empaque.id="+String.valueOf(empaque.getId());
} else {
sQuery=" INNER JOIN detalleproforma.Empaque WHERE detalleproforma.Empaque.id="+String.valueOf(empaque.getId());
}
QueryWhereSelectParameters queryWhereSelectParameters=new QueryWhereSelectParameters();
queryWhereSelectParameters.setFinalQuery(sQuery);
DetalleProformaDataAccess detalleproformaDataAccess=new DetalleProformaDataAccess();
detalleproformaDataAccess.setConnexionType(this.connexionType);
detalleproformaDataAccess.setParameterDbType(this.parameterDbType);
detalleproformas=detalleproformaDataAccess.getEntities(connexion,queryWhereSelectParameters);
} catch(SQLException e) {
throw e;
} catch(Exception e) {
throw e;
}
return detalleproformas;
}
public List<DetaNotaCreditoSoli> getDetaNotaCreditoSolis(Connexion connexion,Empaque empaque)throws SQLException,Exception {
List<DetaNotaCreditoSoli> detanotacreditosolis= new ArrayList<DetaNotaCreditoSoli>();
try {
String sQuery="";
if(this.connexionType.equals(ConnexionType.JDBC32)) {
sQuery=" INNER JOIN "+EmpaqueConstantesFunciones.SCHEMA+".empaque ON "+DetaNotaCreditoSoliConstantesFunciones.SCHEMA+".deta_nota_credito_soli.id_empaque="+EmpaqueConstantesFunciones.SCHEMA+".empaque.id WHERE "+EmpaqueConstantesFunciones.SCHEMA+".empaque.id="+String.valueOf(empaque.getId());
} else {
sQuery=" INNER JOIN detanotacreditosoli.Empaque WHERE detanotacreditosoli.Empaque.id="+String.valueOf(empaque.getId());
}
QueryWhereSelectParameters queryWhereSelectParameters=new QueryWhereSelectParameters();
queryWhereSelectParameters.setFinalQuery(sQuery);
DetaNotaCreditoSoliDataAccess detanotacreditosoliDataAccess=new DetaNotaCreditoSoliDataAccess();
detanotacreditosoliDataAccess.setConnexionType(this.connexionType);
detanotacreditosoliDataAccess.setParameterDbType(this.parameterDbType);
detanotacreditosolis=detanotacreditosoliDataAccess.getEntities(connexion,queryWhereSelectParameters);
} catch(SQLException e) {
throw e;
} catch(Exception e) {
throw e;
}
return detanotacreditosolis;
}
public static ParametersMaintenance buildParametersMaintenance(ParameterDbType newDbType,ParametersType parametersType,Empaque empaque) throws Exception {
ParametersMaintenance parametersMaintenance=new ParametersMaintenance();
try {
//ParametersMaintenance parametersMaintenance=super.getParametersMaintenance();
ArrayList<ParameterMaintenance> parametersTemp=new ArrayList<ParameterMaintenance>();
ParameterMaintenance parameterMaintenance;
ParameterValue<Long> parameterMaintenanceValueId;
Integer iOrder=1;
if(!empaque.getIsDeleted()) {
parameterMaintenance=new ParameterMaintenance();
parameterMaintenance.setOrder(iOrder++);
parameterMaintenance.setParameterMaintenanceType(ParameterType.LONG);
ParameterValue<Long> parameterMaintenanceValueid_empresa=new ParameterValue<Long>();
parameterMaintenanceValueid_empresa.setValue(empaque.getid_empresa());
parameterMaintenance.setParameterMaintenanceValue(parameterMaintenanceValueid_empresa);
parametersTemp.add(parameterMaintenance);
parameterMaintenance=new ParameterMaintenance();
parameterMaintenance.setOrder(iOrder++);
parameterMaintenance.setParameterMaintenanceType(ParameterType.DOUBLE);
ParameterValue<Double> parameterMaintenanceValuevalor=new ParameterValue<Double>();
parameterMaintenanceValuevalor.setValue(empaque.getvalor());
parameterMaintenance.setParameterMaintenanceValue(parameterMaintenanceValuevalor);
parametersTemp.add(parameterMaintenance);
parameterMaintenance=new ParameterMaintenance();
parameterMaintenance.setOrder(iOrder++);
parameterMaintenance.setParameterMaintenanceType(ParameterType.STRING);
ParameterValue<String> parameterMaintenanceValuedescripcion=new ParameterValue<String>();
parameterMaintenanceValuedescripcion.setValue(empaque.getdescripcion());
parameterMaintenance.setParameterMaintenanceValue(parameterMaintenanceValuedescripcion);
parametersTemp.add(parameterMaintenance);
if(!empaque.getIsNew()) {
parameterMaintenance=new ParameterMaintenance();
parameterMaintenance.setOrder(iOrder++);
parameterMaintenance.setParameterMaintenanceType(ParameterType.LONG);
parameterMaintenanceValueId=new ParameterValue<Long>();
parameterMaintenanceValueId.setValue(empaque.getId());
parameterMaintenance.setParameterMaintenanceValue(parameterMaintenanceValueId);
parametersTemp.add(parameterMaintenance);
parameterMaintenance=new ParameterMaintenance();
parameterMaintenance.setOrder(iOrder++);
parameterMaintenance.setParameterMaintenanceType(ParameterType.TIMESTAMP);
ParameterValue<Date> parameterMaintenanceValueVersionRow=new ParameterValue<Date>();
parameterMaintenanceValueVersionRow.setValue(empaque.getVersionRow());
parameterMaintenance.setParameterMaintenanceValue(parameterMaintenanceValueVersionRow);
parametersTemp.add(parameterMaintenance);
}
} else {
parameterMaintenance=new ParameterMaintenance();
parameterMaintenance.setOrder(iOrder);
parameterMaintenance.setParameterMaintenanceType(ParameterType.LONG);
parameterMaintenanceValueId=new ParameterValue<Long>();
parameterMaintenanceValueId.setValue(empaque.getId());
parameterMaintenance.setParameterMaintenanceValue(parameterMaintenanceValueId);
parametersTemp.add(parameterMaintenance);
}
parametersMaintenance= new ParametersMaintenance();
parametersMaintenance.setDbType(newDbType);
parametersMaintenance.setParametersMaintenance(parametersTemp);
//super.setParametersMaintenance(parametersMaintenance);
} catch(Exception e) {
throw e;
}
return parametersMaintenance;
}
public void setIsNewIsChangedFalseEmpaque(Empaque empaque)throws Exception {
empaque.setIsNew(false);
empaque.setIsChanged(false);
}
public void setIsNewIsChangedFalseEmpaques(List<Empaque> empaques)throws Exception {
for(Empaque empaque:empaques) {
empaque.setIsNew(false);
empaque.setIsChanged(false);
}
}
public void generarExportarEmpaque(Connexion connexion,String sQuery,QueryWhereSelectParameters queryWhereSelectParameters)throws Exception {
try {
if(this.datosCliente.getIsConExportar()) {
String sQueryExportar=Funciones2.getQueryExportar(this.datosCliente, sQuery, queryWhereSelectParameters);
this.executeQueryJdbc(connexion,sQueryExportar);
}
} catch(Exception e) {
e.printStackTrace();
//System.out.print(e.getStackTrace());
}
}
}
|
[
"[email protected]"
] | |
2c7045bf46246dd8cce7ac9f3a49e16a17060a95
|
8fd78e2bb4fa920a1ebab69b203b5688a5799414
|
/lecture7/World.java
|
5a03d62610e90197dd81835d8181fe6af4b92c71
|
[] |
no_license
|
phuzeron/AdvancedProgramming3
|
45d7a761dabcf18bfb4f8fb4ed1eedb32b67d37b
|
ec9e49b14e3106b3b9b5f9db7b82a306e0b56ccb
|
refs/heads/master
| 2020-12-30T16:02:29.254151 | 2017-10-03T06:52:11 | 2017-10-03T06:52:11 | 90,953,282 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,151 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lecture7;
import java.awt.BorderLayout;
import java.awt.Container;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
*
* @author phuzeron
*/
public class World extends JFrame{
JPanel panel;
private List<Actor> actorList;
public World(String title){
super();
setTitle(title);
setBounds(0, 0, 300, 250);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel = new JPanel();
panel.setLayout(null);
Container contentPane = getContentPane();
contentPane.add(panel, BorderLayout.CENTER);
actorList = new ArrayList<>();
}
public void addObject(Actor object, int x, int y){
actorList.add(object);
panel.add(object.getIcon());
object.setLocation(x, y);
}
@Override
public void repaint(){
for(Actor actor : actorList){
actor.act();
}
}
}
|
[
"[email protected]"
] | |
9909da3c836cd188635f3c76a0ad78150ba68eb9
|
f72551ff3bb4fb527ae06886f74c6b2a20abea73
|
/hadoop-eco-tutorial/src/main/java/org/apn/hadoop/commons/Messages.java
|
918b295695402946909ca646955bdd675849d91d
|
[] |
no_license
|
amitnema/hadoop-ecosystem
|
12b55b7454bf90b4a561796d5564dcb4f6789276
|
3f9247c94fac462251c3fdfd08cd0ba52cec7a84
|
refs/heads/master
| 2022-07-06T20:26:28.905129 | 2019-06-23T11:39:31 | 2019-06-23T11:39:31 | 50,645,114 | 0 | 1 | null | 2022-07-01T17:31:55 | 2016-01-29T07:10:17 |
Java
|
UTF-8
|
Java
| false | false | 542 |
java
|
package org.apn.hadoop.commons;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.apn.hadoop.commons.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private Messages() {
}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}
|
[
"[email protected]"
] | |
bf1453d31d99a183cc314ca346c314d211318152
|
93d6beeb52176ed12624b7ec2b7b0d733c2e2345
|
/core/src/main/java/ma/glasnost/orika/property/IntrospectorPropertyResolver.java
|
18fec018fbf16d9ec4d39da4399c10f341828d4f
|
[] |
no_license
|
gigaZhang/orika
|
22f633ea11a02da3415b1007226ae74c36b21eec
|
ccc880e90dce959e3909be76981cb8dc1a8870b0
|
refs/heads/master
| 2020-04-16T05:06:02.207994 | 2012-09-12T00:22:30 | 2012-09-12T00:22:30 | 33,932,713 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 14,482 |
java
|
/*
* Orika - simpler, better and faster Java bean mapping
*
* Copyright (C) 2011 Orika authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ma.glasnost.orika.property;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import ma.glasnost.orika.metadata.NestedProperty;
import ma.glasnost.orika.metadata.Property;
import ma.glasnost.orika.metadata.Type;
import ma.glasnost.orika.metadata.TypeFactory;
/**
* IntrospectionPropertyResolver leverages JavaBeans introspector to resolve
* properties for provided types.<br>
*
* @author
*
*/
public class IntrospectorPropertyResolver implements PropertyResolverStrategy {
private final Map<java.lang.reflect.Type, Map<String, Property>> propertiesCache = new ConcurrentHashMap<java.lang.reflect.Type, Map<String, Property>>();
public Map<String, Property> getProperties(java.lang.reflect.Type theType) {
Map<String, Property> properties = propertiesCache.get(theType);
if (properties == null) {
synchronized(theType) {
properties = propertiesCache.get(theType);
if (properties == null) {
properties = new LinkedHashMap<String, Property>();
Type<?> typeHolder;
if (theType instanceof Type) {
typeHolder = (Type<?>) theType;
} else if (theType instanceof Class) {
typeHolder = TypeFactory.valueOf((Class<?>) theType);
} else {
throw new IllegalArgumentException("type " + theType + " not supported.");
}
BeanInfo beanInfo;
PropertyDescriptor currentPd = null;
try {
LinkedList<Class<? extends Object>> types = new LinkedList<Class<? extends Object>>();
types.addFirst((Class<? extends Object>) typeHolder.getRawType());
while (!types.isEmpty()) {
Class<? extends Object> type = types.removeFirst();
beanInfo = Introspector.getBeanInfo(type);
PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
for (final PropertyDescriptor pd : descriptors) {
currentPd = pd;
try {
final Property property = new Property();
final String capitalName = pd.getName().substring(0,1).toUpperCase() + pd.getName().substring(1);
Method readMethod;
if (pd.getReadMethod() == null && Boolean.class.equals(pd.getPropertyType())) {
/*
* Special handling for Boolean "is" read method; not compliant with JavaBeans spec, but still very common
*/
try {
readMethod = type.getMethod("is" + capitalName);
} catch (NoSuchMethodException e) {
readMethod = null;
}
} else {
readMethod = pd.getReadMethod();
}
Method writeMethod = pd.getWriteMethod();
property.setExpression(pd.getName());
property.setName(pd.getName());
if (readMethod != null) {
property.setGetter(readMethod.getName() + "()");
}
if (writeMethod != null) {
property.setSetter(writeMethod.getName() + "(%s)");
}
if (readMethod == null && writeMethod == null) {
continue;
}
Class<?> rawType = resolveRawPropertyType(pd);
if (typeHolder.isParameterized()
|| type.getTypeParameters().length > 0
|| rawType.getTypeParameters().length > 0) {
/*
* Make attempts to determine the parameters
*/
Type<?> resolvedGenericType = null;
if (readMethod != null) {
try {
resolvedGenericType = resolveGenericType(readMethod.getDeclaringClass()
.getDeclaredMethod(readMethod.getName(), new Class[0])
.getGenericReturnType(), typeHolder);
} catch (NoSuchMethodException e) {
throw new IllegalStateException("readMethod does not exist",e);
}
}
if (resolvedGenericType != null && !resolvedGenericType.isAssignableFrom(rawType)) {
property.setType(resolvedGenericType);
} else {
property.setType(TypeFactory.valueOf(rawType));
}
} else {
/*
* Neither the type nor it's parameter is generic; use the raw type
*/
property.setType(TypeFactory.valueOf(rawType));
}
if (writeMethod == null) {
/*
* Special handling for fluid APIs where setters return a value
*/
try {
writeMethod = type.getMethod("set" + capitalName, property.getType().getRawType());
property.setSetter(writeMethod.getName() + "(%s)");
} catch (NoSuchMethodException e) {
writeMethod = null;
}
}
Property existing = properties.get(pd.getName());
if (existing == null) {
properties.put(pd.getName(), property);
} else if (existing.getType().isAssignableFrom(property.getType()) && !existing.getType().equals(property.getType())) {
/*
* The type has been refined by the generic information in a super-type
*/
existing.setType(property.getType());
}
} catch (final RuntimeException e) {
/*
* Wrap with info for the property we were trying to introspect
*/
throw new RuntimeException("Unexpected error while trying to resolve property " + theType + ", [" + pd.getName() + "]", e);
}
}
if (type.getSuperclass() != null && !Object.class.equals(type.getSuperclass())) {
types.add(type.getSuperclass());
}
List<? extends Class<? extends Object>> interfaces = Arrays.<Class<? extends Object>> asList(type.getInterfaces());
types.addAll(interfaces);
}
} catch (final IntrospectionException e) {
if (currentPd != null) {
throw new RuntimeException("Unexpected error while trying to resolve property " + theType + ", [" + currentPd.getName() + "]", e);
} else {
throw new RuntimeException("Unexpected error while trying to resolve properties for " + theType, e);
}
}
/*
* Add public non-static fields as properties; we call this outside of
* the loop because the fields returned are already inclusive of
* ancestors.
*/
for (Field f : typeHolder.getRawType().getFields()) {
if (!Modifier.isStatic(f.getModifiers())) {
final Property property = new Property();
property.setExpression(f.getName());
property.setName(f.getName());
Class<?> rawType = f.getType();
Type<?> genericType = resolveGenericType(f.getGenericType(), typeHolder);
if (genericType != null && !genericType.isAssignableFrom(rawType)) {
property.setType(genericType);
} else {
property.setType(TypeFactory.valueOf(rawType));
}
Property existing = properties.get(property.getName());
if (existing == null) {
property.setGetter(property.getName());
property.setSetter(property.getName() + " = %s");
properties.put(property.getName(), property);
} else if (existing.getSetter() == null) {
existing.setSetter(property.getName() + " = %s");
}
}
}
propertiesCache.put(theType, Collections.unmodifiableMap(properties));
}
}
}
return properties;
}
/**
* Attempt to resolve the generic type, using refereceType to resolve
* TypeVariables
*
* @param genericType the type to resolve
* @param referenceType the reference type to use for lookup of type variables
* @return
*/
private Type<?> resolveGenericType(java.lang.reflect.Type genericType, Type<?> referenceType) {
Type<?> resolvedType = null;
Type<?> reference = referenceType;
do {
if (genericType instanceof TypeVariable && reference.isParameterized()) {
java.lang.reflect.Type t = reference.getTypeByVariable((TypeVariable<?>) genericType);
if (t != null) {
resolvedType = TypeFactory.valueOf(t);
}
} else if (genericType instanceof ParameterizedType) {
if (reference.isParameterized()) {
resolvedType = TypeFactory.resolveValueOf((ParameterizedType) genericType, reference);
} else {
resolvedType = TypeFactory.valueOf((ParameterizedType) genericType);
}
}
reference = reference.getSuperType();
} while (resolvedType == null && reference != TypeFactory.TYPE_OF_OBJECT);
return resolvedType;
}
/**
* Resolves the raw property type from a property descriptor;
* if a read method is available, use it to refine the type.
* The results of pd.getPropertyType() are sometimes inconsistent across
* platforms.
*
* @param pd
* @return
*/
private Class<?> resolveRawPropertyType(PropertyDescriptor pd) {
Class<?> rawType = pd.getPropertyType();
try {
return ( pd.getReadMethod() == null ? rawType :
pd.getReadMethod().getDeclaringClass()
.getDeclaredMethod(pd.getReadMethod().getName(), new Class[0])
.getReturnType());
} catch (Exception e) {
return rawType;
}
}
public NestedProperty getNestedProperty(java.lang.reflect.Type type, String p) {
String typeName = type.toString();
Map<String, Property> properties = getProperties(type);
Property property = null;
final List<Property> path = new ArrayList<Property>();
if (p.indexOf('.') != -1) {
final String[] ps = p.split("\\.");
int i = 0;
while (i < ps.length) {
if (!properties.containsKey(ps[i])) {
throw new RuntimeException("could not resolve nested property [" + p + "] on " + type + ", because "
+ type + " does not contain property [" + ps[i] + "]");
}
property = properties.get(ps[i]);
properties = getProperties(property.getType());
i++;
if (i < ps.length) {
path.add(property);
}
}
}
if (property == null) {
throw new RuntimeException(typeName + " does not contain property [" + p + "]");
}
return new NestedProperty(p, property, path.toArray(new Property[path.size()]));
}
}
|
[
"[email protected]@f4a4e40d-1d15-de9b-c3e8-c5ea35f5a4c4"
] |
[email protected]@f4a4e40d-1d15-de9b-c3e8-c5ea35f5a4c4
|
28b792fdfbcc9099642fc1d8a8c401fdaf27cbff
|
e29f051ecfb77c66e6a1f5a5c1e7f434375893eb
|
/src/test/java/com/maxdemarzi/MyServiceWebIntegrationTests.java
|
0e9de5d81f7d11e49f6b929239178ee39524db0b
|
[] |
no_license
|
maxdemarzi/SBRM
|
38e2c39ec067306bc88c28187a0ac47ead2006b0
|
6ebd761dc641c8465dd212ceccd32391251e3c01
|
refs/heads/master
| 2021-01-13T08:40:47.607851 | 2016-10-29T02:51:25 | 2016-10-29T02:51:25 | 72,261,237 | 0 | 0 | null | 2016-10-29T03:16:56 | 2016-10-29T02:51:22 |
Shell
|
UTF-8
|
Java
| false | false | 874 |
java
|
package com.maxdemarzi;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.client.RestTemplate;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = MyServiceApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT)
public class MyServiceWebIntegrationTests {
private static final int PORT = 8080;
// Parameterize tests like this
private static final String AN_APP_PATH = "http://localhost:" + PORT + "/path";
// Use this to run tests
private RestTemplate restTemplate = new RestTemplate();
@Test
public void sampleTest() {
// Use RestTemplate to hit chosen URLs
}
}
|
[
"[email protected]"
] | |
24ab179354457ed08ab3385b695489dd0b270f3c
|
88b8747b90c4b688f60293e77def93dc70b1ae1d
|
/project/2017-01/water/code/timesheet/src/main/java/edu/mum/cs/cs544/timesheet/dao/CourseOfferingDAO.java
|
dd5d12589b7732313d60c5be9bc93a5f2baa82db
|
[] |
no_license
|
phan-dev/cs544
|
1cbc188d435b9313cc7dec9d3c174acd9a6a9be3
|
743d96cafda487e3ab1587854db5d06c05ceb8d6
|
refs/heads/master
| 2022-10-24T04:48:00.380054 | 2020-06-07T17:32:39 | 2020-06-07T17:32:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 243 |
java
|
package edu.mum.cs.cs544.timesheet.dao;
import java.util.List;
import edu.mum.cs.cs544.timesheet.entity.CourseOffering;
public interface CourseOfferingDAO extends BaseDAO<CourseOffering>{
public List<CourseOffering> getAll();
}
|
[
"[email protected]"
] | |
2e710f0c30d44e48a414e27079460e1e18efeb62
|
4801e3651360029593e6e5513459a8f20d0c9911
|
/src/learning/Main.java
|
4f695d2e623d8b331ef35e63ffbf070d499ea986
|
[] |
no_license
|
embe7/Application-Menghitung-Luas-Persegi-Panjang
|
2aa1b7eb90094c32382086d11026bcd96e03ddeb
|
021e8a18b41ea29b3c429aada55977cda2cd3104
|
refs/heads/master
| 2023-03-22T17:47:02.945271 | 2021-03-13T11:01:21 | 2021-03-13T11:01:21 | 347,343,541 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 661 |
java
|
package learning;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// This Is Application Calculator Rectangle
Scanner inputNilai = new Scanner(System.in);
int panjang;
int lebar;
int hasil;
System.out.println("===== Insert Large Rectangle ===== ");
System.out.println("Insert Rectangle = " );
System.out.print("Insert Long = ");
panjang = inputNilai.nextInt();
System.out.print("Insert Wide = ");
lebar = inputNilai.nextInt();
hasil = (panjang * lebar);
System.out.println("Large Rectangle Is = " + hasil);
}
}
|
[
"[email protected]"
] | |
919fae6b63e1ec05b8500e5cd08a6b2476063531
|
27d844e6f3578d7af2597efa85d5908850ca0188
|
/app/src/main/java/com/blog/demo/component/receiver/DemoBroadcastReceiver.java
|
2c30c9629b911b7e5497c815291b9bbc257ae595
|
[] |
no_license
|
lozn00/AndroidBlog
|
c7d620d695c0adf4c68e30b4c1a5b4325de9a24d
|
440a0159d6611ef6f5c69ff5431c898ca0e50495
|
refs/heads/master
| 2023-08-31T01:34:05.055039 | 2021-05-11T01:34:04 | 2021-05-11T01:34:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 421 |
java
|
package com.blog.demo.component.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.blog.demo.LogTool;
public class DemoBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
LogTool.logi("DemoBroadcastReceiver", "onReceive " + intent.getStringExtra("value"));
}
}
|
[
"[email protected]"
] | |
cd5f78451e6f474d65c5769f4898e84e65e0a6f6
|
4a6f2213a90c9604d0423dd77e6c0992727b5d51
|
/app/src/main/java/com/constore/adapter/GridviewAdapter.java
|
47862859eafca9effe28b9bbf2353a59816dec3a
|
[] |
no_license
|
hoaiann/UI
|
08939f8a052feda911e62a944bfd7559086ebd4d
|
252d3756bbfdceefda8c7a7248a7ac0e3b3a3164
|
refs/heads/master
| 2020-08-26T15:24:59.335646 | 2019-10-21T07:38:57 | 2019-10-21T07:38:57 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,241 |
java
|
package com.constore.adapter;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.constore.R;
import com.constore.model.bean.Beanclass;
import java.util.ArrayList;
public class GridviewAdapter extends BaseAdapter {
Context context;
ArrayList<Beanclass> bean;
public GridviewAdapter(Context context, ArrayList<Beanclass> bean) {
this.bean = bean;
this.context = context;
}
@Override
public int getCount() {
return bean.size();
}
@Override
public Object getItem(int position) {
return bean.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.gridview, null);
viewHolder = new ViewHolder();
viewHolder.image1 = (ImageView) convertView.findViewById(R.id.image1);
viewHolder.title1 = (TextView) convertView.findViewById(R.id.title1);
viewHolder.discription1 = (TextView) convertView.findViewById(R.id.description1);
viewHolder.date1 = (TextView) convertView.findViewById(R.id.date1);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
Beanclass bean = (Beanclass) getItem(position);
viewHolder.image1.setImageResource(bean.getImage1());
viewHolder.title1.setText(bean.getTitle1());
viewHolder.discription1.setText(bean.getDate1());
viewHolder.date1.setText(bean.getDiscription1());
return convertView;
}
private class ViewHolder {
ImageView image1;
TextView title1;
TextView discription1;
TextView date1;
}
}
|
[
"[email protected]"
] | |
a37c5958336515af790572909451ce7dc5a6eb68
|
754f4ed889c8fbcdc5b4563b326213d00916e294
|
/EasyVrml/src/com/bxh/easyvrml/exception/InvalidNavigationTypeException.java
|
18fb5c5cc03732a0dd5335a3033924d4ea7bdd56
|
[] |
no_license
|
OLSUN/EasyVrml
|
1a9f7d6d5abcfe8ca645f48fdd8b95eea31366e9
|
28485e1ad94615bd10f03b4b14a2bebd90d589bb
|
refs/heads/master
| 2021-01-16T17:43:16.282877 | 2014-05-21T06:11:28 | 2014-05-21T06:11:28 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 167 |
java
|
package com.bxh.easyvrml.exception;
public class InvalidNavigationTypeException extends IllegalArgumentException
{
public InvalidNavigationTypeException()
{
}
}
|
[
"[email protected]"
] | |
ec19243213839ee23b13f66f49a3090c023b6a1e
|
dec24a2a9d64e18417e5a1474c2f26ed1ebd827f
|
/src/org/pentaho/plugins/asd/client/canvas/ActionNodeMovedEvent.java
|
97688557c67ce6bb196c62b867a6d5732aae9a0e
|
[] |
no_license
|
paulobds/pentaho-asd
|
bad795243553515ba24f9d016d41c0a84c9fcbd7
|
566d7d1c96f8bd0ecc109defdd1ad766d0faa265
|
refs/heads/master
| 2021-01-25T12:09:22.921260 | 2010-07-07T12:07:29 | 2010-07-07T12:07:29 | 34,016,284 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 588 |
java
|
package org.pentaho.plugins.asd.client.canvas;
public class ActionNodeMovedEvent {
private int x, y;
private ActionNode source;
/**
* @param toX the resulting center X coordinate
* @param toY the resulting center Y coordinate
* @param source the {@link ActionNode} that moved
*/
public ActionNodeMovedEvent(int toX, int toY, ActionNode source) {
super();
this.x = toX;
this.y = toY;
this.source = source;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public ActionNode getSource() {
return source;
}
}
|
[
"adphillips@48a11de6-3772-a3ac-1762-bc1b886dcebc"
] |
adphillips@48a11de6-3772-a3ac-1762-bc1b886dcebc
|
aee5f5eb928425a94f45f3368a8ab1d6cff804bc
|
5a7eed6752d830f9c33710273b67b2b1cc3f506e
|
/app/src/main/java/com/olfu/olfudisasterapp/builder/ToastBuilder.java
|
d4a20fb81a4e6f6e1cdfad6fde6d86434b9ab420
|
[] |
no_license
|
mnleano/OLFUDisasterManagement-AndroidStudio
|
305034a77f97094b68d8df87faa15a5368b49163
|
284ca41eb94d5b0806126453df210acce1f5f100
|
refs/heads/master
| 2021-06-23T23:16:54.517965 | 2017-09-05T03:27:58 | 2017-09-05T03:27:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 467 |
java
|
package com.olfu.olfudisasterapp.builder;
import android.content.Context;
import android.widget.Toast;
/**
* Created by mykelneds on 27/01/2017.
*/
public class ToastBuilder {
public static void createShortToast(Context ctx, String message) {
Toast.makeText(ctx, message, Toast.LENGTH_SHORT).show();
}
public static void createLongToast(Context ctx, String message) {
Toast.makeText(ctx, message, Toast.LENGTH_LONG).show();
}
}
|
[
"[email protected]"
] | |
ab15305f320d85fe1fb24e39c1c5e103e633fbc9
|
f159aeec3408fe36a9376c50ebb42a9174d89959
|
/171.Excel-Sheet-Column-Number.java
|
5127bdf261f920252ba5342753564825c104fce3
|
[
"MIT"
] |
permissive
|
mickey0524/leetcode
|
83b2d11ab226fad5da7198bb37eeedcd8d17635a
|
fc5b1744af7be93f4dd01d6ad58d2bd12f7ed33f
|
refs/heads/master
| 2023-09-04T00:01:13.138858 | 2023-08-27T07:43:53 | 2023-08-27T07:43:53 | 140,945,128 | 27 | 9 | null | null | null | null |
UTF-8
|
Java
| false | false | 536 |
java
|
// https://leetcode.com/problems/excel-sheet-column-number/
//
// algorithms
// Easy (52.25%)
// Total Accepted: 237,025
// Total Submissions: 453,594
// beats 100.0% of java submissions
class Solution {
public int titleToNumber(String s) {
char[] chs = s.toCharArray();
int length = chs.length;
int base = 1, res = 0;
for (int i = length - 1; i >= 0; i--) {
int bit = (chs[i] - 'A') + 1;
res += bit * base;
base *= 26;
}
return res;
}
}
|
[
"[email protected]"
] | |
4815733f0765537480fac228a56c3f7af8b5574d
|
7a3153dff734d4385d01be8e27135155d2c51876
|
/library/src/main/java/com/cavalry/androidlib/mvp/subscriber/listener/OnSubscriberNextListener.java
|
6b59ebaee9550364f5bb65a90ba8042ef03e83c1
|
[] |
no_license
|
geekbanana/AndroidLib
|
c31acc412cd65f95647fc09d518d9cbda909f136
|
9740bbed72c4dc90d24d064b3fd219c0d6b3b85d
|
refs/heads/master
| 2021-01-12T10:02:33.254301 | 2018-06-27T03:02:29 | 2018-06-27T03:02:29 | 76,341,709 | 5 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 175 |
java
|
package com.cavalry.androidlib.mvp.subscriber.listener;
/**
* @author Cavalry Lin
* @since 1.0.0
*/
public interface OnSubscriberNextListener<T> {
void onNext(T t);
}
|
[
"[email protected]"
] | |
c7d357e3c393337d902d493689f1d23921cc2eb4
|
7e944da7816e347c630a2cf575f9c7628816832a
|
/src/main/java/com/xceder/CTP/api/market/CThostFtdcExchangeExecOrderField.java
|
52a0ce6d418b18fe99ef37c0c3eee51df68885bd
|
[] |
no_license
|
Smiledemon/testload
|
f01cba7b3104775c8035c4ce3a015bce5c551414
|
c8e899d9cd6228b109b95068b1e1d9abb7020ea0
|
refs/heads/master
| 2021-04-26T22:55:47.302047 | 2018-03-05T09:43:23 | 2018-03-05T09:43:23 | 123,897,805 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,937 |
java
|
package com.xceder.ctp.api.market;
import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ann.Array;
import org.bridj.ann.Field;
import org.bridj.ann.Library;
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* <i>native declaration : ThostFtdcUserApiStruct.h:3139</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> or <a href="http://bridj.googlecode.com/">BridJ</a> .
*/
@Library("Thostmduserapi")
public class CThostFtdcExchangeExecOrderField extends StructObject {
/**
* \ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcVolumeType
*/
@Field(0)
public int Volume() {
return this.io.getIntField(this, 0);
}
/**
* \ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcVolumeType
*/
@Field(0)
public CThostFtdcExchangeExecOrderField Volume(int Volume) {
this.io.setIntField(this, 0, Volume);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcRequestIDType
*/
@Field(1)
public int RequestID() {
return this.io.getIntField(this, 1);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcRequestIDType
*/
@Field(1)
public CThostFtdcExchangeExecOrderField RequestID(int RequestID) {
this.io.setIntField(this, 1, RequestID);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcBusinessUnitType
*/
@Array({21})
@Field(2)
public Pointer<Byte > BusinessUnit() {
return this.io.getPointerField(this, 2);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcOffsetFlagType
*/
@Field(3)
public byte OffsetFlag() {
return this.io.getByteField(this, 3);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcOffsetFlagType
*/
@Field(3)
public CThostFtdcExchangeExecOrderField OffsetFlag(byte OffsetFlag) {
this.io.setByteField(this, 3, OffsetFlag);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcHedgeFlagType
*/
@Field(4)
public byte HedgeFlag() {
return this.io.getByteField(this, 4);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcHedgeFlagType
*/
@Field(4)
public CThostFtdcExchangeExecOrderField HedgeFlag(byte HedgeFlag) {
this.io.setByteField(this, 4, HedgeFlag);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcActionTypeType
*/
@Field(5)
public byte ActionType() {
return this.io.getByteField(this, 5);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcActionTypeType
*/
@Field(5)
public CThostFtdcExchangeExecOrderField ActionType(byte ActionType) {
this.io.setByteField(this, 5, ActionType);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcPosiDirectionType
*/
@Field(6)
public byte PosiDirection() {
return this.io.getByteField(this, 6);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcPosiDirectionType
*/
@Field(6)
public CThostFtdcExchangeExecOrderField PosiDirection(byte PosiDirection) {
this.io.setByteField(this, 6, PosiDirection);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd,\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecOrderPositionFlagType
*/
@Field(7)
public byte ReservePositionFlag() {
return this.io.getByteField(this, 7);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd,\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecOrderPositionFlagType
*/
@Field(7)
public CThostFtdcExchangeExecOrderField ReservePositionFlag(byte ReservePositionFlag) {
this.io.setByteField(this, 7, ReservePositionFlag);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecOrderCloseFlagType
*/
@Field(8)
public byte CloseFlag() {
return this.io.getByteField(this, 8);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecOrderCloseFlagType
*/
@Field(8)
public CThostFtdcExchangeExecOrderField CloseFlag(byte CloseFlag) {
this.io.setByteField(this, 8, CloseFlag);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcOrderLocalIDType
*/
@Array({13})
@Field(9)
public Pointer<Byte > ExecOrderLocalID() {
return this.io.getPointerField(this, 9);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExchangeIDType
*/
@Array({9})
@Field(10)
public Pointer<Byte > ExchangeID() {
return this.io.getPointerField(this, 10);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcParticipantIDType
*/
@Array({11})
@Field(11)
public Pointer<Byte > ParticipantID() {
return this.io.getPointerField(this, 11);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcClientIDType
*/
@Array({11})
@Field(12)
public Pointer<Byte > ClientID() {
return this.io.getPointerField(this, 12);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExchangeInstIDType
*/
@Array({31})
@Field(13)
public Pointer<Byte > ExchangeInstID() {
return this.io.getPointerField(this, 13);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcTraderIDType
*/
@Array({21})
@Field(14)
public Pointer<Byte > TraderID() {
return this.io.getPointerField(this, 14);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcInstallIDType
*/
@Field(15)
public int InstallID() {
return this.io.getIntField(this, 15);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcInstallIDType
*/
@Field(15)
public CThostFtdcExchangeExecOrderField InstallID(int InstallID) {
this.io.setIntField(this, 15, InstallID);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcOrderSubmitStatusType
*/
@Field(16)
public byte OrderSubmitStatus() {
return this.io.getByteField(this, 16);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcOrderSubmitStatusType
*/
@Field(16)
public CThostFtdcExchangeExecOrderField OrderSubmitStatus(byte OrderSubmitStatus) {
this.io.setByteField(this, 16, OrderSubmitStatus);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcSequenceNoType
*/
@Field(17)
public int NotifySequence() {
return this.io.getIntField(this, 17);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcSequenceNoType
*/
@Field(17)
public CThostFtdcExchangeExecOrderField NotifySequence(int NotifySequence) {
this.io.setIntField(this, 17, NotifySequence);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcDateType
*/
@Array({9})
@Field(18)
public Pointer<Byte > TradingDay() {
return this.io.getPointerField(this, 18);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcSettlementIDType
*/
@Field(19)
public int SettlementID() {
return this.io.getIntField(this, 19);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcSettlementIDType
*/
@Field(19)
public CThostFtdcExchangeExecOrderField SettlementID(int SettlementID) {
this.io.setIntField(this, 19, SettlementID);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecOrderSysIDType
*/
@Array({21})
@Field(20)
public Pointer<Byte > ExecOrderSysID() {
return this.io.getPointerField(this, 20);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcDateType
*/
@Array({9})
@Field(21)
public Pointer<Byte > InsertDate() {
return this.io.getPointerField(this, 21);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcTimeType
*/
@Array({9})
@Field(22)
public Pointer<Byte > InsertTime() {
return this.io.getPointerField(this, 22);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcTimeType
*/
@Array({9})
@Field(23)
public Pointer<Byte > CancelTime() {
return this.io.getPointerField(this, 23);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecResultType
*/
@Field(24)
public byte ExecResult() {
return this.io.getByteField(this, 24);
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcExecResultType
*/
@Field(24)
public CThostFtdcExchangeExecOrderField ExecResult(byte ExecResult) {
this.io.setByteField(this, 24, ExecResult);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcParticipantIDType
*/
@Array({11})
@Field(25)
public Pointer<Byte > ClearingPartID() {
return this.io.getPointerField(this, 25);
}
/**
* \ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcSequenceNoType
*/
@Field(26)
public int SequenceNo() {
return this.io.getIntField(this, 26);
}
/**
* \ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcSequenceNoType
*/
@Field(26)
public CThostFtdcExchangeExecOrderField SequenceNo(int SequenceNo) {
this.io.setIntField(this, 26, SequenceNo);
return this;
}
/**
* \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcBranchIDType
*/
@Array({9})
@Field(27)
public Pointer<Byte > BranchID() {
return this.io.getPointerField(this, 27);
}
/**
* IP\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcIPAddressType
*/
@Array({16})
@Field(28)
public Pointer<Byte > IPAddress() {
return this.io.getPointerField(this, 28);
}
/**
* Mac\ufffd\ufffd\ufffd\ufffd<br>
* C type : TThostFtdcMacAddressType
*/
@Array({21})
@Field(29)
public Pointer<Byte > MacAddress() {
return this.io.getPointerField(this, 29);
}
public CThostFtdcExchangeExecOrderField() {
super();
}
public CThostFtdcExchangeExecOrderField(Pointer pointer) {
super(pointer);
}
}
|
[
"[email protected]"
] | |
db55de2f37c05eed211697e1defc180df0979720
|
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
|
/services/gaussdbfornosql/src/main/java/com/huaweicloud/sdk/gaussdbfornosql/v3/model/SwitchSlowlogDesensitizationRequest.java
|
7b4fa72a8dc3544df3c2c64e7b46ef91609127f3
|
[
"Apache-2.0"
] |
permissive
|
huaweicloud/huaweicloud-sdk-java-v3
|
51b32a451fac321a0affe2176663fed8a9cd8042
|
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
|
refs/heads/master
| 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 |
NOASSERTION
| 2023-09-08T12:24:55 | 2020-05-08T02:27:00 |
Java
|
UTF-8
|
Java
| false | false | 3,001 |
java
|
package com.huaweicloud.sdk.gaussdbfornosql.v3.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;
/**
* Request Object
*/
public class SwitchSlowlogDesensitizationRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "instance_id")
private String instanceId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "body")
private SwitchSlowlogDesensitizationRequestBody body;
public SwitchSlowlogDesensitizationRequest withInstanceId(String instanceId) {
this.instanceId = instanceId;
return this;
}
/**
* 实例ID,可以调用5.3.3 查询实例列表和详情接口获取。如果未申请实例,可以调用5.3.1 创建实例接口创建。
* @return instanceId
*/
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public SwitchSlowlogDesensitizationRequest withBody(SwitchSlowlogDesensitizationRequestBody body) {
this.body = body;
return this;
}
public SwitchSlowlogDesensitizationRequest withBody(Consumer<SwitchSlowlogDesensitizationRequestBody> bodySetter) {
if (this.body == null) {
this.body = new SwitchSlowlogDesensitizationRequestBody();
bodySetter.accept(this.body);
}
return this;
}
/**
* Get body
* @return body
*/
public SwitchSlowlogDesensitizationRequestBody getBody() {
return body;
}
public void setBody(SwitchSlowlogDesensitizationRequestBody body) {
this.body = body;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
SwitchSlowlogDesensitizationRequest that = (SwitchSlowlogDesensitizationRequest) obj;
return Objects.equals(this.instanceId, that.instanceId) && Objects.equals(this.body, that.body);
}
@Override
public int hashCode() {
return Objects.hash(instanceId, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SwitchSlowlogDesensitizationRequest {\n");
sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"[email protected]"
] | |
d377761a1fb2b58cf93c4d49ba95be84441dd36e
|
af58debce137ae704eb573c2671b89d6aa44f3f9
|
/src/main/java/com/waterelephant/controller/article/GlobalFieldController.java
|
781d1d34bbf5f0675761df910acd1f50ef410fd4
|
[] |
no_license
|
String-name-ren/cms
|
fa547201c00b11f1cd0c77cc3e230645d19e031d
|
31a2d7377a72a62a2cfa26c8d3f90351731b4fb9
|
refs/heads/master
| 2020-05-16T02:56:32.045605 | 2019-04-22T07:41:47 | 2019-04-22T07:41:47 | 182,642,853 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,287 |
java
|
package com.waterelephant.controller.article;
import com.waterelephant.common.entity.dto.BjuiDto;
import com.waterelephant.entity.CmsGlobalField;
import com.waterelephant.service.CmsGlobalFieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* 描述
*
* @author: renpenghui
* @date: 2019-03-25 09:20
**/
@Controller
@RequestMapping("global/field")
public class GlobalFieldController {
@Autowired
private CmsGlobalFieldService globalFieldService;
@RequestMapping("get")
public String getGlobalField(ModelMap model){
model.put("globalField",globalFieldService.get());
return "article/global_field";
}
@RequestMapping("update")
@ResponseBody
public BjuiDto updateGlobalField(CmsGlobalField globalField){
globalFieldService.update(globalField);
BjuiDto bjuiDto = new BjuiDto();
bjuiDto.setStatusCode("200");
bjuiDto.setMessage("更新成功!");
bjuiDto.setTabid("global_field");
return bjuiDto;
}
}
|
[
"[email protected]"
] | |
06b5976e4c54f54e44ae0cd9606deb9f126a8976
|
5ae775a77a7cdd122be2d8c38ca4706a4c7be2f9
|
/app/src/main/java/com/superslug/myapplication3/app/Person.java
|
cc787c1c3fa1209881230a6a0350d28d728fac7a
|
[] |
no_license
|
iweaver/NSBE_Task
|
0523c9643c6f4718e823fc64c308123bce7210cd
|
2c74d71c2b536ee04ebfc6e0ccf7c7e87e634ee4
|
refs/heads/master
| 2020-05-24T12:33:42.238291 | 2014-03-29T16:41:32 | 2014-03-29T16:41:32 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 843 |
java
|
package com.superslug.myapplication3.app;
import java.util.ArrayList;
import java.util.List;
public class Person {
String name;
List<Task> tasks; // tasks they are working on
public Person (String name) {
this.tasks = new ArrayList<Task>();
this.name = name;
}
void addTask (Task t) {
boolean exists = false;
for (Task task: tasks) {
if (t.title.equals(task.title)) {
exists = true;
break;
}
}
// task doesn't exist
if (!exists) {
tasks.add(t);
}
}
void removeTask (Task t) {
boolean exists = false;
for (Task task: tasks) {
if (t.title.equals(task.title)) {
tasks.remove(task);
break;
}
}
}
}
|
[
"dvehar"
] |
dvehar
|
37dd3b939e9bd95da865be21f97ee7b5eeff6f01
|
5a011138f88e50366302202c4ca0d9ad4c0da2db
|
/ClasificadorDocumental-JSF/src/java/Controllers/RolController.java
|
f267e745d8d1be1e913e2d2844ae6e1330c1cb82
|
[] |
no_license
|
josejulianospina/clasificadorDocumental
|
f799ec2cd73cfbc6177c3f4904a02c3863b265c5
|
85322dcaffc2a69b3796cac2df8ee1b3ba1452a1
|
refs/heads/main
| 2023-08-26T23:46:15.571516 | 2021-10-22T19:05:13 | 2021-10-22T19:05:13 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,187 |
java
|
package Controllers;
import Models.Rol;
import Controllers.util.JsfUtil;
import Controllers.util.JsfUtil.PersistAction;
import Models.RolFacade;
import java.io.Serializable;
import java.util.List;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
@Named("rolController")
@SessionScoped
public class RolController implements Serializable {
@EJB
private Models.RolFacade ejbFacade;
private List<Rol> items = null;
private Rol selected;
public RolController() {
}
public Rol getSelected() {
return selected;
}
public void setSelected(Rol selected) {
this.selected = selected;
}
protected void setEmbeddableKeys() {
}
protected void initializeEmbeddableKey() {
}
private RolFacade getFacade() {
return ejbFacade;
}
public Rol prepareCreate() {
selected = new Rol();
initializeEmbeddableKey();
return selected;
}
public void create() {
persist(PersistAction.CREATE, ResourceBundle.getBundle("/Language/Bundle").getString("RolCreated"));
if (!JsfUtil.isValidationFailed()) {
items = null; // Invalidate list of items to trigger re-query.
}
}
public void update() {
persist(PersistAction.UPDATE, ResourceBundle.getBundle("/Language/Bundle").getString("RolUpdated"));
}
public void destroy() {
persist(PersistAction.DELETE, ResourceBundle.getBundle("/Language/Bundle").getString("RolDeleted"));
if (!JsfUtil.isValidationFailed()) {
selected = null; // Remove selection
items = null; // Invalidate list of items to trigger re-query.
}
}
public List<Rol> getItems() {
if (items == null) {
items = getFacade().findAll();
}
return items;
}
private void persist(PersistAction persistAction, String successMessage) {
if (selected != null) {
setEmbeddableKeys();
try {
if (persistAction != PersistAction.DELETE) {
getFacade().edit(selected);
} else {
getFacade().remove(selected);
}
JsfUtil.addSuccessMessage(successMessage);
} catch (EJBException ex) {
String msg = "";
Throwable cause = ex.getCause();
if (cause != null) {
msg = cause.getLocalizedMessage();
}
if (msg.length() > 0) {
JsfUtil.addErrorMessage(msg);
} else {
JsfUtil.addErrorMessage(ex, ResourceBundle.getBundle("/Language/Bundle").getString("PersistenceErrorOccured"));
}
} catch (Exception ex) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, ex);
JsfUtil.addErrorMessage(ex, ResourceBundle.getBundle("/Language/Bundle").getString("PersistenceErrorOccured"));
}
}
}
public Rol getRol(java.lang.Integer id) {
return getFacade().find(id);
}
public List<Rol> getItemsAvailableSelectMany() {
return getFacade().findAll();
}
public List<Rol> getItemsAvailableSelectOne() {
return getFacade().findAll();
}
@FacesConverter(forClass = Rol.class)
public static class RolControllerConverter implements Converter {
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0) {
return null;
}
RolController controller = (RolController) facesContext.getApplication().getELResolver().
getValue(facesContext.getELContext(), null, "rolController");
return controller.getRol(getKey(value));
}
java.lang.Integer getKey(String value) {
java.lang.Integer key;
key = Integer.valueOf(value);
return key;
}
String getStringKey(java.lang.Integer value) {
StringBuilder sb = new StringBuilder();
sb.append(value);
return sb.toString();
}
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null) {
return null;
}
if (object instanceof Rol) {
Rol o = (Rol) object;
return getStringKey(o.getId());
} else {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "object {0} is of type {1}; expected type: {2}", new Object[]{object, object.getClass().getName(), Rol.class.getName()});
return null;
}
}
}
}
|
[
"[email protected]"
] | |
b3f8e98b510724b6a9c29472ee13ad45e6668c0c
|
7d7f8df50a91921ad361c324e6b2fb3044b704a9
|
/src/Client/Client.java
|
7ba30dd355c93fc56ed4fef283ce42233b9d9ebd
|
[] |
no_license
|
fanliangandrew/test
|
2a023e18811ed310d11594882785e5403354f370
|
8aef32f35a58b1bd85baed06a32befafb8b674bd
|
refs/heads/master
| 2021-01-10T12:10:32.057748 | 2015-10-20T15:42:23 | 2015-10-20T15:42:23 | 44,613,629 | 0 | 0 | null | null | null | null |
GB18030
|
Java
| false | false | 1,219 |
java
|
import HelloApp.Hello;
import HelloApp.HelloHelper;
import org.omg.CORBA.ORB;
import org.omg.CosNaming.NamingContextExt;
import org.omg.CosNaming.NamingContextExtHelper;
public class HelloClient {
static Hello helloImpl;
public static void main(String args[]) {
try {
//创建一个ORB实例
ORB orb = ORB.init(args, null);
//获取根名称上下文
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
// Use NamingContextExt instead of NamingContext. This is
// part of the Interoperable naming Service.
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
//从命名上下文中获取接口实现对象
String name = "Hello";
helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
//调用接口对象的方法
System.out.println("Obtained a handle on server object: " + helloImpl);
System.out.println(helloImpl.sayHello());
helloImpl.shutdown();
} catch (Exception e) {
System.out.println("ERROR : " + e);
e.printStackTrace(System.out);
}
}
}
|
[
"[email protected]"
] | |
1eaeedbc3788eaab0e6e9e711b90452e38ac60b8
|
b1585f672f4bdfdf87d564497c7e0870a6f1d6e2
|
/AlgorithmsJava/src/fb/GenerateParenthesis.java
|
fd01817c6180db1d39185a80c1a71d2c5b35fa23
|
[] |
no_license
|
RahulChakraborty/Algorithms
|
6a80e50c1f3b80168eb2a199cabaf5afcc1b15e1
|
7be5843a9b66f545fdc79827063607561261b970
|
refs/heads/master
| 2022-11-12T20:43:19.338927 | 2020-07-10T15:58:02 | 2020-07-10T15:58:02 | 273,375,921 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 927 |
java
|
package fb;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
class GenerateParenthesis {
public static List<String> generateParenthesis(int n) {
List<String> ans = new ArrayList<>();
backtrack(ans, "", 0, 0, n);
return ans;
}
public static void backtrack(List<String> ans, String cur, int open, int close, int max){
if (cur.length() == max * 2) {
ans.add(cur);
return;
}
if (open < max)
backtrack(ans, cur+"(", open+1, close, max);
if (close < open)
backtrack(ans, cur+")", open, close+1, max);
System.out.println("Hello");
}
public static void main(String[] args) throws IOException {
List<String> strings = generateParenthesis(3);
System.out.print(strings);
}
}
|
[
"[email protected]"
] | |
2edca226ac09e996bc9adc2894131de57eca6de5
|
9669bffd7a8cfd350598d9fdf2e754f3520c0c96
|
/src/main/java/br/com/assertsistemas/htmlunit/bot/CaptureInfoTableBot.java
|
cd75bef3991a164c8ec452b4e49107a124bc5c22
|
[] |
no_license
|
magnolett/Java-Crawlers
|
903dad4a890041138fcfa9bb270c1f4a9d98d3c3
|
8d0d44d06cca87b19047bebb2eb997d51575c8bd
|
refs/heads/master
| 2021-01-01T19:44:28.217505 | 2017-08-16T20:50:34 | 2017-08-16T20:50:34 | 98,666,333 | 0 | 0 | null | null | null | null |
ISO-8859-1
|
Java
| false | false | 6,249 |
java
|
package br.com.assertsistemas.htmlunit.bot;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlTable;
import com.gargoylesoftware.htmlunit.html.HtmlTableRow;
import br.com.assertsistemas.entity.SimplesNacional;
public class CaptureInfoTableBot extends SettingBot {
private static final String PORTAL_TRANSPARENCIA_TABLE = "http://www.normaslegais.com.br/legislacao/simples-nacional-anexoII.html";
public List<SimplesNacional> tableManipulator() throws Exception {
final WebClient webClient = new WebClient(); // Instancia o webClient
final HtmlPage page = webClient.getPage(PORTAL_TRANSPARENCIA_TABLE); // Instancia uma page e, pegando o webClient, lê a URL "PORTAL_TRANSPARENCIA_TABLE"
final List<SimplesNacional> simplesNacionals = new ArrayList<>(); // Cria um ArrayList do objeto
page.getElementsByTagName("table").forEach(e -> { // Procura na página o elemento "table" para fazer a função "um para cada"
if ("MsoTableGrid".equals(e.getAttribute("class"))) { // Se "MsoTableGrid" for igual ao atributo "class" então..
final String demilitador = "Receita Bruta em 12 meses (em R$)";
final HtmlTable table = (HtmlTable) e; // Cria uma leitura de table
for (final HtmlTableRow row : table.getRows()) { // Cria e relaciona a leitura de linhas
//System.out.println("\n Linha encontrada! \n"); // Printa linhas
if(!row.getCell(0).asText().contains(demilitador)){
final SimplesNacional simplesNacional = new SimplesNacional(); // Instancia o objeto
int index = 0; // Contador para pegar a celular
String receitaBruta = row.getCell(index++).asText(); // Coluna 0
String aliquota = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 1
String irpj = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 2
String csll = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 3
String cofins = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 4
String pisPas = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 5
String cpp = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 6
String icms = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 7
String ipi = row.getCell(index++).asText().replaceAll("%", "").replaceAll("\\,", "."); // Coluna 8
simplesNacional.setAliquota(new BigDecimal(aliquota)); // Setando no objeto
simplesNacional.setIrpj(new BigDecimal(irpj)); // Setando no objeto
simplesNacional.setCsll(new BigDecimal(csll)); // Setando no objeto
simplesNacional.setCofins(new BigDecimal(cofins)); // Setando no objeto
simplesNacional.setPasep(new BigDecimal(pisPas)); // Setando no objeto
simplesNacional.setCpp(new BigDecimal(cpp)); // Setando no objeto
simplesNacional.setIcms(new BigDecimal(icms)); // Setando no objeto
simplesNacional.setIpi(new BigDecimal(ipi)); // Setando no objeto
final String[] receitasBrutas = receitaBruta.replaceAll("De", "").replaceAll("Até ", "").replaceAll("\\.", "").
replaceAll("\\,", ".").split(" a "); // Cria um array de string com replace all e o split do 'a' para separar os valores
if(receitasBrutas.length >= 2){ // Se esse array for maior ou igual a 2 então..
final Double valor01 = Double.valueOf(receitasBrutas[0]); // O numérico (Double) valor01 é igual ao array de string na posição [0]
final Double valor02 = Double.valueOf(receitasBrutas[1]); // O numérico (Double) valor02 é igual ao array da string na posição [1]
simplesNacional.setReceitaMinima(valor01);
simplesNacional.setReceitaMaxima(valor02);
//System.out.println(valor01); // Print do array convertido para double
//System.out.println(valor02); // Print do array convertido para double
} else { // Se array menor que 2 então..
final Double valor01 = Double.valueOf(receitasBrutas[0]); // Converte novamente
simplesNacional.setReceitaMaxima(valor01);
simplesNacional.setReceitaMinima(0.0);
}
simplesNacionals.add(simplesNacional);
}
}
simplesNacionals.forEach(s ->{System.out.println(s.toString());});
// final String cleanContentLine = row.getCell(0).asText().replaceAll(",", ".").replaceAll("%", "")
// .replaceAll("De", "").replaceAll("Até", "").replaceAll(" a ", "-");
//
// int i = 0;
// if (row.getCell(i).equals("180.000.00")) {
// i++;
// row.getCell(i);
// System.out.println(row.getCell(i));
// }
//
// System.out.println(row.asText());
//
// if(cleanContentLine.split("-").length > 2){
// String[] parts = cleanContentLine.split("-");
// String part1 = parts[0];
// String part2 = parts[1];
// System.out.println(part1);
// System.out.println(part2);
// System.out.println(cleanContentLine);
// System.out.println(row.getCell(0).asText().replaceAll(",", ".").replaceAll("%", "")
// .replaceAll("De", "").replaceAll("Até", "0-").replaceAll(" a ", "-"));
// }else {
// System.out.println(cleanContentLine);
// }
// final HtmlDivision htmlClass = (HtmlDivision) e;
// table.getRows().forEach(row -> {
// Integer cell = 1;
//
// });
//
// if (htmlClass.getElementsByTagName("p") != null && !htmlClass.getElementsByTagName("p").isEmpty()) {
// final String p = htmlClass.getElementsByTagName("p").get(0).asText();
//
// if (p.contains("span")) {
// System.out.println("Por class!");
// if (e.getAttribute("font-family").equals("Times New Roman")) {
//
// }
// }
//
// }
}
});
return simplesNacionals;
}
public static void main(String[] args) throws Exception {
new CaptureInfoTableBot().tableManipulator();
}
}
|
[
"[email protected]"
] | |
0866e846dda4b872094f8285ec662df5ebe8839c
|
b0ec91b43376b40b7b7c0c54b56cc14750d203d6
|
/DailyCodes/July/DailyCodes_29July/Codes/SwitchDemo10.java
|
aa1f2ffcb76de4a189744dd82737f92ff80f7816
|
[] |
no_license
|
himanshuparmar121/Sortedmap
|
a8c1e8df24cd4b85f4beacac926feb3bf9fd0c89
|
c55b9d1ed038311a679ca943f29054906b425458
|
refs/heads/master
| 2023-03-07T00:31:34.845702 | 2021-02-09T17:26:43 | 2021-02-09T17:26:43 | 281,379,432 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 512 |
java
|
class SwitchDemo {
public static void main(String[] args) {
boolean x = true;
boolean y = 10;
switch(x) {
}
}
}
/* Output
himanshu@himansh:~/java9/July/29july/Codes$ vim SwitchDemo10.java
himanshu@himansh:~/java9/July/29july/Codes$ javac SwitchDemo10.java
SwitchDemo10.java:6: error: incompatible types: int cannot be converted to boolean
boolean y = 10;
^
SwitchDemo10.java:8: error: incompatible types: boolean cannot be converted to int
switch(x) {
^
2 errors
*/
|
[
"[email protected]"
] | |
69a7007458ec01eeef1d3e7777ea9353fbc258b0
|
1d60b2f757ea3eff26b0ac7937fbdb3f5a19c1cd
|
/lock-redisson-spring-boot-starter-parent/lock-redisson-spring-boot-autoconfigure/src/main/java/com/itopener/lock/redisson/spring/boot/autoconfigure/LockType.java
|
b70c211e49338375c49d2968c5d8df1aa368d779
|
[] |
no_license
|
xie-summer/spring-boot-starters-parent
|
405ad6b8276c623a80bd0c34fe9e710836e7280b
|
cd85592b53e707d2277bdde911f73bf03d1a5e98
|
refs/heads/master
| 2023-07-23T09:38:05.802793 | 2019-12-02T09:36:50 | 2019-12-02T09:36:50 | 123,099,286 | 1 | 6 | null | 2023-09-12T13:55:30 | 2018-02-27T08:42:33 |
Java
|
UTF-8
|
Java
| false | false | 295 |
java
|
package com.itopener.lock.redisson.spring.boot.autoconfigure;
/**
* @author summer
* @date 2018年1月9日 上午11:25:59
* @version 1.0.0
*/
public enum LockType {
/** 可重入锁*/
REENTRANT_LOCK,
/** 公平锁*/
FAIR_LOCK,
/** 读锁*/
READ_LOCK,
/** 写锁*/
WRITE_LOCK;
}
|
[
"[email protected]"
] | |
5b1c576cca6c377470866aaf6a5e4aabf0a090f3
|
a16824ff4f99950854a634d40541539d36f75de0
|
/app/src/test/java/com/github/guignol/indrah/ResetHeadPartillyTest.java
|
8ba8615d2aa7a425b49a0cfa1ddb2f6aa9419a46
|
[
"MIT"
] |
permissive
|
guignol/indrah
|
60b2243c6622592453857757a76f5f95b6f231dc
|
0ec8f8e916c83a2811dff57969345314ee55dfb7
|
refs/heads/main
| 2023-02-27T17:30:53.523394 | 2021-02-01T12:16:43 | 2021-02-01T12:16:43 | 331,927,024 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 90 |
java
|
package com.github.guignol.indrah;
// TODO
public class ResetHeadPartillyTest {
}
|
[
"[email protected]"
] | |
ecca69fa6077e08260ee64b415212ca4f857fc6d
|
41f10d3d7b1d68d7c323928399550b827db28994
|
/src/com/rup/ignite/sample/CacheQueryExample.java
|
3aa5f22e9ca1aa58e99588ade04b5765180d16db
|
[] |
no_license
|
sandeepreddy502/SampleProjects
|
cd5464a2eb6ac1b366958c033cf7cd57ceac6307
|
a8be611a1d6b4f4e0c5a6868f6f100349147019d
|
refs/heads/master
| 2020-05-27T21:16:43.855606 | 2016-03-04T21:38:35 | 2016-03-04T21:38:35 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,571 |
java
|
package com.rup.ignite.sample;
import java.util.List;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.configuration.CacheConfiguration;
public class CacheQueryExample {
public static void main(String[] args) throws IgniteException {
Ignition.setClientMode(true);
try (Ignite ignite = Ignition.start("config/example-ignite.xml")) {
CacheConfiguration<Long, Organization> orgCfg = new CacheConfiguration<>("orgCache");
orgCfg.setCacheMode(CacheMode.REPLICATED);
orgCfg.setIndexedTypes(Long.class, Organization.class);
IgniteCache<Long, Organization> orgCache = ignite.getOrCreateCache(orgCfg);
CacheConfiguration<Long, Person> personCfg = new CacheConfiguration<>("personCache");
personCfg.setCacheMode(CacheMode.PARTITIONED);
personCfg.setIndexedTypes(Long.class, Person.class);
IgniteCache<Long, Person> personCache = ignite.getOrCreateCache(personCfg);
/*
Organization org1 = new Organization(101, "GridGain");
Organization org2 = new Organization(102, "Other");
orgCache.put(org1.getId(), org1);
orgCache.put(org2.getId(), org2);
Person p1 = new Person(1, org1.getId(), "Jon Doe", 2000);
Person p2 = new Person(2, org1.getId(), "Alex Smith", 6000);
Person p3 = new Person(3, org2.getId(), "Rob chan", 5000);
personCache.put(p1.getId(), p1);
personCache.put(p2.getId(), p2);
personCache.put(p3.getId(), p3);
*/
String sql1 = "select p.name from Person as p, \"orgCache\".Organization as org " +
"where p.orgId = org.Id and org.name = ?";
QueryCursor<List<?>> cursor1 = personCache.query(new SqlFieldsQuery(sql1).setArgs("GridGain"));
System.out.println(cursor1.getAll());
String sql2 = "select min(salary), max(salary), avg(salary) from Person as p, \"orgCache\".Organization as org " +
"where p.orgId = org.Id and org.name = ?";
QueryCursor<List<?>> cursor2 = personCache.query(new SqlFieldsQuery(sql2).setArgs("GridGain"));
System.out.println(cursor2.getAll());
String sql3 = "select org.name, count(p.id) from Person as p, \"orgCache\".Organization as org " +
"where p.orgId = org.Id group by org.name";
QueryCursor<List<?>> cursor3 = personCache.query(new SqlFieldsQuery(sql3));
System.out.println(cursor3.getAll());
}
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.