blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d8df652083e8a28a3fafab6862b5cc6f1e4ecb71 | c97122c76be77d5d673e6c79cf843ea54c986781 | /src/main/java/br/com/silrait/services/ClienteService.java | db428086edb4d62459b7583e3fb95993b7c4b92a | [] | no_license | silrait/estudoDeCasoModeloConceitual | 8fe32fc266262bb962b096c4bbb05da7872a4f0d | c5a4e7d6c175ae05ef3920cf115b0ab56749a78d | refs/heads/master | 2020-04-26T14:52:51.852129 | 2019-03-18T17:31:50 | 2019-03-18T17:31:50 | 173,629,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 660 | java | package br.com.silrait.services;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import br.com.silrait.domain.Cliente;
import br.com.silrait.repositories.ClienteRepository;
import br.com.silrait.services.exceptions.ObjectNotFoundException;
@Service
public class ClienteService {
@Autowired
private ClienteRepository repo;
public Cliente buscar(Integer id) {
Optional<Cliente> optional = repo.findById(id);
return optional.orElseThrow(() -> new ObjectNotFoundException("Objeto Não encontrado! Id:" + id
+ ", Tipo: " + Cliente.class.getName()));
}
}
| [
"thiarllisba@hotmail.com"
] | thiarllisba@hotmail.com |
ceda22179fccdefd554673436d3b27bb6b234d02 | 3be46d1b9609b71462dcf5f20fca63aafd53fb6c | /src/main/java/com/matafe/iptvlist/business/sec/control/TokenExpiredException.java | 296d81d133f341978c1f3f0b33e8453307511f1e | [] | no_license | matafe/iptvlist | 0bbee2a448fde71836451998aaf178e8071184ce | 214a042d762584d1dbf72e4d082cc2f7c0df88b4 | refs/heads/master | 2020-03-23T13:35:05.623592 | 2018-08-11T20:35:17 | 2018-08-11T20:35:17 | 141,626,129 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 520 | java | package com.matafe.iptvlist.business.sec.control;
import com.matafe.iptvlist.business.ApplicationException;
import com.matafe.iptvlist.business.Message;
/**
* Token Expired Exception
*
* @author matafe@gmail.com
*/
public class TokenExpiredException extends ApplicationException {
private static final long serialVersionUID = 1L;
public TokenExpiredException(String username, String time) {
super(new Message.Builder().text("The {0}'s token was expired {1} min ago").build(), username, time);
}
}
| [
"matafe@gmail.com"
] | matafe@gmail.com |
47a53df5cd426832dd04df3ce650c4b98894fe38 | 8b8aec6348c86e236aef6238bdd3f201cbdab198 | /src/main/java/com/empservices/EmployeeServices/Controller/TimeCardController.java | 4170136670520639df82ad0e0275d767a79df2f7 | [] | no_license | buom0701/EmployeeServices | 28b55072968cd91e5601137a1286e9e8e579898e | e49256525ae854179672aa92bbea7e2e6cb71fa1 | refs/heads/master | 2023-04-26T23:54:57.117846 | 2021-06-02T22:49:47 | 2021-06-02T22:49:47 | 359,220,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,397 | java | package com.empservices.EmployeeServices.Controller;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.empservices.EmployeeServices.Model.TimeCard;
import com.empservices.EmployeeServices.dao.TimeCarddao;
@RestController
public class TimeCardController {
@Autowired
TimeCarddao tcd;
@RequestMapping (value = "/timecard/add", method = RequestMethod.POST)
public String addtimecard(@RequestBody TimeCard tc) {
return tcd.addnew(tc);
}
@RequestMapping (value = "/timecard/showAll")
public List<TimeCard> showAll() {
return tcd.findAll();
}
@RequestMapping (value = "/timecard/showbyId")
public Optional<TimeCard> showbyId (@RequestBody TimeCard tc) {
return tcd.findbyId(tc);
}
@RequestMapping (value = "/timecard/update", method = RequestMethod.POST)
public String updatetimecard(@RequestBody TimeCard tc) {
return tcd.update(tc);
}
@RequestMapping (value = "/timecard/delete", method = RequestMethod.POST)
public String deletetimecard(@RequestBody TimeCard tc) {
return tcd.delete(tc);
}
}
| [
"buom0701@gmail.com"
] | buom0701@gmail.com |
45db9008137e198a4827908e20969da0e011ea96 | 341d1ff342dff20637fdb5bb3b85e795e4a7a6ff | /test/src/test/java/com/lusidity/test/RandomNames.java | 7f172992e5d6763564ed594b1a5edbff3be94dc2 | [] | no_license | venio-lusidity/soterium | 7d574c0504145769730bac3d41ab83b1f15e0a44 | 149eefa981e852e78931ba95fd156fa6099d1142 | refs/heads/master | 2022-07-11T14:12:09.988390 | 2019-06-03T17:32:21 | 2019-06-03T17:32:21 | 184,399,501 | 1 | 0 | null | 2022-06-29T17:21:00 | 2019-05-01T10:16:09 | Java | UTF-8 | Java | false | false | 5,392 | java | package com.lusidity.test;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.Collection;
public class RandomNames {
private static final Collection<String> NAMES = new ArrayList<>();
static {
RandomNames.NAMES.add("Sacheen Klingenschmitt");
RandomNames.NAMES.add("Bel Brandolini");
RandomNames.NAMES.add("Spark Calamia");
RandomNames.NAMES.add("Gyasi Perlac");
RandomNames.NAMES.add("Nutu Cupec");
RandomNames.NAMES.add("Oreka Schwamborn");
RandomNames.NAMES.add("Arttu Koyal");
RandomNames.NAMES.add("Tamisha Rostaing");
RandomNames.NAMES.add("Apphia Gorniok");
RandomNames.NAMES.add("Jonjon Kalda");
RandomNames.NAMES.add("Emanuel Chval");
RandomNames.NAMES.add("Bertel Methenitis");
RandomNames.NAMES.add("Guada Gong");
RandomNames.NAMES.add("Perkasa Kaethler");
RandomNames.NAMES.add("Sendi Oreyma");
RandomNames.NAMES.add("Keirnyn Nickless");
RandomNames.NAMES.add("Tifanny Magodo");
RandomNames.NAMES.add("Stanislao Rützler");
RandomNames.NAMES.add("Arciolinda Gantillon");
RandomNames.NAMES.add("Uladzimir Losa");
RandomNames.NAMES.add("Dragoslava Louie");
RandomNames.NAMES.add("Mozarteum Dittner");
RandomNames.NAMES.add("Abiya Lizde");
RandomNames.NAMES.add("Boril Ehrlicher");
RandomNames.NAMES.add("Francha Zreik");
RandomNames.NAMES.add("Hanny Enslow");
RandomNames.NAMES.add("Pharoah Perbatasari");
RandomNames.NAMES.add("Patrik Talero");
RandomNames.NAMES.add("Jizhong Oczlon");
RandomNames.NAMES.add("Perica Cury");
RandomNames.NAMES.add("Neftun Winopal");
RandomNames.NAMES.add("Giovannella Auba");
RandomNames.NAMES.add("Mitsurô Farhang");
RandomNames.NAMES.add("Leorra Chaitalli");
RandomNames.NAMES.add("Cobe Riddim");
RandomNames.NAMES.add("Nadar Mini");
RandomNames.NAMES.add("Ashelyn Melzer");
RandomNames.NAMES.add("Santico Brodsky");
RandomNames.NAMES.add("Menflorante Neubeck");
RandomNames.NAMES.add("Meny Ollinger");
RandomNames.NAMES.add("Damarques Hofele");
RandomNames.NAMES.add("Shebbac Iwaki");
RandomNames.NAMES.add("Josiara Isman");
RandomNames.NAMES.add("Sudarat Fourastie");
RandomNames.NAMES.add("Dóra Healey");
RandomNames.NAMES.add("Penda Tuomas");
RandomNames.NAMES.add("Gordan Mialaret");
RandomNames.NAMES.add("Jocko Pek");
RandomNames.NAMES.add("Viena Culligan");
RandomNames.NAMES.add("Syndra Gooley");
RandomNames.NAMES.add("Yasutoshi Coumare");
RandomNames.NAMES.add("Khokon Priestley");
RandomNames.NAMES.add("Tifni Deruvo");
RandomNames.NAMES.add("Shinzoku Wilck");
RandomNames.NAMES.add("Adera Eggimann");
RandomNames.NAMES.add("Efthymios Petra");
RandomNames.NAMES.add("Alicja Dashow");
RandomNames.NAMES.add("Latreese Ino");
RandomNames.NAMES.add("Fredrick Magedman");
RandomNames.NAMES.add("Ratheesh Pacífico");
RandomNames.NAMES.add("Tanzila Arverbro");
RandomNames.NAMES.add("Savina Baledón");
RandomNames.NAMES.add("Samay Deathe");
RandomNames.NAMES.add("Takamichi Gattanella");
RandomNames.NAMES.add("Jokko Ezzemour");
RandomNames.NAMES.add("Olcun Sahota");
RandomNames.NAMES.add("Preben Filipov");
RandomNames.NAMES.add("Gianfilippo Cruok");
RandomNames.NAMES.add("Chrystelle Sarnow");
RandomNames.NAMES.add("Ardis Fusselman");
RandomNames.NAMES.add("Birgir Bellantonio");
RandomNames.NAMES.add("Jeen Evidy");
RandomNames.NAMES.add("Ziga Buffham");
RandomNames.NAMES.add("Masuyo Calvan");
RandomNames.NAMES.add("Gurcharan Jeayes");
RandomNames.NAMES.add("Miljana Dupleasis");
RandomNames.NAMES.add("Curro Paploray");
RandomNames.NAMES.add("Kritapas Groleau");
RandomNames.NAMES.add("Elenio Schmelzer");
RandomNames.NAMES.add("Vesna Neider");
RandomNames.NAMES.add("Henric Hambourg");
RandomNames.NAMES.add("Indre Ensslen");
RandomNames.NAMES.add("Shû Sarabi");
RandomNames.NAMES.add("Yorgos Cinaroglu");
RandomNames.NAMES.add("Soula Michalojko");
RandomNames.NAMES.add("Dominque Babbidge");
RandomNames.NAMES.add("Sayumi Clodet");
RandomNames.NAMES.add("Xavy Pomianowski");
RandomNames.NAMES.add("Chisato Riggas");
RandomNames.NAMES.add("Ider Szameitat");
RandomNames.NAMES.add("Bibiane Sencio");
RandomNames.NAMES.add("Hassane Ohzora");
RandomNames.NAMES.add("Furiten Swietlik");
RandomNames.NAMES.add("Jasse Vringova");
RandomNames.NAMES.add("Asiyah Coombes");
RandomNames.NAMES.add("Lucrecia Siemaszkowa");
RandomNames.NAMES.add("Pomy Bertaccini");
RandomNames.NAMES.add("Keren Stuhlmacher");
RandomNames.NAMES.add("Kegham Sandschneider");
RandomNames.NAMES.add("Jaspal Seccafieno");
}
public static String at(int index){
return (index>=0 && index<RandomNames.NAMES.size()) ? (String)CollectionUtils.get(RandomNames.NAMES, index) : null;
}
}
| [
"rmk@ds-1.soterium-dev.com"
] | rmk@ds-1.soterium-dev.com |
f64d5060f79cb26f94418699f1d0bdc8ec0389d8 | 144044f9282c50253a75bd8d5c23f619ad38fdf8 | /biao-boss/src/main/java/com/thinkgem/jeesite/modules/market/web/Mk2PopularizeCommonMemberController.java | 55d9ecfdf9c3223eb163810969feda976f0e9b1c | [] | no_license | clickear/biao | ba645de06b4e92b0539b05404c061194669f4570 | af71fd055c4ff3aa0b767a0a8b4eb74328e00f6f | refs/heads/master | 2020-05-16T15:47:33.675136 | 2019-09-25T08:20:28 | 2019-09-25T08:20:28 | 183,143,104 | 0 | 0 | null | 2019-04-24T03:46:28 | 2019-04-24T03:46:28 | null | UTF-8 | Java | false | false | 9,311 | java | /**
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.market.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.beanvalidator.BeanValidators;
import com.thinkgem.jeesite.common.service.ServiceException;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.excel.ExportExcel;
import com.thinkgem.jeesite.common.utils.excel.ImportExcel;
import com.thinkgem.jeesite.modules.plat.entity.Coin;
import com.thinkgem.jeesite.modules.plat.service.CoinService;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.market.entity.Mk2PopularizeCommonMember;
import com.thinkgem.jeesite.modules.market.service.Mk2PopularizeCommonMemberService;
import java.math.BigDecimal;
import java.util.List;
/**
* 普通用户Controller
* @author dongfeng
* @version 2018-08-17
*/
@Controller
@RequestMapping(value = "${adminPath}/market/mk2PopularizeCommonMember")
public class Mk2PopularizeCommonMemberController extends BaseController {
@Autowired
private CoinService coinService;
@Autowired
private Mk2PopularizeCommonMemberService mk2PopularizeCommonMemberService;
@ModelAttribute
public Mk2PopularizeCommonMember get(@RequestParam(required=false) String id) {
Mk2PopularizeCommonMember entity = null;
if (StringUtils.isNotBlank(id)){
entity = mk2PopularizeCommonMemberService.get(id);
}
if (entity == null){
entity = new Mk2PopularizeCommonMember();
}
return entity;
}
@RequiresPermissions("market:mk2PopularizeCommonMember:view")
@RequestMapping(value = {"list", ""})
public String list(Mk2PopularizeCommonMember mk2PopularizeCommonMember, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<Mk2PopularizeCommonMember> page = mk2PopularizeCommonMemberService.findPage(new Page<Mk2PopularizeCommonMember>(request, response), mk2PopularizeCommonMember);
model.addAttribute("page", page);
return "modules/market/mk2PopularizeCommonMemberList";
}
@RequiresPermissions("market:mk2PopularizeCommonMember:view")
@RequestMapping(value = "form")
public String form(Mk2PopularizeCommonMember mk2PopularizeCommonMember, Model model) {
model.addAttribute(coinService.findList(new Coin()));
model.addAttribute("mk2PopularizeCommonMember", mk2PopularizeCommonMember);
return "modules/market/mk2PopularizeCommonMemberForm";
}
@RequiresPermissions("market:mk2PopularizeCommonMember:edit")
@RequestMapping(value = "save")
public String save(Mk2PopularizeCommonMember mk2PopularizeCommonMember, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, mk2PopularizeCommonMember)){
return form(mk2PopularizeCommonMember, model);
}
try {
mk2PopularizeCommonMemberService.save(mk2PopularizeCommonMember);
addMessage(model, "保存普通用户成功");
} catch (ServiceException e) {
logger.error("保存普通用户失败", e);
addMessage(model, e.getMessage());
} catch (Exception e) {
logger.error("保存普通用户失败", e);
addMessage(model, "参数错误,保存普通用户失败!");
}
return form(mk2PopularizeCommonMember, model);
}
@RequiresPermissions("market:mk2PopularizeCommonMember:edit")
@RequestMapping(value = "release")
public String release(BigDecimal manualReleaseVolume, String commonMemberId, Model model, RedirectAttributes redirectAttributes) {
Mk2PopularizeCommonMember mk2PopularizeCommonMember = null;
try {
mk2PopularizeCommonMemberService.release(manualReleaseVolume, commonMemberId);
addMessage(model, "手动释放数量" + manualReleaseVolume +"成功");
} catch (ServiceException e) {
logger.error("手动释放数量失败", e);
addMessage(model, "释放失败:" + e.getMessage());
} catch (Exception e) {
logger.error("手动释放数量失败", e);
addMessage(model, "手动释放数量失败!");
}
mk2PopularizeCommonMember = mk2PopularizeCommonMemberService.get(commonMemberId);
model.addAttribute("mk2PopularizeCommonMember", mk2PopularizeCommonMember);
return form(mk2PopularizeCommonMember, model);
}
@RequiresPermissions("market:mk2PopularizeCommonMember:edit")
@RequestMapping(value = "delete")
public String delete(Mk2PopularizeCommonMember mk2PopularizeCommonMember, RedirectAttributes redirectAttributes) {
mk2PopularizeCommonMemberService.delete(mk2PopularizeCommonMember);
addMessage(redirectAttributes, "删除普通用户成功");
return "redirect:"+Global.getAdminPath()+"/market/mk2PopularizeCommonMember/?repage";
}
/**
* 导入
* @param file
* @param redirectAttributes
* @return
*/
@RequiresPermissions("market:mk2PopularizeCommonMember:edit")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
if(Global.isDemoMode()){
addMessage(redirectAttributes, "演示模式,不允许操作!");
return "redirect:" + adminPath + "/market/mk2PopularizeCommonMember/list?repage";
}
try {
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
ImportExcel ei = new ImportExcel(file, 1, 0);
List<Mk2PopularizeCommonMember> list = ei.getDataList(Mk2PopularizeCommonMember.class);
for (Mk2PopularizeCommonMember member : list){
try{
mk2PopularizeCommonMemberService.saveImport(member);
successNum++;
}catch(ConstraintViolationException ex){
failureMsg.append("<br/>会员 "+ member.getRealName() +" 导入失败:");
List<String> messageList = BeanValidators.extractPropertyAndMessageAsList(ex, ": ");
for (String message : messageList){
failureMsg.append(message+"; ");
failureNum++;
}
}catch (Exception ex) {
failureMsg.append("<br/>会员 "+ member.getRealName() + " 导入失败:"+ex.getMessage());
}
}
if (failureNum>0){
failureMsg.insert(0, ",失败 "+failureNum+" 条用户,导入信息如下:");
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条用户"+failureMsg);
} catch (Exception e) {
addMessage(redirectAttributes, "导入用户失败!失败信息:"+e.getMessage());
}
return "redirect:" + adminPath + "/market/mk2PopularizeCommonMember/list?repage";
}
/**
* 下载导入用户数据模板
* @param response
* @param redirectAttributes
* @return
*/
@RequiresPermissions("market:mk2PopularizeCommonMember:view")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "会员币冻结模板.xlsx";
List<Mk2PopularizeCommonMember> list = Lists.newArrayList();
Mk2PopularizeCommonMember mk2PopularizeCommonMember = new Mk2PopularizeCommonMember();
mk2PopularizeCommonMember.setType("3");
mk2PopularizeCommonMember.setUserId("252200802112901121");
mk2PopularizeCommonMember.setMail("otc001@qq.com");
mk2PopularizeCommonMember.setMobile("13659885621");
mk2PopularizeCommonMember.setIdCard("556998965532653021");
mk2PopularizeCommonMember.setRealName("蜀");
mk2PopularizeCommonMember.setCoinId("e7ca5a25c7df4bcead954ade71aec7fe");
mk2PopularizeCommonMember.setCoinSymbol("UES");
mk2PopularizeCommonMember.setLockStatus("1");
mk2PopularizeCommonMember.setLockVolumeDouble(Double.valueOf("2000"));
mk2PopularizeCommonMember.setReleaseVolumeDouble(Double.valueOf("0"));
mk2PopularizeCommonMember.setReleaseBeginDateString("2019-03-05");
mk2PopularizeCommonMember.setReleaseCycle("1");
mk2PopularizeCommonMember.setReleaseCycleRatioDouble(Double.valueOf("0.1"));
mk2PopularizeCommonMember.setRemark("活动奖励");
list.add(mk2PopularizeCommonMember);
new ExportExcel("会员币冻结导入", Mk2PopularizeCommonMember.class, 2).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:" + adminPath + "/sys/user/list?repage";
}
} | [
"1072163919@qq.com"
] | 1072163919@qq.com |
9154bddec494000b2d1d5a9976db119b7049a01d | 31470083013cd0ad8f225091eca1d01832545c1d | /forum/src/main/java/br/com/alura/forum/Controller/dto/input/TopicSearchInputDto.java | 5b57592a59cd8f2c145fbcdba95df74a3d7c01d2 | [] | no_license | Luisrobbo/FJ-27---Spring-Framework | 7264a60bd18a3c17afd5916a4b64ee7f6d95d32c | ea77e33298b430d3728ab52996fff6e82368c727 | refs/heads/master | 2020-04-23T00:30:54.718292 | 2019-02-15T01:23:37 | 2019-02-15T01:23:37 | 170,782,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,197 | java | package br.com.alura.forum.controller.dto.input;
import java.util.ArrayList;
import javax.persistence.criteria.Predicate;
import org.springframework.data.jpa.domain.Specification;
import br.com.alura.forum.model.topic.domain.Topic;
import br.com.alura.forum.model.topic.domain.TopicStatus;
public class TopicSearchInputDto {
public TopicStatus status;
public String categoryName;
public TopicStatus getStatus() {
return status;
}
public String getCategoryName() {
return categoryName;
}
public void setStatus(TopicStatus status) {
this.status = status;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public Specification<Topic> build() {
return (root, criteriaQuery, criteriaBuilder) -> {
ArrayList<Predicate> predicates = new ArrayList<>();
if(this.status!=null) {
predicates.add(criteriaBuilder.equal(root.get("status"), status));
}
if(this.categoryName!=null) {
predicates.add(criteriaBuilder.equal(root
.get("course")
.get("subcategory")
.get("category")
.get("name"), this.categoryName));
}
return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
};
}
}
| [
"luis.robbo@yahoo.com"
] | luis.robbo@yahoo.com |
6faab819728dbf0a6aa1de33d855b43bb1ea4b72 | 63bebda99f7067abf12b4eb4b3661cdef052f214 | /hrms/src/main/java/com/example/hrms/Business/Concretes/JobSeekerCvManager.java | 7fe41859729684e3f4b31c4fcf6b4fa05fbeb7a4 | [] | no_license | CengizhanKorkmaz/HrmsBackend | e5ea02661b55edb66cac2da81e8fbd53430b372b | 57c1bd4f14ce37fdd34457bd459049c9c449d270 | refs/heads/master | 2023-07-29T23:39:39.144775 | 2021-09-16T15:43:11 | 2021-09-16T15:43:11 | 407,221,911 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | package com.example.hrms.Business.Concretes;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.hrms.Business.Abstracts.JobSeekerCvService;
import com.example.hrms.Core.Utilities.Results.DataResult;
import com.example.hrms.Core.Utilities.Results.Result;
import com.example.hrms.Core.Utilities.Results.SuccessDataResult;
import com.example.hrms.Core.Utilities.Results.SuccessResult;
import com.example.hrms.DataAccess.Abstracts.JobSeekerCvDao;
import com.example.hrms.Entities.Concretes.JobSeekerCv;
@Service
public class JobSeekerCvManager implements JobSeekerCvService {
@Autowired
private JobSeekerCvDao jobSeekerCvDao;
public JobSeekerCvManager(JobSeekerCvDao cvDao) {
this.jobSeekerCvDao = cvDao;
}
@Override
public Result add(JobSeekerCv jobSeekerCv) {
this.jobSeekerCvDao.save(jobSeekerCv);
return new SuccessResult("Data kaydedildi.");
}
@Override
public DataResult<List<JobSeekerCv>> getAll() {
return new SuccessDataResult<List<JobSeekerCv>>(this.jobSeekerCvDao.findAll(), "Data getirildi.");
}
}
| [
"Korkmaz@Korkmaz"
] | Korkmaz@Korkmaz |
c36c8e1cd72eda71e01333346d81ff9ecee176ab | dd33f45b8b98de8a74d7bc2909cd86781d6452dc | /Shape.java | 6f95a9ceaee3bb8ae5da17bdfb1295ec1797c0ae | [] | no_license | swetha-Full/BeginnerlevelRepo | 32f9a90e59bd9e98216e606103965b0c821da071 | df5c63cbe34297a975c8de5fe5673578c05a4f67 | refs/heads/master | 2021-04-30T15:13:05.907168 | 2018-02-12T10:31:58 | 2018-02-12T10:31:58 | 121,235,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,521 | java | package employee;
public abstract class Shape {
String color;
// these are abstract methods
abstract double area();
public abstract String toString();
// abstract class can have constructor
public Shape(String color) {
System.out.println("Shape constructor called");
this.color = color;
}
// this is a concrete method
public String getColor() {
return color;
}
}
class Circle extends Shape
{
double radius;
public Circle(String color,double radius) {
// calling Shape constructor
super(color);
System.out.println("Circle constructor called");
this.radius = radius;
}
@Override
double area() {
return Math.PI * Math.pow(radius, 2);
}
@Override
public String toString() {
return "Circle color is " + super.color +
"and area is : " + area();
}
}
class Rectangle extends Shape{
double length;
double width;
public Rectangle(String color,double length,double width) {
// calling Shape constructor
super(color);
System.out.println("Rectangle constructor called");
this.length = length;
this.width = width;
}
@Override
double area() {
return length*width;
}
@Override
public String toString() {
return "Rectangle color is " + super.color +
"and area is : " + area();
}
}
| [
"36259984+swetha-Full@users.noreply.github.com"
] | 36259984+swetha-Full@users.noreply.github.com |
0e6cb28836eaf474fc359d5360806550e5ee0864 | 4086432aa84150985fbbab0c9f7163973acfb546 | /coronalibrary/src/androidTest/java/com/blogspot/prajbtc/coronalibrary/ExampleInstrumentedTest.java | 6d32cda2213991bc8647530a000ebe703994725e | [
"MIT"
] | permissive | PAPPURAJ/CoronaLibrary | 52c289e38dfd87a5de74d064b367726d4dc44ba4 | 83777c4ca6c8e38a97e763a8b78c895007d586bf | refs/heads/master | 2022-07-26T18:11:35.578459 | 2020-05-24T12:04:07 | 2020-05-24T12:04:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package com.blogspot.prajbtc.coronalibrary;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.blogspot.prajbtc.coronalibrary.test", appContext.getPackageName());
}
}
| [
"pappuraj.duet@gmail.com"
] | pappuraj.duet@gmail.com |
a1f3b5ce0db128bb35fb892e536c419e69609935 | 165f5e822ee85500e55880f2d4e0c6523c200ba2 | /PDFboxDemo/src/test/SameRowColumnTest.java | 1fc91f9a81e321b18f2f6ff77c9657008e081d05 | [] | no_license | charleslzq/eclipse-workspace | 4c5cd816dc6e9736b771e8043bd2ddceca517224 | b58b65a7f6465e249fc13bd6404d7726f4f9ae8c | refs/heads/master | 2021-01-10T19:30:23.820545 | 2015-04-12T12:12:53 | 2015-04-12T12:12:53 | 32,664,440 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,975 | java | package test;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import src.tool.PDFRectangle;
public class SameRowColumnTest {
@Before
public void setUp() throws Exception {
}
@Test
public void testIsSameRow() {
//fail("Not yet implemented");
PDFRectangle p1 = new PDFRectangle(1,2,3,4);
PDFRectangle p2 = new PDFRectangle(1,9,3,4);
System.out.println("Same Row:"+p1.isSameRow(p2));
}
@Test
public void testIsSameColumn() {
//fail("Not yet implemented");
PDFRectangle p1 = new PDFRectangle(1,2,3,4);
PDFRectangle p2 = new PDFRectangle(1,9,3,4);
System.out.println("Same Column:"+p1.isSameColumn(p2));
}
@Test
public void testIsNextCellInTheSameRow() {
//fail("Not yet implemented");
PDFRectangle p1 = new PDFRectangle(373.55999755859375,427.67999267578125,45.0,16.08001708984375);
PDFRectangle p2 = new PDFRectangle(371.87999272346497,428.760009765625,94.56000971794128,10.199999809265137);
p1.print();
p2.print();
System.out.println(p2.isInThisArea(p1.getX(),p1.getY()));
System.out.println(p2.isInThisArea(p1.getX()+p1.getWidth(),p1.getY()+p1.getHeight()));
System.out.println(p1.getX()+p1.getWidth());
System.out.println(p2.getX()+p2.getWidth());
System.out.println(p1.getY()+p1.getHeight());
System.out.println(p2.getY()+p2.getHeight());
System.out.println(p1.intersect(p2));
System.out.println(p1.intersect(p2)/p1.getMeasure());
System.out.println(p1.intersect(p2)/p2.getMeasure());
System.out.println("Contain 2 in 1:"+p1.isInThisArea(p2));
System.out.println("Contain 1 in 2:"+p2.isInThisArea(p1));
System.out.println("Next Cell in the Same Row:"+p1.isNextCellInTheSameRow(p2));
}
@Test
public void testIsNextCellInTheSameColumn() {
//fail("Not yet implemented");
PDFRectangle p1 = new PDFRectangle(1,6,3,4);
PDFRectangle p2 = new PDFRectangle(1,2,3,4);
System.out.println("Next Cell in the Same Column:"+p1.isNextCellInTheSameColumn(p2));
}
}
| [
"charleslzq@gmail.com"
] | charleslzq@gmail.com |
0bcc89f46b5c954a54633dee979439308f09e09f | f128e45c681ec3aa08b7ff9cd974361573facae3 | /app/src/main/java/com/example/nh/recyclerview/MainActivity.java | c566e2a050ed1e7744635066165ad3f2ec819714 | [] | no_license | EngHwary/RecyclerView | d72141167dfb9f916036d6c2a5dc7c26e32e6a36 | e981f350c2718e2ff87f1dc28927624b16842d0c | refs/heads/master | 2020-05-18T20:49:54.109514 | 2019-05-02T20:05:53 | 2019-05-02T20:05:53 | 184,644,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,879 | java | package com.example.nh.recyclerview;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.Button;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
RecyclerView recyclerView;
ArrayList<Item> items;
String link = "https://www.simplifiedcoding.net/demos/marvel/";
URL url;
InputStream inputStream;
String result, result2;
HttpURLConnection urlConnection;
StringBuffer buffer2 = new StringBuffer();
String name;
String team;
String createdby;
String firstappearance;
String bio;
String image1;
StringBuffer buffer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = findViewById(R.id.recycle);
items = new ArrayList<>();
new MyTask().execute();
}
public class MyTask extends AsyncTask<String, Void, ArrayList<Item>> {
@Override
protected ArrayList<Item> doInBackground(String... strings) {
try {
url = new URL(link);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setConnectTimeout(15000);
urlConnection.setReadTimeout(15000);
urlConnection.setRequestMethod("GET");
inputStream = urlConnection.getInputStream();
int responseCode = urlConnection.getResponseCode();
int c = 0;
buffer = new StringBuffer();
if (responseCode == HttpURLConnection.HTTP_OK) {
while ((c = inputStream.read()) != -1) {
buffer.append((char) c);
}
}
result=buffer.toString();
JSONArray array = new JSONArray(result);
for (int i = 0; i < array.length(); i++) {
JSONObject object = array.getJSONObject(i);
String name = object.getString("name");
String team = object.getString("team");
String bio=object.getString("bio");
String imgUrl=object.getString("imageurl");
String author=object.getString("createdby");
String firstappearance=object.getString("firstappearance");
items.add(new Item(name, team,author, firstappearance,bio,imgUrl));
}
}
catch (Exception e) {
e.printStackTrace();
}
result=buffer.toString();
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return items;
}
@Override
protected void onPostExecute(ArrayList<Item> items) {
super.onPostExecute(items);
ItemsAdapter adapter = new ItemsAdapter(MainActivity.this, items);
recyclerView.setLayoutManager(new LinearLayoutManager(MainActivity.this));
recyclerView.addItemDecoration(new DividerItemDecoration(MainActivity.this, DividerItemDecoration.VERTICAL));
recyclerView.setAdapter(adapter);
}
}
} | [
"eng.hwary@gmail.com"
] | eng.hwary@gmail.com |
73c2a64f8483265413da7ac7f9f31204965bd6cd | 50bfe5d62051e800f1473581bdf083249df015e1 | /other_coursework/CSC8002/Java Rental Cars/car/AbstractCar.java | 9d2afd311ecced02343ebfc84cab11cbe7e756ea | [] | no_license | garycarr/android_dissertation | e3cff7ea2a45e933befe72b06622e0cca7762aea | cbd7ffc1d6879149c830b9e1d0ec001b61766721 | refs/heads/master | 2021-01-17T07:26:41.255891 | 2016-07-17T17:19:05 | 2016-07-17T17:19:05 | 27,143,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,454 | java | package uk.ac.ncl.CSC8002.b2052238.car;
import java.util.Calendar;
import java.util.Date;
/**
* Abstract class instantiates a new Object of subclass cars. Provides methods
* to modify those objects and implements InterfaceAbstractCar
*
* @author Gary Carr - Class creates a car
*
*/
public abstract class AbstractCar implements InterfaceAbstractCar {
private final int capacity;
private int currentFuel;
private final RegFactory reg;
private boolean carRented;
/**
* Constructor instantiates a new car of a subclass type. The total capacity
* of the car is stored, the constructor calls on RegFactory to create a new
* Registration and assigns it to the car, and sets the current fuel to
* match the capacity of the car.
*
* @param capacity
* The cars total tank capacity, passed by the subclasses
* @param typeofcar
*/
AbstractCar(int capacity) {
this.capacity = capacity;
this.currentFuel = capacity;
this.reg = RegFactory.getInstance();
}
/**
* Returns a new Small or Large Car dependent on the String entered by the
* user
*
* @param type
* String must be either "small" or "large" to match availabe
* cars. It is trimmed and changed to lower case in the method
* @return Returns a new car of the specified type
* @throws IllegalArgumentException
* If the user does not type "small" or "large"
* @throws NullPointerException
* If string is not typed
*/
public static AbstractCar getInstance(String type) {
String typeCar = type.toLowerCase().trim();
if (typeCar.equals("small")) {
return new SmallCar();
}
if (typeCar.equals("large")) {
return new LargeCar();
} else {
throw new IllegalArgumentException("Incorrect car type specificied");
}
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* getRegistrationNumber()
*/
public String getRegistrationNumber() {
return reg.toString();
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* getCapacity()
*/
public int getCapacity() {
return capacity;
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* getCurrentFuel()
*/
public int getCurrentFuel() {
return currentFuel;
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* isTankFull()
*/
public boolean isTankFull() {
return currentFuel == getCapacity();
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* isCarRented()
*/
public boolean isCarRented() {
return carRented;
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* changeCarRented()
*/
public void changeCarRented() {
if (isCarRented()) {
carRented = false;
} else {
carRented = true;
}
}
/*
* (non-Javadoc)
*
* @see
* uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#addPetrol
* (int)
*/
public int addPetrol(int petrol) {
if (!isCarRented() || petrol < 0)
return 0;
if (spaceInTank() <= petrol) {
final int space = spaceInTank();
currentFuel += spaceInTank();
return space;
}
else {
currentFuel += petrol;
return petrol;
}
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* spaceInTank()
*/
public int spaceInTank() {
return capacity - currentFuel;
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* fillTankForNewRental()
*/
public int fillTankForNewRental() {
if (carRented)
return -1;
currentFuel = capacity;
return 1;
}
/**
* Method tests if the car is in a state where it can be driven. The car
* must be rented out, the distance entered must be greater than zero, and
* petrol must be in the tank
*
* @param distance
* The distance of the journey, must be greater than zero
* @return Returns true if the car is rented, the fuel in the tank is
* greater than zero, and the distance is greater than zero
*/
boolean checkIfCanDrive(int distance) {
return isCarRented() && getCurrentFuel() > 0 && distance > 0;
}
/**
* Method subtracts the current fuel by the amount of fuel used in a journey
*
* @param totalConsumption
* The amount of fuel used in the drivers journey
*/
void amountOfFuelUsed(int consumption) {
currentFuel -= consumption;
}
/*
* (non-Javadoc)
*
* @see uk.ac.ncl.CSC8002.b2052238.rentalCarCoursework.InterfaceAbstractCar#
* isOldEnough(int, java.util.Date)
*/
public boolean isOldEnough(Date date, int noOfYears) {
final Date newDate = new Date(date.getTime());
final Calendar calDate = Calendar.getInstance();
calDate.setTime(newDate);
final Calendar now = Calendar.getInstance();
now.add(Calendar.YEAR, -noOfYears);
return calDate.compareTo(now) <= 0;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
public String toString() {
return reg.toString();
}
} | [
"gcarr@turnitin.com"
] | gcarr@turnitin.com |
0056425eb4e5a0e63291f753f586029c3ad8b1e7 | 01ebbc94cd4d2c63501c2ebd64b8f757ac4b9544 | /commons/gxqpt-commons/src/main/java/com/hengyunsoft/commons/adapter/Swagger2WebMvcConfigurerAdapter.java | 8e884146a34cf02b7bb8762b69d8a4ade381eaf2 | [] | no_license | KevinAnYuan/gxq | 60529e527eadbbe63a8ecbbad6aaa0dea5a61168 | 9b59f4e82597332a70576f43e3f365c41d5cfbee | refs/heads/main | 2023-01-04T19:35:18.615146 | 2020-10-27T06:24:37 | 2020-10-27T06:24:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,706 | java | package com.hengyunsoft.commons.adapter;
import com.hengyunsoft.commons.exception.core.ExceptionCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.builders.ResponseMessageBuilder;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.service.ResponseMessage;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import javax.servlet.ServletContext;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public abstract class Swagger2WebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
@Value("${auth.client.token-header:token}")
protected String tokenHeader;
@Value("${auth.client.user-id:_user_id}")
protected String userIdHeader;
@Autowired
protected ServletContext servletContext;
protected abstract Swagger2BaseProperties getSwagger2BaseProperties();
protected static class Swagger2BaseProperties {
private String contactName;
private String contactUrl;
private String contactEmail;
private String host = "";
private String basePath = "";
public String getContactName() {
return contactName;
}
public void setContactName(String contactName) {
this.contactName = contactName;
}
public String getContactUrl() {
return contactUrl;
}
public void setContactUrl(String contactUrl) {
this.contactUrl = contactUrl;
}
public String getContactEmail() {
return contactEmail;
}
public void setContactEmail(String contactEmail) {
this.contactEmail = contactEmail;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getBasePath() {
return basePath;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
}
/**
* 这个地方要重新注入一下资源文件,不然不会注入资源的,也没有注入requestHandlerMappping,相当于xml配置的
* <!--swagger资源配置-->
* <mvc:resources location="classpath:/META-INF/resources/" mapping="swagger-ui.html"/>
* <mvc:resources location="classpath:/META-INF/resources/webjars/" mapping="/webjars/**"/>
* 不知道为什么,这也是spring boot的一个缺点(菜鸟觉得的)
*
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars*")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
protected ArrayList<ResponseMessage> getResponseMessages() {
//自定义异常响应头信息
return new ArrayList<ResponseMessage>() {{
add(new ResponseMessageBuilder().code(0).message("成功").build());
add(new ResponseMessageBuilder().code(ExceptionCode.JWT_TOKEN_EXPIRED.getCode()).message(ExceptionCode.JWT_TOKEN_EXPIRED.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.JWT_SIGNATURE.getCode()).message(ExceptionCode.JWT_SIGNATURE.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.JWT_ILLEGAL_ARGUMENT.getCode()).message(ExceptionCode.JWT_ILLEGAL_ARGUMENT.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.JWT_PARSER_TOKEN_FAIL.getCode()).message(ExceptionCode.JWT_PARSER_TOKEN_FAIL.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.SYSTEM_TIMEOUT.getCode()).message(ExceptionCode.SYSTEM_TIMEOUT.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.SYSTEM_BUSY.getCode()).message(ExceptionCode.SYSTEM_BUSY.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.PARAM_EX.getCode()).message(ExceptionCode.PARAM_EX.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.SQL_EX.getCode()).message(ExceptionCode.SQL_EX.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.NULL_POINT_EX.getCode()).message(ExceptionCode.NULL_POINT_EX.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.ILLEGALA_RGUMENT_EX.getCode()).message(ExceptionCode.ILLEGALA_RGUMENT_EX.getMsg())
.responseModel(new ModelRef("Error")).build());
add(new ResponseMessageBuilder().code(ExceptionCode.MEDIA_TYPE_EX.getCode()).message(ExceptionCode.MEDIA_TYPE_EX.getMsg())
.responseModel(new ModelRef("Error")).build());
}};
}
protected List<Parameter> getParameters() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name(tokenHeader).description("token令牌")
.modelRef(new ModelRef("string")).parameterType("header").required(true).build();
pars.add(tokenPar.build());
return pars;
}
protected List<Parameter> getTokenUserParameters() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name(tokenHeader).description("token令牌")
.modelRef(new ModelRef("string")).parameterType("header").required(true).build();
pars.add(tokenPar.build());
// tokenPar = new ParameterBuilder();
// tokenPar.name(userIdHeader).description("用户id")
// .modelRef(new ModelRef("long")).parameterType("header").required(true).build();
// pars.add(tokenPar.build());
return pars;
}
protected ApiInfo getApiInfo(String title, String description) {
Contact contact = new Contact(getSwagger2BaseProperties().getContactName(),
getSwagger2BaseProperties().getContactUrl(),
getSwagger2BaseProperties().getContactEmail());
return new ApiInfoBuilder()
.title(title)
.description(description)
.contact(contact)
.version("1.0")
.build();
}
protected Docket getDocket(Map<String, String> map, String basePackage, String groupName, List<Parameter> pars, ArrayList<ResponseMessage> responseMessages) {
String title = map.get("title");
String description = map.get("description");
return new Docket(DocumentationType.SWAGGER_2)
.host(getSwagger2BaseProperties().getHost())
.apiInfo(getApiInfo(title, description))
.groupName(groupName) //内部API
.select()
.apis(RequestHandlerSelectors.basePackage(basePackage))
.paths(PathSelectors.any())
.build().globalOperationParameters(pars)
.globalResponseMessage(RequestMethod.GET, responseMessages)
.globalResponseMessage(RequestMethod.POST, responseMessages)
.globalResponseMessage(RequestMethod.PUT, responseMessages)
.globalResponseMessage(RequestMethod.DELETE, responseMessages);
}
protected Docket getDocket(Map<String, String> map, Class<? extends Annotation> clazz, String groupName,
List<Parameter> pars, ArrayList<ResponseMessage> responseMessages) {
String title = map.get("title");
String description = map.get("description");
return new Docket(DocumentationType.SWAGGER_2)
.host(getSwagger2BaseProperties().getHost())
.apiInfo(getApiInfo(title, description))
.groupName(groupName) //内部API
.select()
.apis(RequestHandlerSelectors.withClassAnnotation(clazz))
.paths(PathSelectors.any())
.build().globalOperationParameters(pars)
.globalResponseMessage(RequestMethod.GET, responseMessages)
.globalResponseMessage(RequestMethod.POST, responseMessages)
.globalResponseMessage(RequestMethod.PUT, responseMessages)
.globalResponseMessage(RequestMethod.DELETE, responseMessages);
}
}
| [
"470382668@qq.com"
] | 470382668@qq.com |
bfb330b188a7cffcd175c09148aafef837f6a9d2 | 6d48a4b4b3c958e200af84782db7920b546bc54d | /Android/AndroidPrograms/EXP4J_Liabrary_Useage/EXP4J_LiaBRARY/app/src/test/java/com/example/exp4j_liabrary/ExampleUnitTest.java | 49006987dfda7f7c5d29e34ec977337378640cde | [] | no_license | RehanDragon/Android_Dump | 3b38752392c287b10f51ce1856b13694df7b0cca | d3927053626c511957bbd696f0d12ca3936c1e84 | refs/heads/main | 2023-03-03T15:55:25.358903 | 2021-01-12T10:28:17 | 2021-01-12T10:28:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.example.exp4j_liabrary;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"33097646+ShadowArtist@users.noreply.github.com"
] | 33097646+ShadowArtist@users.noreply.github.com |
aa7ea405589bc4f3997cffdc458b790ff6835e2a | e8104a1239ef91bf100eaec8244029cb8ea68c0a | /HuongVtl/SpringSample/src/bean/HocKyFE.java | 864648383070d1f6ae96b4edb26970d37c5709dd | [] | no_license | FASTTRACKSE/FFSE1703.JavaWeb | 72b868b34a934bb9504a218011ccce668d278ad6 | b659082bf40c5d2128092ab3a3addd3caff770e9 | refs/heads/master | 2021-06-07T09:22:16.125557 | 2021-03-05T04:52:01 | 2021-03-05T04:52:01 | 137,868,312 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package bean;
public class HocKyFE implements HocKy{
private String tenHocKy;
public HocKyFE(String tenHocKy) {
this.tenHocKy = tenHocKy;
}
@Override
public String hocKi() {
// TODO Auto-generated method stub
return "hoc kỳ"+tenHocKy;
}
}
| [
"ffse1703001@st.fasttrack.edu.vn"
] | ffse1703001@st.fasttrack.edu.vn |
5ee035d8251a82d22de39fe882af554e6f103ead | 72e6553fdc551e1e5cc1738a0e9bf2ac139350b4 | /aigou_common_parent_4399/aigou_common_service_4399/src/main/java/cn/cqlyy/aigou/web/controller/RedisCacheController.java | a57d7c1930e4fea5ee01750ea5480aa84c4e8206 | [] | no_license | 1104317430/aigou | 501b838ce5534f7fa46da824cdc6d4d1bfa73587 | b20c175c6fa986e76265fde02a607e5116eb3978 | refs/heads/master | 2022-07-07T14:38:45.900196 | 2019-07-02T06:48:42 | 2019-07-02T06:48:42 | 192,842,911 | 0 | 0 | null | 2022-06-21T01:19:48 | 2019-06-20T03:34:42 | Java | UTF-8 | Java | false | false | 695 | java | package cn.cqlyy.aigou.web.controller;
import cn.cqlyy.aigou.RedisClient;
import cn.cqlyy.aigou.utils.RedisUtil;
import org.springframework.web.bind.annotation.*;
/**
* @Author: cqlyy
* @Date: 2019/06/25 17:44
* @Version 1.0
*/
@RestController
public class RedisCacheController implements RedisClient {
@RequestMapping(value = "/redis/set",method = RequestMethod.POST)
public void set(@RequestParam("key") String key, @RequestParam("value") String value){
RedisUtil.setData(key,value);
}
@RequestMapping(value = "/redis/get/{key}",method = RequestMethod.GET)
public String get(@PathVariable("key") String key){
return RedisUtil.getByKey(key);
}
}
| [
"zh@qq.com"
] | zh@qq.com |
b4edd168feaab94a14425d79456b45de88fabc35 | 9ce9d2bb732fa48a4a7665fd9fdbfea4d16c0923 | /final-project-kop1314-master/app/src/main/java/edu/illinois/finalproject/DataObject/FriendRef.java | e62bb1476eb570d1ca807bc603f5033ea9e6930f | [] | no_license | kop1314/personal_website | 24eab78b174f872d7430d28aac06f9360bb22e56 | a2312484fb621fc021fa0b191684a371cd1e91fa | refs/heads/main | 2023-06-23T03:59:56.312422 | 2021-07-21T22:18:29 | 2021-07-21T22:18:29 | 361,871,260 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,022 | java | package edu.illinois.finalproject.DataObject;
import android.os.Parcel;
import android.os.Parcelable;
public class FriendRef implements Parcelable {
private String friend_email;
private String chat_room_id;
public FriendRef(){
}
public FriendRef(String friend_email){
this.friend_email = friend_email;
this.chat_room_id = "";
}
public FriendRef(String friend_email, String chat_room_id){
this.friend_email = friend_email;
this.chat_room_id = chat_room_id;
}
/**
* get friend's email
* @return a string stores email of friend
*/
public String getFriend_email() {
return friend_email;
}
/**
* get id of chatroom
* @return a string stores id of a chatroom
*/
public String getChat_room_id() {
return chat_room_id;
}
/**
* set email of friend
* @param friend_email a string stores email of friend
*/
public void setFriend_email(String friend_email) {
this.friend_email = friend_email;
}
/**
* set id of chatroom where this friend chats
* @param chat_room_id a string stores id fo chatroom
*/
public void setChat_room_id(String chat_room_id) {
this.chat_room_id = chat_room_id;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.friend_email);
dest.writeString(this.chat_room_id);
}
protected FriendRef(Parcel in) {
this.friend_email = in.readString();
this.chat_room_id = in.readString();
}
public static final Parcelable.Creator<FriendRef> CREATOR = new Parcelable.Creator<FriendRef>() {
@Override
public FriendRef createFromParcel(Parcel source) {
return new FriendRef(source);
}
@Override
public FriendRef[] newArray(int size) {
return new FriendRef[size];
}
};
}
| [
"zy15@illinois.edu"
] | zy15@illinois.edu |
7376bddd3f128403de8e727f4400e96ec127df28 | a57a404b8f5f12c02942c0ecae2e691b893c6972 | /Values/IListValue.java | 7738203198490b50e56e9dd7d644757a18209891 | [] | no_license | Dooping/Interpreter-Compiler | aeecb3614a412fe7b557715d029e3031ab03ef2d | bf3a738008da2fa908ca4f58f2d06f45568288fe | refs/heads/master | 2020-04-24T11:57:46.658036 | 2019-02-21T20:59:27 | 2019-02-21T20:59:27 | 171,942,440 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 110 | java | package Values;
public interface IListValue extends IValue{
public IValue hd();
public IListValue tl();
}
| [
"davidgago@Davids-MBP.home"
] | davidgago@Davids-MBP.home |
9d7cd1f64196ccda37859432f8ce4193394c276b | 2dd908aa235e6a370cee81d0ef9d877ed11bba32 | /utils/src/main/java/com/common/example/ScreenModeDis_Ean_Act.java | 3518fbc46499274e640d96f0bc702a3e2e6b8129 | [] | no_license | androidroadies/CommonSDK | 0eb26e5890a5776d827a44d738beaf5dd442d074 | 253b876868f8882771cbc31b42edbf34ad194bf3 | refs/heads/master | 2016-09-05T12:08:19.559659 | 2015-02-02T10:44:14 | 2015-02-02T10:44:14 | 29,465,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,813 | java | package com.common.example;
/**
* @author Y@$!n
*
*/
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.common.utils.Common;
import com.common.utils.R;
public class ScreenModeDis_Ean_Act extends Activity {
Context mContext;
Button btnDisable, btnEnable;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.screen_mode_dis_ean_act);
mContext = ScreenModeDis_Ean_Act.this;
init();
}
private void init() {
// TODO Auto-generated method stub
btnDisable = (Button) findViewById(R.id.btnDisable);
btnEnable = (Button) findViewById(R.id.btnEnable);
btnDisable.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Common.disableSleepMode(mContext);
Common.showAlertDialog(mContext, getString(R.string.app_name), "Screen Sleep mode Disable.", false);
btnEnable.setEnabled(true);
btnDisable.setEnabled(false);
}
});
btnEnable.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Common.enableSleepMode();
Common.showAlertDialog(mContext, getString(R.string.app_name), "Screen Sleep mode Enable.", false);
btnEnable.setEnabled(false);
btnDisable.setEnabled(true);
}
});
}
}
| [
"mayankdudhatra01@gmail.com"
] | mayankdudhatra01@gmail.com |
d8f731f1e02d01796d224e0e7153ef8c186bc4ab | 40807318d9053570510011030020fc894ec1833c | /springBoot-api/src/main/java/com/agussuhardi/sample/api/sampleapi/SampleApiApplication.java | c75bde8a4b5aab53a4141c235d62d15c953b53d8 | [] | no_license | agussuhardii/simple-react-nantive-spring-boot-api | 416f424531af319d3d04136a22239a273e885bc0 | b77aab5489287f77e6fda0195a3ef4415ad6349c | refs/heads/master | 2020-04-29T11:00:03.225902 | 2019-03-17T10:28:30 | 2019-03-17T10:28:30 | 176,080,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.agussuhardi.sample.api.sampleapi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SampleApiApplication {
public static void main(String[] args) {
SpringApplication.run(SampleApiApplication.class, args);
}
}
| [
"agus.suhardii@gmail.com"
] | agus.suhardii@gmail.com |
08a75788fb7987c2a28e493fae8ea4b891477ac8 | 6e53ba89ef5ac861548e2ed8969fbc03fe3b5e04 | /vraptor-core/src/main/java/br/com/caelum/vraptor/others/GuavaServiceProducer.java | e7d34b297f2fa0f5d5cf8a2d98c4a61bf0eeaab4 | [
"Apache-2.0"
] | permissive | guilhermejccavalcanti/vraptor4 | b583209642e2b59baf6d04bfecfa5195f7e48bbf | f352b93daf97c781abdeb01f76e3b660f9bcce88 | refs/heads/master | 2020-03-25T05:46:53.350945 | 2019-02-11T04:45:10 | 2019-02-11T04:45:10 | 143,465,855 | 0 | 0 | null | 2018-08-03T19:31:48 | 2018-08-03T19:31:48 | null | UTF-8 | Java | false | false | 479 | java | package br.com.caelum.vraptor.others;
import static java.util.Collections.emptySet;
import java.util.Set;
import javax.enterprise.inject.Produces;
import com.google.common.util.concurrent.Service;
/**
* Class to avoid erros when using in CDI environments. See
* https://code.google.com/p/guava-libraries/issues/detail?id=1433 for more details.
*/
public class GuavaServiceProducer {
@Produces
public Set<Service> guavaCdiClashWorkaround() {
return emptySet();
}
}
| [
"otavio@otavio.com.br"
] | otavio@otavio.com.br |
ed81b00a42aa6b12f825284873553d3ee7676941 | 1ce95fea9ef6cd034f64c39bae0f00721131cee8 | /easeui/src/main/java/com/hyphenate/easeui/model/EaseDingMessageHelper.java | 71de631124f4467bebe55d20516d1f148cbd9873 | [] | no_license | JeffKuoCool/ZhiHuiDangJian | cb7b8486b7ccbbd1d7f9d4db57e6eed0dc2c2e55 | b0a97b7132d95f1cf9f277a34db115952f8fb7b0 | refs/heads/master | 2020-06-28T08:06:11.563796 | 2019-09-25T05:52:58 | 2019-09-25T05:52:58 | 200,182,141 | 0 | 1 | null | 2019-09-25T05:55:49 | 2019-08-02T06:54:02 | Java | UTF-8 | Java | false | false | 10,929 | java | package com.hyphenate.easeui.model;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.LruCache;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMCmdMessageBody;
import com.hyphenate.chat.EMConversation;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.exceptions.HyphenateException;
import com.hyphenate.util.EMLog;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* For ding-type message handle.
* <p>
* Created by zhangsong on 18-1-22.
*/
public class EaseDingMessageHelper {
/**
* To notify if a ding-type msg acked users updated.
*/
public interface IAckUserUpdateListener {
void onUpdate(List<String> list);
}
private static final String TAG = "EaseDingMessageHelper";
// Cache 5 conversations in memory at most.
static final int CACHE_SIZE_CONVERSATION = 5;
// Cache 10 ding-type messages every conversation at most.
static final int CACHE_SIZE_MESSAGE = 10;
static final String KEY_DING = "EMDingMessage";
static final String KEY_DING_ACK = "EMDingMessageAck";
static final String KEY_CONVERSATION_ID = "EMConversationID";
private static EaseDingMessageHelper instance;
// Map<msgId, IAckUserUpdateListener>
private Map<String, WeakReference<IAckUserUpdateListener>> listenerMap;
// LruCache<conversationId, LruCache<msgId, List<username>>>
private LruCache<String, LruCache<String, List<String>>> dataCache;
private SharedPreferences dataPrefs;
private SharedPreferences.Editor prefsEditor;
public static EaseDingMessageHelper get() {
if (instance == null) {
synchronized (EaseDingMessageHelper.class) {
if (instance == null) {
instance = new EaseDingMessageHelper(EMClient.getInstance().getContext());
}
}
}
return instance;
}
/**
* Set a ack-user update listener.
*
* @param msg
* @param listener Nullable, if this is null, will remove this msg's listener from listener map.
*/
public void setUserUpdateListener(EMMessage msg, @Nullable IAckUserUpdateListener listener) {
if (!validateMessage(msg)) {
return;
}
String key = msg.getMsgId();
if (listener == null) {
listenerMap.remove(key);
} else {
listenerMap.put(key, new WeakReference<>(listener));
}
}
/**
* Contains ding msg and ding-ack msg.
*
* @param message
* @return
*/
public boolean isDingMessage(EMMessage message) {
try {
return message.getBooleanAttribute(KEY_DING);
} catch (HyphenateException e) {
}
return false;
}
/**
* Create a ding-type message.
*/
public EMMessage createDingMessage(String to, String content) {
EMMessage message = EMMessage.createTxtSendMessage(content, to);
message.setAttribute(KEY_DING, true);
return message;
}
public void sendAckMessage(EMMessage message) {
if (!validateMessage(message)) {
return;
}
if (message.isAcked()) {
return;
}
// May a user login from multiple devices, so do not need to send the ack msg.
if (EMClient.getInstance().getCurrentUser().equalsIgnoreCase(message.getFrom())) {
return;
}
try {
// cmd-type message will not store in native database.
EMMessage msg = EMMessage.createSendMessage(EMMessage.Type.CMD);
msg.setTo(message.getFrom());
msg.setAttribute(KEY_CONVERSATION_ID, message.getTo());
msg.setAttribute(KEY_DING_ACK, true);
msg.addBody(new EMCmdMessageBody(message.getMsgId()));
EMClient.getInstance().chatManager().sendMessage(msg);
message.setAcked(true);
EMLog.i(TAG, "Send the group ack cmd-type message.");
} catch (Exception e) {
}
}
/**
* To handle ding-type ack msg.
* Need store native for reload when app restart.
*
* @param message The ding-type message.
*/
public void handleAckMessage(EMMessage message) {
if (message == null) {
return;
}
EMLog.i(TAG, "To handle ding-type ack msg: " + message.toString());
if (!isDingAckMessage(message)) {
return;
}
String conversationId = message.getStringAttribute(KEY_CONVERSATION_ID, "");
String msgId = ((EMCmdMessageBody) message.getBody()).action();
String username = message.getFrom();
// Get a message map.
LruCache<String, List<String>> msgCache = dataCache.get(conversationId);
if (msgCache == null) {
msgCache = createCache();
dataCache.put(conversationId, msgCache);
}
// Get the msg ack-user list.
List<String> userList = msgCache.get(msgId);
if (userList == null) {
userList = new ArrayList<>();
msgCache.put(msgId, userList);
}
if (!userList.contains(username)) {
userList.add(username);
}
// Notify ack-user list changed.
WeakReference<IAckUserUpdateListener> listenerRefs = listenerMap.get(msgId);
if (listenerRefs != null) {
listenerRefs.get().onUpdate(userList);
}
// Store in preferences.
String key = generateKey(conversationId, msgId);
Set<String> set = new HashSet<>();
set.addAll(userList);
prefsEditor.putStringSet(key, set).commit();
}
/**
* Get the acked users by the ding-type message.
*
* @param message
* @return Nullable, If this message is not a ding-type msg or does not exist this msg's ack-user data,
* this will return null.
*/
@Nullable
public List<String> getAckUsers(EMMessage message) {
if (!validateMessage(message)) {
return null;
}
String conversationId = message.getTo();
String msgId = message.getMsgId();
// Load from memory first.
LruCache<String, List<String>> msgCache = dataCache.get(conversationId);
if (msgCache == null) {
msgCache = createCache();
dataCache.put(conversationId, msgCache);
}
List<String> userList = msgCache.get(msgId);
if (userList != null) {// return memory data directly.
return userList;
}
// Need to load from preferences.
String key = generateKey(conversationId, msgId);
// No data for this message in preferences.
if (!dataPrefs.contains(key)) {
return null;
}
Set<String> set = dataPrefs.getStringSet(key, null);
if (set == null) {
return null;
}
userList = new ArrayList<>();
userList.addAll(set);
// Put this in memory.
msgCache.put(msgId, userList);
return userList;
}
/**
* Delete the native stored acked users if this message deleted.
*
* @param message
*/
public void delete(EMMessage message) {
if (!validateMessage(message)) {
return;
}
String conversationId = message.getTo();
String msgId = message.getMsgId();
// Remove the memory data.
LruCache<String, List<String>> msgCache = dataCache.get(conversationId);
if (msgCache != null) {
msgCache.remove(msgId);
}
// Delete the data in preferences.
String key = generateKey(conversationId, msgId);
if (dataPrefs.contains(key)) {
prefsEditor.remove(key).commit();
}
}
/**
* Delete the native stored acked users if this conversation deleted.
*
* @param conversation
*/
public void delete(EMConversation conversation) {
if (!conversation.isGroup()) {
return;
}
// Remove the memory data.
String conversationId = conversation.conversationId();
dataCache.remove(conversationId);
// Remove the preferences data.
String keyPrefix = generateKey(conversationId, "");
Map<String, ?> prefsMap = dataPrefs.getAll();
Set<String> keySet = prefsMap.keySet();
for (String key : keySet) {
if (key.startsWith(keyPrefix)) {
prefsEditor.remove(key);
}
}
prefsEditor.commit();
}
// Package level interface, for test.
Map<String, WeakReference<IAckUserUpdateListener>> getListenerMap() {
return listenerMap;
}
// Package level interface, for test.
LruCache<String, LruCache<String, List<String>>> getDataCache() {
return dataCache;
}
// Package level interface, for test.
SharedPreferences getDataPrefs() {
return dataPrefs;
}
EaseDingMessageHelper(Context context) {
dataCache = new LruCache<String, LruCache<String, List<String>>>(CACHE_SIZE_CONVERSATION) {
@Override
protected int sizeOf(String key, LruCache<String, List<String>> value) {
return 1;
}
};
listenerMap = new HashMap<>();
String NAME_PREFS = "group-ack-data-prefs";
dataPrefs = context.getSharedPreferences(NAME_PREFS, Context.MODE_PRIVATE);
prefsEditor = dataPrefs.edit();
}
/**
* Generate a key for SharedPreferences to store
*
* @param conversationId Group chat conversation id.
* @param originalMsgId The id of the ding-type message.
* @return
*/
String generateKey(@NonNull String conversationId, @NonNull String originalMsgId) {
return conversationId + "|" + originalMsgId;
}
private boolean validateMessage(EMMessage message) {
if (message == null) {
return false;
}
if (message.getChatType() != EMMessage.ChatType.GroupChat) {
return false;
}
if (!isDingMessage(message)) {
return false;
}
return true;
}
private boolean isDingAckMessage(EMMessage message) {
try {
return message.getBooleanAttribute(KEY_DING_ACK);
} catch (HyphenateException e) {
}
return false;
}
private LruCache<String, List<String>> createCache() {
return new LruCache<String, List<String>>(CACHE_SIZE_MESSAGE) {
@Override
protected int sizeOf(String key, List<String> value) {
return 1;
}
};
}
}
| [
"gj@fengshang2002.com"
] | gj@fengshang2002.com |
ef0ed1bb8baca74a64ac96a6a85a86f29098f9a0 | 5d08a87df0d8cbd4ced138ea6381ba5fbb38396c | /Tesseract-J2ME/src/tessearctntest/EventDetails.java | 331dc7e720e17a3ef5b85d58d3eff20240f25418 | [] | no_license | MedElfadhelELHACHEMI/PIDEV | 7e83ca4fe1be91be59464b7800fba748c3efb2a2 | 0e6e96bc23d22279ec80b93a4311c676e194a424 | refs/heads/master | 2021-05-31T16:20:21.673486 | 2016-05-22T15:22:17 | 2016-05-22T15:22:17 | 52,443,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,280 | java | package tessearctntest;
import com.sun.lwuit.Label;
import java.io.IOException;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.StringItem;
/**
*
* @author Noor
*/
class EventDetails extends Form {
Command join;
ImageItem imgItem;
StringItem details=null;
public EventDetails(String title, Evenement event) throws IOException {
super(title);
join=new Command("Join",Command.OK, 0);
addCommand(join);
imgItem=new ImageItem("", Image.createImage(event.getAffiche()), 0, title);
append(imgItem);
details=new StringItem("", " Event id = " + event.getIdEvenement() +
" \n Event Name : " + event.getNom() +
"\n Description : " + event.getDescription() +
"\n Takes place at " + event.getDateEvenement() +
"\n Remaining places " +event.getNbrMax());
//get host name (org) + fix picture + add join cmd
// rod l'image URI
append(details);
}
}
| [
"haikal.magrahi@esprit.tn"
] | haikal.magrahi@esprit.tn |
1ec56cc25fe1f698ee6b890dd1991419ffae4c40 | 4b75ee370a8d13a0d679752ca8216b22e5f4619d | /src/jvntextpro/util/StringUtils.java | 94eb412201b62b879f0d3099b9a53debfba3bf70 | [] | no_license | thanhphi0127/JVnTextPro | 32669cd1ee3f3e679c038e699984bfef5ba9a829 | 3d813a5f3e03a07a337623ae0f80c86aed3367d1 | refs/heads/master | 2021-01-10T03:00:26.877764 | 2016-03-29T10:27:32 | 2016-03-29T10:27:32 | 54,967,180 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,549 | java | /*
Copyright (C) 2010 by
*
* Cam-Tu Nguyen
* ncamtu@ecei.tohoku.ac.jp or ncamtu@gmail.com
*
* Xuan-Hieu Phan
* pxhieu@gmail.com
*
* College of Technology, Vietnamese University, Hanoi
* Graduate School of Information Sciences, Tohoku University
*
* JVnTextPro-v.2.0 is a free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* JVnTextPro-v.2.0 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with JVnTextPro-v.2.0); if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
package jvntextpro.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Set;
import java.util.Vector;
// TODO: Auto-generated Javadoc
/**
* The Class StringUtils.
*/
public class StringUtils {
/**
* Find the first occurrence .
*
* @param container the string on which we search
* @param chars the string which we search for the occurrence
* @param begin the start position to search from
* @return the position where chars first occur in the container
*/
public static int findFirstOf (String container, String chars, int begin){
int minIdx = -1;
for (int i = 0; i < chars.length() && i >= 0; ++i){
int idx = container.indexOf(chars.charAt(i), begin);
if ( (idx < minIdx && idx != -1) || minIdx == -1){
minIdx = idx;
}
}
return minIdx;
}
/**
* Find the last occurrence.
*
* @param container the string on which we search
* @param charSeq the string which we search for the occurrence
* @param begin the start position in container to search from
* @return the position where charSeq occurs for the last time in container (from right to left).
*/
public static int findLastOf (String container, String charSeq, int begin){
//find the last occurrence of one of characters in charSeq from begin backward
for (int i = begin; i < container.length() && i >= 0; --i){
if (charSeq.contains("" + container.charAt(i)))
return i;
}
return -1;
}
/**
* Find the first occurrence of characters not in the charSeq from begin
*
* @param container the container
* @param chars the chars
* @param begin the begin
* @return the int
*/
public static int findFirstNotOf(String container, String chars, int begin){
//find the first occurrence of characters not in the charSeq from begin forward
for (int i = begin; i < container.length() && i >=0; ++i)
if (!chars.contains("" + container.charAt(i)))
return i;
return -1;
}
/**
* Find last not of.
*
* @param container the container
* @param charSeq the char seq
* @param end the end
* @return the int
*/
public static int findLastNotOf(String container, String charSeq, int end){
for (int i = end; i < container.length() && i >= 0; --i){
if (!charSeq.contains("" + container.charAt(i)))
return i;
}
return -1;
}
//Syllable Features
/**
* Contain number.
*
* @param str the str
* @return true, if successful
*/
public static boolean containNumber(String str) {
for (int i = 0; i < str.length(); i++) {
if (Character.isDigit(str.charAt(i))) {
return true;
}
}
return false;
}
/**
* Contain letter.
*
* @param str the str
* @return true, if successful
*/
public static boolean containLetter(String str) {
for (int i = 0; i < str.length(); i++) {
if (Character.isLetter(str.charAt(i))) {
return true;
}
}
return false;
}
/**
* Contain letter and digit.
*
* @param str the string
* @return true, if str consists both letters & digits
*/
public static boolean containLetterAndDigit(String str) {
return (containLetter(str) && containNumber(str));
}
/**
* Checks if is all number.
*
* @param str the string
* @return true, if str consists all numbers
*/
public static boolean isAllNumber(String str) {
boolean hasNumber = false;
for (int i = 0; i < str.length(); i++) {
if (!(Character.isDigit(str.charAt(i)) ||
str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%'
|| str.charAt(i) == '$' || str.charAt(i) == '_')) {
return false;
}
else if (Character.isDigit(str.charAt(i)))
hasNumber = true;
}
if (hasNumber == true)
return true;
else return false;
}
/**
* Checks if is first cap.
*
* @param str the string
* @return true, if str has the first character capitalized
*/
public static boolean isFirstCap(String str) {
if (isAllCap(str)) return false;
if (str.length() > 0 && Character.isLetter(str.charAt(0)) &&
Character.isUpperCase(str.charAt(0))) {
return true;
}
return false;
}
/**
* Checks if is all capitalized.
*
* @param str the string
* @return true, if is all characters capitalized
*/
public static boolean isAllCap(String str) {
if (str.length() <= 0) {
return false;
}
for (int i = 0; i < str.length(); i++) {
if (!Character.isLetter(str.charAt(i)) ||
!Character.isUpperCase(str.charAt(i))) {
return false;
}
}
return true;
}
/**
* Checks if is not first capitalized.
*
* @param str the str
* @return true, if is not first capitalized
*/
public static boolean isNotFirstCap(String str) {
return !isFirstCap(str);
}
/**
* Ends with sign.
*
* @param str the string token to test
* @return true, if this token is ended with punctuation (such as ?:\;)
*/
public static boolean endsWithPunc(String str) {
if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!") ||
str.endsWith(",") || str.endsWith(":") || str.endsWith("\"") ||
str.endsWith("'") || str.endsWith("''") || str.endsWith(";")) {
return true;
}
return false;
}
/**
* Ends with stop.
*
* @param str the string
* @return true, if this token is ended with stop '.'
*/
public static boolean endsWithStop(String str) {
if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!")) {
return true;
}
return false;
}
/**
* Count stops.
*
* @param str string
* @return how many stops '.' str contains
*/
public static int countStops(String str) {
int count = 0;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!') {
count++;
}
}
return count;
}
/**
* Count signs.
*
* @param str string
* @return the number of punctuation marks in this token
*/
public static int countPuncs(String str) {
int count = 0;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!' ||
str.charAt(i) == ',' || str.charAt(i) == ':' || str.charAt(i) == ';') {
count++;
}
}
return count;
}
/**
* Checks if is stop.
*
* @param str string
* @return true, if the input is the stop character '.'
*/
public static boolean isStop(String str) {
if (str.compareTo(".") == 0) {
return true;
}
if (str.compareTo("?") == 0) {
return true;
}
if (str.compareTo("!") == 0) {
return true;
}
return false;
}
/**
* Checks if is punctuation.
*
* @param str the string token to test
* @return true, if the input is one of the punctuation marks
*/
public static boolean isPunc(String str) {
if (str == null) return false;
str = str.trim();
for (int i = 0; i < str.length(); ++i){
char c = str.charAt(i);
if (Character.isDigit(c) || Character.isLetter(c)){
return false;
}
}
return true;
}
/**
* Join the <tt>String</tt> representations of an array of objects, with the specified
* separator.
*
* @param objects the objects
* @param sep the sep
* @return newly created .
*/
public static String join( Object[] objects, char sep )
{
if( objects.length == 0 )
{
return "";
}
StringBuffer buffer = new StringBuffer( objects[0].toString() );
for (int i = 1; i < objects.length; i++)
{
buffer.append( sep );
buffer.append( objects[i].toString() );
}
return buffer.toString();
}
/**
* Join the <tt>String</tt> representations of a collection of objects, with the specified
* separator.
*
* @param col the col
* @param sep the sep
* @return newly created .
*/
public static String join( Collection col, char sep )
{
if( col.isEmpty() )
{
return "";
}
StringBuffer buffer = new StringBuffer();
boolean first = true;
for (Object o : col)
{
if( first )
{
first = false;
}
else
{
buffer.append( sep );
}
buffer.append( o.toString() );
}
return buffer.toString();
}
// ---------------------------------------------------------
// String Manipulation
// ---------------------------------------------------------
/**
* Capitalises the first letter of a given string.
*
* @param s the input string
*
* @return the capitalized string
*/
public static String capitalizeWord( String s )
{
// validate
if( (s == null) || (s.length() == 0) )
{
return s;
}
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
}
/**
* Encloses the specified <tt>String</tt> in single quotes.
*
* @param s the input string
*
* @return the quoted String
*/
public static String quote( String s )
{
return '\'' + s + '\'';
}
/**
* Encloses the specified <tt>String</tt> in double quotes.
*
* @param s the input string
*
* @return the quoted String
*/
public static String doubleQuote( String s )
{
return '"' + s + '"';
}
/**
* Pad the specified <tt>String</tt> with spaces on the right-hand side.
*
* @param s String to add spaces
* @param length Desired length of string after padding
*
* @return padded string.
*/
public static String pad( String s, int length )
{
// Trim if longer...
if( s.length() > length )
{
return s.substring( 0, length );
}
StringBuffer buffer = new StringBuffer(s);
int spaces = length - s.length();
while( spaces-- > 0 )
{
buffer.append(' ');
}
return buffer.toString();
}
/**
* Sorts the characters in the specified string.
*
* @param s input String to sort.
*
* @return output String, containing sorted characters.
*/
public static String sort( String s )
{
char[] chars = s.toCharArray();
Arrays.sort( chars );
return new String( chars );
}
// ---------------------------------------------------------
// String Matching
// ---------------------------------------------------------
/**
* Checks whether a String is whitespace, empty or null.
*
* @param s the <tt>String</tt> to analyze.
* @return otherwise.
*/
public static boolean isBlank( String s )
{
if (s == null)
{
return true;
}
int sLen = s.length();
for (int i = 0; i < sLen; i++)
{
if (!Character.isWhitespace(s.charAt(i)))
{
return false;
}
}
return true;
}
/**
* Checks whether a <tt>String</tt> is composed entirely of whitespace characters.
*
* @param s the <tt>String</tt> to analyze.
* @return otherwise.
*/
public static boolean isWhitespace( String s )
{
if( s == null )
{
return false;
}
int sLen = s.length();
for (int i = 0; i < sLen; i++)
{
if (!Character.isWhitespace(s.charAt(i)))
{
return false;
}
}
return true;
}
// ---------------------------------------------------------
// Search-related
// ---------------------------------------------------------
/**
* Counts the number of occurrences of a character in the specified <tt>String</tt>.
*
* @param s the <tt>String</tt> to analyze.
* @param c the character to search for.
*
* @return number of occurrences found.
*/
public static int countOccurrences( String s, char c )
{
int count = 0;
int index = 0;
while( true )
{
index = s.indexOf( c, index );
if( index == -1 )
{
break;
}
count++;
}
return count;
}
/**
* Indicates whether the specified array of <tt>String</tt>s contains
* a given <tt>String</tt>.
*
* @param array the array
* @param s the s
* @return otherwise.
*/
public static boolean isContained( String[] array, String s )
{
for (String string : array)
{
if( string.equals( s ) )
{
return true;
}
}
return false;
}
// ---------------------------------------------------------
// Array/Collection conversion
// ---------------------------------------------------------
/**
* Returns the index of the first occurrence of the specified <tt>String</tt>
* in an array of <tt>String</tt>s.
*
* @param array array of <tt>String</tt>s to search.
* @param s the <tt>String</tt> to search for.
*
* @return the index of the first occurrence of the argument in this list,
* or -1 if the string is not found.
*/
public static int indexOf( String[] array, String s )
{
for (int index = 0; index < array.length; index++)
{
if( s.equals( array[index] ) )
{
return index;
}
}
return -1;
}
/**
* Creates a new <tt>ArrayList</tt> collection from the specified array of <tt>String</tt>s.
*
* @param array the array
* @return newly created .
*/
public static ArrayList<String> toList( String[] array )
{
if( array == null )
{
return new ArrayList<String>( 0 );
}
ArrayList<String> list = new ArrayList<String>( array.length );
for (String s : array)
{
list.add( s );
}
return list;
}
/**
* Creates a new <tt>Vector</tt> collection from the specified array of <tt>String</tt>s.
*
* @param array the array
* @return newly created .
*/
public static Vector<String> toVector( String[] array )
{
if( array == null )
{
return new Vector<String>( 0 );
}
Vector<String> v = new Vector<String>( array.length );
v.copyInto( array );
return v;
}
/**
* Creates a new <tt>ArrayList</tt> collection from the specified <tt>Set</tt> of <tt>String</tt>s.
*
* @param set a set of <tt>String</tt>s.
* @return newly created .
*/
public static ArrayList<String> toList( Set<String> set )
{
int n = set.size();
ArrayList<String> list = new ArrayList<String>( n );
for (String string : set)
{
list.add(string);
}
return list;
}
}
| [
"thanhphi0127@gmail.com"
] | thanhphi0127@gmail.com |
41a612761104705e2913a83d43c77fd645b3b057 | 5635587c6033e1ec020b1f89d1fa2f00c70d3a09 | /src/main/java/com/niyue/coding/leetcode/symmetrictree/Solution.java | f7c239213bbdb82e7bc4f59e6533f9b94a6ec675 | [] | no_license | arnabs542/coding | 1673a012f764c2fc6bf430ab7f48fbae338ff341 | 19bf62b4a4d9afa7599706731952cbe2b948c4a1 | refs/heads/master | 2023-01-04T11:21:02.060660 | 2015-09-30T05:49:38 | 2015-09-30T05:49:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,746 | java | package com.niyue.coding.leetcode.symmetrictree;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import com.niyue.coding.leetcode.common.TreeNode;
// http://leetcode.com/onlinejudge#question_101
// non recursive solution to this problem, use BFS to traverse the tree level by level and check the symmetricity level by level
public class Solution {
public boolean isSymmetric(TreeNode root) {
boolean isSymmetric = true;
if(root != null) {
Queue<TreeNode> queue = new LinkedList<TreeNode>();
queue.offer(root);
queue.offer(null);
List<TreeNode> level = new ArrayList<TreeNode>();
level.add(root.left);
level.add(root.right);
while(!(queue.size() == 1 && queue.peek() == null)) {
TreeNode node = queue.poll();
if(node == null) {
isSymmetric = isSymmetric(level);
if(!isSymmetric) {
break;
}
level = new ArrayList<TreeNode>();
queue.offer(null);
} else {
if(node.left != null) {
queue.offer(node.left);
}
if(node.right != null) {
queue.offer(node.right);
}
level.add(node.left);
level.add(node.right);
}
}
}
return isSymmetric;
}
private boolean isSymmetric(List<TreeNode> level) {
boolean isSymmetric = true;
for(int i = 0; i <= level.size() / 2; i++) {
TreeNode front = level.get(i);
TreeNode back = level.get(level.size() - 1 - i);
if(front == null && back == null) {
continue;
} else if((front == null && back != null) ||
(front != null && back == null) ||
front.val != back.val) {
isSymmetric = false;
break;
}
}
return isSymmetric;
}
/**
* A recursive solution to this problem
*/
public static class RecursiveSolution {
public boolean isSymmetric(TreeNode root) {
return root == null || isSymmetric(root.left, root.right);
}
private boolean isSymmetric(TreeNode n1, TreeNode n2) {
return n1 == null && n2 == null ||
n1 != null && n2 != null &&
n1.val == n2.val &&
isSymmetric(n1.left, n2.right) &&
isSymmetric(n1.right, n2.left);
}
}
}
| [
"niyue.com@gmail.com"
] | niyue.com@gmail.com |
2612f786d16e0a56c78313059a153e8447af91ea | 8ddfbee1a987f2392344c97ffacb82894787f675 | /Spring backend/src/main/java/com/example/shop/services/UserServiceImpl.java | 835a327e6c2b23a150dbf0ea93dcec1eae213b30 | [] | no_license | Kajkitsu/ShopApp | 652ee82be5f4d9a3ffeff2522bee4bcbf424fb73 | 24d3efd18cebb77f8032434e481b7066fc670663 | refs/heads/master | 2023-05-27T03:24:42.632909 | 2021-06-14T17:59:09 | 2021-06-14T17:59:09 | 376,907,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,353 | java | package com.example.shop.services;
import com.example.shop.dtos.request.AddUserRequest;
import com.example.shop.dtos.request.CreateAccountRequest;
import com.example.shop.dtos.request.LoginRequest;
import com.example.shop.dtos.response.JwtResponse;
import com.example.shop.dtos.response.MessageResponse;
import com.example.shop.dtos.response.UserResponse;
import com.example.shop.entities.ERole;
import com.example.shop.entities.RoleEntity;
import com.example.shop.entities.UserEntity;
import com.example.shop.jwt.JwtUtils;
import com.example.shop.repositories.RoleRepository;
import com.example.shop.repositories.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
@Service
public class UserServiceImpl implements UserService {
private final UserRepository userRepository;
private final RoleRepository roleRepository;
private final PasswordEncoder encoder;
private final AuthenticationManager authenticationManager;
private final JwtUtils jwtUtils;
@Autowired
public UserServiceImpl(UserRepository userRepository, RoleRepository roleRepository, PasswordEncoder encoder, AuthenticationManager authenticationManager, JwtUtils jwtUtils) {
this.userRepository = userRepository;
this.roleRepository = roleRepository;
this.encoder = encoder;
this.authenticationManager = authenticationManager;
this.jwtUtils = jwtUtils;
}
@Override
public void addMoney(String userID, int money) {
if(userRepository.findById(userID).isPresent()){
UserEntity user = userRepository.findById(userID).get();
user.setMoney(user.getMoney()+money);
userRepository.save(user);
}
}
@Override
public MessageResponse createAccount(CreateAccountRequest createAccountRequest) {
if (userRepository.existsByUsername(createAccountRequest.getUsername())) {
return new MessageResponse("Error: Username is already taken!");
}
if (userRepository.existsByEmail(createAccountRequest.getEmail())) {
return new MessageResponse("Error: Email is already in use!");
}
// Create new user's account
UserEntity user = new UserEntity();
user.setUsername(createAccountRequest.getUsername());
user.setPassword(encoder.encode(createAccountRequest.getPassword()));
user.setName(createAccountRequest.getName());
user.setSurname(createAccountRequest.getSurname());
user.setEmail(createAccountRequest.getEmail());
user.setMoney(100);
userRepository.save(user);
Set<RoleEntity> roles = new HashSet<>();
RoleEntity userRole = roleRepository.findByName(ERole.ROLE_USER)
.orElseThrow(() -> new RuntimeException("Error: Role is not found."));
roles.add(userRole);
user.setRoleEntities(roles);
userRepository.save(user);
return new MessageResponse("User registered successfully!");
}
@Override
public List<UserResponse> getAll() {
return StreamSupport.stream(userRepository.findAll().spliterator(), false)
.map(userEntity -> new UserResponse(
userEntity.getId(),
userEntity.getEmail(),
userEntity.getSurname(),
userEntity.getName()
)).collect(Collectors.toList());
}
@Override
public List<UserResponse> getWithFilters(String name) {
return StreamSupport.stream(userRepository.findAllBySurnameContainsOrNameContainsOrPeselContainsOrEmailContains(name,name,name,name).spliterator(), false)
.map(userEntity -> new UserResponse(
userEntity.getId(),
userEntity.getEmail(),
userEntity.getSurname(),
userEntity.getName()
)).collect(Collectors.toList());
}
@Override
public JwtResponse signIn(LoginRequest loginRequest) {
Authentication authentication = authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));
SecurityContextHolder.getContext().setAuthentication(authentication);
String jwt = jwtUtils.generateJwtToken(authentication);
UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();
List<String> roles = userDetails.getAuthorities().stream()
.map(item -> item.getAuthority())
.collect(Collectors.toList());
return new JwtResponse(jwt,
userDetails.getId(),
userDetails.getUsername(),
userDetails.getEmail(),
roles);
}
@Override
public MessageResponse addNew(@Valid @RequestBody AddUserRequest signUpRequest) {
if (userRepository.existsByUsername(signUpRequest.getUsername())) {
return new MessageResponse("Error: Username is already taken!");
}
if (userRepository.existsByEmail(signUpRequest.getEmail())) {
return new MessageResponse("Error: Email is already in use!");
}
// Create new user's account
UserEntity user = new UserEntity();
user.setUsername(signUpRequest.getUsername());
user.setPassword(encoder.encode(signUpRequest.getPassword()));
user.setName(signUpRequest.getName());
user.setSurname(signUpRequest.getSurname());
user.setEmail(signUpRequest.getEmail());
user.setMoney(100);
userRepository.save(user);
Set<String> strRoles = signUpRequest.getRole();
Set<RoleEntity> roles = new HashSet<>();
if (strRoles == null) {
RoleEntity userRole = roleRepository.findByName(ERole.ROLE_USER)
.orElseThrow(() -> new RuntimeException("Error: Role is not found."));
roles.add(userRole);
} else {
strRoles.forEach(role -> {
switch (role) {
case "admin":
RoleEntity adminRole = roleRepository.findByName(ERole.ROLE_ADMIN)
.orElseThrow(() -> new RuntimeException("Error: Role is not found."));
roles.add(adminRole);
break;
case "mod":
RoleEntity modRole = roleRepository.findByName(ERole.ROLE_MODERATOR)
.orElseThrow(() -> new RuntimeException("Error: Role is not found."));
roles.add(modRole);
break;
default:
RoleEntity userRole = roleRepository.findByName(ERole.ROLE_USER)
.orElseThrow(() -> new RuntimeException("Error: Role is not found."));
roles.add(userRole);
}
});
}
user.setRoleEntities(roles);
userRepository.save(user);
return new MessageResponse("User registered successfully!");
}
@Override
public void removeById(String userId) {
userRepository.deleteById(userId);
}
@Override
public UserResponse get(String user_id) {
if(userRepository.findById(user_id).isPresent()){
UserEntity user = userRepository.findById(user_id).get();
return new UserResponse(
user.getId(),
user.getEmail(),
user.getSurname(),
user.getName()
);
}
else{
return null;
}
}
}
| [
"n.waszkowiak@sages.com.pl"
] | n.waszkowiak@sages.com.pl |
d46c0c4adc7029f3247e75c0e0ae602c2df5e2ab | a33aac97878b2cb15677be26e308cbc46e2862d2 | /data/libgdx/btTranslationalLimitMotor_getRestitution.java | d4a6b633620311a9d7015168503332cea2719317 | [] | no_license | GabeOchieng/ggnn.tensorflow | f5d7d0bca52258336fc12c9de6ae38223f28f786 | 7c62c0e8427bea6c8bec2cebf157b6f1ea70a213 | refs/heads/master | 2022-05-30T11:17:42.278048 | 2020-05-02T11:33:31 | 2020-05-02T11:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 116 | java | public float getRestitution() {
return DynamicsJNI.btTranslationalLimitMotor_restitution_get(swigCPtr, this);
}
| [
"bdqnghi@gmail.com"
] | bdqnghi@gmail.com |
b1b676b15ac9e205466eb13bb4a244dcc1c7230c | 1b23b064cb1d391f860fb14274f3132902afcf8d | /app/src/main/java/com/geek/kaijo/mvp/contract/HandleContract.java | ea0fefdb20d7d085f1c51234cd1f01aabd446c87 | [
"Apache-2.0"
] | permissive | DarianLiu/kaijo | 67c5302c9de4186bcf77c08fd9dcaa39df462809 | ad876332dbc049363b20f7b82ada348aa482f55f | refs/heads/master | 2020-05-04T17:03:50.917380 | 2019-06-26T10:56:36 | 2019-06-26T10:56:36 | 179,296,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | package com.geek.kaijo.mvp.contract;
import com.geek.kaijo.mvp.model.entity.BaseArrayResult;
import com.geek.kaijo.mvp.model.entity.BaseResult;
import com.geek.kaijo.mvp.model.entity.Case;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.RequestBody;
public interface HandleContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void finishRefresh();
void finishLoadMore();
void refreshData(List<Case> caseList);
void loadMoreData(List<Case> caseList);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult<BaseArrayResult<Case>>> findCaseInfoPageList(RequestBody requestBody);
}
}
| [
"darian.liu@fixmail.com"
] | darian.liu@fixmail.com |
a76ccb87b48f9c4dab8a4540c0a2116ab7756670 | 122dd5627a432e7f4674b3cf4f372cd885ca6507 | /SpringCloudsentinelexamples/spring-cloud-sentinel/src/main/java/com/newland/springcloudsentinel/controller/RateLimitController.java | 091ebcf9309cf3dced2d0186bb3789d4fdd15979 | [] | no_license | yelcartoubi/springcloud-examples | 2b9cc5381c79fa33a6186d3ebd551a502bf7fdeb | d588c1e3fbcdd8b93669b18b8b350049f5e3357a | refs/heads/master | 2023-06-17T10:51:11.325416 | 2021-07-19T08:08:54 | 2021-07-19T08:08:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,562 | java | package com.newland.springcloudsentinel.controller;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.newland.springcloudsentinel.entities.Payment;
import com.newland.springcloudsentinel.entities.Response;
import com.newland.springcloudsentinel.handler.SentinelBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @auther zzyy
* @create 2020-02-25 15:04
*/
@RestController
public class RateLimitController {
@GetMapping("/byResource")
@SentinelResource(value = "byResource", blockHandler = "handleException")
public Response byResource() {
return new Response(200, "按资源名称限流测试OK", new Payment(2020L, "serial001"));
}
public Response handleException(BlockException exception) {
return new Response(444, exception.getClass().getCanonicalName() + "\t 服务不可用");
}
@GetMapping("/rateLimit/byUrl")
@SentinelResource(value = "byUrl")
public Response byUrl() {
return new Response(200, "按url限流测试OK", new Payment(2020L, "serial002"));
}
@GetMapping("/rateLimit/customerBlockHandler")
@SentinelResource(value = "customerBlockHandler",
blockHandlerClass = SentinelBlockHandler.class,
blockHandler = "handlerException2")
public Response customerBlockHandler() {
return new Response(200, "按客戶自定义", new Payment(2020L, "serial003"));
}
} | [
"leellun@sina.cn"
] | leellun@sina.cn |
0ad7dab05832890619002ae083d79f8778e2be49 | 5373587f8db3ebb38353488e910ce3aa15167d7f | /PhoneBook/PhBArrayList.java | 80ddce0b1639d5ba0f2b4b389ad29a6ba2d2c690 | [] | no_license | tangj1905/phonebook | e8755368db11d115223a3ffe2ad88976eabd2fdd | 76d8ce2ea25e7588d9a7baa5411ce787d4e85f03 | refs/heads/main | 2023-02-25T00:21:14.132537 | 2021-01-28T20:16:22 | 2021-01-28T20:16:22 | 333,912,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,015 | java | import java.util.NoSuchElementException;
/**
* PhBArrayList.java
* @author jgt31
*/
public class PhBArrayList implements PhoneBook, Iterable<Person> {
/**
* Iterator for this array list
*/
private class PhBArrayIterator implements PhBIterator {
private int nextIndex; // always points to the next node, head is first returned upon first next() call
public PhBArrayIterator() {
nextIndex = 0;
}
@Override
public boolean hasNext() {
return nextIndex <= size() - 1;
}
@Override
public Person next() {
if(!hasNext()) {
throw new NoSuchElementException();
}
Person person = list[nextIndex];
nextIndex++;
return person;
}
@Override
public boolean removePrevious() {
// nextIndex always starts at 0 by default; if it's still at 0 we know next() hasn't been called yet...
if(nextIndex <= 0 || nextIndex >= size()) {
return false;
}
nextIndex--;
PhBArrayList.this.remove(nextIndex);
return true;
}
}
private int size = 0;
private Person[] list;
/**
* Default constructor to create an empty ArrayList-based phonebook
*/
public PhBArrayList() {
list = new Person[4]; // The minimum size of this array will always be 4, based on this resizing method
}
/**
* Gets the number of people in the phonebook
*/
@Override
public int size() {
return size;
}
/**
* Inserts a person at the specified index
* Running time O(N) - insertion at front requires shifting back every element of the array
*/
@Override
public void insert(int index, Person person) {
size++;
// First, grow the array if it's the list is about to exceed the internal array's size
if(size >= list.length) {
Person[] newList = new Person[list.length * 2]; // Doubling the array size
for(int i = 0; i < size; i++) {
newList[i] = list[i];
}
list = newList;
}
// If the index is large we'll just place the person at the end
if(index >= size - 1) {
list[size - 1] = person;
} else {
// If the index is less than 0, we'll just place the person at the front
if(index < 0) index = 0;
// We have to move everyone over first
for(int i = size - 1; i >= index; i--) {
list[i + 1] = list[i];
}
list[index] = person;
}
}
/**
* Removes and returns the person at the specified index
* Running time O(N) - removal at front requires shifting forward every element of the array
*/
@Override
public Person remove(int index) {
// Shrink the array if the number of elements is less than 1/4 the size
if(size < list.length / 4) {
Person[] newList = new Person[list.length / 2]; // Halving the array size
for(int i = 0; i < size(); i++) {
newList[i] = list[i];
}
list = newList;
}
// If the index is large or negative we'll just return nothing
if(index >= size() || index < 0) {
return null;
} else {
// Shifting everyone from the index to the back...
Person person = list[index];
for(int i = index; i < size; i++) {
list[i] = list[i + 1];
}
size--;
return person;
}
}
/**
* Returns the person at the specified index
* Running time O(1) - random access for arrays take constant time
*/
@Override
public Person lookup(int index) throws Exception {
if(index >= size || index < 0) {
throw new Exception("Out of bounds!");
}
return list[index];
}
/**
* Returns an iterator over the array list
*/
@Override
public PhBIterator iterator() {
return new PhBArrayIterator();
}
/**
* Returns a String representation of the ArrayList
*/
public String toString() {
if(size == 0) { return "[]";}
String str = "[";
for(int i = 0; i < size; i++) {
try {
str += lookup(i) + ", ";
} catch (Exception e) {
e.printStackTrace();
}
}
str = str.substring(0, str.length() - 2) + "]";
return str;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
6dc297944c9644ff95a47174a5855c4932d052b2 | c80168fa15ba52ddeda2b85798ad8ae4fded1e07 | /app/src/main/java/com/imie/edycem/view/workingtime/SummaryActivity.java | f85a326a487ffa787c2309288a4063f327004c39 | [] | no_license | MaeBzh/edycem | 1ef6ce398441df58e25d3018c004e1983367fb87 | bace813cf09425daed21050b85873db2fa5f64d7 | refs/heads/master | 2020-06-14T00:32:03.325010 | 2019-07-12T11:04:08 | 2019-07-12T11:04:08 | 194,836,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,541 | java | package com.imie.edycem.view.workingtime;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import com.imie.edycem.R;
import com.imie.edycem.view.login.LoginActivity;
public class SummaryActivity extends AppCompatActivity {
private Toolbar toolbar;
private ImageButton logoutButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_summary);
this.toolbar = (Toolbar) findViewById(R.id.toolbar);
this.setSupportActionBar(this.toolbar);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
this.logoutButton = (ImageButton) menu.findItem(R.id.logout).getActionView();
this.logoutButton.setBackground(getDrawable(R.drawable.logout));
this.logoutButton.setPaddingRelative(0, 0, 20, 0);
this.logoutButton.setScaleType(ImageView.ScaleType.CENTER_CROP);
this.logoutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(SummaryActivity.this, LoginActivity.class);
startActivity(intent);
}
});
return true;
}
}
| [
"Maelenn.picaud@gmail.com"
] | Maelenn.picaud@gmail.com |
98c3343d1b4cb87107cbabb452a5c8418ec6b414 | 5d57db1cfa0274a17e07f2e8273240ee14fef919 | /Common/src/main/java/com/chestnut/Common/utils/ScreenUtils.java | dd3a5f67785cc794078105ae12e2bf95953d91e8 | [] | no_license | GreenVegetables/ModulesCommon | 295a25de9762968b5f578f86b6a3c49295491f6b | db689347e0b432440812483650efa11ba5aa8c82 | refs/heads/master | 2021-06-27T16:23:17.027828 | 2017-09-18T03:21:51 | 2017-09-18T03:21:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,993 | java | package com.chestnut.Common.utils;
import android.app.Activity;
import android.app.KeyguardManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.os.PowerManager;
import android.support.annotation.IntDef;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.Surface;
import android.view.View;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import static com.chestnut.Common.utils.ConvertUtils.px2dp;
/**
* <pre>
* author: Chestnut
* blog :
* time : 2016年10月18日21:37:50
* desc : 屏幕相关工具类
* thanks To:
* dependent on:
* BarUtils
* ConvertUtils
* </pre>
*/
public class ScreenUtils {
private ScreenUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
/**
* 获取屏幕的宽度px
*
* @param context 上下文
* @return 屏幕宽px
*/
public static int getScreenWidth_PX(Context context) {
Resources resources = context.getResources();
DisplayMetrics dm = resources.getDisplayMetrics();
return dm.widthPixels;
}
/**
* 获取屏幕的高度px
*
* @param context 上下文
* @return 屏幕高px
*/
public static int getScreenHeight_PX(Context context) {
Resources resources = context.getResources();
DisplayMetrics dm = resources.getDisplayMetrics();
return dm.heightPixels;
}
/**
* 获取屏幕的宽度dp
*
* @param context 上下文
* @return 屏幕宽dp
*/
public static int getScreenWidth_Dip(Context context) {
Resources resources = context.getResources();
DisplayMetrics dm = resources.getDisplayMetrics();
return px2dp(context,dm.widthPixels);
}
/**
* 获取屏幕的高度dp
*
* @param context 上下文
* @return 屏幕高dp
*/
public static int getScreenHeight_Dip(Context context) {
Resources resources = context.getResources();
DisplayMetrics dm = resources.getDisplayMetrics();
return px2dp(context,dm.heightPixels);
}
/**
* 设置屏幕为横屏
* <p>还有一种就是在Activity中加属性android:screenOrientation="landscape"</p>
* <p>不设置Activity的android:configChanges时,切屏会重新调用各个生命周期,切横屏时会执行一次,切竖屏时会执行两次</p>
* <p>设置Activity的android:configChanges="orientation"时,切屏还是会重新调用各个生命周期,切横、竖屏时只会执行一次</p>
* <p>设置Activity的android:configChanges="orientation|keyboardHidden|screenSize"(4.0以上必须带最后一个参数)时
* 切屏不会重新调用各个生命周期,只会执行onConfigurationChanged方法</p>
*
* @param activity activity
*/
public static void setLandscape(Activity activity) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
/**
* 设置屏幕为竖屏
*
* @param activity activity
*/
public static void setPortrait(Activity activity) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
/**
* 判断是否横屏
*
* @param context 上下文
* @return {@code true}: 是<br>{@code false}: 否
*/
public static boolean isLandscape(Context context) {
return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}
/**
* 判断是否竖屏
*
* @param context 上下文
* @return {@code true}: 是<br>{@code false}: 否
*/
public static boolean isPortrait(Context context) {
return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
}
/**
* 获取屏幕旋转角度
*
* @param activity activity
* @return 屏幕旋转角度
*/
public static int getScreenRotation(Activity activity) {
switch (activity.getWindowManager().getDefaultDisplay().getRotation()) {
default:
case Surface.ROTATION_0:
return 0;
case Surface.ROTATION_90:
return 90;
case Surface.ROTATION_180:
return 180;
case Surface.ROTATION_270:
return 270;
}
}
/**
* 获取当前屏幕截图,包含状态栏
*
* @param activity activity
* @return Bitmap
*/
public static Bitmap captureWithStatusBar(Activity activity) {
View view = activity.getWindow().getDecorView();
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap bmp = view.getDrawingCache();
DisplayMetrics dm = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
Bitmap ret = Bitmap.createBitmap(bmp, 0, 0, dm.widthPixels, dm.heightPixels);
view.destroyDrawingCache();
return ret;
}
/**
* 获取当前屏幕截图,不包含状态栏
*
* @param activity activity
* @return Bitmap
*/
public static Bitmap captureWithoutStatusBar(Activity activity) {
View view = activity.getWindow().getDecorView();
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap bmp = view.getDrawingCache();
int statusBarHeight = BarUtils.getStatusBarHeight(activity);
DisplayMetrics dm = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
Bitmap ret = Bitmap.createBitmap(bmp, 0, statusBarHeight, dm.widthPixels, dm.heightPixels - statusBarHeight);
view.destroyDrawingCache();
return ret;
}
/**
* 判断是否锁屏
*
* @param context 上下文
* @return {@code true}: 是<br>{@code false}: 否
*/
public static boolean isScreenLock(Context context) {
KeyguardManager km = (KeyguardManager) context
.getSystemService(Context.KEYGUARD_SERVICE);
return km.inKeyguardRestrictedInputMode();
}
/**
* 内部静态类,用于监听用户的锁屏,开屏,Home键等等。
* 最后记得unregisterListener去除,否则造成内存泄漏。
*/
public static class ScreenListener {
private Context mContext;
private ScreenBroadcastReceiver mScreenReceiver;
private ScreenStateListener mScreenStateListener;
public ScreenListener(Context context) {
mContext = context;
mScreenReceiver = new ScreenBroadcastReceiver();
}
/**
* screen状态广播接收者
*/
private class ScreenBroadcastReceiver extends BroadcastReceiver {
private String action = null;
final String SYSTEM_DIALOG_REASON_KEY = "reason";
final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";
final String SYSTEM_DIALOG_REASON_HOME_KEY = "homekey";
@Override
public void onReceive(Context context, Intent intent) {
action = intent.getAction();
if (Intent.ACTION_SCREEN_ON.equals(action)) { // 开屏
mScreenStateListener.onScreenOn();
} else if (Intent.ACTION_SCREEN_OFF.equals(action)) { // 锁屏
mScreenStateListener.onScreenOff();
} else if (Intent.ACTION_USER_PRESENT.equals(action)) { // 解锁
mScreenStateListener.onUserPresent();
} else if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) { //home键
String reason = intent.getStringExtra(SYSTEM_DIALOG_REASON_KEY);
if (reason != null) {
if (reason.equals(SYSTEM_DIALOG_REASON_HOME_KEY)) {
// 短按home键
mScreenStateListener.onHomePress();
} else if (reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {
// 长按home键
}
}
}
}
}
/**
* 开始监听screen状态
*
* @param listener
*/
public void begin(ScreenStateListener listener) {
mScreenStateListener = listener;
registerListener();
getScreenState();
}
/**
* 获取screen状态
*/
private void getScreenState() {
PowerManager manager = (PowerManager) mContext
.getSystemService(Context.POWER_SERVICE);
if (manager.isScreenOn()) {
if (mScreenStateListener != null) {
mScreenStateListener.onScreenOn();
}
} else {
if (mScreenStateListener != null) {
mScreenStateListener.onScreenOff();
}
}
}
/**
* 停止screen状态监听
*/
public void unregisterListener() {
mContext.unregisterReceiver(mScreenReceiver);
}
/**
* 启动screen状态广播接收器
*/
private void registerListener() {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_USER_PRESENT);
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
mContext.registerReceiver(mScreenReceiver, filter);
}
public interface ScreenStateListener {// 返回给调用者屏幕状态信息
void onScreenOn();
void onScreenOff();
void onUserPresent();
void onHomePress();
}
}
//新增监听的方法跟接口,简化上面的调用
public interface Callback {
void onScreenOn();
void onScreenOff();
void onUserUnlockThePhone();
void onHomeKeyShortPress();
void onHomeKeyLongPress();
}
public static void setListenerScreenLock(Context context, Callback callback) {
if (callback!=null) {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_USER_PRESENT);
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
final String SYSTEM_DIALOG_REASON_KEY = "reason";
final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";
final String SYSTEM_DIALOG_REASON_HOME_KEY = "homekey";
broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
// 开屏
case Intent.ACTION_SCREEN_ON:
callback.onScreenOn();
break;
// 锁屏
case Intent.ACTION_SCREEN_OFF:
callback.onScreenOff();
break;
// 解锁
case Intent.ACTION_USER_PRESENT:
callback.onUserUnlockThePhone();
break;
// Home键
case Intent.ACTION_CLOSE_SYSTEM_DIALOGS:
String reason = intent.getStringExtra(SYSTEM_DIALOG_REASON_KEY);
if (reason != null) {
if (reason.equals(SYSTEM_DIALOG_REASON_HOME_KEY)) {
// 短按home键
callback.onHomeKeyShortPress();
} else if (reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {
// 长按home键
callback.onHomeKeyLongPress();
}
}
break;
}
}
};
context.getApplicationContext().registerReceiver(broadcastReceiver,filter);
}
}
private static BroadcastReceiver broadcastReceiver = null;
public static void removeListenerScreenLock(Context context) {
if (broadcastReceiver!=null)
context.getApplicationContext().unregisterReceiver(broadcastReceiver);
}
//新增监听实体按键的方法
// Thanks To: http://www.tuicool.com/articles/aI36Fz
public static final int KEYCODE_POWER = -1;
public static final int KEYCODE_MENU = -2;
public static final int KEYCODE_BACK = -3;
public static final int KEYCODE_HOME = -4;
public static final int KEYCODE_CAMERA = -5;
public static final int KEYCODE_SEARCH = -6;
public static final int KEYCODE_VOLUME_UP = -7;
public static final int KEYCODE_VOLUME_DOWN = -8;
public static final int KEYCODE_VOLUME_MUTE = -9;
@IntDef({KEYCODE_POWER,KEYCODE_MENU,KEYCODE_BACK,KEYCODE_HOME,
KEYCODE_CAMERA,KEYCODE_SEARCH,KEYCODE_VOLUME_UP,
KEYCODE_VOLUME_DOWN,KEYCODE_VOLUME_MUTE
})
@Retention(RetentionPolicy.SOURCE)
private @interface KEY_NAME {}
public interface KeyCallback {
void onPowerDown(int keyCode);
void onMenuDown(int keyCode);
void onBackDown(int keyCode);
void onHomeDown(int keyCode);
void onCameraDown(int keyCode);
void onSearchDown(int keyCode);
void onVoiceUpDown(int keyCode);
void onVoiceDownDown(int keyCode);
void onVoiceMuteDown(int keyCode);
}
/**
* 监听Key的点击,需要在Activity中,
* 在 onKeyDown 中调用
*
* public boolean onKeyDown(int keyCode, KeyEvent event) {
* ScreenUtils.setKeyDownListener(xx,xx,xxx);
* return super.onKeyDown(keyCode, event);
* }
*
* @param keyCode key
* @param keyCallback callback
*/
public static void setKeyDownListener(int keyCode, KeyCallback keyCallback) {
if (keyCallback!=null) {
switch (keyCode) {
case KeyEvent.KEYCODE_POWER:
keyCallback.onPowerDown(keyCode);
break;
case KeyEvent.KEYCODE_MENU:
keyCallback.onMenuDown(keyCode);
break;
case KeyEvent.KEYCODE_BACK:
keyCallback.onBackDown(keyCode);
break;
case KeyEvent.KEYCODE_HOME:
keyCallback.onHomeDown(keyCode);
break;
case KeyEvent.KEYCODE_CAMERA:
keyCallback.onCameraDown(keyCode);
break;
case KeyEvent.KEYCODE_SEARCH:
keyCallback.onSearchDown(keyCode);
break;
case KeyEvent.KEYCODE_VOLUME_UP:
keyCallback.onVoiceUpDown(keyCode);
break;
case KeyEvent.KEYCODE_VOLUME_DOWN:
keyCallback.onVoiceDownDown(keyCode);
break;
case KeyEvent.KEYCODE_VOLUME_MUTE:
keyCallback.onVoiceMuteDown(keyCode);
break;
}
}
}
}
| [
"974920378@qq.com"
] | 974920378@qq.com |
d8362812ae7337df3af18328d057f4b46a5400f0 | d6d847132708f2e735190e62cb2f5d39ae062230 | /StdScoreManager0.7/src/book/stdscore/data/Course.java | aa8230ba48d1a646ec4ae871fa42d1c645105931 | [
"Apache-2.0"
] | permissive | grain-2/gui | dbeee5b18f01d4a5f625e66454079a857af70785 | 7e778cdd792cd54f3e85f9b591cb54d9b1166415 | refs/heads/master | 2022-04-07T13:18:16.547610 | 2020-02-11T11:27:24 | 2020-02-11T11:27:24 | 239,722,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | package book.stdscore.data;
public class Course {
private String name;
private String type;
private float score;
public Course(String name, String type) {
super();
this.name = name;
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public float getScore() {
return score;
}
public void setScore(float score) {
this.score = score;
}
}
| [
"grainss@163.com"
] | grainss@163.com |
9700817ad4e2c7f3db97b865ffdc31fb6f99c91d | c59523d4c95fd807783e8c134e2dc911215aff03 | /app/src/test/java/com/example/balloonpopper/ExampleUnitTest.java | fcbe7d51effd4824d339153a2254c060b584ff04 | [] | no_license | princ3raj/BalloonPopper | d565fd05cc05a909a6abbe63337a57454c482224 | bf182e24117621a84de6c90d7edc04f48490745a | refs/heads/master | 2023-03-29T15:12:19.074989 | 2021-04-01T17:40:02 | 2021-04-01T17:40:02 | 266,085,841 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.example.balloonpopper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"princ31999@gmail.com"
] | princ31999@gmail.com |
19b8d037bbede1762b12720c2160dfdd73cd959d | 117a90114e3c40c87a4351df2077a36505b939f5 | /temporal-sdk/src/main/java/io/temporal/internal/common/GrpcRetryer.java | 7074ee6e92410f9682d9f10ae02e437043771da1 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | cfieber/sdk-java | eccf7836ff3b1222461a1b5377502141f3d44108 | 221c4bb6a197b52e1e242b3713bd61cd251b6190 | refs/heads/master | 2023-05-14T13:04:17.949997 | 2021-05-20T01:27:20 | 2021-05-20T01:27:20 | 364,964,573 | 0 | 0 | NOASSERTION | 2021-05-26T21:38:48 | 2021-05-06T15:57:15 | Java | UTF-8 | Java | false | false | 8,906 | java | /*
* Copyright (C) 2020 Temporal Technologies, Inc. All Rights Reserved.
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* 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 io.temporal.internal.common;
import static io.temporal.internal.common.CheckedExceptionWrapper.unwrap;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import io.temporal.serviceclient.RpcRetryOptions;
import java.time.Duration;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class GrpcRetryer {
public interface RetryableProc<E extends Throwable> {
void apply() throws E;
}
public interface RetryableFunc<R, E extends Throwable> {
R apply() throws E;
}
/**
* Used to pass failure to a {@link java.util.concurrent.CompletionStage#thenCompose(Function)}
* which doesn't include exception parameter like {@link
* java.util.concurrent.CompletionStage#handle(BiFunction)} does.
*/
private static class ValueExceptionPair<V> {
private final CompletableFuture<V> value;
private final Throwable exception;
public ValueExceptionPair(CompletableFuture<V> value, Throwable exception) {
this.value = value;
this.exception = exception;
}
public CompletableFuture<V> getValue() {
return value;
}
public Throwable getException() {
return exception;
}
}
private static final Logger log = LoggerFactory.getLogger(GrpcRetryer.class);
public static <T extends Throwable> void retry(RpcRetryOptions options, RetryableProc<T> r)
throws T {
retryWithResult(
options,
() -> {
r.apply();
return null;
});
}
public static <R, T extends Throwable> R retryWithResult(
RpcRetryOptions options, RetryableFunc<R, T> r) throws T {
int attempt = 0;
long startTime = System.currentTimeMillis();
BackoffThrottler throttler =
new BackoffThrottler(
options.getInitialInterval(),
options.getMaximumInterval(),
options.getBackoffCoefficient());
do {
try {
attempt++;
throttler.throttle();
R result = r.apply();
throttler.success();
return result;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new CancellationException();
} catch (StatusRuntimeException e) {
if (e.getStatus().getCode() == Status.Code.CANCELLED) {
throw new CancellationException();
}
throttler.failure();
for (RpcRetryOptions.DoNotRetryPair pair : options.getDoNotRetry()) {
if (pair.getCode() == e.getStatus().getCode()
&& (pair.getDetailsClass() == null
|| StatusUtils.hasFailure(e, pair.getDetailsClass()))) {
rethrow(e);
}
}
long elapsed = System.currentTimeMillis() - startTime;
int maxAttempts = options.getMaximumAttempts();
Duration expiration = options.getExpiration();
if ((maxAttempts > 0 && attempt >= maxAttempts)
|| (expiration != null && elapsed >= expiration.toMillis())) {
rethrow(e);
}
log.warn("Retrying after failure", e);
}
} while (true);
}
public static <R> CompletableFuture<R> retryWithResultAsync(
RpcRetryOptions options, Supplier<CompletableFuture<R>> function) {
int attempt = 0;
long startTime = System.currentTimeMillis();
AsyncBackoffThrottler throttler =
new AsyncBackoffThrottler(
options.getInitialInterval(),
options.getMaximumInterval(),
options.getBackoffCoefficient());
// Need this to unwrap checked exception.
CompletableFuture<R> unwrappedExceptionResult = new CompletableFuture<>();
CompletableFuture<R> result =
retryWithResultAsync(options, function, attempt + 1, startTime, throttler);
@SuppressWarnings({"FutureReturnValueIgnored", "unused"})
CompletableFuture<Void> ignored =
result.handle(
(r, e) -> {
if (e == null) {
unwrappedExceptionResult.complete(r);
} else {
unwrappedExceptionResult.completeExceptionally(unwrap(e));
}
return null;
});
return unwrappedExceptionResult;
}
private static <R> CompletableFuture<R> retryWithResultAsync(
RpcRetryOptions options,
Supplier<CompletableFuture<R>> function,
int attempt,
long startTime,
AsyncBackoffThrottler throttler) {
options.validate();
return throttler
.throttle()
.thenCompose(
(ignore) -> {
// try-catch is because get() call might throw.
CompletableFuture<R> result;
try {
result = function.get();
} catch (Throwable e) {
throttler.failure();
throw CheckedExceptionWrapper.wrap(e);
}
if (result == null) {
return CompletableFuture.completedFuture(null);
}
return result.handle(
(r, e) -> {
if (e == null) {
throttler.success();
return r;
} else {
throttler.failure();
throw CheckedExceptionWrapper.wrap(e);
}
});
})
.handle((r, e) -> failOrRetry(options, function, attempt, startTime, throttler, r, e))
.thenCompose(
(pair) -> {
if (pair.getException() != null) {
throw CheckedExceptionWrapper.wrap(pair.getException());
}
return pair.getValue();
});
}
/** Using {@link ValueExceptionPair} as future#thenCompose doesn't include exception parameter. */
private static <R> ValueExceptionPair<R> failOrRetry(
RpcRetryOptions options,
Supplier<CompletableFuture<R>> function,
int attempt,
long startTime,
AsyncBackoffThrottler throttler,
R r,
Throwable e) {
if (e == null) {
return new ValueExceptionPair<>(CompletableFuture.completedFuture(r), null);
}
// If exception is thrown from CompletionStage/CompletableFuture methods like compose or handle
// - it gets wrapped into CompletionException, so here we need to unwrap it. We can get not
// wrapped raw exception here too if CompletableFuture was explicitly filled with this exception
// using CompletableFuture.completeExceptionally
if (e instanceof CompletionException) {
e = e.getCause();
}
// Do not retry if it's not StatusRuntimeException
if (!(e instanceof StatusRuntimeException)) {
return new ValueExceptionPair<>(null, e);
}
StatusRuntimeException exception = (StatusRuntimeException) e;
long elapsed = System.currentTimeMillis() - startTime;
for (RpcRetryOptions.DoNotRetryPair pair : options.getDoNotRetry()) {
if (pair.getCode() == exception.getStatus().getCode()
&& (pair.getDetailsClass() == null
|| StatusUtils.hasFailure(exception, pair.getDetailsClass()))) {
return new ValueExceptionPair<>(null, e);
}
}
int maxAttempts = options.getMaximumAttempts();
if ((maxAttempts > 0 && attempt >= maxAttempts)
|| (options.getExpiration() != null && elapsed >= options.getExpiration().toMillis())) {
return new ValueExceptionPair<>(null, e);
}
log.debug("Retrying after failure", e);
CompletableFuture<R> next =
retryWithResultAsync(options, function, attempt + 1, startTime, throttler);
return new ValueExceptionPair<>(next, null);
}
private static <T extends Throwable> void rethrow(Exception e) throws T {
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
} else {
@SuppressWarnings("unchecked")
T toRethrow = (T) e;
throw toRethrow;
}
}
/** Prohibits instantiation. */
private GrpcRetryer() {}
}
| [
"noreply@github.com"
] | noreply@github.com |
009697c97577ab2421f3be2307a8b0ae1e245df2 | d312212f3940ff963c8ca8af9e7756d34b4a4966 | /src/main/java/com/nighteagle/security/SpringSecurityAuditorAware.java | d41c8cd10624a3e311591862b4516b582bbad6f4 | [] | no_license | windrainer/AUSTravel | 532db6d0891a93a4bc0f02e1846dc22746cad93f | 804f1edc43e520faf534277a8f1ee218240d011e | refs/heads/master | 2021-09-07T22:39:05.795735 | 2018-01-17T10:06:53 | 2018-01-17T10:06:53 | 115,688,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | package com.nighteagle.security;
import com.nighteagle.config.Constants;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;
/**
* Implementation of AuditorAware based on Spring Security.
*/
@Component
public class SpringSecurityAuditorAware implements AuditorAware<String> {
@Override
public String getCurrentAuditor() {
String userName = SecurityUtils.getCurrentUserLogin();
return userName != null ? userName : Constants.SYSTEM_ACCOUNT;
}
}
| [
"sengao1984@gmail.com"
] | sengao1984@gmail.com |
6934ec632f2d2c4d1d2e891dbf85f01b7c57861b | 32b35052829f268c4f3f706686e84af04befc7af | /src/main/java/com/cg/bo/model/projection/TypeSeat.java | 83bbb42b8a1fc1cfd5e26485d745afc0328c62b2 | [] | no_license | quangnguyen1203/Spring_Boot_POS_Box_Office | 578cb98430ab98df53a5352b5cd811c2f43a060a | 9a501cb86eb720b0d2d4d75192d92c7e5dc345aa | refs/heads/master | 2023-09-05T11:36:34.999117 | 2021-09-10T04:13:56 | 2021-09-10T04:13:56 | 390,262,323 | 0 | 0 | null | 2021-09-10T04:13:06 | 2021-07-28T07:49:49 | JavaScript | UTF-8 | Java | false | false | 532 | java | package com.cg.bo.model.projection;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "typeseats")
public class TypeSeat {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long type_id;
private String type_name;
private double price;
public TypeSeat(String type_name, double price) {
this.type_name = type_name;
this.price = price;
}
}
| [
"lehoang0811@gmail.com"
] | lehoang0811@gmail.com |
cbbff9c8960460736a7c02c7d55111767ac355ee | 8ca78a8e4d30728ad3098e98f8c6161a3c5ac2ba | /app/app/src/main/java/com/example/syncreadyapp/models/repositories/UserRepository.java | 390b4f91f3ba553167096c20e4f1b12ecf0b79e4 | [] | no_license | bgabrielma/project-syncready | e793839f8c8e8549af54fe5940ac09e977609ac0 | 1b0726c4673b6fd452e058f8e65480e6b0da8a87 | refs/heads/master | 2023-01-28T01:46:57.118649 | 2020-03-05T10:14:06 | 2020-03-05T10:14:06 | 215,556,833 | 3 | 0 | null | 2023-01-11T02:01:12 | 2019-10-16T13:36:09 | Java | UTF-8 | Java | false | false | 10,034 | java | package com.example.syncreadyapp.models.repositories;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;
import com.example.syncreadyapp.models.homedata.ResponseHomeData;
import com.example.syncreadyapp.models.loginmodel.LoginModel;
import com.example.syncreadyapp.models.registermodel.RegisterModel;
import com.example.syncreadyapp.models.userinsert.ResponseUserInsert;
import com.example.syncreadyapp.models.userlogged.ResponseUserLogged;
import com.example.syncreadyapp.models.userlogged.UserLogged;
import com.example.syncreadyapp.models.usermodel.ResponseUser;
import com.example.syncreadyapp.models.userupdate.UserUpdate;
import com.example.syncreadyapp.services.RetrofitInstance;
import com.example.syncreadyapp.services.SyncReadyMobileDataService;
import com.example.syncreadyapp.userregistervalidate.ResponseValidateRegister;
import com.example.syncreadyapp.userregistervalidate.ValidateRegisterModel;
import com.google.gson.JsonObject;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class UserRepository {
private MutableLiveData<Boolean> isNetworkTroubleLiveData = new MutableLiveData<>();
private MutableLiveData<RepositoryResponse> repositoryResponseMutableLiveData = new MutableLiveData<>();
private SyncReadyMobileDataService syncReadyMobileDataService = RetrofitInstance.getService();
public MutableLiveData<RepositoryResponse> getUserLogged(LoginModel loginModelInstance) {
final MutableLiveData<UserLogged> userLoggedMutableLiveData = new MutableLiveData<>();
isNetworkTroubleLiveData.setValue(false);
Call<ResponseUserLogged> call = syncReadyMobileDataService.login(loginModelInstance);
call.enqueue(new Callback<ResponseUserLogged>() {
@Override
public void onResponse(Call<ResponseUserLogged> call, Response<ResponseUserLogged> response) {
ResponseUserLogged responseUserLogged = response.body();
if (responseUserLogged != null) {
userLoggedMutableLiveData.setValue(responseUserLogged.getUserLogged());
} else {
userLoggedMutableLiveData.setValue(null);
}
repositoryResponseMutableLiveData.setValue(new RepositoryResponse(userLoggedMutableLiveData, isNetworkTroubleLiveData));
}
@Override
public void onFailure(Call<ResponseUserLogged> call, Throwable t) {
userLoggedMutableLiveData.setValue(null);
isNetworkTroubleLiveData.setValue(true);
repositoryResponseMutableLiveData.setValue(new RepositoryResponse(userLoggedMutableLiveData, isNetworkTroubleLiveData));
}
});
return repositoryResponseMutableLiveData;
}
public MutableLiveData<ResponseUserInsert> getUserInsert(RegisterModel registerModel) {
final MutableLiveData<ResponseUserInsert> userInsertMutableLiveData = new MutableLiveData<>();
isNetworkTroubleLiveData.setValue(false);
Call<ResponseUserInsert> call = syncReadyMobileDataService.register(registerModel);
call.enqueue(new Callback<ResponseUserInsert>() {
@Override
public void onResponse(Call<ResponseUserInsert> call, Response<ResponseUserInsert> response) {
ResponseUserInsert responseUserInsert = response.body();
if (responseUserInsert != null) {
userInsertMutableLiveData.setValue(responseUserInsert);
} else {
userInsertMutableLiveData.setValue(null);
}
}
@Override
public void onFailure(Call<ResponseUserInsert> call, Throwable t) {
userInsertMutableLiveData.setValue(null);
}
});
return userInsertMutableLiveData;
}
public MutableLiveData<JsonObject> getUserUpdate(UserUpdate userUpdate) {
final MutableLiveData<JsonObject> jsonObjectMutableLiveData = new MutableLiveData<>();
isNetworkTroubleLiveData.setValue(false);
Call<JsonObject> call = syncReadyMobileDataService.update(userUpdate);
call.enqueue(new Callback<JsonObject>() {
@Override
public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
JsonObject responseUserInsert = response.body();
if (responseUserInsert != null) {
jsonObjectMutableLiveData.setValue(responseUserInsert);
} else {
jsonObjectMutableLiveData.setValue(null);
}
}
@Override
public void onFailure(Call<JsonObject> call, Throwable t) {
jsonObjectMutableLiveData.setValue(null);
}
});
return jsonObjectMutableLiveData;
}
public MutableLiveData<RepositoryResponse> getValidateRegister(ValidateRegisterModel validateRegisterModel) {
final MutableLiveData<ResponseValidateRegister> validateRegisterModelMutableLiveData = new MutableLiveData<>();
isNetworkTroubleLiveData.setValue(false);
Call<ResponseValidateRegister> call = syncReadyMobileDataService.mobileValidateRegister(validateRegisterModel);
call.enqueue(new Callback<ResponseValidateRegister>() {
@Override
public void onResponse(Call<ResponseValidateRegister> call, Response<ResponseValidateRegister> response) {
ResponseValidateRegister responseValidateRegister = response.body();
if (responseValidateRegister != null) {
validateRegisterModelMutableLiveData.setValue(responseValidateRegister);
} else {
validateRegisterModelMutableLiveData.setValue(null);
}
repositoryResponseMutableLiveData.setValue(new RepositoryResponse(validateRegisterModelMutableLiveData, isNetworkTroubleLiveData));
}
@Override
public void onFailure(Call<ResponseValidateRegister> call, Throwable t) {
validateRegisterModelMutableLiveData.setValue(null);
isNetworkTroubleLiveData.setValue(true);
repositoryResponseMutableLiveData.setValue(new RepositoryResponse(validateRegisterModelMutableLiveData, isNetworkTroubleLiveData));
}
});
return repositoryResponseMutableLiveData;
}
public MutableLiveData<ResponseUser> getUserDataByUuid(String uuid, String bearerToken) {
isNetworkTroubleLiveData.setValue(false);
return fetchUsers(syncReadyMobileDataService.getUser(uuid, bearerToken));
}
public MutableLiveData<ResponseHomeData> getHomeData(String uuid, String bearerToken) {
final MutableLiveData<ResponseHomeData> responseHomeDataMutableLiveData = new MutableLiveData<>();
isNetworkTroubleLiveData.setValue(false);
Call<ResponseHomeData> call = syncReadyMobileDataService.getMobileHome(uuid, bearerToken);
call.enqueue(new Callback<ResponseHomeData>() {
@Override
public void onResponse(Call<ResponseHomeData> call, Response<ResponseHomeData> response) {
ResponseHomeData responseHomeData = response.body();
if (responseHomeData != null) {
responseHomeDataMutableLiveData.setValue(responseHomeData);
} else {
responseHomeDataMutableLiveData.setValue(null);
}
}
@Override
public void onFailure(Call<ResponseHomeData> call, Throwable t) {
responseHomeDataMutableLiveData.setValue(null);
}
});
return responseHomeDataMutableLiveData;
}
public MutableLiveData<ResponseUser> getUsersByRoom(String roomUUID, String bearerToken) {
isNetworkTroubleLiveData.setValue(false);
return fetchUsers(syncReadyMobileDataService.getUsersByRoom(roomUUID, bearerToken));
}
private MutableLiveData<ResponseUser> fetchUsers(Call<ResponseUser> call) {
final MutableLiveData<ResponseUser> responseUserMutableLiveData = new MutableLiveData<>();
call.enqueue(new Callback<ResponseUser>() {
@Override
public void onResponse(Call<ResponseUser> call, Response<ResponseUser> response) {
ResponseUser responseUser = response.body();
if (responseUser != null) {
responseUserMutableLiveData.setValue(responseUser);
} else {
responseUserMutableLiveData.setValue(null);
}
}
@Override
public void onFailure(Call<ResponseUser> call, Throwable t) {
responseUserMutableLiveData.setValue(null);
}
});
return responseUserMutableLiveData;
}
public MutableLiveData<JsonObject> getUpdateUserImage(String image, String uuid, String bearerToken) {
final MutableLiveData<JsonObject> jsonObjectMutableLiveData = new MutableLiveData<>();
isNetworkTroubleLiveData.setValue(false);
Call<JsonObject> call = syncReadyMobileDataService.updateUserImage(image, uuid, bearerToken);
call.enqueue(new Callback<JsonObject>() {
@Override
public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
JsonObject responseUser = response.body();
if (responseUser != null) {
jsonObjectMutableLiveData.setValue(responseUser);
} else {
jsonObjectMutableLiveData.setValue(null);
}
}
@Override
public void onFailure(Call<JsonObject> call, Throwable t) {
jsonObjectMutableLiveData.setValue(null);
}
});
return jsonObjectMutableLiveData;
}
}
| [
"b.gabriel.ma@gmail.com"
] | b.gabriel.ma@gmail.com |
f7d86ce8c1c28701d835e925896cb60e9ef0eeaf | 283fe7633619296a1e126053e4627e17023ef7f5 | /sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeRunningStatus.java | 822e2c1aedfe96628caa1eb68f0a65c6fe1a09d7 | [
"LicenseRef-scancode-generic-cla",
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-or-later",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jyotsnaravikumar/azure-sdk-for-java | c39e79280d0e97f9a1a5c2eec81f71e7ddb4516a | aa39e866c545ea78cf810588ee3209158f6c2a58 | refs/heads/master | 2022-06-22T12:51:23.821173 | 2020-05-06T16:53:16 | 2020-05-06T16:53:16 | 261,849,429 | 1 | 0 | MIT | 2020-05-06T18:45:12 | 2020-05-06T18:45:12 | null | UTF-8 | Java | false | false | 2,055 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.management.compute;
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
/** The RollingUpgradeRunningStatus model. */
@Immutable
public final class RollingUpgradeRunningStatus {
/*
* Code indicating the current status of the upgrade.
*/
@JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY)
private RollingUpgradeStatusCode code;
/*
* Start time of the upgrade.
*/
@JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime startTime;
/*
* The last action performed on the rolling upgrade.
*/
@JsonProperty(value = "lastAction", access = JsonProperty.Access.WRITE_ONLY)
private RollingUpgradeActionType lastAction;
/*
* Last action time of the upgrade.
*/
@JsonProperty(value = "lastActionTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime lastActionTime;
/**
* Get the code property: Code indicating the current status of the upgrade.
*
* @return the code value.
*/
public RollingUpgradeStatusCode code() {
return this.code;
}
/**
* Get the startTime property: Start time of the upgrade.
*
* @return the startTime value.
*/
public OffsetDateTime startTime() {
return this.startTime;
}
/**
* Get the lastAction property: The last action performed on the rolling upgrade.
*
* @return the lastAction value.
*/
public RollingUpgradeActionType lastAction() {
return this.lastAction;
}
/**
* Get the lastActionTime property: Last action time of the upgrade.
*
* @return the lastActionTime value.
*/
public OffsetDateTime lastActionTime() {
return this.lastActionTime;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
78576e92d286a5d2a600db96f0365fd62124f124 | 96d71f73821cfbf3653f148d8a261eceedeac882 | /external/decompiled/android/WhatsApp-2.8.4278_dex2jar.src/com/whatsapp/dm.java | 89e05217140e2d8518717c4b49788cedb2b94ea8 | [] | no_license | JaapSuter/Niets | 9a9ec53f448df9b866a8c15162a5690b6bcca818 | 3cc42f8c2cefd9c3193711cbf15b5304566e08cb | refs/heads/master | 2020-04-09T19:09:40.667155 | 2012-09-28T18:11:33 | 2012-09-28T18:11:33 | 5,751,595 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,350 | java | package com.whatsapp;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
class dm
implements View.OnClickListener
{
private static final String z;
final Conversation a;
static
{
char[] arrayOfChar = "XK��".toCharArray();
int i = arrayOfChar.length;
int j = 0;
if (i <= j)
{
z = new String(arrayOfChar).intern();
return;
}
int k = arrayOfChar[j];
int m;
switch (j % 5)
{
default:
m = 94;
case 0:
case 1:
case 2:
case 3:
}
while (true)
{
arrayOfChar[j] = (char)(m ^ k);
j++;
break;
m = 50;
continue;
m = 34;
continue;
m = 100;
continue;
m = 69;
}
}
dm(Conversation paramConversation)
{
}
public void onClick(View paramView)
{
boolean bool = DialogToastListActivity.f;
Conversation.y(this.a).setVisibility(8);
this.a.V.setVisibility(8);
if (this.a.Qb.n)
{
Intent localIntent = new Intent(this.a, ViewProfilePhoto.class);
localIntent.putExtra(z, this.a.Qb.b);
this.a.startActivity(localIntent);
if (!bool);
}
else if (Conversation.k(this.a))
{
iz.a(this.a.Qb, this.a, 19);
if (!bool);
}
else
{
App.a(this.a, 2131296654, 0);
}
}
} | [
"git@jaapsuter.com"
] | git@jaapsuter.com |
a13e8cfca9cc95552c8a852b31f013bd6abb2b32 | 3841f7991232e02c850b7e2ff6e02712e9128b17 | /小浪底泥沙三维/EV_Xld/jni/src/JAVA/EV_GAWrapper/src/com/earthview/world/spatial3d/controls/GlobeAnimationPathClassFactory.java | 2c34965533f9f00f60becd21b87a563e85310c61 | [] | no_license | 15831944/BeijingEVProjects | 62bf734f1cb0a8be6fed42cf6b207f9dbdf99e71 | 3b5fa4c4889557008529958fc7cb51927259f66e | refs/heads/master | 2021-07-22T14:12:15.106616 | 2017-10-15T11:33:06 | 2017-10-15T11:33:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.earthview.world.spatial3d.controls;
import global.*;
import com.earthview.world.base.*;
import com.earthview.world.util.*;
import com.earthview.world.core.*;
public class GlobeAnimationPathClassFactory implements IClassFactory {
public BaseObject create()
{
GlobeAnimationPath emptyInstance = new GlobeAnimationPath(CreatedWhenConstruct.CWC_NotToCreate);
return emptyInstance;
}
}
| [
"yanguanqi@aliyun.com"
] | yanguanqi@aliyun.com |
f1b02e78e353b05355d74b322e3a12eb1092baf5 | 5b779a104b58a6a6f3641a099cac9514f663179d | /Whatsapp/app/src/main/java/com/example/serialkiller/KillersData.java | 5e1d47292ee5b984165136428f5621a6a63efb20 | [] | no_license | auliaAgust/ListView | 1cfe347bce13b1bd98677c31e33a8f9e13a0bacf | e822908d3ed094920fb75da9c0a5b8d38ffa4b15 | refs/heads/master | 2022-12-08T15:03:35.749267 | 2020-09-04T10:55:34 | 2020-09-04T10:55:34 | 292,824,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,470 | java | package com.example.serialkiller;
import java.util.ArrayList;
public class KillersData {
private static String[] detail = {
"Treat People With Kindness!",
"Booyah!",
"Potato",
"It's aLl YoURs hoHOho",
"I I I I am your little butterfly",
"Kuberi kamu satu permintaan!",
"Kuberi kamu satu permintaan!",
"Hiiii there!",
"Hi There! Whatsapp is using me",
"Terima jasa bersih-bersih halaman!"
};
private static String[] nama = {
"Abang Harry",
"Adekku",
"Abang Niall",
"Abang Zayn",
"Anak Ilang",
"Jin Biru",
"Mba Ari",
"Ponakan",
"Teh Taylor",
"Tukang Kebun"
};
private static int[] foto = {
R.drawable.harry,
R.drawable.adek,
R.drawable.niall,
R.drawable.zayn,
R.drawable.bocilcpwp,
R.drawable.jin,
R.drawable.ariana,
R.drawable.bocil,
R.drawable.taylor,
R.drawable.kebun
};
static ArrayList<BarisKontak> getListData(){
ArrayList<BarisKontak> list = new ArrayList<>();
for (int pos=0; pos<nama.length; pos++){
BarisKontak bunuh = new BarisKontak(foto[pos], nama[pos], detail[pos]);
list.add(bunuh);
}
return list;
}
}
| [
"auliaguss@gmail.com"
] | auliaguss@gmail.com |
52d64bfd0c971fa94c9c8db5f8a3e707cf110824 | 7a0bdcdf74972c9991ed3aa486e269772ef52b9a | /344.java | 812f58acb72527987ad4f7d9afe4f1d01aedff06 | [] | no_license | michaelshum321/leetcode | 488900037dc94bc5bea5a14bc7458da83c3b08b1 | c2e56a9371513edde1eef8bd0181d47f47b91648 | refs/heads/master | 2022-08-01T05:19:45.752235 | 2020-05-19T22:36:34 | 2020-05-19T22:36:34 | 219,041,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | // 344. Reverse String
// https://leetcode.com/problems/reverse-string/
class Solution {
public void reverseString(char[] s) {
rev(s,0, s.length - 1);
}
private void rev(char[] s, int lower, int higher) {
if (lower >= higher) {
return;
}
// fun with not using temp var
s[higher] ^= s[lower]; //s[h] has s[l] and s[h]
s[lower] ^= s[higher]; // s[l] has s[h]
s[higher] ^= s[lower]; // s[h] has s[l]
rev(s, lower+1, higher-1);
return;
}
} | [
"michael-shum@hotmail.com"
] | michael-shum@hotmail.com |
15142fab2e91b39b953da039aa29f6dcaba0644a | a02807595f98bb2a756c16fc743458d22aa8b5d1 | /MinNumber_07.java | 9321273c0f244a3017a683b63ea14d818f8da275 | [] | no_license | VasilKostadinov1/NestedLoopLab | 1e33f67c2fc1a9c4656c620661d8e58c4491daa9 | dae242c9584f809b42f22c5e8e6230b68bcd2bf6 | refs/heads/main | 2023-08-28T08:42:18.463809 | 2021-10-17T15:40:57 | 2021-10-17T15:40:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 539 | java | package BASIC.WhileLoopLab;
import java.util.Scanner;
public class MinNumber_07 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
int min = Integer.MAX_VALUE;
while (!input.equals("Stop")) {
int number = Integer.parseInt(input);
if (number < min) {
min = number;
}
input = scanner.nextLine();
}
System.out.println(min);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
1f82ce578f65adf46cf0beea8c86691cefc39e56 | bddaf801e0d89e98b5fbba5a31e757edcfdd30e1 | /zjc/src/com/git/controller/ZjcController.java | 1074610ca8e579756f28da5df756dcca4f97e1ca | [] | no_license | Zhou-jiancai/git-project | 963a496bc9913a92154abcb660ab40a5821814ab | 8d622bea7e1a0718e6af13131153d43bf86c7741 | refs/heads/master | 2023-02-27T22:23:39.191090 | 2020-06-11T01:23:25 | 2020-06-11T01:23:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | package com.git.controller;
public class ZjcController {
private int id;
private String username;
private String password;
private int sex;
private String love;
}
| [
"505512907@qq.com"
] | 505512907@qq.com |
cfe41c6259b434b70d0a243a09edb686618b9147 | 24b5a13a14182ea00062087e11bae56e9559c729 | /JMapper performance Test/src/test/java/com/googlecode/jmapper/integrationtest/operations/bean/CollectionS.java | 6fe13d22ad077ae1affc0fa671efb79c1d324176 | [
"Apache-2.0"
] | permissive | jmapper-framework/jmapper-test | 5970277a01a643f12e4e4eeb17c6f90b7b9d7b84 | 34d8ce4e5c36f8bfe937c479e700d4ed75e2a476 | refs/heads/master | 2021-01-17T10:06:17.534690 | 2016-12-28T20:15:02 | 2016-12-28T20:15:02 | 34,121,892 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,222 | java | package com.googlecode.jmapper.integrationtest.operations.bean;
import static com.googlecode.jmapper.util.GeneralUtility.newLine;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import com.googlecode.jmapper.annotations.JMap;
public class CollectionS {
@JMap("aSetD")
private List<String> aListS;
@JMap("aHashSetD")
private ArrayList<String> aArrayListS;
@JMap("aArrayListD")
private Set<String> aSetS;
@JMap("aListD")
private HashSet<String> aHashSetS;
@JMap("aSortedSetD")
private Queue<String> aQueueS;
@JMap("aLinkedListD")
private LinkedList<String> aLinkedListS;
@JMap("aQueueD")
private SortedSet<String> aSortedSetS;
@JMap("aTreeSetD")
private TreeSet<String> aTreeSetS;
/**
* @param aListS
* @param aArrayListS
* @param aSetS
* @param aHashSetS
* @param aQueueS
* @param aLinkedListS
* @param aSortedSetS
* @param aTreeSetS
*/
public CollectionS(List<String> aListS, ArrayList<String> aArrayListS,
Set<String> aSetS, HashSet<String> aHashSetS,
Queue<String> aQueueS, LinkedList<String> aLinkedListS,
SortedSet<String> aSortedSetS, TreeSet<String> aTreeSetS) {
super();
this.aListS = aListS;
this.aArrayListS = aArrayListS;
this.aSetS = aSetS;
this.aHashSetS = aHashSetS;
this.aQueueS = aQueueS;
this.aLinkedListS = aLinkedListS;
this.aSortedSetS = aSortedSetS;
this.aTreeSetS = aTreeSetS;
}
public List<String> getAListS() {
return aListS;
}
public void setAListS(List<String> aListS) {
this.aListS = aListS;
}
public ArrayList<String> getAArrayListS() {
return aArrayListS;
}
public void setAArrayListS(ArrayList<String> aArrayListS) {
this.aArrayListS = aArrayListS;
}
public Set<String> getASetS() {
return aSetS;
}
public void setASetS(Set<String> aSetS) {
this.aSetS = aSetS;
}
public HashSet<String> getAHashSetS() {
return aHashSetS;
}
public void setAHashSetS(HashSet<String> aHashSetS) {
this.aHashSetS = aHashSetS;
}
public Queue<String> getAQueueS() {
return aQueueS;
}
public void setAQueueS(Queue<String> aQueueS) {
this.aQueueS = aQueueS;
}
public LinkedList<String> getALinkedListS() {
return aLinkedListS;
}
public void setALinkedListS(LinkedList<String> aLinkedListS) {
this.aLinkedListS = aLinkedListS;
}
public SortedSet<String> getASortedSetS() {
return aSortedSetS;
}
public void setASortedSetS(SortedSet<String> aSortedSetS) {
this.aSortedSetS = aSortedSetS;
}
public TreeSet<String> getATreeSetS() {
return aTreeSetS;
}
public void setATreeSetS(TreeSet<String> aTreeSetS) {
this.aTreeSetS = aTreeSetS;
}
public CollectionS() {}
@Override
public String toString() {
return "CollectionS"+newLine+"aListS=" + aListS + newLine+" aArrayListS=" + aArrayListS
+ newLine+" aSetS=" + aSetS + newLine+" aHashSetS=" + aHashSetS
+ newLine+" aQueueS=" + aQueueS + newLine+" aLinkedListS=" + aLinkedListS
+ newLine+" aSortedSetS=" + aSortedSetS + newLine+" aTreeSetS=" + aTreeSetS;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((aArrayListS == null) ? 0 : aArrayListS.hashCode());
result = prime * result
+ ((aHashSetS == null) ? 0 : aHashSetS.hashCode());
result = prime * result
+ ((aLinkedListS == null) ? 0 : aLinkedListS.hashCode());
result = prime * result + ((aListS == null) ? 0 : aListS.hashCode());
result = prime * result + ((aQueueS == null) ? 0 : aQueueS.hashCode());
result = prime * result + ((aSetS == null) ? 0 : aSetS.hashCode());
result = prime * result
+ ((aSortedSetS == null) ? 0 : aSortedSetS.hashCode());
result = prime * result
+ ((aTreeSetS == null) ? 0 : aTreeSetS.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CollectionS other = (CollectionS) obj;
if (aArrayListS == null) {
if (other.aArrayListS != null)
return false;
} else if (!aArrayListS.equals(other.aArrayListS))
return false;
if (aHashSetS == null) {
if (other.aHashSetS != null)
return false;
} else if (!aHashSetS.equals(other.aHashSetS))
return false;
if (aLinkedListS == null) {
if (other.aLinkedListS != null)
return false;
} else if (!aLinkedListS.equals(other.aLinkedListS))
return false;
if (aListS == null) {
if (other.aListS != null)
return false;
} else if (!aListS.equals(other.aListS))
return false;
if (aQueueS == null) {
if (other.aQueueS != null)
return false;
} else if (!aQueueS.equals(other.aQueueS))
return false;
if (aSetS == null) {
if (other.aSetS != null)
return false;
} else if (!aSetS.equals(other.aSetS))
return false;
if (aSortedSetS == null) {
if (other.aSortedSetS != null)
return false;
} else if (!aSortedSetS.equals(other.aSortedSetS))
return false;
if (aTreeSetS == null) {
if (other.aTreeSetS != null)
return false;
} else if (!aTreeSetS.equals(other.aTreeSetS))
return false;
return true;
}
}
| [
"alessandro.vurro@decisyon.com"
] | alessandro.vurro@decisyon.com |
42c1d111bc48988cee9c14082015249cd778ae76 | 7ad0c0385c19b9aa7d1f9f5b162a0838b4f08e03 | /Netshop/src/com/netshop/adapter/AddrAdapter.java | a2e79f12cd129acd48321013f0e7eb6d72fcfa30 | [] | no_license | xhjwhat/Mywork | 9c6fa26809953321c10141942a8e3e34beb9b077 | 54e8225794d91a6638b3e0f0a1a3448fdc2df879 | refs/heads/master | 2016-09-05T10:07:08.511748 | 2015-06-07T14:46:58 | 2015-06-07T14:46:58 | 34,663,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,148 | java | package com.netshop.adapter;
import java.util.List;
import com.netshop.activity.AddrManagerActivity;
import com.netshop.app.R;
import com.netshop.entity.Addr;
import com.netshop.net.HttpRequest;
import com.netshop.net.HttpRequest.HttpCallBack;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class AddrAdapter extends BaseAdapter {
public List<Addr> addrs;
public Context context;
public Handler handler;
public AddrAdapter(Context context,List<Addr> datas,Handler handler){
this.context = context;
addrs = datas;
this.handler = handler;
}
public void setList(List<Addr> datas){
addrs = datas;
}
@Override
public int getCount() {
return addrs.size();
}
@Override
public Object getItem(int position) {
return addrs.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
HoldView holder;
if(convertView == null){
holder = new HoldView();
convertView = LayoutInflater.from(context).inflate(R.layout.addr_manage_item, null);
holder.addr = (TextView)convertView.findViewById(R.id.addmanage_addr);
holder.name = (TextView)convertView.findViewById(R.id.addmanage_name);
holder.phone = (TextView)convertView.findViewById(R.id.addmanage_phone);
holder.del = (TextView)convertView.findViewById(R.id.addrmanage_delete_text);
//holder.edit = (TextView)convertView.findViewById(R.id.addrmanage_eidt_text);
holder.check = (ImageView)convertView.findViewById(R.id.addrmanage_default_img);
holder.layout = convertView.findViewById(R.id.default_layout);
convertView.setTag(holder);
}
else{
holder = (HoldView) convertView.getTag();
}
if(addrs.get(position).getIsde().equals("1")){
holder.layout.setVisibility(View.GONE);
}else{
holder.layout.setVisibility(View.VISIBLE);
holder.check.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Message msg = handler.obtainMessage();
msg.obj = addrs.get(position).getId();
msg.what = AddrManagerActivity.CHECK_DEFAULT;
handler.sendMessage(msg);
}
});
// holder.edit.setOnClickListener(new OnClickListener() {
// public void onClick(View v) {
// handler.sendEmptyMessage(AddrManagerActivity.EDIT);
// }
// });
holder.del.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Message msg = handler.obtainMessage();
msg.obj = addrs.get(position).getId();
msg.what = AddrManagerActivity.DELETE;
handler.sendMessage(msg);
}
});
}
holder.addr.setText(addrs.get(position).getAddress());
holder.name.setText(addrs.get(position).getName());
holder.phone.setText(addrs.get(position).getPhone());
return convertView;
}
class HoldView {
TextView name,phone,addr,del,edit;
ImageView check;
View layout;
}
}
| [
"xhjwhat@163.com"
] | xhjwhat@163.com |
fdd09c535879885de995253392b50bcea1ef1258 | db69c6701862d322c6a69b9667f956fbca912c8b | /알고리즘 2주차 Solution/SWexpert 문제/홍성표/등산로 조성.java | 17f8661b217b46ee4a5343c40936515e0e0771c4 | [] | no_license | KIMYONGGEE/SSAFY-Algorithm-Study-Daejeon5-Team2 | fb0409b2a2b056d8828caf307dd4447366ad4998 | 339565a4074922e4bef58095c636f4d42bb24eb5 | refs/heads/main | 2023-03-29T07:00:21.958737 | 2021-04-11T03:54:20 | 2021-04-11T03:54:20 | 342,811,440 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,963 | java | package com.company;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static int[][] map;
static boolean[][] visited;
static int N, K, max;
static int[] dx = {1, -1, 0, 0};
static int[] dy = {0, 0, 1, -1};
public static void main(String[] args) throws IOException {
int T = Integer.parseInt(br.readLine());
int[] result = new int[T];
for (int i = 0; i < T; i++) {
result[i] = getResult();
}
for (int i = 0; i < T; i++) {
System.out.printf("#%d %d\n", i + 1, result[i]);
}
}
private static int getResult() throws IOException {
String[] input = br.readLine().split(" ");
N = Integer.parseInt(input[0]);
K = Integer.parseInt(input[1]);
map = new int[N][N];
int highest = Integer.MIN_VALUE;
for (int i = 0; i < N; i++) {
String[] line = br.readLine().split(" ");
for (int j = 0; j < N; j++) {
map[i][j] = Integer.parseInt(line[j]);
if (highest < map[i][j]) highest = map[i][j];
}
}
max = Integer.MIN_VALUE;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N ; j++) {
if (map[i][j] != highest) continue;
visited = new boolean[N][N];
visited[i][j] = true;
dfs(i,j,1,false);
}
}
return max;
}
private static void dfs(int x, int y, int dist, boolean used) {
for (int i = 0; i < 4; i++) {
int nextX = x + dx[i];
int nextY = y + dy[i];
// 유효하지 않음 범위이거나 이미 방문한 곳이면 continue
if (nextX < 0 || nextY < 0 || nextX >= N || nextY >= N || visited[nextX][nextY]) continue;
// 다음 장소의 높이가 현재 높이보다 크거나 같은 경우
if (map[x][y] <= map[nextX][nextY]) {
// 공사를 이미 했거나, 최대 공사 높이(K)보다 두 높이의 차이가 크면 공사 불가능
if (used || map[nextX][nextY] - map[x][y] + 1 > K) continue;
// 다음 높이를 현재 높이보다 1 작은 높이로 변경
int temp = map[nextX][nextY];
map[nextX][nextY] = map[x][y] - 1;
visited[nextX][nextY] = true;
dfs(nextX, nextY, dist + 1, true);
map[nextX][nextY] = temp;
visited[nextX][nextY] = false;
} else { // 다음 장소의 높이가 현재 높이보다 작은 경우
visited[nextX][nextY] = true;
dfs(nextX, nextY, dist + 1,used);
visited[nextX][nextY] = false;
}
}
max = Math.max(max, dist);
}
} | [
"sphong0417@gmail.com"
] | sphong0417@gmail.com |
f7a20b1d05972845b1f7cfe38e38fe158ed73c24 | be2b7e91bb8cebf9b52ba5d76877f8870de28cfb | /app/src/main/java/com/film/movie/moviepopulareapp/MovieAdapterTrailer.java | 808db701eeb8a9ade7685115f99b3f92aadaf5c2 | [] | no_license | MinaBAlexander/MinaBAlexander-MoviePopulareApp-ba7975f | 2eba3185eac587ef23a9af5b249569d6b9884608 | 3026efd6971a6b03aec317fc58cfe4f7b732c05e | refs/heads/master | 2021-01-10T16:23:50.918254 | 2016-02-05T14:46:48 | 2016-02-05T14:46:48 | 51,176,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,097 | java | package com.film.movie.moviepopulareapp;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.ArrayList;
public class MovieAdapterTrailer extends ArrayAdapter<Movie> {
ArrayList<Movie> list;
LayoutInflater vi;
int Resource;
Context context;
public MovieAdapterTrailer(Context context, int resource, ArrayList<Movie> objects) {
super(context, resource, objects);
vi = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Resource = resource;
list = objects;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null)
v = vi.inflate(Resource, null);
Movie movie = list.get(position);
TextView tx_trailer=(TextView)v.findViewById(R.id.ViewTrailer);
tx_trailer.setText(movie.getTrailer());
return v;
}
}
| [
"eng_mariam58@yahoo.com"
] | eng_mariam58@yahoo.com |
8f0b584afa6456cab5f8ba7019d5325656899300 | a494be473e52ff211d8cf10a81028bacc2abe112 | /aspenos.org/exception/SDbException.java | b426dd807de13f45ba7b654a6de5b99b19f2c1e1 | [
"MIT"
] | permissive | pmark/AspenOS | a65f7285ed96ba03d88041e0f900a17ddabe0984 | b04901b9d3855393f24dde7130990e647b940e0a | refs/heads/master | 2021-01-10T06:19:48.552416 | 2015-06-04T17:54:49 | 2015-06-04T17:54:49 | 36,886,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package org.aspenos.exception;
import java.sql.*;
/**
*
* @see java.lang.Exception
* @see java.lang.Throwable
*/
public class SDbException extends SQLException
{
/**
* Constructs an <code>SDbException</code> with no specified detail message.
*/
public SDbException(){
super();
}
/**
* Constructs an <code>SDbException</code> with the specified detail message.
*
* @param s the detail message.
*/
public SDbException(String s){
super(s);
}
}
| [
"manderson@flightstats.com"
] | manderson@flightstats.com |
4d18e79de7c315cb7c981de169ca58975744469a | 01c51072fa3f20016ee04cbb3261d7a171838114 | /RUI/src/main/java/ru/mf/rui/core/controller/SpringContextHelper.java | dc416181c21532eb09718cb371ddc5cab35f0b28 | [] | no_license | kpv87/RUI | 812efc93950226a4f452034f6f243cf172f412a8 | 87a9c2f08b67d823679e3454ce70e9971e1a1a4c | refs/heads/master | 2021-01-21T21:54:00.874473 | 2016-01-19T06:31:25 | 2016-01-19T06:31:25 | 33,850,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | 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 ru.mf.rui.core.controller;
import javax.servlet.ServletContext;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
*
* @author Zip
*/
public class SpringContextHelper {
private ApplicationContext applicationContext;
public SpringContextHelper(ServletContext servletContext) {
applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
}
public Object getBean(final String beanRef){
return applicationContext.getBean(beanRef);
}
}
| [
"pavel.krutov@gmail.com"
] | pavel.krutov@gmail.com |
9ac460c0d4085284d1828d8d21a53b74d9541ce0 | 89d4a3802845331bb7780fb65cf95f30a7506449 | /opt-may-2016/kevin/com/two95/chapter6/ExceptionTest4.java | 425dda1eaf049d99da647ac797585156e3d906dd | [] | no_license | nipulgurupatel/optmay2016 | 1bee34f4daff36cd4d9511275aa13471f34988d9 | b50b15e0bcdce4ca9315a779a5963c7fe3378e2f | refs/heads/master | 2020-12-25T03:00:47.178524 | 2016-07-16T22:07:29 | 2016-07-16T22:07:29 | 61,904,798 | 2 | 0 | null | 2016-07-16T22:07:48 | 2016-06-24T18:34:18 | Java | UTF-8 | Java | false | false | 204 | java | package com.two95.chapter6;
public class ExceptionTest4 {
public static void main(String[] args) {
Calculator calc = new Calculator();
calc.divide(10, 2);
calc.divide(10, 0);
}
}
| [
"Kevin Santhosh@Mark.fios-router.home"
] | Kevin Santhosh@Mark.fios-router.home |
dc3ae8f0ce8f74b3cbeca984ca2bd00a32f22f4d | b895255dc398ec4dab0e64edcc958194849ee7d5 | /Sklepy/src/ShopMain.java | 2fd89a7a49647fcb8dce1d8921020927cce1d243 | [] | no_license | CichyWonder/Java-Poj-PJATK | 4658e8ae059045e15858ece2d4977576d0a03345 | d302661374239d038a8f47a93e775ec9397105ad | refs/heads/master | 2023-02-13T05:07:36.084484 | 2021-01-06T17:17:35 | 2021-01-06T17:17:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | public class ShopMain {
public static void main(String[] args){
Bookshop bookshop = new Bookshop("Polska 3",5, new String[]{"Zeszyt","Słownik","Książka"});
Bakery bakery = new Bakery ("Żeromskiego 23",2, new String[]{"Chleb","Bułka","Drożdżówka"});
System.out.println(bookshop.getInformation());
System.out.println(bakery.getInformation());
}
}
| [
"cichychannel@onet.pl"
] | cichychannel@onet.pl |
922ee0f1fbb37d3ccb22daf99db1fa897a33a1ec | a45f559a07504529973b106bb354ef99dfcc5029 | /RacesServlets/src/main/java/entity/response/RaceResponseAvailable.java | 277ffe003b344fd45c148294015c0aa97b0b24dd | [] | no_license | AntonHladkiy/OOP_semester_6 | 8574d6f56d23b21460b1f5087c3f5df6525eeaf9 | d8cc44d01f00ffa65dd05bcc2dab580c2b352149 | refs/heads/main | 2023-05-26T03:44:55.185236 | 2021-06-16T07:13:51 | 2021-06-16T07:13:51 | 377,405,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package entity.response;
import entity.Runner;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class RaceResponseAvailable {
private Integer race_id;
private String raceName;
private Double coef1;
private Double coef2;
private Runner runner1;
private Runner runner2;
}
| [
"gladkyy@ukr.net"
] | gladkyy@ukr.net |
34a6bbbba6661571b630eaf12b12a2e03d57fa47 | 24748d9c3311c5683f1d6e815fa7e24740c3709a | /Java_1.8/Lamda_Basics/src/Com/Artek/Unit1.java | 17617c9fa85fbf9442481860258ac05b3e8feea3 | [] | no_license | pradeepp82/mypractice | 6262a862770f4a8bcfaf5e6be725d51c5d24b915 | 3b845d2b7635271d5a75631ae47515c429d4a7cb | refs/heads/master | 2021-07-17T07:48:18.324173 | 2017-10-25T07:20:23 | 2017-10-25T07:20:23 | 108,234,160 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package Com.Artek;
import java.util.Arrays;
import java.util.List;
public class Unit1 {
public static void main(String[] args) {
List<Person> people = Arrays.asList(new Person("pp", "rp", 23),
new Person("ad", "dj", 21),
new Person("lgm", "jsdbd", 27),
new Person("fjn", "jkdjj", 28),
new Person("jvjv", "gaga", 29)
);
// step :1 sort list y lastname
//step :2 create method and print all elements in the list
// step 3 create a method and print all element with last name start with c
}
}
| [
"panwarp82@gmail.com"
] | panwarp82@gmail.com |
70ddfe220b6d1d2dcc0932379a2668a7ff98487b | 3d42da3e52e8dfccf61b601ab1a8c93bc44a9e11 | /src/test/java/FinalSeleniumTest.java | 28773dfa447ade8f6f39f44c453486f5ceb92f82 | [] | no_license | nika-sketch/selenium-final-project | b749a9ea87cc6b693e0ab6d9dac26bd93326801f | b846198df8a34a7ae8dbb6a5804b8329a146e0dc | refs/heads/master | 2023-07-05T08:35:39.599490 | 2021-08-14T06:01:50 | 2021-08-14T06:01:50 | 395,906,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,589 | java | /*
at least 3 different types of Xpath -> line 54(using title), line 57(using href), line 109(using img src)
at least 3 different types of cssSelector -> line 138(using relative(short) selector), line 80(using id selector), line 151(using absolute)
at least 3 different types of By.. -> line 64(name), line 76(css), line 94(xpath)
at least 3 different types of JsExecutor -> line 143(scroll down(bottom of page)), line 62(passing value in it), line 160(scroll into view)
*/
import java.util.List;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import java.time.LocalTime;
import java.util.ArrayList;
import org.openqa.selenium.*;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
import java.util.NoSuchElementException;
import java.time.format.DateTimeFormatter;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class FinalSeleniumTest extends ConstantsForFinalSeleniumTest {
WebDriver driver = null;
@Parameters("browserName")
@BeforeTest
public void setup(String browserName) {
if (browserName.equalsIgnoreCase("chrome")) {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
} else if (browserName.equalsIgnoreCase("firefox")) {
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
}
}
@Test
public void TestAll() throws InterruptedException {
driver.get(MAIN_SITE_URL);
JavascriptExecutor js = (JavascriptExecutor) driver;
waitForClick();
WebElement myAccount = driver.findElement(By.xpath(MY_ACCOUNT_XPATH));
myAccount.click();
WebElement registerButton = driver.findElement(By.xpath(REGISTER_BUTTON_XPATH));
registerButton.click();
waitForClick();
js.executeScript("document.getElementById('input-firstname').value='John';");
WebElement lastName = driver.findElement(By.name(LASTNAME_BY_NAME));
lastName.clear();
lastName.sendKeys(LASTNAME);
WebElement eMail = driver.findElement(By.xpath(EMAIL_XPATH));
eMail.clear();
eMail.sendKeys(getUniqueEmail());
WebElement telephone = driver.findElement(By.xpath(TELEPHONE_XPATH));
telephone.clear();
telephone.sendKeys(TELEPHONE_NUMBER);
WebElement password = driver.findElement(By.cssSelector(PASSWORD_SELECTOR));
password.clear();
password.sendKeys(PASSWORD);
WebElement confirmPassword = driver.findElement(By.cssSelector(CONFIRM_PASSWORD_SELECTOR));
confirmPassword.clear();
confirmPassword.sendKeys(PASSWORD);
WebElement radioButton = driver.findElement(By.name(RADIO_BUTTON_NAME));
if (radioButton.isEnabled()) {
radioButton.click();
}
WebElement privacyPolicyAgreement = driver.findElement(By.name(POLICY_AGREEMENT_NAME));
if (privacyPolicyAgreement.isEnabled()) {
privacyPolicyAgreement.click();
}
WebElement continueButton = driver.findElement(By.xpath(CONTINUE_BUTTON_XPATH));
continueButton.click();
waitForClick();
Actions actions = new Actions(driver);
WebElement desktops = driver.findElement(By.xpath(DESKTOPS_XPATH));
actions.moveToElement(desktops).perform();
WebElement showAllDesktops = driver.findElement(By.xpath(ALL_DESKTOPS_XPATH));
showAllDesktops.click();
WebElement mp3Players = driver.findElement(By.cssSelector(MP3_PLAYERS_SELECTOR));
mp3Players.click();
WebElement iPodShuffle = driver.findElement(By.xpath(IPOD_SHUFFLE_XPATH));
iPodShuffle.click();
WebElement iPodShuffleImage = driver.findElement(By.cssSelector(IPOD_SHUFFLE_IMAGE_SELECTOR));
iPodShuffleImage.click();
WebElement rightClickImage = driver.findElement(By.xpath(RIGHT_CLICK_ON_BUTTON_XPATH));
Integer countImages = 1;
for (int i = 0; i < 4; i++) {
rightClickImage.click();
waitForClick();
countImages++;
}
WebElement imageCounter = driver.findElement(By.className(IMAGE_COUNTER_CLASSNAME));
String imageCounterText = imageCounter.getText();
Integer imageCounterToInt = Integer.parseInt(String.valueOf(imageCounterText.charAt(0)));
boolean checkCounter = false;
if (imageCounterToInt.equals(countImages)) {
checkCounter = true;
Assert.assertEquals(imageCounterToInt, countImages);
System.out.println("4 photos are seen!");
}
WebElement closeImages = driver.findElement(By.xpath(CLOSE_IMAGES_XPATH));
closeImages.click();
WebElement writeReview = driver.findElement(By.cssSelector(WRITE_REVIEW_SELECTOR));
writeReview.click();
waitForClick();
js.executeScript("window.scrollBy(0,document.body.scrollHeight)");
waitForClick();
WebElement review = driver.findElement(By.cssSelector(REVIEW_SELECTOR));
review.clear();
review.sendKeys(REVIEW);
WebElement ratingRadioButton = driver.findElement(By.cssSelector(RATING_RADIO_BUTTON_SELECTOR));
ratingRadioButton.click();
WebElement submitReview = driver.findElement(By.cssSelector(SUBMIT_REVIEW_SELECTOR));
submitReview.click();
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("button-cart")));
WebElement addToCardButton = driver.findElement(By.cssSelector("#button-cart"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", addToCardButton);
addToCardButton.click();
waitForClick();
WebElement cardTotal = driver.findElement(By.id(CARD_TOTAL_ID));
String realAmount = cardTotal.getText().substring(12);
if (realAmount.equals("$122.00")) {
System.out.println("Item successfully added to your cart");
}
WebElement checkForCheckoutCart = driver.findElement(By.id(CARD_TOTAL_ID));
checkForCheckoutCart.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(UNVISIBLEELEMENTXPATH)));
driver.findElement(By.xpath(UNVISIBLEELEMENTXPATH)).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.name(FIRST_NAME_DETAILS)));;
WebElement firstNamingDetails = driver.findElement(By.name(FIRST_NAME_DETAILS));
firstNamingDetails.clear();
firstNamingDetails.sendKeys(NAME);
WebElement lastNamingDetails = driver.findElement(By.id(LAST_NAME));
lastNamingDetails.clear();
lastNamingDetails.sendKeys(LASTNAME);
WebElement address = driver.findElement(By.xpath(ADDRESS_XPATH));
address.clear();
address.sendKeys(ADDRESS);
WebElement city = driver.findElement(By.name(CITY));
city.clear();
city.sendKeys(OUR_CITY);
WebElement testDropDown = driver.findElement(By.id(TEST_DROPDOWN_ID));
testDropDown.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(GEORGIA)));
driver.findElement(By.xpath(GEORGIA)).click();
WebElement regionState = driver.findElement(By.id(REGIONSTATE_ID));
regionState.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(TBILISI)));
driver.findElement(By.xpath(TBILISI)).click();
WebElement buttonPaymentContinueButton = driver.findElement(By.id(PAYMENT_ID));
buttonPaymentContinueButton.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(BUTTON_SHIPPING_ADDRESS_ID)));
WebElement deliveryDetailsContinueButton = driver.findElement(By.id(BUTTON_SHIPPING_ADDRESS_ID));
deliveryDetailsContinueButton.click();
// wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("button-shipping-method")));
// WebElement deliveryMethodContinueButton = driver.findElement(By.id("button-shipping-method"));
// deliveryDetailsContinueButton.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.name(COMMENT)));
WebElement comment = driver.findElement(By.name(COMMENT));
comment.clear();
comment.sendKeys("Commented here!");
WebElement deliveryMethodButton = driver.findElement(By.id(DELIVERY_ID));
deliveryMethodButton.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(TERMS_AND_CONDITIONS_XPATH)));
WebElement termsAndConditionsRadioButton = driver.findElement(By.xpath(TERMS_AND_CONDITIONS_XPATH));
termsAndConditionsRadioButton.click();
WebElement paymentMethodContinueButton = driver.findElement(By.id(BUTTON_PAYMENT));
paymentMethodContinueButton.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(TOTAL_AMOUNT_XPATH)));
WebElement totalAmount = driver.findElement(By.xpath(TOTAL_AMOUNT_XPATH));
String totalAmountText = totalAmount.getText();
if (totalAmountText.equals("$100.00")) {
System.out.println("Item was successfully bought on your cart!");
} else {
System.out.println("you did not buy an item, try again!");
}
try {
WebElement flatShippingRate = driver.findElement(By.xpath(SHIPPING_RATE_XPATH));
String flatShippingRateText = flatShippingRate.getText();
System.out.println(flatShippingRateText);
if (flatShippingRateText.equals("$5.00")) {
System.out.println("Flat shipping rate checked");
} else {
System.out.println("Flat shipping error!");
}
} catch (NoSuchElementException | NotFoundException e) {
System.out.println(e.getMessage());
}
WebElement confirmOrderButton = driver.findElement(By.id(CONFIRM_BUTTON_ID));
confirmOrderButton.click();
waitForClick();
WebElement orderPlacedSection = driver.findElement(By.xpath(ORDER_PLACED_SECTION_XPATH));
orderPlacedSection.click();
List<WebElement> listOfTable = driver.findElements(By.xpath(LIST_OF_TABLE_XPATH));
ArrayList<String> elements = new ArrayList<String>();
boolean temp = false;
for (WebElement e: listOfTable) {
String currentElement = e.getText();
elements.add(currentElement);
}
System.out.println(elements);
WebElement checkStatus = driver.findElement(By.xpath(CHECK_STATUS_XPATH));
if (checkStatus.getText().equals("Pending")) {
System.out.println("Status is pending!");
}
}
private static void waitForClick() throws InterruptedException {
TimeUnit.SECONDS.sleep(3);
}
private static String getUniqueEmail() {
DateTimeFormatter datetime = DateTimeFormatter.ofPattern("HHmmss");
LocalTime localtime = LocalTime.now();
String randomStringGenerator = datetime.format(localtime);
return "johnDoe" + randomStringGenerator + "@gmail.com";
}
}
| [
"nikoloz.latsabidze.1@btu.edu.ge"
] | nikoloz.latsabidze.1@btu.edu.ge |
dff35b7e3ead844ff30b745c2d1b7822cdb79260 | 5dc8e89cb551f2fdcabbaede0b583b5fa0e8ebac | /app/src/test/java/ru/com/penza/myfinalapp/ExampleUnitTest.java | 28e907e6255f656d2cf9b04e865063cac66fdc86 | [] | no_license | ljubchenkok/MyFinalApp | 85f4fb75b0f1dc9594f8e36d8584d9c3dfc161c6 | ed3611c4cca0dbc2cde62786821831c2feab4ab2 | refs/heads/master | 2021-09-09T07:14:19.735436 | 2018-03-13T13:17:41 | 2018-03-13T13:17:41 | 125,054,501 | 0 | 0 | null | 2018-03-13T14:20:38 | 2018-03-13T13:17:32 | Java | UTF-8 | Java | false | false | 401 | java | package ru.com.penza.myfinalapp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"ljubchenko.k@gmail.com"
] | ljubchenko.k@gmail.com |
15eed2e93786be98ae266a388970a9efe2f594c8 | cc35f5baee3a1ed241aa7636e50bed84db8ad0a8 | /imgloader_lib/src/main/java/com/waitou/imgloader_lib/ImageLoader.java | c7a36ab546fc6d8f89b98db806c8ccf730096a28 | [] | no_license | liket/Towards | c79c6c67b6c5a00344415bd93ff935ac0506e835 | 6d583d3fd312815ba7b728b64c1be3d9915eac1a | refs/heads/master | 2022-01-05T05:06:47.352381 | 2019-04-29T11:46:56 | 2019-04-29T11:46:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,220 | java | package com.waitou.imgloader_lib;
import android.annotation.SuppressLint;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.BitmapImageViewTarget;
import com.bumptech.glide.request.target.DrawableImageViewTarget;
/**
* auth aboom
* date 2018/8/8
* 圆角变换 RoundedCorners
* 圆形变换 circleCrop
* <p>
* <p>
* CenterCrop,FitCenter
* CenterCrop,FitCenter都是对目标图片进行裁剪,了解过ImageView的ScaleType属性就知道,
* 这2种裁剪方式在ImageView上也是有的,分别对应ImageView的ImageView.ScaleType.CENTER_CROP和mageView.ScaleType.FIT_CENTER的.
* <p>
* DiskCacheStrategy.NONE:什么都不缓存
* DiskCacheStrategy.SOURCE:仅缓存原图(全分辨率的图片)
* DiskCacheStrategy.RESULT:仅缓存最终的图片,即修改了尺寸或者转换后的图片
* DiskCacheStrategy.ALL:缓存所有版本的图片,默认模式
* <p>
* 下载优先级
* • Priority.LOW
* • Priority.NORMAL
* • Priority.HIGH
* • Priority.IMMEDIATE
* <p>
* Glide.with(context)
* .load(url)
* .asBitmap() 强制处理成bitmap
* .asGif() 指明了加载gif图,即使不指定Glide也会自己判断
* .placeholder() 加载中显示的图片
* .error()加载错误显示的图片
* .crossFade()淡入显示,如果设置了这个则需要去掉asBitmap
* .dontAnimte()直接显示图片
* .override(80,80).//设置最终显示的图片像素为80*80,注意:这个是像素,而不是控件的宽高
* .centerCrop().//中心裁剪,缩放填充至整个ImageView
* .skipMemoryCache(true).//跳过内存缓存
* .diskCacheStrategy(DiskCacheStrategy.RESULT).//保存最终图片
* .thumbnail(0.1f).//10%的原图大小
* .transform(new BlurTransformation(this)).//高斯模糊处理
* .animate(R.anim.left_in).//加载xml文件定义的动画
* <p>
* 清理磁盘缓存 需要在子线程中执行
* Glide.get(this).clearDiskCache();
* 清理内存缓存 可以在UI主线程中进
* Glide.get(this).clearMemory();
*/
public class ImageLoader {
/**
* 通用的加载图片的方法
*
* @param imageView 加载的view
* @param url 加载的url
*/
public static void displayImage(ImageView imageView, String url) {
Glide.with(imageView)
.load(url)
.transition(new DrawableTransitionOptions().crossFade())
.into(imageView);
}
/**
* 通用的加载图片的方法
*
* @param imageView 加载的view
* @param url 加载的url
* @param placeholder 占位图
*/
public static void displayImage(ImageView imageView, String url, int placeholder) {
Glide.with(imageView)
.load(url)
.transition(new DrawableTransitionOptions().crossFade())
.apply(getRequestOptions(DisplayOptions.build().setPlaceholder(placeholder)))
.into(imageView);
}
/**
* 通用的加载图片的方法
*
* @param imageView 加载的view
* @param url 加载的url
* @param options 配置属性
*/
public static void displayImage(ImageView imageView, String url, DisplayOptions options) {
Glide.with(imageView)
.load(url)
.transition(new DrawableTransitionOptions().crossFade())
.apply(getRequestOptions(options))
.into(imageView);
}
/**
* 图片加载方法回调加载
*/
public static void displayImage(ImageView imageView, String url, BitmapImageViewTarget target) {
Glide.with(imageView)
.asBitmap()
.load(url)
.transition(new BitmapTransitionOptions().crossFade())
.into(target);
}
/**
* 图片加载方法回调加载
*/
public static void displayImage(ImageView imageView, String url, int placeholder, BitmapImageViewTarget target) {
Glide.with(imageView)
.asBitmap()
.load(url)
.transition(new BitmapTransitionOptions().crossFade())
.apply(getRequestOptions(DisplayOptions.build().setPlaceholder(placeholder)))
.into(target);
}
/**
* 图片加载方法回调加载
*/
public static void displayImage(ImageView imageView, String url, DisplayOptions options, BitmapImageViewTarget target) {
Glide.with(imageView)
.asBitmap()
.load(url)
.transition(new BitmapTransitionOptions().crossFade())
.apply(getRequestOptions(options))
.into(target);
}
/**
* 图片加载方法回调加载
*/
public static void displayImage(ImageView imageView, String url, DrawableImageViewTarget target) {
Glide.with(imageView)
.load(url)
.transition(new DrawableTransitionOptions().crossFade())
.into(target);
}
/**
* 图片加载方法回调加载
*/
public static void displayImage(ImageView imageView, String url, int placeholder, DrawableImageViewTarget target) {
Glide.with(imageView)
.load(url)
.transition(new DrawableTransitionOptions().crossFade())
.apply(getRequestOptions(DisplayOptions.build().setPlaceholder(placeholder)))
.into(target);
}
/**
* 图片加载方法回调加载
*/
public static void displayImage(ImageView imageView, String url, DisplayOptions options, DrawableImageViewTarget target) {
Glide.with(imageView)
.load(url)
.transition(new DrawableTransitionOptions().crossFade())
.apply(getRequestOptions(options))
.into(target);
}
/**
* 清除image上的图片
*/
public static void clearImage(ImageView imageView) {
Glide.with(imageView).clear(imageView);
}
@SuppressLint("CheckResult")
static RequestOptions getRequestOptions(DisplayOptions options) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.diskCacheStrategy(DiskCacheStrategy.RESOURCE);
if (options == null) {
return requestOptions;
}
if (options.getPlaceholder() != DisplayOptions.RES_NONE) {
requestOptions.placeholder(options.getPlaceholder());
}
if (options.getPlaceholder() != DisplayOptions.RES_NONE) {
requestOptions.error(options.getError());
}
if (options.getTransformation() != null) {
requestOptions.transform(options.getTransformation());
}
if (options.getWidth() != DisplayOptions.RES_NONE && options.getHeight() != DisplayOptions.RES_NONE) {
requestOptions.override(options.getWidth(), options.getHeight());
}
return requestOptions;
}
}
| [
"374735994@qq.com"
] | 374735994@qq.com |
038f8dacd24658dc5dcba14bd05da1bda891db25 | 2612f336d667a087823234daf946f09b40d8ca3d | /platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConnectionTester.java | 398e1bafaea5f33d650c148ec7ad8fc7d5c0706f | [
"Apache-2.0"
] | permissive | tnorbye/intellij-community | df7f181861fc5c551c02c73df3b00b70ab2dd589 | f01cf262fc196bf4dbb99e20cd937dee3705a7b6 | refs/heads/master | 2021-04-06T06:57:57.974599 | 2018-03-13T17:37:00 | 2018-03-13T17:37:00 | 125,079,130 | 2 | 0 | Apache-2.0 | 2018-03-13T16:09:41 | 2018-03-13T16:09:41 | null | UTF-8 | Java | false | false | 2,222 | java | package com.intellij.remoteServer.impl.configuration;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.remoteServer.configuration.RemoteServer;
import com.intellij.remoteServer.runtime.ServerConnection;
import com.intellij.remoteServer.runtime.ServerConnectionManager;
import com.intellij.remoteServer.runtime.ServerConnector;
import com.intellij.remoteServer.runtime.deployment.ServerRuntimeInstance;
import com.intellij.util.concurrency.Semaphore;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.atomic.AtomicReference;
public class RemoteServerConnectionTester {
public interface Callback {
void connectionTested(boolean wasConnected, @NotNull String hadStatusText);
}
private final RemoteServer<?> myServer;
public RemoteServerConnectionTester(@NotNull RemoteServer<?> server) {
myServer = server;
}
public void testConnection(@NotNull Callback callback) {
final ServerConnection connection = ServerConnectionManager.getInstance().createTemporaryConnection(myServer);
final AtomicReference<Boolean> connectedRef = new AtomicReference<>(null);
final Semaphore semaphore = new Semaphore();
semaphore.down();
//noinspection unchecked
connection.connectIfNeeded(new ServerConnector.ConnectionCallback() {
@Override
public void connected(@NotNull ServerRuntimeInstance serverRuntimeInstance) {
connectedRef.set(true);
semaphore.up();
connection.disconnect();
}
@Override
public void errorOccurred(@NotNull String errorMessage) {
connectedRef.set(false);
semaphore.up();
}
});
new Task.Backgroundable(null, "Connecting...", true) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setIndeterminate(true);
while (!indicator.isCanceled()) {
if (semaphore.waitFor(500)) {
break;
}
}
final Boolean connected = connectedRef.get();
if (connected == null) {
return;
}
callback.connectionTested(connected, connection.getStatusText());
}
}.queue();
}
}
| [
"michael.golubev@jetbrains.com"
] | michael.golubev@jetbrains.com |
d5a0fd2c777a9b35a87c17074666212ef16d26af | 4f82735458d47c7e8b93ac830b887250e0c902ac | /src/main/java/com/nishith/config/DatasourcePoolConfigProperties.java | fa90c9e82f4214a03e2e3c9b6c008112f85e07e3 | [
"MIT"
] | permissive | mobiquitousnishith/ro-routing-datasource-sample | 6503455e7333cd75fdcb70435bae2183596186e4 | be332efb613ae1f9ea3e501956b6b4e12ca8a12c | refs/heads/master | 2023-07-08T01:38:47.329401 | 2021-08-19T19:26:49 | 2021-08-19T19:26:49 | 397,301,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package com.nishith.config;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DatasourcePoolConfigProperties {
protected long connectionTimeout;
protected long idleTimeout;
protected int maximumPoolSize;
protected int minimumIdle;
protected String poolName;
protected long maxLifetime;
}
| [
"nshah@mobiquityinc.com"
] | nshah@mobiquityinc.com |
faf3fb014b7ff55105d23d901c86c4c0847d00bf | d908f8607075767e45d3e30aacb32b4a07f1a47c | /src/test/java/org/group3/parking/controller/UserControllerTest.java | 521d0fd43cf60a7dbb66ed09b4682b5f58741cda | [] | no_license | wangyuqi0706/parking_lot_management | 5ff27dc53c31485357c4cddb8b7464022bc155a4 | a92d8946951c685a2975fe6a73c12f2e64086375 | refs/heads/master | 2023-01-28T20:38:12.640709 | 2020-12-16T10:28:47 | 2020-12-16T10:28:47 | 310,193,427 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,376 | java | package org.group3.parking.controller;
import org.group3.parking.ParkingApplication;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ParkingApplication.class)
@WebAppConfiguration
@Transactional
public class UserControllerTest {
@Autowired
private WebApplicationContext webApplicationContext;
private MockMvc mockMvc;
private MockHttpSession session;
@Before
public void setUp() throws Exception {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
}
@After
public void tearDown() throws Exception {
}
@Test
public void enter() throws Exception {
enterRequest("川ATEST1", "2020-12-09T10:20", "ok");
enterRequest("川ATEST2", "2020-12-09T10:20", "ok");
//同一辆车试图进入两次
enterRequest("川ATEST2", "2020-12-09T10:30", "error");
}
@Test
public void leave() throws Exception {
enterRequest("川ATEST1", "2020-12-09T10:20", "ok");
enterRequest("川ATEST2", "2020-12-09T10:20", "ok");
leaveRequest("川ATEST1", "2020-12-09T17:16");
leaveRequest("川ATEST2", "2020-12-10T10:30");
//未进入的车辆试图离开
leaveRequest("川ATEST3", "2020-12-10T10:30");
//TEST1再次进入
enterRequest("川ATEST1", "2020-12-11T10:20", "ok");
leaveRequest("川ATEST1", "2020-12-14T10:20");
}
@Test
public void pay() {
}
private void enterRequest(String plateNumber, String enterTime, String expected) throws Exception {
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders
.post("/user/enter")
.accept(MediaType.APPLICATION_JSON_VALUE)
.param("plateNumber", plateNumber)
.param("enterTime", enterTime))
.andExpect(MockMvcResultMatchers.content().string(expected))
.andReturn();
System.out.println(mvcResult.getResponse().getContentAsString());
}
private void leaveRequest(String plateNumber, String leaveTime) throws Exception {
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders
.post("/user/leave")
.accept(MediaType.APPLICATION_JSON_VALUE)
.param("plateNumber", plateNumber)
.param("leaveTime", leaveTime))
.andReturn();
System.out.println(mvcResult.getResponse().getContentAsString());
}
} | [
"wangyuqi2000@outlook.com"
] | wangyuqi2000@outlook.com |
eaac11749d6ceb48ff935422fd43a5986937ba26 | f491b6dc9da691e6a995415b3a4276b0809e0f71 | /AtividadeC/src/Cap06/app/TestaEmpresa.java | 46547c2820281eebbbb84ceec4ed80860ceb3e12 | [] | no_license | henriquesgarcia/POO-2017-HENRIQUE | 7005f59b630015b9ae89e4abe7df0179e2dd0d86 | 3ae1b373ef438ed6f9e5701a629f3f329f7d3fce | refs/heads/master | 2021-05-07T15:25:27.009173 | 2018-03-14T19:05:27 | 2018-03-14T19:05:27 | 110,008,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,059 | java | package Cap06.app;
import Cap06.model.Empresa;
import Cap06.model.Funcionario;
import javax.swing.*;
public class TestaEmpresa {
public static void main(String[] args) {
Empresa empresa = new Empresa("Walmart", "123456",3);
for (int i = 0; i < 3; i++) {
Funcionario f = new Funcionario();
empresa.adiciona(f);
/*
Data dataF2 = new Data(25,9,2017);
Funcionario f2 = new Funcionario(
"Silva",
"Administração",
940.00,
dataF2,
"3.530.868"
);
empresa.adiciona(f2);
Data dataF3 = new Data(13,10,2017);
Funcionario f3 = new Funcionario(
"Garcia",
"Contabilidade",
840.00,
dataF3,
"3.530.868"
);
empresa.adiciona(f3);
*/
}
JOptionPane.showMessageDialog(null,empresa);
}
} | [
"enriqe_garcia15@hotmail.com"
] | enriqe_garcia15@hotmail.com |
07ce27abb9f01c8d62d646e9d3644e8ec7d043b7 | dcc1f467cda26200c7148ed81492ec70130c2bf7 | /Matrix/Matrix.java | 78d7beab40b151554c936fe50a6f009d5e98139c | [] | no_license | MuhammadMoiz200099/All_Data_Structures | c202ed2f515bc2ffcd09ad48fb672b5bc74ac72f | ae486ff5760ab5f11b78fdf988839a18b4172205 | refs/heads/master | 2020-04-15T01:54:43.951648 | 2019-01-06T10:26:24 | 2019-01-06T10:26:24 | 164,295,945 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,958 | java | package Matrix;
/**
*
*
* @author Muhammad Moiz
*
*/
public class Matrix {
public static void main(String[] args) {
int[][] data1 = new int[0][0];
int[][] data2 = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int[][] data3 = {{1, 4, 7}, {2, 5, 8}, {3, 6, 9}};
Matrix m1 = new Matrix(data1);
Matrix m2 = new Matrix(data2);
Matrix m3 = new Matrix(data3);
System.out.println("m1 --> Rows: " + m1.getRows() + " Columns: " + m1.getColumns());
System.out.println("m2 --> Rows: " + m2.getRows() + " Columns: " + m2.getColumns());
System.out.println("m3 --> Rows: " + m3.getRows() + " Columns: " + m3.getColumns());
System.out.println("m2 -->\n" + m2);
data2[1][1] = 101;
System.out.println("m2 -->\n" + m2);
System.out.println("m2==null: " + m2.equals(null));
System.out.println("m3==\"MATRIX\": " + m2.equals("MATRIX"));
System.out.println("m2==m1: " + m2.equals(m1));
System.out.println("m2==m2: " + m2.equals(m2));
System.out.println("m2==m3: " + m2.equals(m3));
System.out.println("2 * m2:\n" + m2.scale(2));
System.out.println("m2 / 2:\n" + m2.divide(2));
System.out.println("m2 + m3:\n" + m2.plus(m3));
System.out.println("m2 - m3:\n" + m2.minus(m3));
System.out.println("m2 * m3: \n"+m2.multiply(m3));
}
private int[][] data;
public Matrix(int[][] pData) {
if(pData.length != 0) {
int[][] newData = new int[pData.length][pData[0].length];
for(int i = 0; i < pData.length; i++)
for(int j = 0; j < pData[0].length; j++)
newData[i][j] = pData[i][j];
this.data = newData;
} else {
this.data = null;
}
}
public int getElement(int x, int y) {
return data[x][y];
}
public int getRows() {
if(this.data == null)
return 0;
return data.length;
}
public int getColumns() {
if(this.data == null)
return 0;
return data[0].length;
}
public Matrix scale(int scalar) {
int[][] newData = new int[this.data.length][this.data[0].length];
for (int i = 0; i < this.getRows(); ++i)
for(int j = 0; j < this.getColumns(); ++j)
newData[i][j] = this.data[i][j] * scalar;
return new Matrix(newData);
}
public Matrix divide(int scalar) {
int[][] newData = new int[this.data.length][this.data[0].length];
for (int i = 0; i < this.getRows(); ++i)
for(int j = 0; j < this.getColumns(); ++j)
newData[i][j] = this.data[i][j] / scalar;
return new Matrix(newData);
}
public Matrix plus(Matrix other) throws RuntimeException {
int[][] newData = new int[this.data.length][this.data[0].length];
if(this.getRows() != other.getRows() || this.getColumns() != other.getColumns())
throw new RuntimeException("Not the same size matrix.");
for (int i = 0; i < this.getRows(); ++i)
for(int j = 0; j < this.getColumns(); ++j)
newData[i][j] = this.data[i][j] + other.getElement(i, j);
return new Matrix(newData);
}
public Matrix minus(Matrix other) throws RuntimeException {
int[][] newData = new int[this.data.length][this.data[0].length];
if(this.getRows() != other.getRows() || this.getColumns() != other.getColumns())
throw new RuntimeException("Not the same size matrix.");
for (int i = 0; i < this.getRows(); ++i)
for(int j = 0; j < this.getColumns(); ++j)
newData[i][j] = this.data[i][j] - other.getElement(i, j);
return new Matrix(newData);
}
public Matrix multiply(Matrix other) throws RuntimeException {
int[][] newData = new int[this.data.length][other.getColumns()];
if(this.getColumns() !=other.getRows())
throw new RuntimeException("The two matrices cannot be multiplied.");
int sum;
for (int i = 0; i < this.getRows(); ++i)
for(int j = 0; j < other.getColumns(); ++j){
sum = 0;
for(int k=0;k<this.getColumns();++k){
sum += this.data[i][k] * other.getElement(k, j);
}
newData[i][j] = sum;
}
return new Matrix(newData);
}
public boolean equals(Matrix other) {
return this == other;
}
public String toString() {
String str = "";
for(int i = 0; i < this.data.length; i++) {
str += "[ ";
for(int j = 0; j < this.data[0].length; j++) {
str += data[i][j];
str += " ";
}
str += "]";
str += "\n";
}
return str;
}
public Matrix transpose() {
int[][] newData = new int[this.data[0].length][this.data.length];
for (int i = 0; i < this.getColumns(); ++i)
for(int j = 0; j < this.getRows(); ++j)
newData[i][j] = this.data[j][i];
return new Matrix(newData);
}
}
| [
"muhammadmoiz"
] | muhammadmoiz |
87d45c6b0e074e591831877fcf629fc1d0dc743b | 15e165287c621af6bfa4713b92517d5818fcf5b2 | /src/main/java/com/usda/fmsc/twotrails/objects/map/ArcGisPolygonGraphic.java | 4b3f781cababb691ac18bc5632aea07081a3f991 | [] | no_license | FMSC-Measurements/TwoTrails-Android | 4d00b0362909e2b48b809d2e7bbb02dd8b92c10f | eba591ee433beaee31f2a2ef8e79063332bdc8cf | refs/heads/master | 2023-08-31T21:50:20.286351 | 2023-08-24T17:28:02 | 2023-08-24T17:28:02 | 51,478,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,822 | java | package com.usda.fmsc.twotrails.objects.map;
import androidx.annotation.ColorInt;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.PointCollection;
import com.esri.arcgisruntime.geometry.Polygon;
import com.esri.arcgisruntime.geometry.Polyline;
import com.esri.arcgisruntime.geometry.SpatialReferences;
import com.esri.arcgisruntime.mapping.view.Graphic;
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
import com.esri.arcgisruntime.mapping.view.MapView;
import com.esri.arcgisruntime.symbology.SimpleLineSymbol;
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol;
import com.esri.arcgisruntime.symbology.Symbol;
import com.usda.fmsc.geospatial.Extent;
import com.usda.fmsc.geospatial.Position;
import com.usda.fmsc.twotrails.fragments.map.IMultiMapFragment.MarkerData;
import com.usda.fmsc.twotrails.objects.TtMetadata;
import com.usda.fmsc.twotrails.objects.points.TtPoint;
import com.usda.fmsc.twotrails.objects.TtPolygon;
import com.usda.fmsc.twotrails.units.OpType;
import com.usda.fmsc.twotrails.utilities.TtUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class ArcGisPolygonGraphic implements IPolygonGraphic, IMarkerDataGraphic {
private TtPolygon polygon;
private PolygonDrawOptions drawOptions;
private PolygonGraphicOptions graphicOptions;
private HashMap<String, MarkerData> _MarkerData;
private final MapView map;
private Extent polyBounds;
private GraphicsOverlay _AdjBndPts, _UnadjBndPts, _AdjNavPts, _UnadjNavPts, _WayPts, _AdjMiscPts, _UnadjMiscPts;
private GraphicsOverlay _AdjBndCB, _UnadjBndCB;
private GraphicsOverlay _AdjBnd, _UnadjBnd, _AdjNav, _UnadjNav;
public ArcGisPolygonGraphic(MapView map) {
this.map = map;
}
@Override
public void build(TtPolygon polygon, List<TtPoint> points, HashMap<String, TtMetadata> meta, PolygonGraphicOptions graphicOptions, PolygonDrawOptions drawOptions) {
this.polygon = polygon;
this.drawOptions = drawOptions;
this.graphicOptions = graphicOptions;
_MarkerData = new HashMap<>();
_AdjBndCB = new GraphicsOverlay();
_UnadjBndCB = new GraphicsOverlay();
_AdjBnd = new GraphicsOverlay();
_UnadjBnd = new GraphicsOverlay();
_AdjNav = new GraphicsOverlay();
_UnadjNav = new GraphicsOverlay();
_AdjBndPts = new GraphicsOverlay();
_AdjNavPts = new GraphicsOverlay();
_UnadjBndPts = new GraphicsOverlay();
_UnadjNavPts = new GraphicsOverlay();
_WayPts = new GraphicsOverlay();
_AdjMiscPts = new GraphicsOverlay();
_UnadjMiscPts = new GraphicsOverlay();
Extent.Builder llBuilder = new Extent.Builder();
PointCollection adjBndPC = new PointCollection(SpatialReferences.getWgs84());
PointCollection unadjBndPC = new PointCollection(SpatialReferences.getWgs84());
PointCollection adjBndPLC = new PointCollection(SpatialReferences.getWgs84());
PointCollection unadjBndPLC = new PointCollection(SpatialReferences.getWgs84());
PointCollection adjNavPLC = new PointCollection(SpatialReferences.getWgs84());
PointCollection unadjNavPLC = new PointCollection(SpatialReferences.getWgs84());
SimpleMarkerSymbol adjMkOpts = new SimpleMarkerSymbol(
SimpleMarkerSymbol.Style.DIAMOND,
graphicOptions.getAdjPtsColor(),
(int)graphicOptions.getUnAdjWidth()
);
SimpleMarkerSymbol unAdjMkOpts = new SimpleMarkerSymbol(
SimpleMarkerSymbol.Style.SQUARE,
graphicOptions.getUnAdjPtsColor(),
(int)graphicOptions.getUnAdjWidth()
);
Position adjPos, unAdjPos;
Point adjLL, unadjLL;
TtMetadata metadata;
MarkerData adjMd, unadjMd;
for (TtPoint point : points) {
metadata = meta.get(point.getMetadataCN());
adjPos = TtUtils.Points.getLatLonFromPoint(point, true, metadata);
adjLL = new Point(adjPos.getLongitudeSignedDecimal(), adjPos.getLatitudeSignedDecimal(), SpatialReferences.getWgs84());
unAdjPos = TtUtils.Points.getLatLonFromPoint(point, false, metadata);
unadjLL = new Point(unAdjPos.getLongitudeSignedDecimal(), unAdjPos.getLatitudeSignedDecimal(), SpatialReferences.getWgs84());
adjMd = new MarkerData(point, metadata, true);
unadjMd = new MarkerData(point, metadata, false);
_MarkerData.put(adjMd.getKey(), adjMd);
_MarkerData.put(unadjMd.getKey(), unadjMd);
if (point.isBndPoint()) {
Graphic adjmk = new Graphic(adjLL, adjMkOpts);
adjmk.getAttributes().put(MarkerData.ATTR_KEY, adjMd.getKey());
_AdjBndPts.getGraphics().add(adjmk);
Graphic unadjmk = new Graphic(adjLL, unAdjMkOpts);
unadjmk.getAttributes().put(MarkerData.ATTR_KEY, unadjMd.getKey());
_UnadjBndPts.getGraphics().add(unadjmk);
adjBndPC.add(adjLL);
unadjBndPC.add(unadjLL);
adjBndPLC.add(adjLL);
unadjBndPLC.add(unadjLL);
}
if (point.isNavPoint()) {
Graphic adjmk = new Graphic(adjLL, adjMkOpts);
adjmk.getAttributes().put(MarkerData.ATTR_KEY, adjMd.getKey());
_AdjNavPts.getGraphics().add(adjmk);
Graphic unadjmk = new Graphic(adjLL, unAdjMkOpts);
unadjmk.getAttributes().put(MarkerData.ATTR_KEY, unadjMd.getKey());
_UnadjNavPts.getGraphics().add(unadjmk);
adjNavPLC.add(adjLL);
unadjNavPLC.add(unadjLL);
}
if (point.getOp() == OpType.WayPoint) {
Graphic unadjmk = new Graphic(adjLL, unAdjMkOpts);
unadjmk.getAttributes().put(MarkerData.ATTR_KEY, unadjMd.getKey());
_WayPts.getGraphics().add(unadjmk);
}
if (point.getOp() == OpType.SideShot && !point.isOnBnd()) {
Graphic adjmk = new Graphic(adjLL, adjMkOpts);
adjmk.getAttributes().put(MarkerData.ATTR_KEY, adjMd.getKey());
_AdjMiscPts.getGraphics().add(adjmk);
Graphic unadjmk = new Graphic(adjLL, unAdjMkOpts);
unadjmk.getAttributes().put(MarkerData.ATTR_KEY, unadjMd.getKey());
_UnadjMiscPts.getGraphics().add(unadjmk);
}
llBuilder.include(adjPos);
}
if (points.size() > 0) {
polyBounds = llBuilder.build();
} else {
polyBounds = null;
}
SimpleLineSymbol outline = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, graphicOptions.getAdjBndColor(), graphicOptions.getAdjWidth());
_AdjBnd.getGraphics().add(new Graphic(new Polygon(adjBndPLC), outline));
_AdjBndCB.getGraphics().add(new Graphic(new Polyline(adjBndPC), outline));
outline = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, graphicOptions.getUnAdjBndColor(), graphicOptions.getUnAdjWidth());
_UnadjBnd.getGraphics().add(new Graphic(new Polygon(unadjBndPLC), outline));
_UnadjBndCB.getGraphics().add(new Graphic(new Polyline(unadjBndPC), outline));
outline = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, graphicOptions.getAdjNavColor(), graphicOptions.getAdjWidth());
_AdjNav.getGraphics().add(new Graphic(new Polyline(adjNavPLC), outline));
outline = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, graphicOptions.getUnAdjNavColor(), graphicOptions.getUnAdjWidth());
_UnadjNav.getGraphics().add(new Graphic(new Polyline(unadjNavPLC), outline));
if (drawOptions.isVisible()) {
if (drawOptions.isAdjBnd()) {
if (drawOptions.isAdjBndClose()) {
_AdjBnd.setVisible(false);
} else {
_AdjBndCB.setVisible(false);
}
} else {
_AdjBnd.setVisible(false);
_AdjBndCB.setVisible(false);
}
if (drawOptions.isUnadjBnd()) {
if (drawOptions.isUnadjBndClose()) {
_UnadjBnd.setVisible(false);
} else {
_UnadjBndCB.setVisible(false);
}
} else {
_UnadjBnd.setVisible(false);
_UnadjBndCB.setVisible(false);
}
if (!drawOptions.isAdjNav()) {
_AdjNav.setVisible(false);
}
if (!drawOptions.isUnadjNav()) {
_UnadjNav.setVisible(false);
}
if (!drawOptions.isAdjBndPts()) {
_AdjBndPts.setVisible(false);
}
if (!drawOptions.isUnadjBndPts()) {
_UnadjBndPts.setVisible(false);
}
if (!drawOptions.isAdjNavPts()) {
_AdjNavPts.setVisible(false);
}
if (!drawOptions.isUnadjNavPts()) {
_UnadjNavPts.setVisible(false);
}
if (!drawOptions.isAdjMiscPts()) {
_AdjMiscPts.setVisible(false);
}
if (!drawOptions.isUnadjMiscPts()) {
_UnadjMiscPts.setVisible(false);
}
if (!drawOptions.isWayPts()) {
_WayPts.setVisible(false);
}
} else {
_AdjBnd.setVisible(false);
_AdjBndCB.setVisible(false);
_UnadjBnd.setVisible(false);
_UnadjBndCB.setVisible(false);
_AdjNav.setVisible(false);
_UnadjNav.setVisible(false);
_AdjBndPts.setVisible(false);
_UnadjBndPts.setVisible(false);
_AdjNavPts.setVisible(false);
_UnadjNavPts.setVisible(false);
_AdjMiscPts.setVisible(false);
_UnadjMiscPts.setVisible(false);
_WayPts.setVisible(false);
}
map.getGraphicsOverlays().addAll(Arrays.asList(
_UnadjBnd, _UnadjBndCB,
_AdjBnd, _AdjBndCB,
_UnadjNav, _AdjNav,
_UnadjBndPts, _AdjBndPts,
_UnadjNavPts, _AdjNavPts,
_UnadjMiscPts, _AdjMiscPts,
_WayPts));
}
@Override
public TtPolygon getPolygon() {
return polygon;
}
@Override
public PolygonDrawOptions getDrawOptions() {
return drawOptions;
}
@Override
public HashMap<String, MarkerData> getMarkerData() {
return _MarkerData;
}
@Override
public Extent getExtents() {
return polyBounds;
}
@Override
public Position getPosition() {
return polyBounds.getCenter();
}
@Override
public PolygonGraphicOptions getGraphicOptions() {
return graphicOptions;
}
//region Get Layers
public GraphicsOverlay getAdjBndPtsLayer() {
return _AdjBndPts;
}
public GraphicsOverlay getUnadjBndPtsLayer() {
return _UnadjBndPts;
}
public GraphicsOverlay getAdjNavPtsLayer() {
return _AdjNavPts;
}
public GraphicsOverlay getUnadjNavPtsLayer() {
return _UnadjNavPts;
}
public GraphicsOverlay getWayPtsLayer() {
return _WayPts;
}
public GraphicsOverlay getAdjMiscPtsLayer() {
return _AdjMiscPts;
}
public GraphicsOverlay getUnadjMiscPtsLayer() {
return _UnadjMiscPts;
}
public GraphicsOverlay getAdjBndCBLayer() {
return _AdjBndCB;
}
public GraphicsOverlay getUnadjBndCBLayer() {
return _UnadjBndCB;
}
public GraphicsOverlay getAdjBndLayer() {
return _AdjBnd;
}
public GraphicsOverlay getUnadjBndLayer() {
return _UnadjBnd;
}
public GraphicsOverlay getAdjNavLayer() {
return _AdjNav;
}
//endregion
//region Setters
@Override
public void setVisible(boolean visible) {
drawOptions.setVisible(visible);
if (drawOptions.isAdjBnd()) {
if (drawOptions.isAdjBndClose()) {
_AdjBndCB.setVisible(visible);
}
else
_AdjBnd.setVisible(visible);
}
if (drawOptions.isAdjBndPts())
_AdjBndPts.setVisible(visible);
if (drawOptions.isUnadjBnd()) {
if (drawOptions.isUnadjBndClose())
_UnadjBndCB.setVisible(visible);
else
_UnadjBnd.setVisible(visible);
}
if (drawOptions.isUnadjBndPts())
_UnadjBndPts.setVisible(visible);
if (drawOptions.isAdjNav())
_AdjNav.setVisible(visible);
if (drawOptions.isAdjNavPts())
_AdjNavPts.setVisible(visible);
if (drawOptions.isUnadjNav())
_UnadjNav.setVisible(visible);
if (drawOptions.isUnadjNavPts())
_UnadjNavPts.setVisible(visible);
if (drawOptions.isAdjMiscPts())
_AdjMiscPts.setVisible(visible);
if (drawOptions.isUnadjMiscPts())
_UnadjMiscPts.setVisible(visible);
if (drawOptions.isWayPts())
_WayPts.setVisible(visible);
}
@Override
public void setAdjBndVisible(boolean visible) {
drawOptions.setAdjBnd(visible);
visible &= drawOptions.isVisible();
if (drawOptions.isAdjBndClose())
_AdjBndCB.setVisible(visible);
else
_AdjBnd.setVisible(visible);
}
@Override
public void setAdjBndPtsVisible(boolean visible) {
drawOptions.setAdjBndPts(visible);
visible &= drawOptions.isVisible();
_AdjBndPts.setVisible(visible);
}
@Override
public void setUnadjBndVisible(boolean visible) {
drawOptions.setUnadjBnd(visible);
visible &= drawOptions.isVisible();
if (drawOptions.isUnadjBndClose())
_UnadjBndCB.setVisible(visible);
else
_UnadjBnd.setVisible(visible);
}
@Override
public void setUnadjBndPtsVisible(boolean visible) {
drawOptions.setUnadjBndPts(visible);
visible &= drawOptions.isVisible();
_UnadjBndPts.setVisible(visible);
}
@Override
public void setAdjNavVisible(boolean visible) {
drawOptions.setAdjNav(visible);
visible &= drawOptions.isVisible();
_AdjNav.setVisible(visible);
}
@Override
public void setAdjNavPtsVisible(boolean visible) {
drawOptions.setAdjNavPts(visible);
visible &= drawOptions.isVisible();
_AdjNavPts.setVisible(visible);
}
@Override
public void setUnadjNavVisible(boolean visible) {
drawOptions.setUnadjNav(visible);
visible &= drawOptions.isVisible();
_UnadjNav.setVisible(visible);
}
@Override
public void setUnadjNavPtsVisible(boolean visible) {
drawOptions.setUnadjNavPts(visible);
visible &= drawOptions.isVisible();
_UnadjNavPts.setVisible(visible);
}
@Override
public void setAdjMiscPtsVisible(boolean visible) {
drawOptions.setAdjMiscPts(visible);
visible &= drawOptions.isVisible();
_AdjMiscPts.setVisible(visible);
}
@Override
public void setUnadjMiscPtsVisible(boolean visible) {
drawOptions.setUnadjMiscPts(visible);
visible &= drawOptions.isVisible();
_UnadjMiscPts.setVisible(visible);
}
@Override
public void setWayPtsVisible(boolean visible) {
drawOptions.setWayPts(visible);
visible &= drawOptions.isVisible();
_WayPts.setVisible(visible);
}
@Override
public void setAdjBndClose(boolean close) {
drawOptions.setAdjBndClose(close);
if (drawOptions.isVisible()) {
if (drawOptions.isAdjBndClose()) {
_AdjBndCB.setVisible(true);
_AdjBnd.setVisible(false);
} else {
_AdjBndCB.setVisible(false);
_AdjBnd.setVisible(true);
}
}
}
@Override
public void setUnadjBndClose(boolean close) {
drawOptions.setUnadjBndClose(close);
if (drawOptions.isVisible()) {
if (drawOptions.isUnadjBndClose()) {
_UnadjBndCB.setVisible(true);
_UnadjBnd.setVisible(false);
} else {
_UnadjBndCB.setVisible(false);
_UnadjBnd.setVisible(true);
}
}
}
@Override
public void setAdjBndColor(@ColorInt int adjBndColor) {
graphicOptions.setAdjBndColor(adjBndColor);
setLineColor(adjBndColor, _AdjBnd);
setLineColor(adjBndColor, _AdjBndCB);
}
@Override
public void setUnAdjBndColor(@ColorInt int unAdjBndColor) {
graphicOptions.setUnAdjBndColor(unAdjBndColor);
setLineColor(unAdjBndColor, _UnadjBnd);
setLineColor(unAdjBndColor, _UnadjBndCB);
}
@Override
public void setAdjNavColor(@ColorInt int adjNavColor) {
graphicOptions.setAdjNavColor(adjNavColor);
setLineColor(adjNavColor, _AdjNav);
}
@Override
public void setUnAdjNavColor(@ColorInt int unAdjNavColor) {
graphicOptions.setUnAdjNavColor(unAdjNavColor);
setLineColor(unAdjNavColor, _UnadjNav);
}
@Override
public void setAdjPtsColor(@ColorInt int adjPtsColor) {
graphicOptions.setAdjPtsColor(adjPtsColor);
setPtsColor(adjPtsColor, _AdjBndPts);
setPtsColor(adjPtsColor, _AdjNavPts);
}
@Override
public void setUnAdjPtsColor(@ColorInt int unAdjPtsColor) {
graphicOptions.setUnAdjPtsColor(unAdjPtsColor);
setPtsColor(unAdjPtsColor, _UnadjBndPts);
setPtsColor(unAdjPtsColor, _UnadjNavPts);
}
@Override
public void setWayPtsColor(@ColorInt int wayPtsColor) {
graphicOptions.setWayPtsColor(wayPtsColor);
setPtsColor(wayPtsColor, _WayPts);
}
private void setLineColor(@ColorInt int color, GraphicsOverlay graphicOverlay) {
if (graphicOverlay.getGraphics().size() > 0) {
Graphic[] graphics = graphicOverlay.getGraphics().toArray(new Graphic[0]);
graphicOverlay.getGraphics().clear();
for (Graphic g : graphics) {
Symbol s = g.getSymbol();
if (s instanceof SimpleLineSymbol) {
SimpleLineSymbol sls = (SimpleLineSymbol)s;
sls.setColor(color);
graphicOverlay.getGraphics().remove(g);
graphicOverlay.getGraphics().add(new Graphic(g.getGeometry(), sls));
}
}
}
}
private void setPtsColor(@ColorInt int color, GraphicsOverlay graphicOverlay) {
if (graphicOverlay.getGraphics().size() > 0) {
Graphic[] graphics = graphicOverlay.getGraphics().toArray(new Graphic[0]);
graphicOverlay.getGraphics().clear();
for (Graphic g : graphics) {
Symbol s = g.getSymbol();
if (s instanceof SimpleMarkerSymbol) {
SimpleMarkerSymbol sls = (SimpleMarkerSymbol)s;
sls.setColor(color);
graphicOverlay.getGraphics().remove(g);
graphicOverlay.getGraphics().add(new Graphic(g.getGeometry(), sls));
}
}
}
}
//endregion
//region Getters
@Override
public boolean isVisible() {
return drawOptions.isVisible();
}
@Override
public boolean isAdjBndVisible() {
return drawOptions.isAdjBnd();
}
@Override
public boolean isAdjBndPtsVisible() {
return drawOptions.isAdjBndPts();
}
@Override
public boolean isUnadjBndVisible() {
return drawOptions.isUnadjBnd();
}
@Override
public boolean isUnadjBndPtsVisible() {
return drawOptions.isUnadjBndPts();
}
@Override
public boolean isAdjNavVisible() {
return drawOptions.isAdjNav();
}
@Override
public boolean isAdjNavPtsVisible() {
return drawOptions.isAdjNavPts();
}
@Override
public boolean isUnadjNavVisible() {
return drawOptions.isUnadjNav();
}
@Override
public boolean isUnadjNavPtsVisible() {
return drawOptions.isUnadjNavPts();
}
@Override
public boolean isAdjMiscPtsVisible() {
return drawOptions.isAdjMiscPts();
}
@Override
public boolean isUnadjMiscPtsVisible() {
return drawOptions.isUnadjMiscPts();
}
@Override
public boolean isWayPtsVisible() {
return drawOptions.isWayPts();
}
@Override
public boolean isAdjBndClose() {
return drawOptions.isAdjBndClose();
}
@Override
public boolean isUnadjBndClose() {
return drawOptions.isUnadjBndClose();
}
@Override
public int getAdjBndColor() {
return graphicOptions.getAdjBndColor();
}
@Override
public int getUnAdjBndColor() {
return graphicOptions.getUnAdjBndColor();
}
@Override
public int getAdjNavColor() {
return graphicOptions.getAdjNavColor();
}
@Override
public int getUnAdjNavColor() {
return graphicOptions.getUnAdjNavColor();
}
@Override
public int getAdjPtsColor() {
return graphicOptions.getAdjPtsColor();
}
@Override
public int getUnAdjPtsColor() {
return graphicOptions.getUnAdjPtsColor();
}
@Override
public int getWayPtsColor() {
return graphicOptions.getWayPtsColor();
}
//endregion
}
| [
"bryan.c.miller@usda.gov"
] | bryan.c.miller@usda.gov |
3f067019313bd0d1c55bfef02c0aaac4473991ee | 44803253ca6235cf838f3c8414a575e77ccf0c81 | /GCLACS.diagram/src/GCLACS/diagram/edit/commands/ServicesCreateCommand.java | 1fa1d2ff06cf5b674ce3b87dec3a0ffb92df62b2 | [] | no_license | saharkallel/clacs | c87d28de9150cd71780cf9c4b95d9a4159fd1aa0 | 682111697a3e3ea769db2ac694d72cfd7fcbc46b | refs/heads/master | 2021-01-02T08:20:45.382356 | 2015-03-17T15:16:40 | 2015-03-17T15:16:40 | 32,180,119 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package GCLACS.diagram.edit.commands;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
import GCLACS.GCLACSPackage;
/**
* @generated
*/
public class ServicesCreateCommand extends CreateElementCommand {
/**
* @generated
*/
public ServicesCreateCommand(CreateElementRequest req) {
super(req);
}
/**
* @generated
*/
protected EObject getElementToEdit() {
EObject container = ((CreateElementRequest) getRequest())
.getContainer();
if (container instanceof View) {
container = ((View) container).getElement();
}
return container;
}
/**
* @generated
*/
protected EClass getEClassToEdit() {
return GCLACSPackage.eINSTANCE.getComponentInstance();
}
}
| [
"sahar.kallel@readcad.org"
] | sahar.kallel@readcad.org |
9943879ebdc953b56844d3376a4fb40ea0599323 | 29ac3ec99471d27aea0838d35c0979d31768e24b | /clients/google-api-services-bigquerydatatransfer/v1/1.30.1/com/google/api/services/bigquerydatatransfer/v1/BigQueryDataTransfer.java | 0db3ba20e6f0d5ff0a32836e71e21052e7da8548 | [
"Apache-2.0"
] | permissive | chrislatimer/google-api-java-client-services | 8d8f8ff22e2c4866100b447e621aba4a17f5eba3 | 4044138392b3a29018b60ca622d27c07410569b2 | refs/heads/master | 2020-12-24T03:15:02.714672 | 2020-01-30T18:18:13 | 2020-01-30T18:18:13 | 237,362,140 | 0 | 1 | Apache-2.0 | 2020-01-31T04:48:38 | 2020-01-31T04:48:37 | null | UTF-8 | Java | false | false | 262,540 | java | /*
* 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.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.bigquerydatatransfer.v1;
/**
* Service definition for BigQueryDataTransfer (v1).
*
* <p>
* Schedule queries or transfer external data from SaaS applications to Google BigQuery on a regular basis.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://cloud.google.com/bigquery/" target="_blank">API Documentation</a>
* </p>
*
* <p>
* This service uses {@link BigQueryDataTransferRequestInitializer} to initialize global parameters via its
* {@link Builder}.
* </p>
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class BigQueryDataTransfer extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {
// Note: Leave this static initializer at the top of the file.
static {
com.google.api.client.util.Preconditions.checkState(
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
"You are currently running with version %s of google-api-client. " +
"You need at least version 1.15 of google-api-client to run version " +
"1.30.3 of the BigQuery Data Transfer API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
}
/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_ROOT_URL = "https://bigquerydatatransfer.googleapis.com/";
/**
* The default encoded service path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_SERVICE_PATH = "";
/**
* The default encoded batch path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.23
*/
public static final String DEFAULT_BATCH_PATH = "batch";
/**
* The default encoded base URL of the service. This is determined when the library is generated
* and normally should not be changed.
*/
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
/**
* Constructor.
*
* <p>
* Use {@link Builder} if you need to specify any of the optional parameters.
* </p>
*
* @param transport HTTP transport, which should normally be:
* <ul>
* <li>Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
* <li>Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
* <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
* </li>
* </ul>
* @param jsonFactory JSON factory, which may be:
* <ul>
* <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
* <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
* <li>Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
* </ul>
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public BigQueryDataTransfer(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
this(new Builder(transport, jsonFactory, httpRequestInitializer));
}
/**
* @param builder builder
*/
BigQueryDataTransfer(Builder builder) {
super(builder);
}
@Override
protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
super.initialize(httpClientRequest);
}
/**
* An accessor for creating requests from the Projects collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.Projects.List request = bigquerydatatransfer.projects().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public Projects projects() {
return new Projects();
}
/**
* The "projects" collection of methods.
*/
public class Projects {
/**
* An accessor for creating requests from the DataSources collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.DataSources.List request = bigquerydatatransfer.dataSources().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public DataSources dataSources() {
return new DataSources();
}
/**
* The "dataSources" collection of methods.
*/
public class DataSources {
/**
* Returns true if valid credentials exist for the given data source and requesting user. Some data
* sources doesn't support service account, so we need to talk to them on behalf of the end user.
* This API just checks whether we have OAuth token for the particular user, which is a pre-
* requisite before user can create a transfer config.
*
* Create a request for the method "dataSources.checkValidCreds".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link CheckValidCreds#execute()} method to invoke the remote
* operation.
*
* @param name Required. The data source in the form:
`projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest}
* @return the request
*/
public CheckValidCreds checkValidCreds(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest content) throws java.io.IOException {
CheckValidCreds result = new CheckValidCreds(name, content);
initialize(result);
return result;
}
public class CheckValidCreds extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsResponse> {
private static final String REST_PATH = "v1/{+name}:checkValidCreds";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/dataSources/[^/]+$");
/**
* Returns true if valid credentials exist for the given data source and requesting user. Some
* data sources doesn't support service account, so we need to talk to them on behalf of the end
* user. This API just checks whether we have OAuth token for the particular user, which is a pre-
* requisite before user can create a transfer config.
*
* Create a request for the method "dataSources.checkValidCreds".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link CheckValidCreds#execute()} method to invoke the remote
* operation. <p> {@link CheckValidCreds#initialize(com.google.api.client.googleapis.services.Abst
* ractGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor. </p>
*
* @param name Required. The data source in the form:
`projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest}
* @since 1.13
*/
protected CheckValidCreds(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/dataSources/[^/]+$");
}
}
@Override
public CheckValidCreds set$Xgafv(java.lang.String $Xgafv) {
return (CheckValidCreds) super.set$Xgafv($Xgafv);
}
@Override
public CheckValidCreds setAccessToken(java.lang.String accessToken) {
return (CheckValidCreds) super.setAccessToken(accessToken);
}
@Override
public CheckValidCreds setAlt(java.lang.String alt) {
return (CheckValidCreds) super.setAlt(alt);
}
@Override
public CheckValidCreds setCallback(java.lang.String callback) {
return (CheckValidCreds) super.setCallback(callback);
}
@Override
public CheckValidCreds setFields(java.lang.String fields) {
return (CheckValidCreds) super.setFields(fields);
}
@Override
public CheckValidCreds setKey(java.lang.String key) {
return (CheckValidCreds) super.setKey(key);
}
@Override
public CheckValidCreds setOauthToken(java.lang.String oauthToken) {
return (CheckValidCreds) super.setOauthToken(oauthToken);
}
@Override
public CheckValidCreds setPrettyPrint(java.lang.Boolean prettyPrint) {
return (CheckValidCreds) super.setPrettyPrint(prettyPrint);
}
@Override
public CheckValidCreds setQuotaUser(java.lang.String quotaUser) {
return (CheckValidCreds) super.setQuotaUser(quotaUser);
}
@Override
public CheckValidCreds setUploadType(java.lang.String uploadType) {
return (CheckValidCreds) super.setUploadType(uploadType);
}
@Override
public CheckValidCreds setUploadProtocol(java.lang.String uploadProtocol) {
return (CheckValidCreds) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The data source in the form:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` or
`projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The data source in the form:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
*/
public CheckValidCreds setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/dataSources/[^/]+$");
}
this.name = name;
return this;
}
@Override
public CheckValidCreds set(String parameterName, Object value) {
return (CheckValidCreds) super.set(parameterName, value);
}
}
/**
* Retrieves a supported data source and returns its settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.DataSource> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/dataSources/[^/]+$");
/**
* Retrieves a supported data source and returns its settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.DataSource.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/dataSources/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/dataSources/{data_source_id}` or
`projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
*/
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/dataSources/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Lists supported data sources and returns their settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The BigQuery project id for which data sources should be returned.
Must be in the form:
* `projects/{project_id}` or
`projects/{project_id}/locations/{location_id}
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListDataSourcesResponse> {
private static final String REST_PATH = "v1/{+parent}/dataSources";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+$");
/**
* Lists supported data sources and returns their settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. The BigQuery project id for which data sources should be returned.
Must be in the form:
* `projects/{project_id}` or
`projects/{project_id}/locations/{location_id}
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListDataSourcesResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The BigQuery project id for which data sources should be returned. Must be in
* the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The BigQuery project id for which data sources should be returned. Must be in the form:
`projects/{project_id}` or `projects/{project_id}/locations/{location_id}
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The BigQuery project id for which data sources should be returned. Must be in
* the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+$");
}
this.parent = parent;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListDataSourcesRequest` list results. For multiple-page results,
* `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListDataSourcesRequest` list
results. For multiple-page results, `ListDataSourcesResponse` outputs a `next_page` token, which
can be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListDataSourcesRequest` list results. For multiple-page results,
* `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the Locations collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.Locations.List request = bigquerydatatransfer.locations().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public Locations locations() {
return new Locations();
}
/**
* The "locations" collection of methods.
*/
public class Locations {
/**
* Gets information about a location.
*
* Create a request for the method "locations.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Resource name for the location.
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.Location> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Gets information about a location.
*
* Create a request for the method "locations.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Resource name for the location.
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.Location.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/** Resource name for the location. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Resource name for the location.
*/
public java.lang.String getName() {
return name;
}
/** Resource name for the location. */
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Lists information about the supported locations for this service.
*
* Create a request for the method "locations.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param name The resource that owns the locations collection, if applicable.
* @return the request
*/
public List list(java.lang.String name) throws java.io.IOException {
List result = new List(name);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListLocationsResponse> {
private static final String REST_PATH = "v1/{+name}/locations";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+$");
/**
* Lists information about the supported locations for this service.
*
* Create a request for the method "locations.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name The resource that owns the locations collection, if applicable.
* @since 1.13
*/
protected List(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListLocationsResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/** The resource that owns the locations collection, if applicable. */
@com.google.api.client.util.Key
private java.lang.String name;
/** The resource that owns the locations collection, if applicable.
*/
public java.lang.String getName() {
return name;
}
/** The resource that owns the locations collection, if applicable. */
public List setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+$");
}
this.name = name;
return this;
}
/** The standard list filter. */
@com.google.api.client.util.Key
private java.lang.String filter;
/** The standard list filter.
*/
public java.lang.String getFilter() {
return filter;
}
/** The standard list filter. */
public List setFilter(java.lang.String filter) {
this.filter = filter;
return this;
}
/** The standard list page size. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** The standard list page size.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** The standard list page size. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/** The standard list page token. */
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** The standard list page token.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/** The standard list page token. */
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* An accessor for creating requests from the DataSources collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.DataSources.List request = bigquerydatatransfer.dataSources().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public DataSources dataSources() {
return new DataSources();
}
/**
* The "dataSources" collection of methods.
*/
public class DataSources {
/**
* Returns true if valid credentials exist for the given data source and requesting user. Some data
* sources doesn't support service account, so we need to talk to them on behalf of the end user.
* This API just checks whether we have OAuth token for the particular user, which is a pre-
* requisite before user can create a transfer config.
*
* Create a request for the method "dataSources.checkValidCreds".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link CheckValidCreds#execute()} method to invoke the remote
* operation.
*
* @param name Required. The data source in the form:
`projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest}
* @return the request
*/
public CheckValidCreds checkValidCreds(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest content) throws java.io.IOException {
CheckValidCreds result = new CheckValidCreds(name, content);
initialize(result);
return result;
}
public class CheckValidCreds extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsResponse> {
private static final String REST_PATH = "v1/{+name}:checkValidCreds";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$");
/**
* Returns true if valid credentials exist for the given data source and requesting user. Some
* data sources doesn't support service account, so we need to talk to them on behalf of the end
* user. This API just checks whether we have OAuth token for the particular user, which is a pre-
* requisite before user can create a transfer config.
*
* Create a request for the method "dataSources.checkValidCreds".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link CheckValidCreds#execute()} method to invoke the remote
* operation. <p> {@link CheckValidCreds#initialize(com.google.api.client.googleapis.services.Abst
* ractGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor. </p>
*
* @param name Required. The data source in the form:
`projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest}
* @since 1.13
*/
protected CheckValidCreds(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsRequest content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.CheckValidCredsResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$");
}
}
@Override
public CheckValidCreds set$Xgafv(java.lang.String $Xgafv) {
return (CheckValidCreds) super.set$Xgafv($Xgafv);
}
@Override
public CheckValidCreds setAccessToken(java.lang.String accessToken) {
return (CheckValidCreds) super.setAccessToken(accessToken);
}
@Override
public CheckValidCreds setAlt(java.lang.String alt) {
return (CheckValidCreds) super.setAlt(alt);
}
@Override
public CheckValidCreds setCallback(java.lang.String callback) {
return (CheckValidCreds) super.setCallback(callback);
}
@Override
public CheckValidCreds setFields(java.lang.String fields) {
return (CheckValidCreds) super.setFields(fields);
}
@Override
public CheckValidCreds setKey(java.lang.String key) {
return (CheckValidCreds) super.setKey(key);
}
@Override
public CheckValidCreds setOauthToken(java.lang.String oauthToken) {
return (CheckValidCreds) super.setOauthToken(oauthToken);
}
@Override
public CheckValidCreds setPrettyPrint(java.lang.Boolean prettyPrint) {
return (CheckValidCreds) super.setPrettyPrint(prettyPrint);
}
@Override
public CheckValidCreds setQuotaUser(java.lang.String quotaUser) {
return (CheckValidCreds) super.setQuotaUser(quotaUser);
}
@Override
public CheckValidCreds setUploadType(java.lang.String uploadType) {
return (CheckValidCreds) super.setUploadType(uploadType);
}
@Override
public CheckValidCreds setUploadProtocol(java.lang.String uploadProtocol) {
return (CheckValidCreds) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The data source in the form:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` or
`projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The data source in the form:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
*/
public CheckValidCreds setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$");
}
this.name = name;
return this;
}
@Override
public CheckValidCreds set(String parameterName, Object value) {
return (CheckValidCreds) super.set(parameterName, value);
}
}
/**
* Retrieves a supported data source and returns its settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.DataSource> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$");
/**
* Retrieves a supported data source and returns its settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.DataSource.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/dataSources/{data_source_id}` or
`projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/dataSources/{data_source_id}` or
* `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
*/
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Lists supported data sources and returns their settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The BigQuery project id for which data sources should be returned.
Must be in the form:
* `projects/{project_id}` or
`projects/{project_id}/locations/{location_id}
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListDataSourcesResponse> {
private static final String REST_PATH = "v1/{+parent}/dataSources";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Lists supported data sources and returns their settings, which can be used for UI rendering.
*
* Create a request for the method "dataSources.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. The BigQuery project id for which data sources should be returned.
Must be in the form:
* `projects/{project_id}` or
`projects/{project_id}/locations/{location_id}
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListDataSourcesResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The BigQuery project id for which data sources should be returned. Must be in
* the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The BigQuery project id for which data sources should be returned. Must be in the form:
`projects/{project_id}` or `projects/{project_id}/locations/{location_id}
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The BigQuery project id for which data sources should be returned. Must be in
* the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
this.parent = parent;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListDataSourcesRequest` list results. For multiple-page results,
* `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListDataSourcesRequest` list
results. For multiple-page results, `ListDataSourcesResponse` outputs a `next_page` token, which
can be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListDataSourcesRequest` list results. For multiple-page results,
* `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the TransferConfigs collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.TransferConfigs.List request = bigquerydatatransfer.transferConfigs().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public TransferConfigs transferConfigs() {
return new TransferConfigs();
}
/**
* The "transferConfigs" collection of methods.
*/
public class TransferConfigs {
/**
* Creates a new data transfer configuration.
*
* Create a request for the method "transferConfigs.create".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
*
* @param parent Required. The BigQuery project id where the transfer configuration should be created.
Must be in the
* format projects/{project_id}/locations/{location_id} or
projects/{project_id}. If
* specified location and location of the
destination bigquery dataset do not match - the
* request will fail.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @return the request
*/
public Create create(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) throws java.io.IOException {
Create result = new Create(parent, content);
initialize(result);
return result;
}
public class Create extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig> {
private static final String REST_PATH = "v1/{+parent}/transferConfigs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Creates a new data transfer configuration.
*
* Create a request for the method "transferConfigs.create".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Create#execute()} method to invoke the remote
* operation. <p> {@link
* Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. The BigQuery project id where the transfer configuration should be created.
Must be in the
* format projects/{project_id}/locations/{location_id} or
projects/{project_id}. If
* specified location and location of the
destination bigquery dataset do not match - the
* request will fail.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @since 1.13
*/
protected Create(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
}
@Override
public Create set$Xgafv(java.lang.String $Xgafv) {
return (Create) super.set$Xgafv($Xgafv);
}
@Override
public Create setAccessToken(java.lang.String accessToken) {
return (Create) super.setAccessToken(accessToken);
}
@Override
public Create setAlt(java.lang.String alt) {
return (Create) super.setAlt(alt);
}
@Override
public Create setCallback(java.lang.String callback) {
return (Create) super.setCallback(callback);
}
@Override
public Create setFields(java.lang.String fields) {
return (Create) super.setFields(fields);
}
@Override
public Create setKey(java.lang.String key) {
return (Create) super.setKey(key);
}
@Override
public Create setOauthToken(java.lang.String oauthToken) {
return (Create) super.setOauthToken(oauthToken);
}
@Override
public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Create) super.setPrettyPrint(prettyPrint);
}
@Override
public Create setQuotaUser(java.lang.String quotaUser) {
return (Create) super.setQuotaUser(quotaUser);
}
@Override
public Create setUploadType(java.lang.String uploadType) {
return (Create) super.setUploadType(uploadType);
}
@Override
public Create setUploadProtocol(java.lang.String uploadProtocol) {
return (Create) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The BigQuery project id where the transfer configuration should be created.
* Must be in the format projects/{project_id}/locations/{location_id} or
* projects/{project_id}. If specified location and location of the destination bigquery
* dataset do not match - the request will fail.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The BigQuery project id where the transfer configuration should be created. Must be in
the format projects/{project_id}/locations/{location_id} or projects/{project_id}. If specified
location and location of the destination bigquery dataset do not match - the request will fail.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The BigQuery project id where the transfer configuration should be created.
* Must be in the format projects/{project_id}/locations/{location_id} or
* projects/{project_id}. If specified location and location of the destination bigquery
* dataset do not match - the request will fail.
*/
public Create setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
this.parent = parent;
return this;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. This is
* required if new credentials are needed, as indicated by `CheckValidCreds`. In order to
* obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means
* that authorization code should be returned in the title bar of the browser, with the
* page text prompting the user to copy the code and paste it in the application.
*/
@com.google.api.client.util.Key
private java.lang.String authorizationCode;
/** Optional OAuth2 authorization code to use with this transfer configuration. This is required if new
credentials are needed, as indicated by `CheckValidCreds`. In order to obtain authorization_code,
please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
* client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by
ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. *
redirect_uri is an optional parameter. If not specified, then authorization code is posted to the
opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value
of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of
the browser, with the page text prompting the user to copy the code and paste it in the
application.
*/
public java.lang.String getAuthorizationCode() {
return authorizationCode;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. This is
* required if new credentials are needed, as indicated by `CheckValidCreds`. In order to
* obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means
* that authorization code should be returned in the title bar of the browser, with the
* page text prompting the user to copy the code and paste it in the application.
*/
public Create setAuthorizationCode(java.lang.String authorizationCode) {
this.authorizationCode = authorizationCode;
return this;
}
/**
* Optional service account name. If this field is set, transfer config will be created
* with this service account credentials. It requires that requesting user calling this
* API has permissions to act as this service account.
*/
@com.google.api.client.util.Key
private java.lang.String serviceAccountName;
/** Optional service account name. If this field is set, transfer config will be created with this
service account credentials. It requires that requesting user calling this API has permissions to
act as this service account.
*/
public java.lang.String getServiceAccountName() {
return serviceAccountName;
}
/**
* Optional service account name. If this field is set, transfer config will be created
* with this service account credentials. It requires that requesting user calling this
* API has permissions to act as this service account.
*/
public Create setServiceAccountName(java.lang.String serviceAccountName) {
this.serviceAccountName = serviceAccountName;
return this;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the
* token request. To obtain the version_info, users must use the "none+gsession" response
* type. which be return a version_info back in the authorization response which be be put
* in a JWT claim in the token request.
*/
@com.google.api.client.util.Key
private java.lang.String versionInfo;
/** Optional version info. If users want to find a very recent access token, that is, immediately after
approving access, users have to set the version_info claim in the token request. To obtain the
version_info, users must use the "none+gsession" response type. which be return a version_info back
in the authorization response which be be put in a JWT claim in the token request.
*/
public java.lang.String getVersionInfo() {
return versionInfo;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the
* token request. To obtain the version_info, users must use the "none+gsession" response
* type. which be return a version_info back in the authorization response which be be put
* in a JWT claim in the token request.
*/
public Create setVersionInfo(java.lang.String versionInfo) {
this.versionInfo = versionInfo;
return this;
}
@Override
public Create set(String parameterName, Object value) {
return (Create) super.set(parameterName, value);
}
}
/**
* Deletes a data transfer configuration, including any associated transfer runs and logs.
*
* Create a request for the method "transferConfigs.delete".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @return the request
*/
public Delete delete(java.lang.String name) throws java.io.IOException {
Delete result = new Delete(name);
initialize(result);
return result;
}
public class Delete extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.Empty> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
/**
* Deletes a data transfer configuration, including any associated transfer runs and logs.
*
* Create a request for the method "transferConfigs.delete".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Delete#execute()} method to invoke the remote
* operation. <p> {@link
* Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @since 1.13
*/
protected Delete(java.lang.String name) {
super(BigQueryDataTransfer.this, "DELETE", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.Empty.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public Delete set$Xgafv(java.lang.String $Xgafv) {
return (Delete) super.set$Xgafv($Xgafv);
}
@Override
public Delete setAccessToken(java.lang.String accessToken) {
return (Delete) super.setAccessToken(accessToken);
}
@Override
public Delete setAlt(java.lang.String alt) {
return (Delete) super.setAlt(alt);
}
@Override
public Delete setCallback(java.lang.String callback) {
return (Delete) super.setCallback(callback);
}
@Override
public Delete setFields(java.lang.String fields) {
return (Delete) super.setFields(fields);
}
@Override
public Delete setKey(java.lang.String key) {
return (Delete) super.setKey(key);
}
@Override
public Delete setOauthToken(java.lang.String oauthToken) {
return (Delete) super.setOauthToken(oauthToken);
}
@Override
public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Delete) super.setPrettyPrint(prettyPrint);
}
@Override
public Delete setQuotaUser(java.lang.String quotaUser) {
return (Delete) super.setQuotaUser(quotaUser);
}
@Override
public Delete setUploadType(java.lang.String uploadType) {
return (Delete) super.setUploadType(uploadType);
}
@Override
public Delete setUploadProtocol(java.lang.String uploadProtocol) {
return (Delete) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public Delete setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Returns information about a data transfer config.
*
* Create a request for the method "transferConfigs.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
/**
* Returns information about a data transfer config.
*
* Create a request for the method "transferConfigs.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Returns information about all data transfers in the project.
*
* Create a request for the method "transferConfigs.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The BigQuery project id for which data sources
should be returned: `projects/{project_id}`
* or
`projects/{project_id}/locations/{location_id}`
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListTransferConfigsResponse> {
private static final String REST_PATH = "v1/{+parent}/transferConfigs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Returns information about all data transfers in the project.
*
* Create a request for the method "transferConfigs.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. The BigQuery project id for which data sources
should be returned: `projects/{project_id}`
* or
`projects/{project_id}/locations/{location_id}`
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListTransferConfigsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The BigQuery project id for which data sources should be returned:
* `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The BigQuery project id for which data sources should be returned:
`projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The BigQuery project id for which data sources should be returned:
* `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
this.parent = parent;
return this;
}
/** When specified, only configurations of requested data sources are returned. */
@com.google.api.client.util.Key
private java.util.List<java.lang.String> dataSourceIds;
/** When specified, only configurations of requested data sources are returned.
*/
public java.util.List<java.lang.String> getDataSourceIds() {
return dataSourceIds;
}
/** When specified, only configurations of requested data sources are returned. */
public List setDataSourceIds(java.util.List<java.lang.String> dataSourceIds) {
this.dataSourceIds = dataSourceIds;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransfersRequest` list results. For multiple-page results, `ListTransfersResponse`
* outputs a `next_page` token, which can be used as the `page_token` value to request the
* next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListTransfersRequest` list
results. For multiple-page results, `ListTransfersResponse` outputs a `next_page` token, which can
be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransfersRequest` list results. For multiple-page results, `ListTransfersResponse`
* outputs a `next_page` token, which can be used as the `page_token` value to request the
* next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* Updates a data transfer configuration. All fields must be set, even if they are not updated.
*
* Create a request for the method "transferConfigs.patch".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
*
* @param name The resource name of the transfer config.
Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`.
The name is
* automatically generated based on the config_id specified in
CreateTransferConfigRequest
* along with project_id and region. If config_id
is not provided, usually a uuid, even
* though it is not guaranteed or
required, will be generated for config_id.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @return the request
*/
public Patch patch(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) throws java.io.IOException {
Patch result = new Patch(name, content);
initialize(result);
return result;
}
public class Patch extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
/**
* Updates a data transfer configuration. All fields must be set, even if they are not updated.
*
* Create a request for the method "transferConfigs.patch".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Patch#execute()} method to invoke the remote
* operation. <p> {@link
* Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name The resource name of the transfer config.
Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`.
The name is
* automatically generated based on the config_id specified in
CreateTransferConfigRequest
* along with project_id and region. If config_id
is not provided, usually a uuid, even
* though it is not guaranteed or
required, will be generated for config_id.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @since 1.13
*/
protected Patch(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) {
super(BigQueryDataTransfer.this, "PATCH", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public Patch set$Xgafv(java.lang.String $Xgafv) {
return (Patch) super.set$Xgafv($Xgafv);
}
@Override
public Patch setAccessToken(java.lang.String accessToken) {
return (Patch) super.setAccessToken(accessToken);
}
@Override
public Patch setAlt(java.lang.String alt) {
return (Patch) super.setAlt(alt);
}
@Override
public Patch setCallback(java.lang.String callback) {
return (Patch) super.setCallback(callback);
}
@Override
public Patch setFields(java.lang.String fields) {
return (Patch) super.setFields(fields);
}
@Override
public Patch setKey(java.lang.String key) {
return (Patch) super.setKey(key);
}
@Override
public Patch setOauthToken(java.lang.String oauthToken) {
return (Patch) super.setOauthToken(oauthToken);
}
@Override
public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Patch) super.setPrettyPrint(prettyPrint);
}
@Override
public Patch setQuotaUser(java.lang.String quotaUser) {
return (Patch) super.setQuotaUser(quotaUser);
}
@Override
public Patch setUploadType(java.lang.String uploadType) {
return (Patch) super.setUploadType(uploadType);
}
@Override
public Patch setUploadProtocol(java.lang.String uploadProtocol) {
return (Patch) super.setUploadProtocol(uploadProtocol);
}
/**
* The resource name of the transfer config. Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. The name is
* automatically generated based on the config_id specified in CreateTransferConfigRequest
* along with project_id and region. If config_id is not provided, usually a uuid, even
* though it is not guaranteed or required, will be generated for config_id.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** The resource name of the transfer config. Transfer config names have the form of
`projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. The name is automatically
generated based on the config_id specified in CreateTransferConfigRequest along with project_id and
region. If config_id is not provided, usually a uuid, even though it is not guaranteed or required,
will be generated for config_id.
*/
public java.lang.String getName() {
return name;
}
/**
* The resource name of the transfer config. Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. The name is
* automatically generated based on the config_id specified in CreateTransferConfigRequest
* along with project_id and region. If config_id is not provided, usually a uuid, even
* though it is not guaranteed or required, will be generated for config_id.
*/
public Patch setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
this.name = name;
return this;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. If it is
* provided, the transfer configuration will be associated with the authorizing user. In
* order to obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means
* that authorization code should be returned in the title bar of the browser, with the
* page text prompting the user to copy the code and paste it in the application.
*/
@com.google.api.client.util.Key
private java.lang.String authorizationCode;
/** Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the
transfer configuration will be associated with the authorizing user. In order to obtain
authorization_code, please make a request to
https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
* client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by
ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. *
redirect_uri is an optional parameter. If not specified, then authorization code is posted to the
opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value
of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of
the browser, with the page text prompting the user to copy the code and paste it in the
application.
*/
public java.lang.String getAuthorizationCode() {
return authorizationCode;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. If it is
* provided, the transfer configuration will be associated with the authorizing user. In
* order to obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means
* that authorization code should be returned in the title bar of the browser, with the
* page text prompting the user to copy the code and paste it in the application.
*/
public Patch setAuthorizationCode(java.lang.String authorizationCode) {
this.authorizationCode = authorizationCode;
return this;
}
/**
* Optional service account name. If this field is set and "service_account_name" is set
* in update_mask, transfer config will be updated to use this service account
* credentials. It requires that requesting user calling this API has permissions to act
* as this service account.
*/
@com.google.api.client.util.Key
private java.lang.String serviceAccountName;
/** Optional service account name. If this field is set and "service_account_name" is set in
update_mask, transfer config will be updated to use this service account credentials. It requires
that requesting user calling this API has permissions to act as this service account.
*/
public java.lang.String getServiceAccountName() {
return serviceAccountName;
}
/**
* Optional service account name. If this field is set and "service_account_name" is set
* in update_mask, transfer config will be updated to use this service account
* credentials. It requires that requesting user calling this API has permissions to act
* as this service account.
*/
public Patch setServiceAccountName(java.lang.String serviceAccountName) {
this.serviceAccountName = serviceAccountName;
return this;
}
/** Required. Required list of fields to be updated in this request. */
@com.google.api.client.util.Key
private String updateMask;
/** Required. Required list of fields to be updated in this request.
*/
public String getUpdateMask() {
return updateMask;
}
/** Required. Required list of fields to be updated in this request. */
public Patch setUpdateMask(String updateMask) {
this.updateMask = updateMask;
return this;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the
* token request. To obtain the version_info, users must use the "none+gsession" response
* type. which be return a version_info back in the authorization response which be be put
* in a JWT claim in the token request.
*/
@com.google.api.client.util.Key
private java.lang.String versionInfo;
/** Optional version info. If users want to find a very recent access token, that is, immediately after
approving access, users have to set the version_info claim in the token request. To obtain the
version_info, users must use the "none+gsession" response type. which be return a version_info back
in the authorization response which be be put in a JWT claim in the token request.
*/
public java.lang.String getVersionInfo() {
return versionInfo;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the
* token request. To obtain the version_info, users must use the "none+gsession" response
* type. which be return a version_info back in the authorization response which be be put
* in a JWT claim in the token request.
*/
public Patch setVersionInfo(java.lang.String versionInfo) {
this.versionInfo = versionInfo;
return this;
}
@Override
public Patch set(String parameterName, Object value) {
return (Patch) super.set(parameterName, value);
}
}
/**
* Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever
* granularity the data source supports - in the range, one transfer run is created. Note that runs
* are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.
*
* Create a request for the method "transferConfigs.scheduleRuns".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link ScheduleRuns#execute()} method to invoke the remote
* operation.
*
* @param parent Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest}
* @return the request
*/
public ScheduleRuns scheduleRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest content) throws java.io.IOException {
ScheduleRuns result = new ScheduleRuns(parent, content);
initialize(result);
return result;
}
public class ScheduleRuns extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsResponse> {
private static final String REST_PATH = "v1/{+parent}:scheduleRuns";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
/**
* Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever
* granularity the data source supports - in the range, one transfer run is created. Note that
* runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns
* instead.
*
* Create a request for the method "transferConfigs.scheduleRuns".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link ScheduleRuns#execute()} method to invoke the remote
* operation. <p> {@link
* ScheduleRuns#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest}
* @since 1.13
*/
protected ScheduleRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public ScheduleRuns set$Xgafv(java.lang.String $Xgafv) {
return (ScheduleRuns) super.set$Xgafv($Xgafv);
}
@Override
public ScheduleRuns setAccessToken(java.lang.String accessToken) {
return (ScheduleRuns) super.setAccessToken(accessToken);
}
@Override
public ScheduleRuns setAlt(java.lang.String alt) {
return (ScheduleRuns) super.setAlt(alt);
}
@Override
public ScheduleRuns setCallback(java.lang.String callback) {
return (ScheduleRuns) super.setCallback(callback);
}
@Override
public ScheduleRuns setFields(java.lang.String fields) {
return (ScheduleRuns) super.setFields(fields);
}
@Override
public ScheduleRuns setKey(java.lang.String key) {
return (ScheduleRuns) super.setKey(key);
}
@Override
public ScheduleRuns setOauthToken(java.lang.String oauthToken) {
return (ScheduleRuns) super.setOauthToken(oauthToken);
}
@Override
public ScheduleRuns setPrettyPrint(java.lang.Boolean prettyPrint) {
return (ScheduleRuns) super.setPrettyPrint(prettyPrint);
}
@Override
public ScheduleRuns setQuotaUser(java.lang.String quotaUser) {
return (ScheduleRuns) super.setQuotaUser(quotaUser);
}
@Override
public ScheduleRuns setUploadType(java.lang.String uploadType) {
return (ScheduleRuns) super.setUploadType(uploadType);
}
@Override
public ScheduleRuns setUploadProtocol(java.lang.String uploadProtocol) {
return (ScheduleRuns) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public ScheduleRuns setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
this.parent = parent;
return this;
}
@Override
public ScheduleRuns set(String parameterName, Object value) {
return (ScheduleRuns) super.set(parameterName, value);
}
}
/**
* Start manual transfer runs to be executed now with schedule_time equal to current time. The
* transfer runs can be created for a time range where the run_time is between start_time
* (inclusive) and end_time (exclusive), or for a specific run_time.
*
* Create a request for the method "transferConfigs.startManualRuns".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link StartManualRuns#execute()} method to invoke the remote
* operation.
*
* @param parent Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest}
* @return the request
*/
public StartManualRuns startManualRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest content) throws java.io.IOException {
StartManualRuns result = new StartManualRuns(parent, content);
initialize(result);
return result;
}
public class StartManualRuns extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsResponse> {
private static final String REST_PATH = "v1/{+parent}:startManualRuns";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
/**
* Start manual transfer runs to be executed now with schedule_time equal to current time. The
* transfer runs can be created for a time range where the run_time is between start_time
* (inclusive) and end_time (exclusive), or for a specific run_time.
*
* Create a request for the method "transferConfigs.startManualRuns".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link StartManualRuns#execute()} method to invoke the remote
* operation. <p> {@link StartManualRuns#initialize(com.google.api.client.googleapis.services.Abst
* ractGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor. </p>
*
* @param parent Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest}
* @since 1.13
*/
protected StartManualRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public StartManualRuns set$Xgafv(java.lang.String $Xgafv) {
return (StartManualRuns) super.set$Xgafv($Xgafv);
}
@Override
public StartManualRuns setAccessToken(java.lang.String accessToken) {
return (StartManualRuns) super.setAccessToken(accessToken);
}
@Override
public StartManualRuns setAlt(java.lang.String alt) {
return (StartManualRuns) super.setAlt(alt);
}
@Override
public StartManualRuns setCallback(java.lang.String callback) {
return (StartManualRuns) super.setCallback(callback);
}
@Override
public StartManualRuns setFields(java.lang.String fields) {
return (StartManualRuns) super.setFields(fields);
}
@Override
public StartManualRuns setKey(java.lang.String key) {
return (StartManualRuns) super.setKey(key);
}
@Override
public StartManualRuns setOauthToken(java.lang.String oauthToken) {
return (StartManualRuns) super.setOauthToken(oauthToken);
}
@Override
public StartManualRuns setPrettyPrint(java.lang.Boolean prettyPrint) {
return (StartManualRuns) super.setPrettyPrint(prettyPrint);
}
@Override
public StartManualRuns setQuotaUser(java.lang.String quotaUser) {
return (StartManualRuns) super.setQuotaUser(quotaUser);
}
@Override
public StartManualRuns setUploadType(java.lang.String uploadType) {
return (StartManualRuns) super.setUploadType(uploadType);
}
@Override
public StartManualRuns setUploadProtocol(java.lang.String uploadProtocol) {
return (StartManualRuns) super.setUploadProtocol(uploadProtocol);
}
/**
* Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public StartManualRuns setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
this.parent = parent;
return this;
}
@Override
public StartManualRuns set(String parameterName, Object value) {
return (StartManualRuns) super.set(parameterName, value);
}
}
/**
* An accessor for creating requests from the Runs collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.Runs.List request = bigquerydatatransfer.runs().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public Runs runs() {
return new Runs();
}
/**
* The "runs" collection of methods.
*/
public class Runs {
/**
* Deletes the specified transfer run.
*
* Create a request for the method "runs.delete".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @return the request
*/
public Delete delete(java.lang.String name) throws java.io.IOException {
Delete result = new Delete(name);
initialize(result);
return result;
}
public class Delete extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.Empty> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
/**
* Deletes the specified transfer run.
*
* Create a request for the method "runs.delete".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Delete#execute()} method to invoke the remote
* operation. <p> {@link
* Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @since 1.13
*/
protected Delete(java.lang.String name) {
super(BigQueryDataTransfer.this, "DELETE", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.Empty.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
}
@Override
public Delete set$Xgafv(java.lang.String $Xgafv) {
return (Delete) super.set$Xgafv($Xgafv);
}
@Override
public Delete setAccessToken(java.lang.String accessToken) {
return (Delete) super.setAccessToken(accessToken);
}
@Override
public Delete setAlt(java.lang.String alt) {
return (Delete) super.setAlt(alt);
}
@Override
public Delete setCallback(java.lang.String callback) {
return (Delete) super.setCallback(callback);
}
@Override
public Delete setFields(java.lang.String fields) {
return (Delete) super.setFields(fields);
}
@Override
public Delete setKey(java.lang.String key) {
return (Delete) super.setKey(key);
}
@Override
public Delete setOauthToken(java.lang.String oauthToken) {
return (Delete) super.setOauthToken(oauthToken);
}
@Override
public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Delete) super.setPrettyPrint(prettyPrint);
}
@Override
public Delete setQuotaUser(java.lang.String quotaUser) {
return (Delete) super.setQuotaUser(quotaUser);
}
@Override
public Delete setUploadType(java.lang.String uploadType) {
return (Delete) super.setUploadType(uploadType);
}
@Override
public Delete setUploadProtocol(java.lang.String uploadProtocol) {
return (Delete) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{proje
* ct_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{proje
* ct_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public Delete setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Returns information about the particular transfer run.
*
* Create a request for the method "runs.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferRun> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
/**
* Returns information about the particular transfer run.
*
* Create a request for the method "runs.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.TransferRun.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{proje
* ct_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{proje
* ct_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Returns information about running and completed jobs.
*
* Create a request for the method "runs.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. Name of transfer configuration for which transfer runs should be retrieved.
Format of
* transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListTransferRunsResponse> {
private static final String REST_PATH = "v1/{+parent}/runs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
/**
* Returns information about running and completed jobs.
*
* Create a request for the method "runs.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. Name of transfer configuration for which transfer runs should be retrieved.
Format of
* transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListTransferRunsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. Name of transfer configuration for which transfer runs should be retrieved.
* Format of transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. Name of transfer configuration for which transfer runs should be retrieved. Format of
transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. Name of transfer configuration for which transfer runs should be retrieved.
* Format of transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$");
}
this.parent = parent;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferRunsRequest` list results. For multiple-page results,
* `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListTransferRunsRequest` list
results. For multiple-page results, `ListTransferRunsResponse` outputs a `next_page` token, which
can be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferRunsRequest` list results. For multiple-page results,
* `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
/** Indicates how run attempts are to be pulled. */
@com.google.api.client.util.Key
private java.lang.String runAttempt;
/** Indicates how run attempts are to be pulled.
*/
public java.lang.String getRunAttempt() {
return runAttempt;
}
/** Indicates how run attempts are to be pulled. */
public List setRunAttempt(java.lang.String runAttempt) {
this.runAttempt = runAttempt;
return this;
}
/** When specified, only transfer runs with requested states are returned. */
@com.google.api.client.util.Key
private java.util.List<java.lang.String> states;
/** When specified, only transfer runs with requested states are returned.
*/
public java.util.List<java.lang.String> getStates() {
return states;
}
/** When specified, only transfer runs with requested states are returned. */
public List setStates(java.util.List<java.lang.String> states) {
this.states = states;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* An accessor for creating requests from the TransferLogs collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.TransferLogs.List request = bigquerydatatransfer.transferLogs().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public TransferLogs transferLogs() {
return new TransferLogs();
}
/**
* The "transferLogs" collection of methods.
*/
public class TransferLogs {
/**
* Returns user facing log messages for the data transfer run.
*
* Create a request for the method "transferLogs.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListTransferLogsResponse> {
private static final String REST_PATH = "v1/{+parent}/transferLogs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
/**
* Returns user facing log messages for the data transfer run.
*
* Create a request for the method "transferLogs.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListTransferLogsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{pro
* ject_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. Transfer run name in the form:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{pro
* ject_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
this.parent = parent;
return this;
}
/**
* Message types to return. If not populated - INFO, WARNING and ERROR messages are
* returned.
*/
@com.google.api.client.util.Key
private java.util.List<java.lang.String> messageTypes;
/** Message types to return. If not populated - INFO, WARNING and ERROR messages are returned.
*/
public java.util.List<java.lang.String> getMessageTypes() {
return messageTypes;
}
/**
* Message types to return. If not populated - INFO, WARNING and ERROR messages are
* returned.
*/
public List setMessageTypes(java.util.List<java.lang.String> messageTypes) {
this.messageTypes = messageTypes;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferLogsRequest` list results. For multiple-page results,
* `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListTransferLogsRequest` list
results. For multiple-page results, `ListTransferLogsResponse` outputs a `next_page` token, which
can be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferLogsRequest` list results. For multiple-page results,
* `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
}
}
}
/**
* An accessor for creating requests from the TransferConfigs collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.TransferConfigs.List request = bigquerydatatransfer.transferConfigs().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public TransferConfigs transferConfigs() {
return new TransferConfigs();
}
/**
* The "transferConfigs" collection of methods.
*/
public class TransferConfigs {
/**
* Creates a new data transfer configuration.
*
* Create a request for the method "transferConfigs.create".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
*
* @param parent Required. The BigQuery project id where the transfer configuration should be created.
Must be in the
* format projects/{project_id}/locations/{location_id} or
projects/{project_id}. If
* specified location and location of the
destination bigquery dataset do not match - the
* request will fail.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @return the request
*/
public Create create(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) throws java.io.IOException {
Create result = new Create(parent, content);
initialize(result);
return result;
}
public class Create extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig> {
private static final String REST_PATH = "v1/{+parent}/transferConfigs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+$");
/**
* Creates a new data transfer configuration.
*
* Create a request for the method "transferConfigs.create".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Create#execute()} method to invoke the remote
* operation. <p> {@link
* Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. The BigQuery project id where the transfer configuration should be created.
Must be in the
* format projects/{project_id}/locations/{location_id} or
projects/{project_id}. If
* specified location and location of the
destination bigquery dataset do not match - the
* request will fail.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @since 1.13
*/
protected Create(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+$");
}
}
@Override
public Create set$Xgafv(java.lang.String $Xgafv) {
return (Create) super.set$Xgafv($Xgafv);
}
@Override
public Create setAccessToken(java.lang.String accessToken) {
return (Create) super.setAccessToken(accessToken);
}
@Override
public Create setAlt(java.lang.String alt) {
return (Create) super.setAlt(alt);
}
@Override
public Create setCallback(java.lang.String callback) {
return (Create) super.setCallback(callback);
}
@Override
public Create setFields(java.lang.String fields) {
return (Create) super.setFields(fields);
}
@Override
public Create setKey(java.lang.String key) {
return (Create) super.setKey(key);
}
@Override
public Create setOauthToken(java.lang.String oauthToken) {
return (Create) super.setOauthToken(oauthToken);
}
@Override
public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Create) super.setPrettyPrint(prettyPrint);
}
@Override
public Create setQuotaUser(java.lang.String quotaUser) {
return (Create) super.setQuotaUser(quotaUser);
}
@Override
public Create setUploadType(java.lang.String uploadType) {
return (Create) super.setUploadType(uploadType);
}
@Override
public Create setUploadProtocol(java.lang.String uploadProtocol) {
return (Create) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The BigQuery project id where the transfer configuration should be created.
* Must be in the format projects/{project_id}/locations/{location_id} or
* projects/{project_id}. If specified location and location of the destination bigquery
* dataset do not match - the request will fail.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The BigQuery project id where the transfer configuration should be created. Must be in
the format projects/{project_id}/locations/{location_id} or projects/{project_id}. If specified
location and location of the destination bigquery dataset do not match - the request will fail.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The BigQuery project id where the transfer configuration should be created.
* Must be in the format projects/{project_id}/locations/{location_id} or
* projects/{project_id}. If specified location and location of the destination bigquery
* dataset do not match - the request will fail.
*/
public Create setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+$");
}
this.parent = parent;
return this;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. This is
* required if new credentials are needed, as indicated by `CheckValidCreds`. In order to
* obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that
* authorization code should be returned in the title bar of the browser, with the page text
* prompting the user to copy the code and paste it in the application.
*/
@com.google.api.client.util.Key
private java.lang.String authorizationCode;
/** Optional OAuth2 authorization code to use with this transfer configuration. This is required if new
credentials are needed, as indicated by `CheckValidCreds`. In order to obtain authorization_code,
please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
* client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by
ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. *
redirect_uri is an optional parameter. If not specified, then authorization code is posted to the
opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value
of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of
the browser, with the page text prompting the user to copy the code and paste it in the
application.
*/
public java.lang.String getAuthorizationCode() {
return authorizationCode;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. This is
* required if new credentials are needed, as indicated by `CheckValidCreds`. In order to
* obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that
* authorization code should be returned in the title bar of the browser, with the page text
* prompting the user to copy the code and paste it in the application.
*/
public Create setAuthorizationCode(java.lang.String authorizationCode) {
this.authorizationCode = authorizationCode;
return this;
}
/**
* Optional service account name. If this field is set, transfer config will be created with
* this service account credentials. It requires that requesting user calling this API has
* permissions to act as this service account.
*/
@com.google.api.client.util.Key
private java.lang.String serviceAccountName;
/** Optional service account name. If this field is set, transfer config will be created with this
service account credentials. It requires that requesting user calling this API has permissions to
act as this service account.
*/
public java.lang.String getServiceAccountName() {
return serviceAccountName;
}
/**
* Optional service account name. If this field is set, transfer config will be created with
* this service account credentials. It requires that requesting user calling this API has
* permissions to act as this service account.
*/
public Create setServiceAccountName(java.lang.String serviceAccountName) {
this.serviceAccountName = serviceAccountName;
return this;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the token
* request. To obtain the version_info, users must use the "none+gsession" response type.
* which be return a version_info back in the authorization response which be be put in a
* JWT claim in the token request.
*/
@com.google.api.client.util.Key
private java.lang.String versionInfo;
/** Optional version info. If users want to find a very recent access token, that is, immediately after
approving access, users have to set the version_info claim in the token request. To obtain the
version_info, users must use the "none+gsession" response type. which be return a version_info back
in the authorization response which be be put in a JWT claim in the token request.
*/
public java.lang.String getVersionInfo() {
return versionInfo;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the token
* request. To obtain the version_info, users must use the "none+gsession" response type.
* which be return a version_info back in the authorization response which be be put in a
* JWT claim in the token request.
*/
public Create setVersionInfo(java.lang.String versionInfo) {
this.versionInfo = versionInfo;
return this;
}
@Override
public Create set(String parameterName, Object value) {
return (Create) super.set(parameterName, value);
}
}
/**
* Deletes a data transfer configuration, including any associated transfer runs and logs.
*
* Create a request for the method "transferConfigs.delete".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @return the request
*/
public Delete delete(java.lang.String name) throws java.io.IOException {
Delete result = new Delete(name);
initialize(result);
return result;
}
public class Delete extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.Empty> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+$");
/**
* Deletes a data transfer configuration, including any associated transfer runs and logs.
*
* Create a request for the method "transferConfigs.delete".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Delete#execute()} method to invoke the remote
* operation. <p> {@link
* Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @since 1.13
*/
protected Delete(java.lang.String name) {
super(BigQueryDataTransfer.this, "DELETE", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.Empty.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public Delete set$Xgafv(java.lang.String $Xgafv) {
return (Delete) super.set$Xgafv($Xgafv);
}
@Override
public Delete setAccessToken(java.lang.String accessToken) {
return (Delete) super.setAccessToken(accessToken);
}
@Override
public Delete setAlt(java.lang.String alt) {
return (Delete) super.setAlt(alt);
}
@Override
public Delete setCallback(java.lang.String callback) {
return (Delete) super.setCallback(callback);
}
@Override
public Delete setFields(java.lang.String fields) {
return (Delete) super.setFields(fields);
}
@Override
public Delete setKey(java.lang.String key) {
return (Delete) super.setKey(key);
}
@Override
public Delete setOauthToken(java.lang.String oauthToken) {
return (Delete) super.setOauthToken(oauthToken);
}
@Override
public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Delete) super.setPrettyPrint(prettyPrint);
}
@Override
public Delete setQuotaUser(java.lang.String quotaUser) {
return (Delete) super.setQuotaUser(quotaUser);
}
@Override
public Delete setUploadType(java.lang.String uploadType) {
return (Delete) super.setUploadType(uploadType);
}
@Override
public Delete setUploadProtocol(java.lang.String uploadProtocol) {
return (Delete) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public Delete setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Returns information about a data transfer config.
*
* Create a request for the method "transferConfigs.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+$");
/**
* Returns information about a data transfer config.
*
* Create a request for the method "transferConfigs.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
*/
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Returns information about all data transfers in the project.
*
* Create a request for the method "transferConfigs.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The BigQuery project id for which data sources
should be returned: `projects/{project_id}`
* or
`projects/{project_id}/locations/{location_id}`
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListTransferConfigsResponse> {
private static final String REST_PATH = "v1/{+parent}/transferConfigs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+$");
/**
* Returns information about all data transfers in the project.
*
* Create a request for the method "transferConfigs.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. The BigQuery project id for which data sources
should be returned: `projects/{project_id}`
* or
`projects/{project_id}/locations/{location_id}`
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListTransferConfigsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The BigQuery project id for which data sources should be returned:
* `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The BigQuery project id for which data sources should be returned:
`projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The BigQuery project id for which data sources should be returned:
* `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+$");
}
this.parent = parent;
return this;
}
/** When specified, only configurations of requested data sources are returned. */
@com.google.api.client.util.Key
private java.util.List<java.lang.String> dataSourceIds;
/** When specified, only configurations of requested data sources are returned.
*/
public java.util.List<java.lang.String> getDataSourceIds() {
return dataSourceIds;
}
/** When specified, only configurations of requested data sources are returned. */
public List setDataSourceIds(java.util.List<java.lang.String> dataSourceIds) {
this.dataSourceIds = dataSourceIds;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of `ListTransfersRequest`
* list results. For multiple-page results, `ListTransfersResponse` outputs a `next_page`
* token, which can be used as the `page_token` value to request the next page of list
* results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListTransfersRequest` list
results. For multiple-page results, `ListTransfersResponse` outputs a `next_page` token, which can
be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of `ListTransfersRequest`
* list results. For multiple-page results, `ListTransfersResponse` outputs a `next_page`
* token, which can be used as the `page_token` value to request the next page of list
* results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* Updates a data transfer configuration. All fields must be set, even if they are not updated.
*
* Create a request for the method "transferConfigs.patch".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
*
* @param name The resource name of the transfer config.
Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`.
The name is
* automatically generated based on the config_id specified in
CreateTransferConfigRequest
* along with project_id and region. If config_id
is not provided, usually a uuid, even
* though it is not guaranteed or
required, will be generated for config_id.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @return the request
*/
public Patch patch(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) throws java.io.IOException {
Patch result = new Patch(name, content);
initialize(result);
return result;
}
public class Patch extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+$");
/**
* Updates a data transfer configuration. All fields must be set, even if they are not updated.
*
* Create a request for the method "transferConfigs.patch".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Patch#execute()} method to invoke the remote
* operation. <p> {@link
* Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name The resource name of the transfer config.
Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`.
The name is
* automatically generated based on the config_id specified in
CreateTransferConfigRequest
* along with project_id and region. If config_id
is not provided, usually a uuid, even
* though it is not guaranteed or
required, will be generated for config_id.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig}
* @since 1.13
*/
protected Patch(java.lang.String name, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig content) {
super(BigQueryDataTransfer.this, "PATCH", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.TransferConfig.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public Patch set$Xgafv(java.lang.String $Xgafv) {
return (Patch) super.set$Xgafv($Xgafv);
}
@Override
public Patch setAccessToken(java.lang.String accessToken) {
return (Patch) super.setAccessToken(accessToken);
}
@Override
public Patch setAlt(java.lang.String alt) {
return (Patch) super.setAlt(alt);
}
@Override
public Patch setCallback(java.lang.String callback) {
return (Patch) super.setCallback(callback);
}
@Override
public Patch setFields(java.lang.String fields) {
return (Patch) super.setFields(fields);
}
@Override
public Patch setKey(java.lang.String key) {
return (Patch) super.setKey(key);
}
@Override
public Patch setOauthToken(java.lang.String oauthToken) {
return (Patch) super.setOauthToken(oauthToken);
}
@Override
public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Patch) super.setPrettyPrint(prettyPrint);
}
@Override
public Patch setQuotaUser(java.lang.String quotaUser) {
return (Patch) super.setQuotaUser(quotaUser);
}
@Override
public Patch setUploadType(java.lang.String uploadType) {
return (Patch) super.setUploadType(uploadType);
}
@Override
public Patch setUploadProtocol(java.lang.String uploadProtocol) {
return (Patch) super.setUploadProtocol(uploadProtocol);
}
/**
* The resource name of the transfer config. Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. The name is
* automatically generated based on the config_id specified in CreateTransferConfigRequest
* along with project_id and region. If config_id is not provided, usually a uuid, even
* though it is not guaranteed or required, will be generated for config_id.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** The resource name of the transfer config. Transfer config names have the form of
`projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. The name is automatically
generated based on the config_id specified in CreateTransferConfigRequest along with project_id and
region. If config_id is not provided, usually a uuid, even though it is not guaranteed or required,
will be generated for config_id.
*/
public java.lang.String getName() {
return name;
}
/**
* The resource name of the transfer config. Transfer config names have the form of
* `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. The name is
* automatically generated based on the config_id specified in CreateTransferConfigRequest
* along with project_id and region. If config_id is not provided, usually a uuid, even
* though it is not guaranteed or required, will be generated for config_id.
*/
public Patch setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
this.name = name;
return this;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. If it is
* provided, the transfer configuration will be associated with the authorizing user. In
* order to obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that
* authorization code should be returned in the title bar of the browser, with the page text
* prompting the user to copy the code and paste it in the application.
*/
@com.google.api.client.util.Key
private java.lang.String authorizationCode;
/** Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the
transfer configuration will be associated with the authorizing user. In order to obtain
authorization_code, please make a request to
https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
* client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by
ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. *
redirect_uri is an optional parameter. If not specified, then authorization code is posted to the
opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value
of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of
the browser, with the page text prompting the user to copy the code and paste it in the
application.
*/
public java.lang.String getAuthorizationCode() {
return authorizationCode;
}
/**
* Optional OAuth2 authorization code to use with this transfer configuration. If it is
* provided, the transfer configuration will be associated with the authorizing user. In
* order to obtain authorization_code, please make a request to
* https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id==_uri=
*
* * client_id should be OAuth client_id of BigQuery DTS API for the given data source
* returned by ListDataSources method. * data_source_scopes are the scopes returned by
* ListDataSources method. * redirect_uri is an optional parameter. If not specified, then
* authorization code is posted to the opener of authorization flow window. Otherwise it
* will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that
* authorization code should be returned in the title bar of the browser, with the page text
* prompting the user to copy the code and paste it in the application.
*/
public Patch setAuthorizationCode(java.lang.String authorizationCode) {
this.authorizationCode = authorizationCode;
return this;
}
/**
* Optional service account name. If this field is set and "service_account_name" is set in
* update_mask, transfer config will be updated to use this service account credentials. It
* requires that requesting user calling this API has permissions to act as this service
* account.
*/
@com.google.api.client.util.Key
private java.lang.String serviceAccountName;
/** Optional service account name. If this field is set and "service_account_name" is set in
update_mask, transfer config will be updated to use this service account credentials. It requires
that requesting user calling this API has permissions to act as this service account.
*/
public java.lang.String getServiceAccountName() {
return serviceAccountName;
}
/**
* Optional service account name. If this field is set and "service_account_name" is set in
* update_mask, transfer config will be updated to use this service account credentials. It
* requires that requesting user calling this API has permissions to act as this service
* account.
*/
public Patch setServiceAccountName(java.lang.String serviceAccountName) {
this.serviceAccountName = serviceAccountName;
return this;
}
/** Required. Required list of fields to be updated in this request. */
@com.google.api.client.util.Key
private String updateMask;
/** Required. Required list of fields to be updated in this request.
*/
public String getUpdateMask() {
return updateMask;
}
/** Required. Required list of fields to be updated in this request. */
public Patch setUpdateMask(String updateMask) {
this.updateMask = updateMask;
return this;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the token
* request. To obtain the version_info, users must use the "none+gsession" response type.
* which be return a version_info back in the authorization response which be be put in a
* JWT claim in the token request.
*/
@com.google.api.client.util.Key
private java.lang.String versionInfo;
/** Optional version info. If users want to find a very recent access token, that is, immediately after
approving access, users have to set the version_info claim in the token request. To obtain the
version_info, users must use the "none+gsession" response type. which be return a version_info back
in the authorization response which be be put in a JWT claim in the token request.
*/
public java.lang.String getVersionInfo() {
return versionInfo;
}
/**
* Optional version info. If users want to find a very recent access token, that is,
* immediately after approving access, users have to set the version_info claim in the token
* request. To obtain the version_info, users must use the "none+gsession" response type.
* which be return a version_info back in the authorization response which be be put in a
* JWT claim in the token request.
*/
public Patch setVersionInfo(java.lang.String versionInfo) {
this.versionInfo = versionInfo;
return this;
}
@Override
public Patch set(String parameterName, Object value) {
return (Patch) super.set(parameterName, value);
}
}
/**
* Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever
* granularity the data source supports - in the range, one transfer run is created. Note that runs
* are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.
*
* Create a request for the method "transferConfigs.scheduleRuns".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link ScheduleRuns#execute()} method to invoke the remote
* operation.
*
* @param parent Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest}
* @return the request
*/
public ScheduleRuns scheduleRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest content) throws java.io.IOException {
ScheduleRuns result = new ScheduleRuns(parent, content);
initialize(result);
return result;
}
public class ScheduleRuns extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsResponse> {
private static final String REST_PATH = "v1/{+parent}:scheduleRuns";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+$");
/**
* Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever
* granularity the data source supports - in the range, one transfer run is created. Note that
* runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns
* instead.
*
* Create a request for the method "transferConfigs.scheduleRuns".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link ScheduleRuns#execute()} method to invoke the remote
* operation. <p> {@link
* ScheduleRuns#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest}
* @since 1.13
*/
protected ScheduleRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsRequest content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.ScheduleTransferRunsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public ScheduleRuns set$Xgafv(java.lang.String $Xgafv) {
return (ScheduleRuns) super.set$Xgafv($Xgafv);
}
@Override
public ScheduleRuns setAccessToken(java.lang.String accessToken) {
return (ScheduleRuns) super.setAccessToken(accessToken);
}
@Override
public ScheduleRuns setAlt(java.lang.String alt) {
return (ScheduleRuns) super.setAlt(alt);
}
@Override
public ScheduleRuns setCallback(java.lang.String callback) {
return (ScheduleRuns) super.setCallback(callback);
}
@Override
public ScheduleRuns setFields(java.lang.String fields) {
return (ScheduleRuns) super.setFields(fields);
}
@Override
public ScheduleRuns setKey(java.lang.String key) {
return (ScheduleRuns) super.setKey(key);
}
@Override
public ScheduleRuns setOauthToken(java.lang.String oauthToken) {
return (ScheduleRuns) super.setOauthToken(oauthToken);
}
@Override
public ScheduleRuns setPrettyPrint(java.lang.Boolean prettyPrint) {
return (ScheduleRuns) super.setPrettyPrint(prettyPrint);
}
@Override
public ScheduleRuns setQuotaUser(java.lang.String quotaUser) {
return (ScheduleRuns) super.setQuotaUser(quotaUser);
}
@Override
public ScheduleRuns setUploadType(java.lang.String uploadType) {
return (ScheduleRuns) super.setUploadType(uploadType);
}
@Override
public ScheduleRuns setUploadProtocol(java.lang.String uploadProtocol) {
return (ScheduleRuns) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public ScheduleRuns setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
this.parent = parent;
return this;
}
@Override
public ScheduleRuns set(String parameterName, Object value) {
return (ScheduleRuns) super.set(parameterName, value);
}
}
/**
* Start manual transfer runs to be executed now with schedule_time equal to current time. The
* transfer runs can be created for a time range where the run_time is between start_time
* (inclusive) and end_time (exclusive), or for a specific run_time.
*
* Create a request for the method "transferConfigs.startManualRuns".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link StartManualRuns#execute()} method to invoke the remote
* operation.
*
* @param parent Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest}
* @return the request
*/
public StartManualRuns startManualRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest content) throws java.io.IOException {
StartManualRuns result = new StartManualRuns(parent, content);
initialize(result);
return result;
}
public class StartManualRuns extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsResponse> {
private static final String REST_PATH = "v1/{+parent}:startManualRuns";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+$");
/**
* Start manual transfer runs to be executed now with schedule_time equal to current time. The
* transfer runs can be created for a time range where the run_time is between start_time
* (inclusive) and end_time (exclusive), or for a specific run_time.
*
* Create a request for the method "transferConfigs.startManualRuns".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link StartManualRuns#execute()} method to invoke the remote
* operation. <p> {@link StartManualRuns#initialize(com.google.api.client.googleapis.services.Abst
* ractGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor. </p>
*
* @param parent Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @param content the {@link com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest}
* @since 1.13
*/
protected StartManualRuns(java.lang.String parent, com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsRequest content) {
super(BigQueryDataTransfer.this, "POST", REST_PATH, content, com.google.api.services.bigquerydatatransfer.v1.model.StartManualTransferRunsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public StartManualRuns set$Xgafv(java.lang.String $Xgafv) {
return (StartManualRuns) super.set$Xgafv($Xgafv);
}
@Override
public StartManualRuns setAccessToken(java.lang.String accessToken) {
return (StartManualRuns) super.setAccessToken(accessToken);
}
@Override
public StartManualRuns setAlt(java.lang.String alt) {
return (StartManualRuns) super.setAlt(alt);
}
@Override
public StartManualRuns setCallback(java.lang.String callback) {
return (StartManualRuns) super.setCallback(callback);
}
@Override
public StartManualRuns setFields(java.lang.String fields) {
return (StartManualRuns) super.setFields(fields);
}
@Override
public StartManualRuns setKey(java.lang.String key) {
return (StartManualRuns) super.setKey(key);
}
@Override
public StartManualRuns setOauthToken(java.lang.String oauthToken) {
return (StartManualRuns) super.setOauthToken(oauthToken);
}
@Override
public StartManualRuns setPrettyPrint(java.lang.Boolean prettyPrint) {
return (StartManualRuns) super.setPrettyPrint(prettyPrint);
}
@Override
public StartManualRuns setQuotaUser(java.lang.String quotaUser) {
return (StartManualRuns) super.setQuotaUser(quotaUser);
}
@Override
public StartManualRuns setUploadType(java.lang.String uploadType) {
return (StartManualRuns) super.setUploadType(uploadType);
}
@Override
public StartManualRuns setUploadProtocol(java.lang.String uploadProtocol) {
return (StartManualRuns) super.setUploadProtocol(uploadProtocol);
}
/**
* Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Transfer configuration name in the form:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public StartManualRuns setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
this.parent = parent;
return this;
}
@Override
public StartManualRuns set(String parameterName, Object value) {
return (StartManualRuns) super.set(parameterName, value);
}
}
/**
* An accessor for creating requests from the Runs collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.Runs.List request = bigquerydatatransfer.runs().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public Runs runs() {
return new Runs();
}
/**
* The "runs" collection of methods.
*/
public class Runs {
/**
* Deletes the specified transfer run.
*
* Create a request for the method "runs.delete".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @return the request
*/
public Delete delete(java.lang.String name) throws java.io.IOException {
Delete result = new Delete(name);
initialize(result);
return result;
}
public class Delete extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.Empty> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
/**
* Deletes the specified transfer run.
*
* Create a request for the method "runs.delete".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Delete#execute()} method to invoke the remote
* operation. <p> {@link
* Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @since 1.13
*/
protected Delete(java.lang.String name) {
super(BigQueryDataTransfer.this, "DELETE", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.Empty.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
}
@Override
public Delete set$Xgafv(java.lang.String $Xgafv) {
return (Delete) super.set$Xgafv($Xgafv);
}
@Override
public Delete setAccessToken(java.lang.String accessToken) {
return (Delete) super.setAccessToken(accessToken);
}
@Override
public Delete setAlt(java.lang.String alt) {
return (Delete) super.setAlt(alt);
}
@Override
public Delete setCallback(java.lang.String callback) {
return (Delete) super.setCallback(callback);
}
@Override
public Delete setFields(java.lang.String fields) {
return (Delete) super.setFields(fields);
}
@Override
public Delete setKey(java.lang.String key) {
return (Delete) super.setKey(key);
}
@Override
public Delete setOauthToken(java.lang.String oauthToken) {
return (Delete) super.setOauthToken(oauthToken);
}
@Override
public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Delete) super.setPrettyPrint(prettyPrint);
}
@Override
public Delete setQuotaUser(java.lang.String quotaUser) {
return (Delete) super.setQuotaUser(quotaUser);
}
@Override
public Delete setUploadType(java.lang.String uploadType) {
return (Delete) super.setUploadType(uploadType);
}
@Override
public Delete setUploadProtocol(java.lang.String uploadProtocol) {
return (Delete) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project
* _id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project
* _id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public Delete setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Returns information about the particular transfer run.
*
* Create a request for the method "runs.get".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.TransferRun> {
private static final String REST_PATH = "v1/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
/**
* Returns information about the particular transfer run.
*
* Create a request for the method "runs.get".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* <p> {@link
* Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @since 1.13
*/
protected Get(java.lang.String name) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.TransferRun.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project
* _id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project
* _id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Returns information about running and completed jobs.
*
* Create a request for the method "runs.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. Name of transfer configuration for which transfer runs should be retrieved.
Format of
* transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListTransferRunsResponse> {
private static final String REST_PATH = "v1/{+parent}/runs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+$");
/**
* Returns information about running and completed jobs.
*
* Create a request for the method "runs.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. Name of transfer configuration for which transfer runs should be retrieved.
Format of
* transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListTransferRunsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. Name of transfer configuration for which transfer runs should be retrieved.
* Format of transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. Name of transfer configuration for which transfer runs should be retrieved. Format of
transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. Name of transfer configuration for which transfer runs should be retrieved.
* Format of transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+$");
}
this.parent = parent;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferRunsRequest` list results. For multiple-page results,
* `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListTransferRunsRequest` list
results. For multiple-page results, `ListTransferRunsResponse` outputs a `next_page` token, which
can be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferRunsRequest` list results. For multiple-page results,
* `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
/** Indicates how run attempts are to be pulled. */
@com.google.api.client.util.Key
private java.lang.String runAttempt;
/** Indicates how run attempts are to be pulled.
*/
public java.lang.String getRunAttempt() {
return runAttempt;
}
/** Indicates how run attempts are to be pulled. */
public List setRunAttempt(java.lang.String runAttempt) {
this.runAttempt = runAttempt;
return this;
}
/** When specified, only transfer runs with requested states are returned. */
@com.google.api.client.util.Key
private java.util.List<java.lang.String> states;
/** When specified, only transfer runs with requested states are returned.
*/
public java.util.List<java.lang.String> getStates() {
return states;
}
/** When specified, only transfer runs with requested states are returned. */
public List setStates(java.util.List<java.lang.String> states) {
this.states = states;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* An accessor for creating requests from the TransferLogs collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code BigQueryDataTransfer bigquerydatatransfer = new BigQueryDataTransfer(...);}
* {@code BigQueryDataTransfer.TransferLogs.List request = bigquerydatatransfer.transferLogs().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public TransferLogs transferLogs() {
return new TransferLogs();
}
/**
* The "transferLogs" collection of methods.
*/
public class TransferLogs {
/**
* Returns user facing log messages for the data transfer run.
*
* Create a request for the method "transferLogs.list".
*
* This request holds the parameters needed by the bigquerydatatransfer server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends BigQueryDataTransferRequest<com.google.api.services.bigquerydatatransfer.v1.model.ListTransferLogsResponse> {
private static final String REST_PATH = "v1/{+parent}/transferLogs";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
/**
* Returns user facing log messages for the data transfer run.
*
* Create a request for the method "transferLogs.list".
*
* This request holds the parameters needed by the the bigquerydatatransfer server. After setting
* any optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* <p> {@link
* List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
* called to initialize this instance immediately after invoking the constructor. </p>
*
* @param parent Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
* @since 1.13
*/
protected List(java.lang.String parent) {
super(BigQueryDataTransfer.this, "GET", REST_PATH, null, com.google.api.services.bigquerydatatransfer.v1.model.ListTransferLogsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{proje
* ct_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. Transfer run name in the form:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
`projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{proje
* ct_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$");
}
this.parent = parent;
return this;
}
/**
* Message types to return. If not populated - INFO, WARNING and ERROR messages are
* returned.
*/
@com.google.api.client.util.Key
private java.util.List<java.lang.String> messageTypes;
/** Message types to return. If not populated - INFO, WARNING and ERROR messages are returned.
*/
public java.util.List<java.lang.String> getMessageTypes() {
return messageTypes;
}
/**
* Message types to return. If not populated - INFO, WARNING and ERROR messages are
* returned.
*/
public List setMessageTypes(java.util.List<java.lang.String> messageTypes) {
this.messageTypes = messageTypes;
return this;
}
/** Page size. The default page size is the maximum value of 1000 results. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Page size. The default page size is the maximum value of 1000 results.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** Page size. The default page size is the maximum value of 1000 results. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferLogsRequest` list results. For multiple-page results,
* `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Pagination token, which can be used to request a specific page of `ListTransferLogsRequest` list
results. For multiple-page results, `ListTransferLogsResponse` outputs a `next_page` token, which
can be used as the `page_token` value to request the next page of list results.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Pagination token, which can be used to request a specific page of
* `ListTransferLogsRequest` list results. For multiple-page results,
* `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
}
}
}
/**
* Builder for {@link BigQueryDataTransfer}.
*
* <p>
* Implementation is not thread-safe.
* </p>
*
* @since 1.3.0
*/
public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {
/**
* Returns an instance of a new builder.
*
* @param transport HTTP transport, which should normally be:
* <ul>
* <li>Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
* <li>Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
* <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
* </li>
* </ul>
* @param jsonFactory JSON factory, which may be:
* <ul>
* <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
* <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
* <li>Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
* </ul>
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
super(
transport,
jsonFactory,
DEFAULT_ROOT_URL,
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
setBatchPath(DEFAULT_BATCH_PATH);
}
/** Builds a new instance of {@link BigQueryDataTransfer}. */
@Override
public BigQueryDataTransfer build() {
return new BigQueryDataTransfer(this);
}
@Override
public Builder setRootUrl(String rootUrl) {
return (Builder) super.setRootUrl(rootUrl);
}
@Override
public Builder setServicePath(String servicePath) {
return (Builder) super.setServicePath(servicePath);
}
@Override
public Builder setBatchPath(String batchPath) {
return (Builder) super.setBatchPath(batchPath);
}
@Override
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}
@Override
public Builder setApplicationName(String applicationName) {
return (Builder) super.setApplicationName(applicationName);
}
@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}
@Override
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
}
@Override
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
return (Builder) super.setSuppressAllChecks(suppressAllChecks);
}
/**
* Set the {@link BigQueryDataTransferRequestInitializer}.
*
* @since 1.12
*/
public Builder setBigQueryDataTransferRequestInitializer(
BigQueryDataTransferRequestInitializer bigquerydatatransferRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(bigquerydatatransferRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}
| [
"chingor@google.com"
] | chingor@google.com |
8f90ec2f52fa6bd7fb607697a3c3ddd42b963a2a | 7ddb854dfa3ac6c39af2b64fdab5eccc9933547f | /week-08/assessment/server/field-agent/src/test/java/learn/field_agent/domain/AliasServiceTest.java | 0cf74dc10e7d0e54b000eb789a2e48f75c689784 | [] | no_license | cward-dev/dev10-program-classwork | 585edb6f81fd5c0f2cb03fc20a0f7d3cfee10bde | b496bbeba156fc6c4e48c04d9a46b1f0bfb5ea56 | refs/heads/main | 2023-03-03T02:45:42.950347 | 2021-02-15T01:29:06 | 2021-02-15T01:29:06 | 319,703,859 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,325 | java | package learn.field_agent.domain;
import learn.field_agent.data.AgentRepository;
import learn.field_agent.data.AliasRepository;
import learn.field_agent.models.Agent;
import learn.field_agent.models.Alias;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.when;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
class AliasServiceTest {
@Autowired
AliasService service;
@MockBean
AliasRepository repository;
@MockBean
AgentRepository agentRepository;
@Test
void shouldFindAll() {
// pass-through test, probably not useful
List<Alias> expected = List.of(
new Alias(1, "Red Noodle", null, 1),
new Alias(2, "Watcher", null, 1),
new Alias(3, "007", null, 2),
new Alias(4, "007", "Rebooted", 3));
when(repository.findAll()).thenReturn(expected);
List<Alias> actual = service.findAll();
assertEquals(expected, actual);
}
@Test
void shouldFindRedNoodle() {
// pass-through test, probably not useful
Alias expected = makeAlias();
when(repository.findById(1)).thenReturn(expected);
Alias actual = service.findById(1);
assertEquals(expected, actual);
}
@Test
void shouldFindByAgentId() {
Agent agent = makeAgent();
List<Alias> expected = List.of(
new Alias(1, "Red Noodle", null, 1),
new Alias(2, "Watcher", null, 1));
when(repository.findByAgentId(1)).thenReturn(expected);
when(agentRepository.findById(1)).thenReturn(agent);
List<Alias> actual = service.findByAgentId(1);
assertEquals(expected, actual);
}
@Test
void shouldNotFindByAgentIdNotPresent() {
List<Agent> agents = List.of(
new Agent(1, "Hazel", "C", "Sauven",
LocalDate.of(1954, 9, 16), 76));
when(agentRepository.findById(45)).thenReturn(null);
List<Alias> actual = service.findByAgentId(45);
assertEquals(0, actual.size());
}
@Test
void shouldAddWithPersona() {
Alias expected = makeAlias();
expected.setAliasId(1);
expected.setPersona("Test Persona");
Alias actual = makeAlias();
actual.setAliasId(0);
actual.setPersona("Test Persona");
when(repository.add(actual)).thenReturn(expected);
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.add(actual);
assertEquals(ResultType.SUCCESS, result.getType());
assertEquals(expected, result.getPayload());
}
@Test
void shouldAddWithNullPersona() {
Alias expected = makeAlias();
Alias actual = makeAlias();
actual.setAliasId(0);
when(repository.add(actual)).thenReturn(expected);
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.add(actual);
assertEquals(ResultType.SUCCESS, result.getType());
assertEquals(expected, result.getPayload());
}
@Test
void shouldAddAndMakePersonaNullIfBlank() {
Alias actual = makeAlias();
actual.setAliasId(0);
actual.setPersona(" ");
when(repository.add(actual)).thenReturn(makeAlias());
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.add(actual);
assertEquals(ResultType.SUCCESS, result.getType());
assertNull(actual.getPersona());
}
@Test
void shouldNotAddNull() {
Result<Alias> result = service.add(null);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("alias cannot be null", result.getMessages().get(0));
assertNull(result.getPayload());
}
@Test
void shouldNotAddNullOrBlankName() {
Alias actual = makeAlias();
actual.setAliasId(0);
actual.setName(null);
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.add(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name is required", result.getMessages().get(0));
assertNull(result.getPayload());
actual.setName(" ");
result = service.add(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name is required", result.getMessages().get(0));
assertNull(result.getPayload());
}
@Test
void shouldNotAddDuplicateNameWithNullPersona() {
Alias actual = makeAlias();
actual.setAliasId(0);
when(agentRepository.findById(1)).thenReturn(makeAgent());
when(repository.findAll()).thenReturn(List.of(makeAlias()));
Result<Alias> result = service.add(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name: 'Bill', already exists, cannot set without persona", result.getMessages().get(0));
assertNull(result.getPayload());
}
@Test
void shouldNotAddDuplicateNameAndPersona() {
Alias alias = makeAlias();
alias.setPersona("Test Persona");
Alias actual = makeAlias();
actual.setAliasId(0);
actual.setPersona("Test Persona");
when(agentRepository.findById(1)).thenReturn(makeAgent());
when(repository.findAll()).thenReturn(List.of(alias));
Result<Alias> result = service.add(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name: 'Bill', persona: 'Test Persona', already exists", result.getMessages().get(0));
assertNull(result.getPayload());
}
@Test
void shouldNotAddWithId() {
Alias actual = makeAlias();
actual.setAliasId(45);
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.add(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("aliasId cannot be set for `add` operation", result.getMessages().get(0));
assertNull(result.getPayload());
}
@Test
void shouldUpdate() {
Alias actual = makeAlias();
actual.setName("Hopper");
when(repository.update(actual)).thenReturn(true);
when(repository.findAll()).thenReturn(List.of(makeAlias()));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.SUCCESS, result.getType());
}
@Test
void shouldUpdateToSameNameAndPersonaCombinationAsExisting() {
Alias actual = makeAlias();
when(repository.update(actual)).thenReturn(true);
when(repository.findAll()).thenReturn(List.of(makeAlias()));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.SUCCESS, result.getType());
}
@Test
void shouldNotUpdateMissingOrInvalidId() {
Alias actual = new Alias(0, "Test", null, 1);
when(repository.findAll()).thenReturn(List.of(makeAlias()));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("aliasId must be set for `update` operation", result.getMessages().get(0));
actual.setAliasId(45);
result = service.update(actual);
assertEquals(ResultType.NOT_FOUND, result.getType());
assertEquals("aliasId: 45, not found", result.getMessages().get(0));
}
@Test
void shouldNotUpdateNullOrBlankName() {
Alias actual = makeAlias();
actual.setName(null);
when(repository.findAll()).thenReturn(List.of(makeAlias()));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name is required", result.getMessages().get(0));
actual.setName(" ");
result = service.update(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name is required", result.getMessages().get(0));
}
@Test
void shouldNotUpdateDuplicateNameNullPersona() {
Alias alias2 = new Alias(2, "Test", null, 1);
Alias actual = makeAlias();
actual.setName("Test");
actual.setPersona(null);
when(repository.findAll()).thenReturn(List.of(makeAlias(), alias2));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name: 'Test', already exists, cannot set without persona", result.getMessages().get(0));
}
@Test
void shouldNotUpdateDuplicateNameAndPersona() {
Alias alias2 = new Alias(2, "Test", "V2", 1);
Alias actual = makeAlias();
actual.setName("Test");
actual.setPersona("V2");
when(repository.findAll()).thenReturn(List.of(makeAlias(), alias2));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.INVALID, result.getType());
assertEquals("name: 'Test', persona: 'V2', already exists", result.getMessages().get(0));
}
@Test
void shouldNotUpdateInvalidAgentId() {
Alias actual = makeAlias();
actual.setAgentId(45);
when(repository.findAll()).thenReturn(List.of(makeAlias()));
when(agentRepository.findById(1)).thenReturn(makeAgent());
Result<Alias> result = service.update(actual);
assertEquals(ResultType.NOT_FOUND, result.getType());
assertEquals("agentId: 45, not found", result.getMessages().get(0));
}
@Test
void shouldDeleteById() {
// pass-through test, probably not useful
when(repository.deleteById(1)).thenReturn(true);
assertTrue(service.deleteById(1));
}
@Test
void shouldNotDeleteByIdNotFound() {
// pass-through test, probably not useful
when(repository.deleteById(45)).thenReturn(false);
assertFalse(service.deleteById(45));
}
private Alias makeAlias() {
//('Bill',null,1)
Alias alias = new Alias();
alias.setAliasId(1);
alias.setName("Bill");
alias.setPersona(null);
alias.setAgentId(1);
return alias;
}
private Agent makeAgent() {
//('Hazel','C','Sauven','1954-09-16',76),
Agent agent = new Agent();
agent.setAgentId(1);
agent.setFirstName("Hazel");
agent.setMiddleName("C");
agent.setLastName("Sauven");
agent.setDob(LocalDate.of(1954, 9, 16));
agent.setHeightInInches(76);
return agent;
}
} | [
"cward@dev-10.com"
] | cward@dev-10.com |
842714c008f94e796ad53b8394863aaf69b854b6 | 744c2fbc20f2a29a1ad964ba2e54a3a4abd44cd1 | /src/main/java/com/sweetpeatime/sweetpeatime/entities/PromotionDetailCurrentDto.java | c5983541b041e4758f1dce3d1f2e5986a2e0da26 | [] | no_license | i-maii/SweetPeaTime-API | 3ff59d01dae847e93cbaf9e0ddf8aa5f307797e6 | c940960a33d56057e474395b0f01088794a19838 | refs/heads/master | 2023-04-27T07:33:31.993342 | 2021-05-10T13:16:24 | 2021-05-10T13:16:24 | 334,951,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,059 | java | package com.sweetpeatime.sweetpeatime.entities;
public class PromotionDetailCurrentDto {
private Integer id;
private String formulaName;
private String size;
private Integer quantity;
private Double profit;
private Integer totalProfit;
private Double price;
private String locationName;
private String image;
private String quantityFlower;
private Integer stock;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getFormulaName() {
return formulaName;
}
public void setFormulaName(String formulaName) {
this.formulaName = formulaName;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Double getProfit() { return profit; }
public void setProfit(Double profit) {
this.profit = profit;
}
public Integer getTotalProfit() { return totalProfit; }
public void setTotalProfit(Integer totalProfit) {
this.totalProfit = totalProfit;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getLocationName() {
return locationName;
}
public void setLocationName(String locationName) {
this.locationName = locationName;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getQuantityFlower() {
return quantityFlower;
}
public void setQuantityFlower(String quantityFlower) {
this.quantityFlower = quantityFlower;
}
public Integer getStock() {
return stock;
}
public void setStock(Integer stock) {
this.stock = stock;
}
}
| [
"6282048426@student.chula.co.th"
] | 6282048426@student.chula.co.th |
6968ead470fd918be3fbd953cd0d4f3ae1f3538a | 38d1b193220cc14f8d42ee394ac7d514be3c7a65 | /search-api/src/main/java/com/mysoft/b2b/search/param/SupplierParam.java | 0c2f05f9df8ecb502b518c6cc593f22f24e4054a | [] | no_license | sdgdsffdsfff/search-dubbo | 4634efecb8541162e39f47079f18c92655e7ee0c | 088fd7b75f01eaafbf49cde77703492d1798a322 | refs/heads/master | 2021-01-21T18:40:04.764620 | 2014-12-30T09:20:57 | 2014-12-30T09:20:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,424 | java | package com.mysoft.b2b.search.param;
import java.io.Serializable;
/**
* 供应商搜索查询参数
*
* @author ganq
*
*/
public class SupplierParam extends BaseParam implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
public SupplierParam() {
super();
super.setSearchModule(SearchModule.SUPPLIER);
super.setSearchSource(SearchSource.WEBSITE);
}
/**
* 注册资本
*/
private String registeredcapital;
/**
* 成立年限
*/
private String year;
/**
* 资质
*/
private String qualification;
/**
* 资质等级
*/
private String qualificationLevel;
/**
* 按注册资金排序
*/
private String regsort;
/**
* 按成立年份排序
*/
private String yearsort;
// ------ 微信用 --------
/**
* 省份编码
*/
private String province;
/**
* 区域
*/
private String area;
// ------ 微信用 --------
public String getRegisteredcapital() {
return registeredcapital;
}
public void setRegisteredcapital(String registeredcapital) {
this.registeredcapital = registeredcapital;
}
public String getQualification() {
return qualification;
}
public void setQualification(String qualification) {
this.qualification = qualification;
}
public String getQualificationLevel() {
return qualificationLevel;
}
public void setQualificationLevel(String qualificationLevel) {
this.qualificationLevel = qualificationLevel;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getRegsort() {
return regsort;
}
public void setRegsort(String regsort) {
this.regsort = regsort;
}
public String getYearsort() {
return yearsort;
}
public void setYearsort(String yearsort) {
this.yearsort = yearsort;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
@Override
public String toString() {
return "SupplierParam [registeredcapital=" + registeredcapital + ", year=" + year + ", qualification="
+ qualification + ", qualificationLevel=" + qualificationLevel + ", regsort=" + regsort + ", yearsort="
+ yearsort + ", province=" + province + ", area=" + area + ", toString()=" + super.toString() + "]";
}
}
| [
"2496408891@qq.com"
] | 2496408891@qq.com |
a1ae181994128b95df44b63554ff1a68f86b95d4 | 8feabb6ff03bb931d61ebe27272b9684d77dd6c3 | /src/com/huijuji/SaleNotificationWakeReceiver.java | 3b628e034d5fa40479178df7590e8fcb71838e77 | [] | no_license | DylanMay/MyRepository | f836504e386ef8895074a700b2eb7c6f8e3bbda4 | fb2f5997c1aee36968358f05bb280365be40e6ac | refs/heads/master | 2016-09-05T15:16:48.147816 | 2013-06-21T08:13:08 | 2013-06-21T08:14:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,736 | java | package com.fab;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.fab.backgroundservice.SaleNotificationService;
public class SaleNotificationWakeReceiver extends BroadcastReceiver
{
private Bundle extra;
private String goTo;
private String goToUrl;
private int isCheckLogin;
private int isSSL;
private String msg;
private int prodId;
private int saleId;
private String saleType;
private int shopId;
private int weeklyShopId;
public void onReceive(Context paramContext, Intent paramIntent)
{
String str = paramIntent.getAction();
this.extra = paramIntent.getExtras();
if (this.extra != null)
{
this.saleType = this.extra.getString("SALE_TYPE");
this.msg = this.extra.getString("MSG");
this.saleId = this.extra.getInt("SALE_ID");
this.prodId = this.extra.getInt("PROD_ID");
this.shopId = this.extra.getInt("SHOP_ID");
this.weeklyShopId = this.extra.getInt("WEEKLY_SHOP_ID");
this.goTo = this.extra.getString("GO_TO");
this.goToUrl = this.extra.getString("GO_TO_URL");
this.isSSL = this.extra.getInt("IS_SSL");
this.isCheckLogin = this.extra.getInt("IS_CHECK_LOGIN");
}
if ((str.contains("FAB_SALE_NOTIFICATION_ALARM")) && (this.saleType != null) && (this.msg != null))
{
Intent localIntent2 = new Intent(paramContext, SaleNotificationService.class);
localIntent2.putExtra("SALE_TYPE", this.saleType);
localIntent2.putExtra("MSG", this.msg);
localIntent2.putExtra("SALE_ID", this.saleId);
localIntent2.putExtra("PROD_ID", this.prodId);
localIntent2.putExtra("SHOP_ID", this.shopId);
localIntent2.putExtra("WEEKLY_SHOP_ID", this.weeklyShopId);
localIntent2.putExtra("GO_TO", this.goTo);
localIntent2.putExtra("GO_TO_URL", this.goToUrl);
localIntent2.putExtra("IS_SSL", this.isSSL);
localIntent2.putExtra("IS_CHECK_LOGIN", this.isCheckLogin);
paramContext.startService(localIntent2);
}
if ((str.contains("WEEKLY_SHOP_NOTIFICATION")) && (this.msg != null))
{
Intent localIntent1 = new Intent(paramContext, SaleNotificationService.class);
localIntent1.putExtra("MSG", this.msg);
localIntent1.putExtra("WEEKLY_SHOP_ID", this.weeklyShopId);
paramContext.startService(localIntent1);
}
}
}
/* Location: C:\Documents and Settings\Administrator\桌面\private\反编译\apk2java\dex2java\dex-translator-0.0.9.3\dex-translator-0.0.9.3\classes_dex2jar.jar
* Qualified Name: com.fab.SaleNotificationWakeReceiver
* JD-Core Version: 0.6.2
*/ | [
"Administrator@GMPU4E9FETCVXAP"
] | Administrator@GMPU4E9FETCVXAP |
f0f6969a553d615ef867cf1673a661f7b3b4b789 | aef7bc8da625717dab31630152080198864b95d7 | /app/src/main/java/com/duma/ld/zhilianlift/view/main/home/MyFragment.java | 314c0351c25cd5520dacb4d916c4e560b163faa1 | [] | no_license | 799536960/zhilianlift | b3cb51d4d6a062d9a487728b24996e0f2d089da2 | 4cc974cebe5f3edb9e7d2c800ec5a42242aae1fe | refs/heads/master | 2020-03-25T19:51:26.633282 | 2018-08-06T12:25:36 | 2018-08-06T12:25:36 | 144,103,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,512 | java | package com.duma.ld.zhilianlift.view.main.home;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.duma.ld.baselibrary.util.ZhuanHuanUtil;
import com.duma.ld.baselibrary.util.config.FragmentConfig;
import com.duma.ld.baselibrary.util.config.InitConfig;
import com.duma.ld.zhilianlift.R;
import com.duma.ld.zhilianlift.base.baseJsonHttp.MyJsonCallback;
import com.duma.ld.zhilianlift.base.baseView.BaseMyFragment;
import com.duma.ld.zhilianlift.model.HttpResModel;
import com.duma.ld.zhilianlift.model.UserModel;
import com.duma.ld.zhilianlift.util.ImageLoader;
import com.duma.ld.zhilianlift.util.IntentUtil;
import com.duma.ld.zhilianlift.util.SpDataUtil;
import com.duma.ld.zhilianlift.view.main.pay.HousePayListActivity;
import com.duma.ld.zhilianlift.view.main.pay.PointsPayListActivity;
import com.duma.ld.zhilianlift.view.main.pay.YuEListActivity;
import com.duma.ld.zhilianlift.view.main.shopping.afterSales.AfterSalesListActivity;
import com.duma.ld.zhilianlift.view.main.wode.MyFinanceActivity;
import com.duma.ld.zhilianlift.view.main.wode.SettingActivity;
import com.duma.ld.zhilianlift.view.main.wode.UserDataActivity;
import com.duma.ld.zhilianlift.view.main.wode.WoDeBaoBeiActivity;
import com.duma.ld.zhilianlift.widget.LinearImageLayout;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.orhanobut.logger.Logger;
import butterknife.BindView;
import butterknife.OnClick;
import static com.duma.ld.zhilianlift.util.HttpUrl.userInfo;
/**
* 我的
* Created by liudong on 2017/11/29.
*/
public class MyFragment extends BaseMyFragment {
@BindView(R.id.layout_setting)
FrameLayout layoutSetting;
@BindView(R.id.layout_messgae)
LinearImageLayout layoutMessgae;
@BindView(R.id.layout_order_daifukuan)
LinearImageLayout layoutOrderDaifukuan;
@BindView(R.id.layout_order_daishouhuo)
LinearImageLayout layoutOrderDaishouhuo;
@BindView(R.id.layout_order_daipinjia)
LinearImageLayout layoutOrderDaipinjia;
@BindView(R.id.layout_order_shouhou)
LinearImageLayout layoutOrderShouhou;
@BindView(R.id.layout_order)
LinearImageLayout layoutOrder;
@BindView(R.id.layout_money_zhuangxiuzijin)
LinearLayout layoutMoneyZhuangxiuzijin;
@BindView(R.id.layout_money_youhuijuan)
LinearLayout layoutMoneyYouhuijuan;
@BindView(R.id.layout_money_yu_e)
LinearLayout layoutMoneyYuE;
@BindView(R.id.layout_money_jifen)
LinearLayout layoutMoneyJifen;
@BindView(R.id.layout_wode_daikuan)
LinearLayout layoutWodeDaikuan;
@BindView(R.id.layout_wode_baobei)
LinearLayout layoutWodeBaobei;
@BindView(R.id.layout_wode_chuzu)
LinearLayout layoutWodeChuzu;
@BindView(R.id.layout_wode_ershoufang)
LinearLayout layoutWodeErshoufang;
@BindView(R.id.layout_wode_shoucang)
LinearLayout layoutWodeShoucang;
@BindView(R.id.layout_wode_jilu)
LinearLayout layoutWodeJilu;
@BindView(R.id.layout_user)
LinearLayout layoutUser;
@BindView(R.id.img_icon)
ImageView imgIcon;
@BindView(R.id.tv_Nick_name)
TextView tvName;
@BindView(R.id.tv_phone)
TextView tvPhone;
@BindView(R.id.tv_zhuangXiuZiJin)
TextView tvZhuangXiuZiJin;
@BindView(R.id.tv_youHuiJuan)
TextView tvYouHuiJuan;
@BindView(R.id.tv_yuE)
TextView tvYuE;
@BindView(R.id.tv_jiFen)
TextView tvJiFen;
@BindView(R.id.sw_loading)
SwipeRefreshLayout swLoading;
@Override
protected FragmentConfig setFragmentConfig(Bundle savedInstanceState, InitConfig initConfig) {
return initConfig.setLayoutIdByFragment(R.layout.fragment_my, false);
}
@Override
protected void init(Bundle savedInstanceState) {
super.init(savedInstanceState);
swLoading.setColorSchemeColors(ContextCompat.getColor(mActivity, com.duma.ld.baselibrary.R.color.textColor));
swLoading.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (SpDataUtil.isLogin()) {
getUserDataHttp();
} else {
swLoading.setRefreshing(false);
}
}
});
}
@Override
public void onSupportVisible() {
super.onSupportVisible();
refreshUserData();
if (SpDataUtil.isLogin()) {
getUserDataHttp();
}
}
private void refreshUserData() {
UserModel user = SpDataUtil.getUser();
if (user != null) {
//登录后
// Logger.e("user: " + user.toString());
ImageLoader.with_head(user.getHead_pic(), imgIcon);
tvPhone.setVisibility(View.VISIBLE);
tvName.setText(user.getNickname());
tvPhone.setText("用户名:" + user.getMobile_xx());
tvZhuangXiuZiJin.setText(user.getRenovation_money());
tvYouHuiJuan.setText(user.getCoupon_count());
tvYuE.setText(user.getUser_money());
tvJiFen.setText(user.getPay_points() + "");
layoutMessgae.setNum(user.getNews());
layoutOrderDaifukuan.setNum(user.getWaitPay());
layoutOrderDaishouhuo.setNum(user.getWaitReceive());
layoutOrderDaipinjia.setNum(user.getWaitcomment());
layoutOrderShouhou.setNum(user.getReturn_count());
} else {
Logger.e("user: null");
imgIcon.setImageDrawable(ZhuanHuanUtil.getDrawable(R.drawable.img_60));
//没有登录 初始化数据
tvPhone.setVisibility(View.GONE);
tvName.setText("未登录");
tvZhuangXiuZiJin.setText("0");
tvYouHuiJuan.setText("0");
tvYuE.setText("0");
tvJiFen.setText("0");
layoutMessgae.setNum("0");
layoutOrderDaifukuan.setNum("0");
layoutOrderDaishouhuo.setNum("0");
layoutOrderDaipinjia.setNum("0");
layoutOrderShouhou.setNum("0");
}
}
private void getUserDataHttp() {
swLoading.setRefreshing(true);
OkGo.<HttpResModel<UserModel>>get(userInfo)
.tag(httpTag)
.execute(new MyJsonCallback<HttpResModel<UserModel>>() {
@Override
protected void onJsonSuccess(Response<HttpResModel<UserModel>> respons, HttpResModel<UserModel> userModelHttpResModel) {
swLoading.setRefreshing(false);
SpDataUtil.setUser(userModelHttpResModel.getResult());
refreshUserData();
}
@Override
public void onError(Response<HttpResModel<UserModel>> response) {
super.onError(response);
swLoading.setRefreshing(false);
}
});
}
@OnClick({R.id.layout_user, R.id.layout_setting, R.id.layout_messgae, R.id.layout_order_daifukuan, R.id.layout_order_daishouhuo, R.id.layout_order_daipinjia, R.id.layout_order_shouhou, R.id.layout_order, R.id.layout_money_zhuangxiuzijin, R.id.layout_money_youhuijuan, R.id.layout_money_yu_e, R.id.layout_money_jifen, R.id.layout_wode_daikuan, R.id.layout_wode_baobei, R.id.layout_wode_chuzu, R.id.layout_wode_ershoufang, R.id.layout_wode_shoucang, R.id.layout_wode_jilu})
public void onViewClicked(View view) {
if (!SpDataUtil.isLogin()) {
IntentUtil.goLogin(mActivity);
return;
}
switch (view.getId()) {
case R.id.layout_setting:
startActivity(new Intent(mActivity, SettingActivity.class));
break;
case R.id.layout_messgae:
IntentUtil.goMessage(mActivity);
break;
case R.id.layout_order_daifukuan:
IntentUtil.goOrderList(mActivity, 1);
break;
case R.id.layout_order_daishouhuo:
IntentUtil.goOrderList(mActivity, 3);
break;
case R.id.layout_order_daipinjia:
IntentUtil.goOrderList(mActivity, 4);
break;
case R.id.layout_order_shouhou:
startActivity(new Intent(mActivity, AfterSalesListActivity.class));
break;
case R.id.layout_order:
IntentUtil.goOrderList(mActivity);
break;
case R.id.layout_money_zhuangxiuzijin:
startActivity(new Intent(mActivity, HousePayListActivity.class));
break;
case R.id.layout_money_youhuijuan:
IntentUtil.goCoupons(mActivity);
break;
case R.id.layout_money_yu_e:
startActivity(new Intent(mActivity, YuEListActivity.class));
break;
case R.id.layout_money_jifen:
startActivity(new Intent(mActivity, PointsPayListActivity.class));
break;
case R.id.layout_wode_daikuan:
startActivity(new Intent(mActivity, MyFinanceActivity.class));
break;
case R.id.layout_wode_baobei:
startActivity(new Intent(mActivity, WoDeBaoBeiActivity.class));
break;
case R.id.layout_wode_chuzu:
IntentUtil.goRental(mActivity);
break;
case R.id.layout_wode_ershoufang:
IntentUtil.goSecondHouse(mActivity);
break;
case R.id.layout_wode_shoucang:
IntentUtil.goMyCollect(mActivity);
break;
case R.id.layout_wode_jilu:
IntentUtil.goMyRecord(mActivity);
break;
case R.id.layout_user:
// IntentUtil.goUserData(mActivity);
Intent intent = new Intent(mActivity, UserDataActivity.class);
ActivityOptionsCompat options = ActivityOptionsCompat
.makeSceneTransitionAnimation(mActivity,
imgIcon, "testImg");
startActivity(intent, options.toBundle());
break;
}
}
}
| [
"799536960@qq.com"
] | 799536960@qq.com |
5a09915866f4938132dd13ec268d881074fa866b | e1cf5880c48775172be0ea80d1eda8bf46083533 | /src/java/CsuEastBay/Util/DataBase.java | dab6bfcb8988e821eebc3dfb3ed5f75b71de721c | [] | no_license | Aksuyash/final-shopping-Cart | 7f6367b029a6c8f39aac0a99c5efea0a2b6258a2 | 2345e087d74605e0d7e5c6abf4617c41725dd053 | refs/heads/master | 2021-01-20T18:52:59.957685 | 2016-07-21T08:13:07 | 2016-07-21T08:13:07 | 63,850,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,398 | 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 CsuEastBay.Util;
import CsuEastBay.model.Address;
import CsuEastBay.bean.UserAccount;
import CsuEastBay.model.Item;
import CsuEastBay.model.User;
import java.io.Serializable;
import java.sql.Array;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author welcome
*/
public class DataBase implements Serializable{
private static Connection getConnection()
{
Connection connection = null;
try {
String dbURL = "jdbc:mysql://localhost:3306/lenden";
String username = "root";
String password = "Coder12";
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
}
connection = DriverManager.getConnection(
dbURL, username, password);
} catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
return connection;
}
public static User SelectUser(String id)
{
User user = null;
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
ResultSet rs = null;
String query = "SELECT * FROM USER_TABLE "
+ "WHERE userId = ?";
ps = connection.prepareStatement(query);
ps.setString(1, id);
rs = ps.executeQuery();
if (rs.next()) {
user = new User();
user.setFirstName(rs.getString("firstName"));
user.setLastName(rs.getString("lastName"));
user.setEmail(rs.getString("email"));
user.setPassword(rs.getString("password"));
user.setUserId(rs.getString("userId"));
user.setMiddleName(rs.getString("middleName"));
}
ps.executeUpdate();
ps.close();
rs.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
return user;
}
public static ArrayList<Item> SelectItem(double id)
{
ArrayList<Item> arrayitem = null;
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
ResultSet rs = null;
String query = "SELECT * FROM ITEM_TABLE";
//ps = connection.prepareStatement(query);
//ps.setDouble(1, id);
System.out.println("asdfadsfas ");
rs = statement.executeQuery(query);
if (rs.next()) {
Item item = new Item();
item.setName(rs.getString("name"));
item.setDescription(rs.getString("description"));
item.setPrice(rs.getDouble("price"));
double in = (rs.getDouble("id"));
item.setId((int) in);
item.setId((int)id);
System.out.println(item.getDescription());
arrayitem.add(item);
}
ps.executeUpdate();
ps.close();
rs.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
return arrayitem;
}
public static void UpdateItem(Item item)
{
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
String query = "UPDATE ITEM_TABLE SET "
+ " name = ?"
+ "description = ? "
+ "price = ? "
+ "date = ?"
+ "id = ?";
ps = connection.prepareStatement(query);
ps.setString(1, item.getName());
ps.setString(2, item.getDescription());
ps.setDouble(3, item.getPrice());
ps.setString(4, item.getDate());
ps.setDouble(5, item.getId());
ps.executeUpdate();
ps.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
}
public static void UpdateUser(User user)
{
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
String query = "UPDATE USER_TABLE SET "
+ "firstName = ? "
+ "middleName = ? "
+ "lastName = ?"
+ "email = ?"
+ "userId = ?"
+ "password = ?";
ps = connection.prepareStatement(query);
ps.setString(1, user.getFirstName());
ps.setString(2, user.getMiddleName());
ps.setString(3, user.getLastName());
ps.setString(4, user.getEmail());
ps.setString(5, user.getUserId());
ps.setString(6, user.getPassword());
ps.executeUpdate();
ps.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
}
public static void InsertUser(User user)
{
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
String query = "INSERT INTO USER_TABLE (firstName, middleName, lastName, email, userId, password)"
+ "VALUES(?,?,?,?,?,?)";
ps = connection.prepareStatement(query);
ps.setString(1, user.getFirstName());
ps.setString(2, user.getMiddleName());
ps.setString(3, user.getLastName());
ps.setString(4, user.getEmail());
ps.setString(5, user.getUserId());
ps.setString(6, user.getPassword());
ps.executeUpdate();
ps.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
}
public static void InsertItem(Item item)
{
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
String query = "INSERT INTO ITEM_TABLE (name,description,price,date,id)"
+ "VALUES (?,?,?,?,?)";
ps = connection.prepareStatement(query);
ps.setString(1, item.getName());
ps.setString(2, item.getDescription());
ps.setDouble(3, item.getPrice());
ps.setString(4, item.getDate());
ps.setDouble(5, item.getId());
ps.executeUpdate();
ps.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
}
public static void DeleteUser(User user)
{
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
String query = "DELETE FROM USER_TABLE "
+ "WHERE userId = ?";
ps = connection.prepareStatement(query);
ps.setString(1, user.getUserId());
ps.executeUpdate();
ps.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
}
public static void DeleteItem(Item item)
{
try{
Connection connection = DataBase.getConnection();
Statement statement = connection.createStatement();
PreparedStatement ps = null;
String query = "DELETE FROM ITEM_TABLE "
+ "WHERE id = ?";
ps = connection.prepareStatement(query);
ps.setLong(1, item.getId());
ps.executeUpdate();
ps.close();
statement.close();
connection.close();
}
catch(SQLException e) {
for (Throwable t : e)
t.printStackTrace();
}
}
} | [
"aksuyash@gmail.com"
] | aksuyash@gmail.com |
7b753040dbde20144af3cf6bc04ab417077ff7be | 59a32d733b5d70c21e6a44b90cee4cc2ee57e6de | /src/com/qian/pos/util/FileUtils.java | c79a2f2eb962dbf80cbe160ae03b6b6cb2ee7cac | [] | no_license | dandelion133/uploadImage | 347712eb073ddef62eebb4db4bd26ff32cd8aef0 | 035811a6fac07adfb7dc0a9da36c256d7874214e | refs/heads/master | 2021-01-17T08:27:25.533174 | 2016-08-11T03:02:36 | 2016-08-11T03:02:36 | 65,433,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,072 | java | package com.qian.pos.util;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import android.graphics.Bitmap;
import android.os.Environment;
public class FileUtils {
public static String SDPATH = Environment.getExternalStorageDirectory()
+ "/pos/";
public static void saveBitmap(Bitmap bm, String picName) {
System.out.println("-----------------------------");
try {
if (!isFileExist("")) {
System.out.println("创建文件");
File tempf = createSDDir("");
}
File f = new File(SDPATH, picName + ".JPEG");
if (f.exists()) {
f.delete();
}
FileOutputStream out = new FileOutputStream(f);
bm.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.flush();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public static File createSDDir(String dirName) throws IOException {
File dir = new File(SDPATH + dirName);
if (Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED)) {
System.out.println("createSDDir:" + dir.getAbsolutePath());
System.out.println("createSDDir:" + dir.mkdir());
}
return dir;
}
public static boolean isFileExist(String fileName) {
File file = new File(SDPATH + fileName);
file.isFile();
System.out.println(file.exists());
return file.exists();
}
public static void delFile(String fileName){
File file = new File(SDPATH + fileName);
if(file.isFile()){
file.delete();
}
file.exists();
}
public static void deleteDir() {
File dir = new File(SDPATH);
if (dir == null || !dir.exists() || !dir.isDirectory())
return;
for (File file : dir.listFiles()) {
if (file.isFile())
file.delete();
else if (file.isDirectory())
deleteDir();
}
dir.delete();
}
public static boolean fileIsExists(String path) {
try {
File f = new File(path);
if (!f.exists()) {
return false;
}
} catch (Exception e) {
return false;
}
return true;
}
}
| [
"825232822@qq.com"
] | 825232822@qq.com |
ae603f83f0a0ead09b8e7be7962f02f725cd7227 | 59bf777ac0458cb87a56fea98039787c29efbb11 | /Hello.java | bbb537b8ddd90988add807d3b53517cd8c96f79b | [] | no_license | yasinshaik1996/Helloworld | 34a81524096d1fa9b6076935ee95f835104915e5 | 2cb677b832a70a5539203f7b56e2327cb0323333 | refs/heads/master | 2023-01-13T02:21:41.159862 | 2020-11-11T11:20:58 | 2020-11-11T11:20:58 | 311,116,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 135 | java | public class Hello{
public static void main(String[] args){
for(int i=1; i<=10; i++){
System.out.println("Hello World..."+i);
}
}
} | [
"67871162+mariam-hue@users.noreply.github.com"
] | 67871162+mariam-hue@users.noreply.github.com |
7d1db82fe539bda2b59a21167faeb92b38dfaff0 | 0d3d08123c6f9a9ae0e8af687873adf1164c7328 | /src/main/java/com/chanmei/entity/Share.java | 7e735501485b05036cce4af7c85248dc22143900 | [] | no_license | 840359379/ShiGuang | 5a30b41e45338fff423927f108b97dfc33de729f | 9c1287a5e088cccb466747f4a16b9a1f94c53e78 | refs/heads/master | 2023-03-11T09:15:20.385763 | 2021-02-20T02:30:18 | 2021-02-20T02:30:18 | 340,542,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,832 | java | package com.chanmei.entity;
import java.sql.Timestamp;
//˵˵
public class Share {
private String shareid;
private String account;
private Timestamp establish;
private String condition;
private String activityid;
private String title;
private String content;
public String getShareid() {
return shareid;
}
public void setShareid(String shareid) {
this.shareid = shareid;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public Timestamp getEstablish() {
return establish;
}
public void setEstablish(Timestamp establish) {
this.establish = establish;
}
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
public String getActivityid() {
return activityid;
}
public void setActivityid(String activityid) {
this.activityid = activityid;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Share(String shareid, String account, Timestamp establish, String condition, String activityid, String title,
String content) {
super();
this.shareid = shareid;
this.account = account;
this.establish = establish;
this.condition = condition;
this.activityid = activityid;
this.title = title;
this.content = content;
}
public Share() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "Share [shareid=" + shareid + ", account=" + account + ", establish=" + establish + ", condition="
+ condition + ", activityid=" + activityid + ", title=" + title + ", content=" + content + "]";
}
}
| [
"jianhui.sheng@feiniu.com"
] | jianhui.sheng@feiniu.com |
c62bcf3329517d7e7293fcf6a804471882800396 | e3aa7ba1903c6f0eff2d7c6a52a2c04b506a0b0c | /src/main/java/com/demotivirus/Day_040/testOpenConsoleFiles/OpenConsole.java | e9b75c54dc0602ddff0aa68dbff6fdb704f384a7 | [] | no_license | demotivirus/365_Days_Challenge_Five_Classes_Every_Single_Day | 81840d0adfbee9ee6bef9e4e7db272412c0ec3be | 4a8de3ea52a8068cf683dc0d4729e462c61f9749 | refs/heads/master | 2023-03-03T12:59:08.851213 | 2021-02-06T21:17:55 | 2021-02-06T21:17:55 | 323,734,587 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package com.demotivirus.Day_040.testOpenConsoleFiles;
import java.awt.*;
import java.io.File;
import java.io.IOException;
public class OpenConsole {
public static void main(String[] args) {
String path = "..\\.\\365_Days_Challenge_Five_Classes_Every_Single_Day" +
"\\365_Days_Challenge_Five_Classes_Every_Single_Day" +
"\\src\\main\\java\\com\\demotivirus\\Day_040\\dir.bat";
File file = new File(path);
Desktop desktop = Desktop.getDesktop();
System.out.println(file.exists());
if (file.exists()) {
try {
desktop.open(file);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
| [
"demotivirus@gmail.com"
] | demotivirus@gmail.com |
70ef03cbf60ea8fa5c3477a2dc5bb93530c4ab88 | 47952612d37b79346c4738bb4f42c412c8e6a2fc | /src/hibernate/entities/jpa/Abcz.java | d59e2b9b9ada95f58ec306cd8141249da168faa4 | [] | no_license | vipinchandranp/hibernate | d2b52b2232efc7e4b990e8fcdf45b4c0c3e3e755 | a20fcc008355fae9afa8bfb753bc96a415869b7a | refs/heads/master | 2021-05-13T23:08:48.743994 | 2018-01-06T18:27:52 | 2018-01-06T18:27:52 | 116,505,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 924 | java | package hibernate.entities.jpa;
import java.io.Serializable;
import javax.persistence.*;
/**
* The persistent class for the ABCZ database table.
*
*/
@Entity
@Table(name="ABCZ")
public class Abcz implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="ABC_ID")
private Integer abcId;
@Column(name="ABCZ_VALUE")
private String abczValue;
//bi-directional one-to-one association to Abc
@OneToOne
@JoinColumn(name="ABC_ID")
private Abc abc;
public Abcz() {
}
public Integer getAbcId() {
return this.abcId;
}
public void setAbcId(Integer abcId) {
this.abcId = abcId;
}
public String getAbczValue() {
return this.abczValue;
}
public void setAbczValue(String abczValue) {
this.abczValue = abczValue;
}
public Abc getAbc() {
return this.abc;
}
public void setAbc(Abc abc) {
this.abc = abc;
}
} | [
"vipin chandran p"
] | vipin chandran p |
6bc891d8bcbe0de3c4ed05db6305eb046b94ec5a | a7fcd9437927a702fa44876a765ce12e67c3a3ad | /src/main/ui/WellnessJournal.java | 3ceb813031d2e0d2ffcbe0eacd83899ff18d3b89 | [] | no_license | daisyuma/WellnessJournal | a6918d8322c5009c95fb7b57ac802a5f0dcb4a3b | f4776be788110ccfaed894c93a1b99c57f36c11b | refs/heads/master | 2020-12-24T00:51:56.945924 | 2020-07-26T15:29:48 | 2020-07-26T15:29:48 | 237,327,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,555 | java | package ui;
import exceptions.EmptyInputException;
import exceptions.InvalidInputException;
import model.*;
import org.json.simple.parser.ParseException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class WellnessJournal {
private static Scanner scanner = new Scanner(System.in);
private User myUser;
private Plant myPlant;
public WellnessJournal() throws IOException, ParseException {
welcome();
myUser = new User();
myPlant = askPlant();
myPlant.loadHeight();
setUpUser(myUser);
boolean complete = false;
try {
complete = askComplete();
} catch (InvalidInputException e) {
System.out.println("Your answer should be one of y or n");
}
myUser.setPlant(myPlant);
myUser.loadPoint();
myUser.addPoint(complete);
myPlant.grow();
myUser.savePoint();
myPlant.changeStage();
myPlant.saveHeight();
}
public void welcome() {
String appName = "Bloom";
System.out.println("Welcome to " + appName);
}
public Plant askPlant() {
System.out.println("What kind of plant would you like to grow? Your default is a flower"
+ " if you want a tomato instead type 2");
int plantAnswer = scanner.nextInt();
Plant myPlant = new Flower();
if (plantAnswer == 2) {
myPlant = new Tomato();
}
return myPlant;
}
//EFFECTS: returns true if user completed their goal of the day
// - else return false
public boolean askComplete() throws InvalidInputException {
System.out.println("Did you complete your goal for today?"
+ " if yes, please answer y, if not, please answer n ");
String answer = scanner.next();
boolean complete = true;
if (answer.equals("y")) {
complete = true;
} else if (answer.equals("n")) {
complete = false;
} else {
throw new InvalidInputException();
}
return complete;
}
public void setUserName() {
System.out.println("Please enter your name");
String name = scanner.nextLine();
myUser.setName(name);
}
public HealthyEntry setEntryOfTheDay() {
System.out.println(
"Please describe your HealthyGoal in one word"
);
String goal = scanner.nextLine();
HealthyEntry myEntry = new HealthyEntry();
System.out.println("How do you feel about your goal?");
String journal = scanner.nextLine();
try {
myEntry.setGoal(goal);
myEntry.setJournal(journal);
} catch (EmptyInputException e) {
System.out.println("You cannot add an empty journal");
}
return myEntry;
}
public void askLoadByGoal() throws InvalidInputException {
System.out.println("Do you want to load all the entries?"
+ "if yes, please enter y, or else please specify a goal you would like to load from");
String answer = scanner.next();
if (answer.equals("y")) {
for (HealthyEntry entry : myUser.getEntries()) {
printEntry(entry.getGoal(), entry.getJournal());
}
} else {
loadSpecificGoal(answer);
}
}
public void loadSpecificGoal(String goal) throws InvalidInputException {
myUser.setEntriesMap();
if (!myUser.getEntriesMap().containsKey(goal)) {
throw new InvalidInputException();
} else {
ArrayList<HealthyEntry> entries = myUser.getEntriesMap().get(goal);
for (HealthyEntry entry : entries) {
printEntry(goal, entry.getJournal());
}
}
}
public void setUpUser(User myUser) throws IOException {
setUserName();
HealthyEntry myEntry = setEntryOfTheDay();
myUser.addEntry(myEntry);
myUser.saveEntry();
this.myUser = myUser.loadEntry();
try {
askLoadByGoal();
} catch (InvalidInputException e) {
System.out.println("There are no entries for this goal");
}
}
public void printEntry(String goal, String journal) {
System.out.print("Goal: " + goal + " | ");
System.out.println("Journal:" + journal);
}
public static void main(String[] args) throws IOException, ParseException {
new WellnessJournal();
}
}
| [
"daisy88129@gmail.com"
] | daisy88129@gmail.com |
8e76a48d47c6875f11a5e0426e0ed37279f3a1d2 | 103d45fecef7746e8e874b67269d659a1d5f7cf9 | /CalendarApp/app/src/main/java/com/example/calendarapp/decorator/SaturdayDecorator.java | 62b442e96b44f9180b099b15d91b801eed483282 | [] | no_license | gyujeong829/03Project | 25b7996a24f0a2cb398e6522c6bfc18dba86c3cf | e0c4e2861a0c2672b0268c1dada9d745dc0dea13 | refs/heads/master | 2022-11-16T01:04:42.721084 | 2020-07-14T06:31:24 | 2020-07-14T06:31:24 | 279,502,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 854 | java | package com.example.calendarapp.decorator;
import android.graphics.Color;
import android.text.style.ForegroundColorSpan;
import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.DayViewDecorator;
import com.prolificinteractive.materialcalendarview.DayViewFacade;
import java.util.Calendar;
public class SaturdayDecorator implements DayViewDecorator {
private final Calendar calendar = Calendar.getInstance();
public SaturdayDecorator() {
}
@Override
public boolean shouldDecorate(CalendarDay day) {
day.copyTo(calendar);
int weekDay = calendar.get(Calendar.DAY_OF_WEEK);
return weekDay == Calendar.SATURDAY;
}
@Override
public void decorate(DayViewFacade view) {
view.addSpan(new ForegroundColorSpan(Color.BLUE));
}
}
| [
"gms04135@naver.com"
] | gms04135@naver.com |
ad34bdf778913e38d1f2203f4f20879fb6c1e61d | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/avito/android/rating/publish/review_input/ReviewInputPresenterImpl_Factory.java | 50a1b0cbc4fc05259a2517c9d26c0dd7d0621386 | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,983 | java | package com.avito.android.rating.publish.review_input;
import com.avito.android.rating.publish.RatingPublishViewData;
import com.avito.android.rating.publish.StepListener;
import com.avito.android.ratings.RatingPublishData;
import com.avito.android.remote.model.publish.NextStagePayload;
import com.avito.android.util.Kundle;
import dagger.internal.Factory;
import javax.inject.Provider;
public final class ReviewInputPresenterImpl_Factory implements Factory<ReviewInputPresenterImpl> {
public final Provider<StepListener> a;
public final Provider<RatingPublishData> b;
public final Provider<RatingPublishViewData> c;
public final Provider<NextStagePayload> d;
public final Provider<Kundle> e;
public ReviewInputPresenterImpl_Factory(Provider<StepListener> provider, Provider<RatingPublishData> provider2, Provider<RatingPublishViewData> provider3, Provider<NextStagePayload> provider4, Provider<Kundle> provider5) {
this.a = provider;
this.b = provider2;
this.c = provider3;
this.d = provider4;
this.e = provider5;
}
public static ReviewInputPresenterImpl_Factory create(Provider<StepListener> provider, Provider<RatingPublishData> provider2, Provider<RatingPublishViewData> provider3, Provider<NextStagePayload> provider4, Provider<Kundle> provider5) {
return new ReviewInputPresenterImpl_Factory(provider, provider2, provider3, provider4, provider5);
}
public static ReviewInputPresenterImpl newInstance(StepListener stepListener, RatingPublishData ratingPublishData, RatingPublishViewData ratingPublishViewData, NextStagePayload nextStagePayload, Kundle kundle) {
return new ReviewInputPresenterImpl(stepListener, ratingPublishData, ratingPublishViewData, nextStagePayload, kundle);
}
@Override // javax.inject.Provider
public ReviewInputPresenterImpl get() {
return newInstance(this.a.get(), this.b.get(), this.c.get(), this.d.get(), this.e.get());
}
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
4b4b74468e9ea23cc73997e4379b5f452678e5bb | 9690794102fae11d08ebcd2f218850798a49fa4b | /CircularCamera/app/src/main/java/com/tencent/circularcamera/util/CamParaUtil.java | c7ee59d766b31472df4cf40db515ab7d233b164f | [] | no_license | feelning/AndroidDevSample | dce80a8d1e6023b24094bfb26cccf61e64235c3a | 48d9f9a40e17d27b67dee4d4102b54eff9e86934 | refs/heads/master | 2021-01-12T06:07:23.745849 | 2016-10-18T12:02:42 | 2016-10-18T12:02:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,722 | java | package com.tencent.circularcamera.util;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import android.hardware.Camera;
import android.hardware.Camera.Size;
import android.util.Log;
public class CamParaUtil {
private static final String TAG = "CamParaUtil";
private CameraSizeComparator sizeComparator = new CameraSizeComparator();
private static CamParaUtil myCamPara = null;
private CamParaUtil(){
}
public static CamParaUtil getInstance(){
if(myCamPara == null){
myCamPara = new CamParaUtil();
return myCamPara;
}
else{
return myCamPara;
}
}
public Size getPropPreviewSize(List<Size> list, float th, int minWidth){
Collections.sort(list, sizeComparator);
int i = 0;
for(Size s:list){
if((s.width >= minWidth) && equalRate(s, th)){
Log.i(TAG, "PreviewSize:w = " + s.width + "h = " + s.height);
break;
}
i++;
}
if(i == list.size()){
i = 0;//���û�ҵ�����ѡ��С��size
}
return list.get(i);
}
public Size getPropPictureSize(List<Size> list, float th, int minWidth){
Collections.sort(list, sizeComparator);
int i = 0;
for(Size s:list){
if((s.width >= minWidth) && equalRate(s, th)){
Log.i(TAG, "PictureSize : w = " + s.width + "h = " + s.height);
break;
}
i++;
}
if(i == list.size()){
i = 0;
}
return list.get(i);
}
public boolean equalRate(Size s, float rate){
float r = (float)(s.width)/(float)(s.height);
if(Math.abs(r - rate) <= 0.03)
{
return true;
}
else{
return false;
}
}
public class CameraSizeComparator implements Comparator<Size>{
public int compare(Size lhs, Size rhs) {
if(lhs.width == rhs.width){
return 0;
}
else if(lhs.width > rhs.width){
return 1;
}
else{
return -1;
}
}
}
public void printSupportPreviewSize(Camera.Parameters params){
List<Size> previewSizes = params.getSupportedPreviewSizes();
for(int i=0; i< previewSizes.size(); i++){
Size size = previewSizes.get(i);
Log.i(TAG, "previewSizes:width = "+size.width+" height = "+size.height);
}
}
public void printSupportPictureSize(Camera.Parameters params){
List<Size> pictureSizes = params.getSupportedPictureSizes();
for(int i=0; i< pictureSizes.size(); i++){
Size size = pictureSizes.get(i);
Log.i(TAG, "pictureSizes:width = "+ size.width
+" height = " + size.height);
}
}
public void printSupportFocusMode(Camera.Parameters params){
List<String> focusModes = params.getSupportedFocusModes();
for(String mode : focusModes){
Log.i(TAG, "focusModes--" + mode);
}
}
}
| [
"dsotsen@gmail.com"
] | dsotsen@gmail.com |
3db3f780733d07448062011a38f3822822b5844a | 76176140d982ad0edf594277f3c4243e0266ebf1 | /total/src/main/java/me/kxis/appfuse/webapp/action/BaseAction.java | 70a681c3c2b543b697ee5bda4a3b1b8992481f0e | [] | no_license | fig4ever/appfuse-demo | ee736f7dbfb2bb4f3bdaebd731cb50389f3a9a8e | 11e63d0eef3d8e493ec8bba39f9788e9c554d41a | refs/heads/master | 2020-04-27T13:00:32.078238 | 2013-12-10T13:15:20 | 2013-12-10T13:15:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,920 | java | package me.kxis.appfuse.webapp.action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import me.kxis.appfuse.Constants;
import me.kxis.appfuse.model.User;
import me.kxis.appfuse.service.MailEngine;
import me.kxis.appfuse.service.RoleManager;
import me.kxis.appfuse.service.UserManager;
import org.springframework.mail.SimpleMailMessage;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Implementation of <strong>ActionSupport</strong> that contains
* convenience methods for subclasses. For example, getting the current
* user and saving messages/errors. This class is intended to
* be a base class for all Action classes.
*
* @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
*/
public class BaseAction extends ActionSupport {
private static final long serialVersionUID = 3525445612504421307L;
/**
* Constant for cancel result String
*/
public static final String CANCEL = "cancel";
/**
* Transient log to prevent session synchronization issues - children can use instance for logging.
*/
protected final transient Log log = LogFactory.getLog(getClass());
/**
* The UserManager
*/
protected UserManager userManager;
/**
* The RoleManager
*/
protected RoleManager roleManager;
/**
* Indicator if the user clicked cancel
*/
protected String cancel;
/**
* Indicator for the page the user came from.
*/
protected String from;
/**
* Set to "delete" when a "delete" request parameter is passed in
*/
protected String delete;
/**
* Set to "save" when a "save" request parameter is passed in
*/
protected String save;
/**
* MailEngine for sending e-mail
*/
protected MailEngine mailEngine;
/**
* A message pre-populated with default data
*/
protected SimpleMailMessage mailMessage;
/**
* Velocity template to use for e-mailing
*/
protected String templateName;
/**
* Simple method that returns "cancel" result
*
* @return "cancel"
*/
public String cancel() {
return CANCEL;
}
/**
* Save the message in the session, appending if messages already exist
*
* @param msg the message to put in the session
*/
@SuppressWarnings("unchecked")
protected void saveMessage(String msg) {
List messages = (List) getRequest().getSession().getAttribute("messages");
if (messages == null) {
messages = new ArrayList();
}
messages.add(msg);
getRequest().getSession().setAttribute("messages", messages);
}
/**
* Convenience method to get the Configuration HashMap
* from the servlet context.
*
* @return the user's populated form from the session
*/
protected Map getConfiguration() {
Map config = (HashMap) getSession().getServletContext().getAttribute(Constants.CONFIG);
// so unit tests don't puke when nothing's been set
if (config == null) {
return new HashMap();
}
return config;
}
/**
* Convenience method to get the request
*
* @return current request
*/
protected HttpServletRequest getRequest() {
return ServletActionContext.getRequest();
}
/**
* Convenience method to get the response
*
* @return current response
*/
protected HttpServletResponse getResponse() {
return ServletActionContext.getResponse();
}
/**
* Convenience method to get the session. This will create a session if one doesn't exist.
*
* @return the session from the request (request.getSession()).
*/
protected HttpSession getSession() {
return getRequest().getSession();
}
/**
* Convenience method to send e-mail to users
*
* @param user the user to send to
* @param msg the message to send
* @param url the URL to the application (or where ever you'd like to send them)
*/
protected void sendUserMessage(User user, String msg, String url) {
if (log.isDebugEnabled()) {
log.debug("sending e-mail to user [" + user.getEmail() + "]...");
}
mailMessage.setTo(user.getFullName() + "<" + user.getEmail() + ">");
Map<String, Object> model = new HashMap<String, Object>();
model.put("user", user);
// TODO: figure out how to get bundle specified in struts.xml
// model.put("bundle", getTexts());
model.put("message", msg);
model.put("applicationURL", url);
mailEngine.sendMessage(mailMessage, templateName, model);
}
public void setUserManager(UserManager userManager) {
this.userManager = userManager;
}
public void setRoleManager(RoleManager roleManager) {
this.roleManager = roleManager;
}
public void setMailEngine(MailEngine mailEngine) {
this.mailEngine = mailEngine;
}
public void setMailMessage(SimpleMailMessage mailMessage) {
this.mailMessage = mailMessage;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
/**
* Convenience method for setting a "from" parameter to indicate the previous page.
*
* @param from indicator for the originating page
*/
public void setFrom(String from) {
this.from = from;
}
public void setDelete(String delete) {
this.delete = delete;
}
public void setSave(String save) {
this.save = save;
}
}
| [
"fig4ever@gmail.com"
] | fig4ever@gmail.com |
201680c91aea8f300a8b839f66851e63ec1bcd4e | ea6e47ca72cf59b56d29b25f160529cbc7b330f3 | /cloud2020/cloud-consumer-hystrix-dashboard9001/src/main/java/com/atguigu/springcloud/HystrixDashboardMain9001.java | 179e7eb411f134e4abe6dee83d99a3a02547a177 | [] | no_license | cbh9527/springcloud2020 | e1b74c3e46e25e50ad04967fae1e0695c431441d | d405ec296faf1adf923ac1cb9d78da0484538aa1 | refs/heads/master | 2022-11-30T15:52:20.542115 | 2020-08-11T08:14:09 | 2020-08-11T08:14:09 | 286,670,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package com.atguigu.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
/**
*
* @className: HystrixDashboardMain9001
* @package: com.atguigu.springcloud
* @author: chenbinghuang
* @date: 2020/8/4 15:12
*/
@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashboardMain9001 {
public static void main(String[] args) {
SpringApplication.run(HystrixDashboardMain9001.class,args);
}
}
| [
"418460854@qq.com"
] | 418460854@qq.com |
060e77acb5f66ee0a6c7a9b64f13ea895f895408 | 67e735ab2b0f3190968aa248e80a7b3a570f1101 | /Spring/08_HibernateBasics/src/com/bookapp/dao/Main.java | cb4df7c28fb3d123ea0aff96dc7ea1bfee706e1c | [] | no_license | DivyaMaddipudi/HCL_Training | 7ed68a19552310093895e12deacf0f019b07b49c | c7a6bd9fbac7f3398e7d68e8dce5f72ed13d14ec | refs/heads/master | 2023-01-28T18:33:04.969333 | 2020-12-08T18:05:32 | 2020-12-08T18:05:32 | 304,354,730 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | package com.bookapp.dao;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
public class Main {
public static void main(String[] args) throws ParseException {
BookDao dao = new BookDaoImpl();
SimpleDateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
// Book book1 = new Book("M123", "spring begining", "Baytes", fmt.parse("11/05/2015"), 500);
// dao.addBook(book1);
// dao.updateBook(3, new Book("M123", "spring begining", "Baytes", fmt.parse("11/05/2015"), 800));
// dao.deleteBook(3);
List<Book> books = dao.getAllBooks();
books.forEach(b -> System.out.println(b));
}
}
| [
"divya.maddipudi1@gmail.com"
] | divya.maddipudi1@gmail.com |
5f3c7f0a0fc957a11440c82c76648e0fb0142fde | 3e4d4ef716f77585b9f8b8bbff9fb70aa2673445 | /src/main/java/com/project/springbootgraphql/repositories/ClienteRepository.java | e34c6eebaea80dfc61e62bf433f627a58064d0fb | [] | no_license | dhiegogoncalves/springboot-graphql | 02936a3f0fa4339e3ac7555deaf235e21cd5e626 | 6c948a11bf15fca27a7baed2c42d61d6ae869dca | refs/heads/master | 2023-01-08T09:17:21.480287 | 2020-10-25T17:28:30 | 2020-10-25T17:28:30 | 307,152,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | package com.project.springbootgraphql.repositories;
import java.util.List;
import javax.persistence.QueryHint;
import com.project.springbootgraphql.models.Cliente;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.QueryHints;
import org.springframework.stereotype.Repository;
@Repository
public interface ClienteRepository extends JpaRepository<Cliente, Long> {
@Override
@QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value = "true") })
List<Cliente> findAll();
}
| [
"dhhiego@gmail.com"
] | dhhiego@gmail.com |
daa14f4d132d4e254110587464958d4d9bd14b6c | 2ce88d0250f2fd542648da3cd953ffb7b281aeae | /Lab24/shapes/Wheel.java | 2c1e129bcb6271e401f85ac3e7978e638f762126 | [] | no_license | tomvalentine/COMP160 | 66ba567b374d413f23b15ca13ab49219a641646e | da28fa48343cefc30a6d9110ff09ee6ae27a0444 | refs/heads/master | 2020-12-06T00:26:30.569685 | 2020-01-07T09:36:47 | 2020-01-07T09:36:47 | 232,288,738 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,039 | java | /* Wheel.java
* Lab 23, COMP160
* draws a 2 tone wheel
*/
package shapes;
import java.awt.*;
public class Wheel extends Shape{
Color shade;
public Wheel(){
height = 29;
width = 29;
y = randomRange(0, 400 - height);
x = randomRange(0, 400 - width);
shade = new Color(randomRange(0,255),randomRange(0,255),randomRange(0,255));
}
/*sets the colour and draws the shape*/
public void display(Graphics g){
g.setColor(shade);
g.drawOval(x, y, width, height);
g.fillArc(x,y,width,height,0,30);
g.setColor(Color.black);
g.fillArc(x,y,width,height,30,30);
g.fillArc(x,y,width,height,90,30);
g.fillArc(x,y,width,height,150,30);
g.fillArc(x,y,width,height,210,30);
g.fillArc(x,y,width,height,270,30);
g.fillArc(x,y,width,height,330,30);
g.setColor(shade);
g.fillArc(x,y,width,height,60,30);
g.fillArc(x,y,width,height,120,30);
g.fillArc(x,y,width,height,180,30);
g.fillArc(x,y,width,height,240,30);
g.fillArc(x,y,width,height,300,30);
}
} | [
"noreply@github.com"
] | noreply@github.com |
9802748ea20f4ad6231d11e275e9de7ed3ce8f92 | 030312972da543eb452ceef20ea11b1f1af60d1e | /src/main/java/io/github/hengyunabc/douyuhelper/VideoDownloader.java | 0872af873f571e5378a57b42ae985048b5b1147a | [] | no_license | airblock/douyu-helper | 4123b480025f864276c73188d06775f663181915 | b39c8889b7f7af6e943fc2090c18d8de97b7e7dc | refs/heads/master | 2020-03-28T01:04:15.828578 | 2018-09-05T07:06:15 | 2018-09-05T07:06:15 | 147,474,390 | 0 | 0 | null | 2018-09-05T07:01:56 | 2018-09-05T07:01:56 | null | UTF-8 | Java | false | false | 4,164 | java | package io.github.hengyunabc.douyuhelper;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class VideoDownloader {
static final Logger logger = LoggerFactory.getLogger(VideoDownloader.class);
ExecutorService executorService = Executors.newCachedThreadPool();
CloseableHttpClient httpclient;
@Autowired
Manager manager;
@PostConstruct
public void init() {
RequestConfig requestConfig =
RequestConfig.custom().setConnectTimeout(5 * 1000).setConnectionRequestTimeout(5 * 1000)
.setSocketTimeout(5 * 1000).build();
PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager();
httpclient =
HttpClients.custom().setConnectionManager(connManager)
.setDefaultRequestConfig(requestConfig).build();
}
@PreDestroy
public void destory() throws IOException {
httpclient.close();
executorService.shutdown();
}
public boolean isDownloading(String room) {
return false;
}
public void addDownloadTask(final String room, final String url) {
executorService.submit(new Runnable() {
@Override
public void run() {
// 先尝试获取下载的许可
if (manager.getDownloadPermit(room) == false) {
return;
}
int downloadedSize = 0;
logger.info("开始下载房间:{}, url:{}", room, url);
System.out.println("开始下载房间:" + room + ",url: " + url);
try (CloseableHttpResponse response = httpclient.execute(new HttpGet(url))) {
if (response.getStatusLine().getStatusCode() == 200) {
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream inputStream = entity.getContent();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss");
Paths.get("video", room).toFile().mkdirs();
Path path = Paths.get("video", room, simpleDateFormat.format(new Date()) + ".flv");
File flvFile = path.toFile();
try (FileOutputStream outstream = new FileOutputStream(flvFile);) {
byte[] buffer = new byte[128 * 1024];
int size = 0;
Date last = new Date();
while ((size = inputStream.read(buffer)) != -1) {
outstream.write(buffer, 0, size);
downloadedSize += size;
Date now = new Date();
if (((now.getTime() - last.getTime()) / 1000) >= 5) {
logger.info("开始下载房间:{}, 已下载大小:{}", room, downloadedSize);
System.out.println("正在下载房间:" + room + ",已下载大小: " + downloadedSize);
last = now;
}
}
}
}
}
} catch (Throwable t) {
logger.error("房间下载出错!room:" + room, t);
System.out.println("下载房间出错!:" + room + ",url: " + url);
} finally {
manager.returnDownloadPermit(room);
logger.info("结束下载房间:{}, url:{}", room, url);
System.out.println("结束下载房间:" + room + ",url: " + url);
}
}
});
}
}
| [
"hengyunabc@gmail.com"
] | hengyunabc@gmail.com |
c99d6cf15a2edcf63b74c17acddd79d64b13e88b | a343b992fb356cb23f49ebcad99958a05b15c6b8 | /RomantoInteger.java | 6e173dfc8236791314cdf8cf37fcc83636c512fa | [] | no_license | gaomigithub/Leetcode | d8c8af8c61f0338e55c8181d9603036f04c156db | 33a9a5830a23afd11445ab5fee6e2433ae947394 | refs/heads/master | 2020-03-23T19:16:17.487436 | 2019-01-12T21:52:59 | 2019-01-12T21:52:59 | 141,964,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,011 | java | // Description
// Given a roman numeral, convert it to an integer.
// The answer is guaranteed to be within the range from 1 to 3999.
class RomantoInteger {
public static int romanToInt(String s) {
if (s == null || s.length() == 0) {
return 0;
}
int result = toNumber(s.charAt(0));
for (int i = 1; i < s.length(); i++) {
if (toNumber(s.charAt(i)) > toNumber(s.charAt(i - 1))) {
result += toNumber(s.charAt(i)) - 2 * toNumber(s.charAt(i - 1));
} else {
result += toNumber(s.charAt(i));
}
}
return result;
}
public static int toNumber(char c) {
int result = 0;
switch (c) {
case 'I' : return 1;
case 'V' : return 5;
case 'X' : return 10;
case 'L' : return 50;
case 'C' : return 100;
case 'D' : return 500;
case 'M' : return 1000;
}
return result;
}
} | [
"gaomius@hotmail.com"
] | gaomius@hotmail.com |
33a7143df2341c311489defba3b304f00b49bdcd | 36155fc6d1b1cd36edb4b80cb2fc2653be933ebd | /lc/src/LC/SOL/PalindromePartitioningIII.java | cd8cdd5c64e532ea62a5d9dd1063885b3fb67e49 | [] | no_license | Delon88/leetcode | c9d46a6e29749f7a2c240b22e8577952300f2b0f | 84d17ee935f8e64caa7949772f20301ff94b9829 | refs/heads/master | 2021-08-11T05:52:28.972895 | 2021-08-09T03:12:46 | 2021-08-09T03:12:46 | 96,177,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,286 | java | package LC.SOL;
import java.util.HashMap;
import java.util.Map;
public class PalindromePartitioningIII {
class Solution {
Map<String, Integer> map = new HashMap<>();
public int palindromePartition(String s, int k) {
if ( s.length() == k ) return 0;
int n = s.length();
int[][] dp = new int[k][n + 1];
for (int i = 1; i <= n; i++) {
dp[0][i] = minReplace(s.substring(0, i));
}
for ( int i = 1 ; i < k ; i++) {
for ( int j = i ; j <= n ; j++) {
dp[i][j] = Integer.MAX_VALUE;
for ( int p = j ; p >= i ; p--) {
dp[i][j] = Math.min( dp[i][j], dp[i-1][p - 1] + minReplace(s.substring(p - 1, j)));
}
}
}
return dp[k - 1][n];
}
private int minReplace(String str) {
if (str == null || str.length() == 0) return 0;
if (map.containsKey(str)) return map.get(str);
int res = 0;
for (int i = 0, j = str.length() - 1; i < j; i++, j--) {
if (str.charAt(i) != str.charAt(j)) res++;
}
map.put(str, res);
return res;
}
}
}
| [
"Mr.AlainDelon@gmail.com"
] | Mr.AlainDelon@gmail.com |
16d0ac60a50ca5704d0c4ac7a05433d9f886b1e5 | db63b544d9cd3e0d07cf6b47283f0b2c9eb83c09 | /Test.java | a652834126dec95ab1dc4e19421e39a5fddab48b | [] | no_license | khushbubandewar/khushbu-java | 527de7b0c78e64f9fdfb509b7c3677687f586db9 | d0ed91460c69e40eb23a43baf6cb104fdec13afc | refs/heads/master | 2023-06-12T00:38:47.886530 | 2021-07-09T14:50:48 | 2021-07-09T14:50:48 | 384,472,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 329 | java | class Test
{
public static void main(String[]args){
System.out.println("First value " +args[0]);
System.out.println("secound value " +args[1]);
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
if(a>b){
System.out.println("a is larger");
}else{
System.out.println("b is larger");
}
}
} | [
"khushbubandewar@gmail.com"
] | khushbubandewar@gmail.com |
7647f2b0f1eaca6b97b3086dca0ee8ef411052be | d8fdf395dde058ada29de7580ceac8705b42a407 | /2.JavaCore/src/com/javarush/task/task19/task1919/Solution.java | e00022f8aa0c855f5aadabc81892ae904d2c0178 | [] | no_license | Wengelm/JavaRushTasks | dea766c368fcf67747bf1cd558c60ec74ff477ba | 2ac1f20be1c8b2c8ae92af0ffeef7e86d38c671d | refs/heads/master | 2020-03-09T18:28:22.707883 | 2018-04-10T13:55:07 | 2018-04-10T13:56:06 | 128,933,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 976 | java | package com.javarush.task.task19.task1919;
/*
Считаем зарплаты
*/
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Map;
import java.util.TreeMap;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader fileReader = new BufferedReader(new FileReader(args[0]));
TreeMap<String, Double> map = new TreeMap<>();
while (fileReader.ready()) {
String[] parts = fileReader.readLine().split(" ");
if (map.containsKey(parts[0])) {
Double value = map.get(parts[0]) + Double.parseDouble(parts[1]);
map.put(parts[0], value);
}
else map.put(parts[0], Double.parseDouble(parts[1]));
}
fileReader.close();
for (Map.Entry<String, Double> pair : map.entrySet()) {
System.out.println(pair.getKey() + " " + pair.getValue());
}
}
}
| [
"wengelmcod@gmail.com"
] | wengelmcod@gmail.com |
bfe3baa53ce36ef9639144c69c071e54833fc5d9 | e89b8a7cb48d1e0c4cfcce5820fdaeb55aa47260 | /fca/src/main/java/org/stackwire/fca/ConceptGenerator.java | a1836ec13dac322092d802803e5b0026f303b34a | [
"Apache-2.0"
] | permissive | sisbell/stackwire-fca | 2d9d8edd673866dac6592b8c04e13cae2b70f42d | c1d944be53b1a360f83110ade4fa377271702c05 | refs/heads/master | 2023-04-16T17:34:01.727218 | 2016-10-11T07:06:57 | 2016-10-11T07:06:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,014 | java | /**
* Copyright 2016 Shane Isbell
*
* 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 org.stackwire.fca;
/**
* Service generates concepts and adds them to the context
*/
public interface ConceptGenerator {
/**
* Generates concepts for specified formal context and returns the same
* context with the concepts added
*
* @param formalContext
* formal context
* @return specified formal context
*/
Context generateConceptsFor(Context formalContext, double threshold);
}
| [
"shane.isbell@gmail.com"
] | shane.isbell@gmail.com |
ec0fd53247d8c2f93e49e3b9bd9f01435509ceae | e5b550c25756ca5a9ae104c9b0d11ecfae41d192 | /opp_homework/src/game/PlayerBullet.java | bcbbc3bdf658a4aa90fd66f3551cbda06b408541 | [] | no_license | tuandat732/java_oop | 7bc73efd4486193ecee2eca62dc53900da2fe2f1 | dadd478f2b14d8d6c2dde16902d5a0eadfec0be4 | refs/heads/master | 2020-05-26T09:08:05.364301 | 2019-06-06T06:55:22 | 2019-06-06T06:55:22 | 188,179,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 836 | java | package game;
import tklibs.SpriteUtils;
import java.awt.*;
import java.awt.image.BufferedImage;
public class PlayerBullet {
BufferedImage image;
Vector2D position;
public PlayerBullet(){
image= SpriteUtils.loadImage("assets/images/player-bullets/a/1.png");
position = new Vector2D();
}
public PlayerBullet(String url){
this.image=SpriteUtils.loadImage(url);
this.position= new Vector2D();
}
public void render(Graphics g){
g.drawImage(image,(int)position.x,(int)position.y,null);
}
public void run(int i){
if (i==2)
position.y-=5;
else if(i==1){
double len=position.getLength();
position.setLength(len-5);
}
else{
position.y-=4;
position.x+=2;
}
}
}
| [
"spt.may7320@gmail.com"
] | spt.may7320@gmail.com |
f9558ae5c7be0fda78d351f5b9c03565b6da7513 | 6635387159b685ab34f9c927b878734bd6040e7e | /src/alb$2.java | d921741f675a9a158fb525fb4e6fb728c0267286 | [] | no_license | RepoForks/com.snapchat.android | 987dd3d4a72c2f43bc52f5dea9d55bfb190966e2 | 6e28a32ad495cf14f87e512dd0be700f5186b4c6 | refs/heads/master | 2021-05-05T10:36:16.396377 | 2015-07-16T16:46:26 | 2015-07-16T16:46:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | final class alb$2
implements alk.a
{
alb$2(alb paramalb) {}
public final void a(alk paramalk, alc paramalc, bfl parambfl, uc paramuc, Object paramObject)
{
alb.a(a, paramalk, paramalc, parambfl, paramuc, (alb.b)paramObject);
}
}
/* Location:
* Qualified Name: alb.2
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
c97e01cdca15bfa3792d9bacdf0d800aad0931ad | 748f8abd09ba7b7164e66b4ada10048df45f5988 | /org.aim.api/src/org/aim/api/measurement/sampling/ResourceSamplerFactory.java | a8532485e17840c1352dab6cfc58f80a9d65d785 | [] | no_license | mariusoe/AIM | cd6fef8fc8af0d81dff50c2636b2d9a6cede8631 | 14794962b39a8791098d89985b6251b07e6399d6 | refs/heads/master | 2021-01-18T18:29:33.370983 | 2015-04-01T13:46:46 | 2015-04-01T13:46:46 | 23,310,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,017 | java | /**
* Copyright 2014 SAP AG
*
* 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 org.aim.api.measurement.sampling;
import org.aim.api.exceptions.MeasurementException;
import org.aim.api.measurement.collector.IDataCollector;
import org.hyperic.sigar.Sigar;
import org.lpe.common.extension.ExtensionRegistry;
/**
* Creates recorder for different sampling types.
*
* @author Alexander Wert
*
*/
public final class ResourceSamplerFactory {
private ResourceSamplerFactory() {
}
private static Sigar sigar;
/**
* Getter for the Sigar singleton instance (required for resource
* information retrieval).
*
* @return Sigar instance
*/
public static Sigar getSigar() {
if (sigar == null) {
sigar = new Sigar();
}
return sigar;
}
/**
*
* @param sType
* sampling type
* @param dataCollector
* data collector to use
* @return sampler for the type
* @throws MeasurementException
* thrown if a sampler extension cannot be found
*/
public static AbstractSampler getSampler(String sType, IDataCollector dataCollector) throws MeasurementException {
AbstractSampler sampler = ExtensionRegistry.getSingleton().getExtensionArtifact(AbstractSamplerExtension.class,
sType);
if (sampler == null) {
throw new MeasurementException("Invalid sampling resource identifier " + sType + "!");
}
sampler.setDataCollector(dataCollector);
((AbstractResourceSampler) sampler).setSigar(getSigar());
return sampler;
}
}
| [
"alexander.wert@sap.com"
] | alexander.wert@sap.com |
23fd6e3c606624c73011c07095f990861efa70fb | 18f7f2b8f82040c772f81f139a5d8864231bde5e | /Rest_Piro/Rest-Piro/src/dominio/Bungalow.java | 0c1c633449000da15b436ffd3268c1dfe89c319d | [] | no_license | Sergio-Silvestre/Rest_piro | dafa06576ae7427338895edc9b9d0dbc80a69fad | 8493b4ee8491aa3e551e95b38b0a99e0045fd1d0 | refs/heads/main | 2023-02-12T17:20:16.102800 | 2021-01-12T01:35:48 | 2021-01-12T01:35:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | package dominio;
import java.io.File;
public class Bungalow extends Estancia {
private int capacidad;
public Bungalow (String nombre, File foto, double tamano, double precioPorNoche, boolean disponibilidad, String razon, String descripcion, boolean[] extras, int capacidad) {
super(nombre, foto, tamano, precioPorNoche, disponibilidad, razon, descripcion, extras);
this.capacidad = capacidad;
}
public int getCapacidad() {
return capacidad;
}
public void setCapacidad(int capacidad) {
this.capacidad = capacidad;
}
} | [
"marinaprieto999@gmail.com"
] | marinaprieto999@gmail.com |
819bb7d135a7850d6a6084e200242d9a62a677f1 | 47b1581f4eada3c4efdce9631ef8c49146e81aed | /app/src/main/java/com/cieslik/karolina/mobilebike/routes/RoutesFragment.java | 3719382cbfe6d58ba549c2e3fd204363036f56e5 | [] | no_license | karolina-cieslik/MobileBike | 648932ebed9ccbebb6719fda58038bb2f0d53665 | 0f156bacdae6c82c83deeaec6c2887854f341181 | refs/heads/master | 2020-03-30T10:41:10.613866 | 2018-10-01T17:34:21 | 2018-10-01T17:34:21 | 151,090,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 81 | java | package com.cieslik.karolina.mobilebike.routes;
public class RoutesFragment
{
}
| [
"karolina.w.cieslik@gmail.com"
] | karolina.w.cieslik@gmail.com |
fb0d6171f6255ba4f0b9da597de11b802eedb3c9 | 359d62828e6a66aaed8468d3018b72c34ad7fff2 | /app/src/main/java/com/example/williamstest/TimesAndErasures.java | 3c21e2de12797e32542b5e30dcab9fc8dfe31c3b | [] | no_license | alessandronasso/WilliamsTest | 725a8199f11d831d3de70b8b3cf0f31535898376 | 7d691c69175b8d34e53bd5bf117716992e719305 | refs/heads/master | 2020-06-23T13:09:30.883648 | 2020-06-18T20:07:13 | 2020-06-18T20:07:13 | 198,632,843 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,213 | java | package com.example.williamstest;
import java.io.Serializable;
public class TimesAndErasures implements Serializable {
public TimesAndErasures(String c, int t1, int t2, int e, int u) {
cornice = c;
timeToDraw = t1;
timeToComplete = t2;
eraseN = e;
undoN = u;
}
public String getCornice() {
return cornice;
}
public void setCornice(String cornice) {
this.cornice = cornice;
}
private String cornice;
public int getTimeToDraw() {
return timeToDraw;
}
public void setTimeToDraw(int timeToDraw) {
this.timeToDraw = timeToDraw;
}
private int timeToDraw;
public int getTimeToComplete() {
return timeToComplete;
}
public void setTimeToComplete(int timeToComplete) {
this.timeToComplete = timeToComplete;
}
private int timeToComplete;
public int getEraseN() {
return eraseN;
}
public void setEraseN(int eraseN) {
this.eraseN = eraseN;
}
private int eraseN;
public int getUndoN() {
return undoN;
}
public void setUndoN(int undoN) {
this.undoN = undoN;
}
private int undoN;
}
| [
"alessandro.nasso@educ.unito.it"
] | alessandro.nasso@educ.unito.it |
6e206e332a2293e857712dafe4ac044a9945390c | 81e820a32498164faecd2d8282d7ca64f3f6385c | /reactor/src/main/java/org/jaxxy/reactor/MonoInvokerProvider.java | 480d1dbfa096750c62869b2c3e67ded64143ad00 | [
"Apache-2.0"
] | permissive | cnygardtw/jaxxy | 5c843b9514a201b6ab918a03f68980037ca14087 | 503c919ac43b4a907f6bb768faef45efeead77a7 | refs/heads/master | 2022-03-30T10:04:26.171410 | 2020-01-04T14:00:05 | 2020-01-04T14:00:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,220 | java | /*
* Copyright (c) 2018 The Jaxxy 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 org.jaxxy.reactor;
import java.util.concurrent.ExecutorService;
import java.util.function.Function;
import javax.ws.rs.client.RxInvokerProvider;
import javax.ws.rs.client.SyncInvoker;
import javax.ws.rs.ext.Provider;
import lombok.RequiredArgsConstructor;
import org.jaxxy.rx.AbstractRxInvoker;
import reactor.core.publisher.Mono;
@Provider
public class MonoInvokerProvider implements RxInvokerProvider<MonoInvoker> {
//----------------------------------------------------------------------------------------------------------------------
// RxInvokerProvider Implementation
//----------------------------------------------------------------------------------------------------------------------
@Override
public MonoInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
return new Invoker(syncInvoker);
}
@Override
public boolean isProviderFor(Class<?> clazz) {
return MonoInvoker.class.equals(clazz);
}
//----------------------------------------------------------------------------------------------------------------------
// Inner Classes
//----------------------------------------------------------------------------------------------------------------------
@RequiredArgsConstructor
@SuppressWarnings("unchecked")
private static class Invoker extends AbstractRxInvoker<Mono> implements MonoInvoker {
private final SyncInvoker syncInvoker;
@Override
protected <R> Mono async(Function<SyncInvoker, R> fn) {
return Mono.fromCallable(() -> fn.apply(syncInvoker));
}
}
}
| [
"jwcarman@gmail.com"
] | jwcarman@gmail.com |
1035d01eaec42b0b8a048593c01a8b0c61cd1b13 | 6e5dd34c136b668f5854f4beb4ac5abda7a165f8 | /src/main/java/com/jaenyeong/chapter_16/OnlineStore/Refactoring/Discount.java | 9675a51dcacce707b062e2d2612cb57c037fbdfe | [] | no_license | jaenyeong/Study_Modern-java | 93e78c199d5b96879727105331140034052717c2 | 28e281a51fec07dda1447e9ec844dc30de687ada | refs/heads/master | 2023-06-16T14:23:57.363877 | 2021-07-11T13:07:06 | 2021-07-11T13:07:06 | 250,226,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package com.jaenyeong.chapter_16.OnlineStore.Refactoring;
import static com.jaenyeong.chapter_16.OnlineStore.Util.*;
public class Discount {
public enum Code {
NONE(0), SILVER(5), GOLD(10), PLATINUM(15), DIAMON(20);
private final int percentage;
Code(int percentage) {
this.percentage = percentage;
}
}
public static String applyDiscount(Quote quote) {
return quote.getShopName() + " price is " +
Discount.apply(quote.getPrice(), quote.getDiscountCode());
}
private static double apply(double price, Code code) {
randomDelay();
return format(price * (100 - code.percentage) / 100);
}
}
| [
"jaenyeong.dev@gmail.com"
] | jaenyeong.dev@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.