blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
0e933681ce718edd75d2d27cda1119439d7e75a3
cbcbbda869bfbb0024f73cb77b6ce7dda2c0d5ca
/service/service_edu/src/test/java/com/atguigu/demo/CodeGenerator.java
41305acf4ee6d8c55a5f0a89bb45b982b8b02508
[]
no_license
rexocean/guli_parent1
2a58c5eab3ce9e0a2d468f29d4f008f003fcdc5e
ff99eae8eb35825eff44335e09bb7ac318b62041
refs/heads/master
2023-03-21T08:56:55.130712
2021-02-07T10:43:01
2021-02-07T10:43:01
335,164,518
0
0
null
null
null
null
UTF-8
Java
false
false
3,151
java
package com.atguigu.demo; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.rules.DateType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import org.junit.Test; /** * @author * @since 2018/12/13 */ public class CodeGenerator { @Test public void run() { // 1、创建代码生成器 AutoGenerator mpg = new AutoGenerator(); // 2、全局配置 GlobalConfig gc = new GlobalConfig(); String projectPath = System.getProperty("user.dir"); gc.setOutputDir("D:\\gaojie\\guli_parent1\\service\\service_edu" + "/src/main/java"); gc.setAuthor("testjava"); gc.setOpen(false); //生成后是否打开资源管理器 gc.setFileOverride(false); //重新生成时文件是否覆盖 gc.setServiceName("%sService"); //去掉Service接口的首字母I gc.setIdType(IdType.ID_WORKER_STR); //主键策略 gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 gc.setSwagger2(true);//开启Swagger2模式 mpg.setGlobalConfig(gc); // 3、数据源配置,mp需要单独配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://localhost:3306/guli?characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong"); dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("123456"); dsc.setDbType(DbType.MYSQL); mpg.setDataSource(dsc); // 4、包配置 PackageConfig pc = new PackageConfig(); //包 com.atguigu.eduservice pc.setParent("com.atguigu"); pc.setModuleName("eduservice"); //模块名 //包 com.atguigu.eduservice.controller pc.setController("controller"); pc.setEntity("entity"); pc.setService("service"); pc.setMapper("mapper"); mpg.setPackageInfo(pc); // 5、策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setInclude("edu_teacher"); strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀 strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 strategy.setRestControllerStyle(true); //restful api风格控制器 strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 mpg.setStrategy(strategy); // 6、执行 mpg.execute(); } }
f2585b10cd27d326fb31fc38ab989cdf07f6d1d4
a4d7fe0d0bb1e26b4f9e89a6828f99898a0ae33d
/CommonUtils/src/main/java/com/CommonUtils/Utils/FrameworkUtils/SecurityUtils/ShrioUtil.java
214b1760bf9f78b04af1093aa67fe093c23338ec
[ "Apache-2.0" ]
permissive
antoni13579/SpringBootCommonUtil
16c1ae2852489fbfe88db9e7c92c34d76b6552fa
89a05fa6fb9216ac7a5662095834941d20fa74d2
refs/heads/prd_20201231
2022-07-25T09:38:24.156765
2020-01-15T02:20:33
2020-01-15T02:20:33
189,137,399
1
0
Apache-2.0
2022-02-01T00:59:32
2019-05-29T02:38:18
JavaScript
UTF-8
Java
false
false
277
java
package com.CommonUtils.Utils.FrameworkUtils.SecurityUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; public final class ShrioUtil { private ShrioUtil() {} public static Subject getSubject() { return SecurityUtils.getSubject(); } }
2d95b7833d230198d02fe916d7f445e3b68cc58c
fc6c869ee0228497e41bf357e2803713cdaed63e
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/scanner/ui/HighlightRectSideView.java
412db5f4a9848ee61108b70f385e2a0eba20863f
[]
no_license
hyb1234hi/reverse-wechat
cbd26658a667b0c498d2a26a403f93dbeb270b72
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
refs/heads/master
2020-09-26T10:12:47.484174
2017-11-16T06:54:20
2017-11-16T06:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,334
java
package com.tencent.mm.plugin.scanner.ui; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Paint.Style; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import com.tencent.gmtrace.GMTrace; import com.tencent.mm.R.g; import com.tencent.mm.compatible.f.a; import com.tencent.mm.sdk.platformtools.aj; import com.tencent.mm.sdk.platformtools.aj.a; import com.tencent.mm.sdk.platformtools.w; public class HighlightRectSideView extends View { private aj htb; private Paint mk; private boolean[] ovN; private Rect ovO; private int ovP; private int ovQ; private int ovR; private int ovS; public HighlightRectSideView(Context paramContext, AttributeSet paramAttributeSet) { super(paramContext, paramAttributeSet); GMTrace.i(6060601507840L, 45155); this.ovS = 0; this.htb = new aj(new aj.a() { public final boolean pM() { GMTrace.i(6084760698880L, 45335); HighlightRectSideView.a(HighlightRectSideView.this); HighlightRectSideView.this.invalidate(); GMTrace.o(6084760698880L, 45335); return true; } }, true); paramContext = a.decodeResource(getResources(), R.g.aZJ); this.ovP = paramContext.getWidth(); this.ovQ = paramContext.getHeight(); if (this.ovQ != this.ovP) { w.e("MicroMsg.HighlightRectSideView", "width is not same as height"); } this.ovR = (this.ovP * 6 / 24); this.ovN = new boolean[4]; this.mk = new Paint(); this.mk.setColor(6676738); this.mk.setAlpha(255); this.mk.setStrokeWidth(this.ovR); this.mk.setStyle(Paint.Style.STROKE); this.htb.z(300L, 300L); GMTrace.o(6060601507840L, 45155); } public final void a(boolean[] paramArrayOfBoolean) { int i = 0; GMTrace.i(6061138378752L, 45159); if ((paramArrayOfBoolean == null) || (4 != paramArrayOfBoolean.length)) { GMTrace.o(6061138378752L, 45159); return; } w.d("MicroMsg.HighlightRectSideView", "%s, %s, %s, %s", new Object[] { Boolean.valueOf(paramArrayOfBoolean[0]), Boolean.valueOf(paramArrayOfBoolean[1]), Boolean.valueOf(paramArrayOfBoolean[2]), Boolean.valueOf(paramArrayOfBoolean[3]) }); while (i < 4) { this.ovN[i] = paramArrayOfBoolean[i]; i += 1; } invalidate(); GMTrace.o(6061138378752L, 45159); } public final void i(Rect paramRect) { GMTrace.i(6060735725568L, 45156); this.ovO = paramRect; w.d("MicroMsg.HighlightRectSideView", "rect:%s", new Object[] { paramRect }); GMTrace.o(6060735725568L, 45156); } protected void onDetachedFromWindow() { GMTrace.i(6060869943296L, 45157); super.onDetachedFromWindow(); if (this.htb != null) { this.htb.stopTimer(); this.htb = null; } GMTrace.o(6060869943296L, 45157); } protected void onDraw(Canvas paramCanvas) { GMTrace.i(6061004161024L, 45158); super.onDraw(paramCanvas); int i = 0; if (i < 4) { if (this.ovN[i] != 0) {} } for (i = 0;; i = 1) { int j = this.ovR / 2; if ((this.ovN[0] != 0) && ((1 == i) || (this.ovS % 2 == 0))) { paramCanvas.drawLine(this.ovO.left + j, this.ovO.top + this.ovQ, this.ovO.left + j, this.ovO.bottom - this.ovQ, this.mk); } if ((this.ovN[1] != 0) && ((1 == i) || (this.ovS % 2 == 0))) { paramCanvas.drawLine(this.ovO.right - j, this.ovO.top + this.ovQ, this.ovO.right - j, this.ovO.bottom - this.ovQ, this.mk); } if ((this.ovN[2] != 0) && ((1 == i) || (this.ovS % 3 == 0))) { paramCanvas.drawLine(this.ovO.left + this.ovP, this.ovO.top + j, this.ovO.right - this.ovP, this.ovO.top + j, this.mk); } if ((this.ovN[3] != 0) && ((1 == i) || (this.ovS % 3 == 0))) { paramCanvas.drawLine(this.ovO.left + this.ovP, this.ovO.bottom - j, this.ovO.right - this.ovP, this.ovO.bottom - j, this.mk); } GMTrace.o(6061004161024L, 45158); return; i += 1; break; } } } /* Location: D:\tools\apktool\weixin6519android1140\jar\classes3-dex2jar.jar!\com\tencent\mm\plugin\scanner\ui\HighlightRectSideView.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
e29bc5fa3c4f2c522e6198e12f9095fef7f812e7
e3954a2c8b393350fd6e568e5421b2e397ff9d04
/storefoundation/web/src/ystorefoundationpackage/yfaces/component/customerreview/CreateCustomerReviewComponent.java
4bee2e96d72ba716af24d5178b42d192af3a393a
[]
no_license
eLBirador/yfaces
c445f38995dfa8b023b6e9c950828d0adbe5b442
f2067f7d491fe4d3a567d3bf1629e9722f304a4e
refs/heads/master
2020-04-05T18:55:55.025894
2010-05-20T19:37:43
2010-05-20T19:37:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,419
java
/* * [y] hybris Platform * * Copyright (c) 2000-2009 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package ystorefoundationpackage.yfaces.component.customerreview; import org.codehaus.yfaces.component.YModel; import org.codehaus.yfaces.component.YEventHandler; import de.hybris.platform.core.model.product.ProductModel; import de.hybris.platform.customerreview.model.CustomerReviewModel; /** * This component allows the logged-in user to write review for the product. */ public interface CreateCustomerReviewComponent extends YModel { /** * Gets the comment from the user review * * @return A string containing the comment */ CustomerReviewModel getCustomerReview(); /** * Sets the comment for the customer review */ void setCustomerReview(CustomerReviewModel comment); /** * Gets the product from the user review * * @return A ProductBean representing the product */ ProductModel getProduct(); /** * Gets the event handler for CreateCustomerReviewTag.xhtml * * @return A CreateCustomerReviewComponent */ YEventHandler<CreateCustomerReviewComponent> getSendReviewEvent(); }
[ "dstrietz@5e2dd871-cf5f-0410-99d1-ce23be8b8ae2" ]
dstrietz@5e2dd871-cf5f-0410-99d1-ce23be8b8ae2
98a09519939a5f70d1d8e2fcb0b58e74a33082ee
64c076eb3aadd68afd72efd517a46b5132622e88
/cloud-register-user-with-auth/src/main/java/com/midou/cloud/register/user/with/auth/mapper/UserDao.java
dd06be329c114cf9c438f5cc925dd3ded90f51ea
[ "Apache-2.0" ]
permissive
lstarby/cloud
fdbe724765e31d0af53b5392b9191be6b9345d23
138c0f54d64e2abd108ad0dfe8b318cac5e45a96
refs/heads/master
2021-09-26T03:13:52.321655
2018-10-27T08:25:17
2018-10-27T08:25:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
293
java
package com.midou.cloud.register.user.with.auth.mapper; import com.midou.cloud.register.user.with.auth.entity.User; /** * @author midou * @description * @date 2018/9/9 11:57 * @modified by */ public interface UserDao { User findUserById(Long id); int insertUser(User user); }
8c45777456fa3da1f27ef173827fc09bcec70ee5
8b224ac579b59df432942861c9b880fe584cb66c
/src/main/java/se/lexicon/java_33_first_rest/Java33FirstRestApplication.java
8014b15454fc90057a4c722173c644c1b06cc80c
[]
no_license
ErikSvensson76/G33_Rest_Lecture_1
8506b3ce6244573b0d0210105fd32ed1aae93c2f
68967a5b56fcc3f4a9d1f64bc845099672273a24
refs/heads/master
2023-03-28T17:50:27.296613
2021-04-06T09:54:35
2021-04-06T09:54:35
355,138,129
1
0
null
null
null
null
UTF-8
Java
false
false
352
java
package se.lexicon.java_33_first_rest; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Java33FirstRestApplication { public static void main(String[] args) { SpringApplication.run(Java33FirstRestApplication.class, args); } }
7e55d56d16b73d69e2dbeed74e3f440c263c258a
d0c1fbc4e0ab322829ac7ffa3ff0c861dd25208f
/src/main/java/com/mike/RecordController.java
343087ead8da875a5ec35018b6aa8bb30300f2ec
[]
no_license
sinisterprog/Scores
a15c9c79b2021f9a3b1ae1a43c9500c544a30e3b
c89e490ba9ed2d51a8279e1e9d722891775658fb
refs/heads/master
2023-05-29T18:49:40.899575
2021-06-17T09:16:40
2021-06-17T09:16:40
377,655,931
0
0
null
null
null
null
UTF-8
Java
false
false
3,515
java
package com.mike; import com.mike.DTOs.Record; import com.mike.DTOs.Request; import com.mike.repo.RecordRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.Predicate; import java.sql.Timestamp; import java.util.ArrayList; import java.util.List; @RestController public class RecordController { //Change at will private static final int pageSize=20; @Autowired private RecordRepository repository; // Find @GetMapping("/records") List<Record> findAll() { return repository.findAll(); } // Save @PostMapping("/records") //return 201 instead of 200 @ResponseStatus(HttpStatus.CREATED) Record newRecord(@RequestBody Record newRecord) { return repository.save(newRecord); } // Find by ID @GetMapping("/records/{id}") int findOne(@PathVariable Long id) { return repository.getScoreById(id).getScore(); } // Find by name @GetMapping("/scores/{name}") List<Record> findByName(@PathVariable String name, @RequestParam(value = "page", defaultValue="0") int page) { Pageable pageable = PageRequest.of(Integer.valueOf(page), pageSize); return repository.getScoresByPlayer(name, pageable); } // Save or update @PutMapping("/records/{id}") Record saveOrUpdate(@RequestBody Record newRecord, @PathVariable Long id) { return repository.findById(id) .map(x -> { x.setPlayer(newRecord.getPlayer()); x.setScore(newRecord.getScore()); return repository.save(x); }) .orElseGet(() -> { newRecord.setId(id); return repository.save(newRecord); }); } @DeleteMapping("/records/{id}") void deleteRecord(@PathVariable Long id) { repository.deleteById(id); } @RequestMapping(value = "/getRecords", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public List<Record> getRecords(@RequestBody Request request) { return repository.findAll((Specification<Record>) (root, criteriaQuery, criteriaBuilder) -> { List<Predicate> predicates = new ArrayList<>(); CriteriaBuilder.In<String> inClause = criteriaBuilder.in(root.get("player")); request.getNames().forEach(inClause::value); predicates.add(inClause); if (request.getFromDateTime() != null) { Timestamp startDateTime = Timestamp.valueOf(request.getFromDateTime()); predicates.add(criteriaBuilder.greaterThanOrEqualTo(root.get("scoreDate"), startDateTime)); } if (request.getToDateTime() != null) { Timestamp startDateTime = Timestamp.valueOf(request.getToDateTime()); predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("scoreDate"), startDateTime)); } return criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()])); }); } }
cb2d49ab49bea493c346c2ba8b69e7882bff656c
0c64c8997ea66d0611d4895e0bf8e5d8ac4bae7e
/src/day18/DropdownExcel.java
eae333a0671a64b45ac1cd9b5331fdd1468e5f0c
[]
no_license
SaiKrishna12/June8Batch
1e7db5d86e81802172609e757e1db454979e36c6
be741ce2486973b40935c4c33f7f264248b84a46
refs/heads/master
2021-01-20T10:37:07.094023
2015-07-15T04:56:54
2015-07-15T04:56:54
39,117,331
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package day18; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class DropdownExcel { FirefoxDriver driver=null; @BeforeMethod public void setUp() { driver=new FirefoxDriver(); driver.get("http://newtours.demoaut.com"); driver.findElement(By.linkText("REGISTER")).click(); } @Test public void dropdownTest() throws IOException { FileInputStream f=new FileInputStream("c:\\users\\sai\\desktop\\dropdown.xlsx"); XSSFWorkbook wb=new XSSFWorkbook(f); XSSFSheet ws=wb.getSheet("Sheet1"); Row r=null; WebElement drop=driver.findElement(By.name("country")); List<WebElement> dropdown=drop.findElements(By.tagName("option")); for(int i=0;i<dropdown.size();i++) { r=ws.createRow(i); r.createCell(0).setCellValue(dropdown.get(i).getText()); dropdown.get(i).click(); if(dropdown.get(i).isSelected()) { r.createCell(1).setCellValue("True"); } else { r.createCell(1).setCellValue("False"); } } FileOutputStream f1=new FileOutputStream("c:\\users\\sai\\desktop\\dropdown.xlsx"); wb.write(f1); f1.close(); } }
c99178ae80c0dd19372fad03feb88f7e78638849
e7ad19b061b426e07c137e43f2a10c1049d084ae
/src/main/java/com/google/code/p/keytooliui/ktl/swing/panel/PSelBtnTfdFileOpenKst.java
52a087132fa6057df52c041242ce7d6c03bab5a1
[]
no_license
tevjef/keytool-iui
30ebb50de207807ab9458be9ac2419b11d029a24
f67762175af7192fca3a40025e10543220eeabdb
refs/heads/master
2020-03-21T03:26:19.263391
2018-06-20T15:41:52
2018-06-20T15:41:52
138,053,362
0
0
null
null
null
null
UTF-8
Java
false
false
20,790
java
/* * * Copyright (c) 2001-2008 RagingCat Project. * LGPL License. * http://code.google.com/p/keytool-iui/ * * This software is the confidential and proprietary information of RagingCat Project. * You shall not disclose such confidential information and shall use it only in * accordance with the terms of RagingCat Project's license agreement. * * THE SOFTWARE IS PROVIDED AND LICENSED "AS IS" WITHOUT WARRANTY OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * LICENSE FOR THE SOFTWARE DOES NOT INCLUDE ANY CONSIDERATION FOR ASSUMPTION OF RISK * BY KEYTOOL IUI PROJECT, AND KEYTOOL IUI PROJECT DISCLAIMS ANY AND ALL LIABILITY FOR INCIDENTAL * OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF OR INABILITY * TO USE THE SOFTWARE, EVEN IF KEYTOOL IUI PROJECT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * */ package com.google.code.p.keytooliui.ktl.swing.panel; /** a panel that displays, from left to right: . 1 buttonSelect . 1 buttonClearSelection . 1 textfieldSelection . a group of 2 radioButtons (for switching) textfield is not editable ... used to select a file (not a directory) located in user's system: . for opening . for saving eg: keytool IMPORTANT: in case od Save option, then the radioButtons should be disabled **/ import com.google.code.p.keytooliui.ktl.io.*; import com.google.code.p.keytooliui.ktl.swing.button.*; import com.google.code.p.keytooliui.shared.swing.button.*; import com.google.code.p.keytooliui.shared.swing.optionpane.*; import com.google.code.p.keytooliui.shared.swing.textfield.*; import com.google.code.p.keytooliui.shared.lang.*; import com.google.code.p.keytooliui.shared.io.*; import com.google.code.p.keytooliui.shared.swing.panel.*; import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.io.*; final public class PSelBtnTfdFileOpenKst extends PSelBtnTfdFileOpenAbs { // ------------------- // FINAL STATIC PUBLIC final static public String f_s_strDocPropVal = "select_file_kst_open"; final static public String s_strDirNameDefault = "mykeystores"; final static public String f_s_strLabel = "Keystore file:"; // --------------------------- // FINAL STATIC PRIVATE STRING // ------ // PUBLIC public String getSelectedFormatFile() { if (this._btnTypeFileKstJks != null) if (this._btnTypeFileKstJks.isSelected()) return this._btnTypeFileKstJks.getFormatFile(); if (this._btnTypeFileKstJceks != null) if (this._btnTypeFileKstJceks.isSelected()) return this._btnTypeFileKstJceks.getFormatFile(); if (this._btnTypeFileKstPkcs12 != null) if (this._btnTypeFileKstPkcs12.isSelected()) return this._btnTypeFileKstPkcs12.getFormatFile(); if (this._btnTypeFileKstBks != null) if (this._btnTypeFileKstBks.isSelected()) return this._btnTypeFileKstBks.getFormatFile(); if (this._btnTypeFileKstUber != null) if (this._btnTypeFileKstUber.isSelected()) return this._btnTypeFileKstUber.getFormatFile(); // return null; } public void destroy() { super.destroy(); if (this._btnTypeFileKstJks != null) { this._btnTypeFileKstJks.removeItemListener(this); this._btnTypeFileKstJks.destroy(); this._btnTypeFileKstJks = null; } if (this._btnTypeFileKstJceks != null) { this._btnTypeFileKstJceks.removeItemListener(this); this._btnTypeFileKstJceks.destroy(); this._btnTypeFileKstJceks = null; } if (this._btnTypeFileKstPkcs12 != null) { this._btnTypeFileKstPkcs12.removeItemListener(this); this._btnTypeFileKstPkcs12.destroy(); this._btnTypeFileKstPkcs12 = null; } if (this._btnTypeFileKstBks != null) { this._btnTypeFileKstBks.removeItemListener(this); this._btnTypeFileKstBks.destroy(); this._btnTypeFileKstBks = null; } if (this._btnTypeFileKstUber != null) { this._btnTypeFileKstUber.removeItemListener(this); this._btnTypeFileKstUber.destroy(); this._btnTypeFileKstUber = null; } } public boolean init() { String strMethod = "init()"; if (! super.init()) { MySystem.s_printOutError(this, strMethod, "failed"); return false; } if (this._btnTypeFileKstJks != null) if (! this._btnTypeFileKstJks.init()) return false; if (this._btnTypeFileKstJceks != null) if (! this._btnTypeFileKstJceks.init()) return false; if (this._btnTypeFileKstPkcs12 != null) { if (! this._btnTypeFileKstPkcs12.init()) return false; } if (this._btnTypeFileKstBks != null) { if (! this._btnTypeFileKstBks.init()) return false; } if (this._btnTypeFileKstUber != null) { if (! this._btnTypeFileKstUber.init()) return false; } if (! _addGroup()) { MySystem.s_printOutError(this, strMethod, "failed"); return false; } // ending return true; } public PSelBtnTfdFileOpenKst( javax.swing.event.DocumentListener docListenerParent, Frame frmParent, String strTitleAppli, ItemListener itmListenerParent, String strTextLabel, // ie. root CA certs store boolean blnFieldRequired, boolean blnAllowTypeJks, boolean blnAllowTypeJceks, boolean blnAllowTypePkcs12, boolean blnAllowTypeBks, boolean blnAllowTypeUber ) { super( docListenerParent, frmParent, strTitleAppli, strTextLabel, blnFieldRequired ); super._tfdCurSelection_.getDocument().putProperty( com.google.code.p.keytooliui.shared.swing.textfield.TFAbstract.f_s_strDocPropKey, (Object) PSelBtnTfdFileOpenKst.f_s_strDocPropVal); _construct(itmListenerParent, blnAllowTypeJks, blnAllowTypeJceks, blnAllowTypePkcs12, blnAllowTypeBks, blnAllowTypeUber); } public PSelBtnTfdFileOpenKst( javax.swing.event.DocumentListener docListenerParent, Frame frmParent, String strTitleAppli, ItemListener itmListenerParent, boolean blnFieldRequired, boolean blnAllowTypeJks, boolean blnAllowTypeJceks, boolean blnAllowTypePkcs12, boolean blnAllowTypeBks, boolean blnAllowTypeUber ) { this( docListenerParent, frmParent, strTitleAppli, itmListenerParent, PSelBtnTfdFileOpenKst.f_s_strLabel, blnFieldRequired, blnAllowTypeJks, blnAllowTypeJceks, blnAllowTypePkcs12, blnAllowTypeBks, blnAllowTypeUber); } public PSelBtnTfdFileOpenKst( javax.swing.event.DocumentListener docListenerParent, Frame frmParent, String strTitleAppli, ItemListener itmListenerParent, boolean blnFieldRequired, boolean blnAllowTypeJks, boolean blnAllowTypeJceks, boolean blnAllowTypePkcs12, boolean blnAllowTypeBks, boolean blnAllowTypeUber, String strSuffixDocPropVal // in case more than on panel of same class in the same tab, used to differentiate ) { super( docListenerParent, frmParent, strTitleAppli, PSelBtnTfdFileOpenKst.f_s_strLabel, blnFieldRequired ); String strDocPropVal = PSelBtnTfdFileOpenKst.f_s_strDocPropVal + strSuffixDocPropVal; super._tfdCurSelection_.getDocument().putProperty( com.google.code.p.keytooliui.shared.swing.textfield.TFAbstract.f_s_strDocPropKey, (Object) strDocPropVal); _construct(itmListenerParent, blnAllowTypeJks, blnAllowTypeJceks, blnAllowTypePkcs12, blnAllowTypeBks, blnAllowTypeUber); } // --------- // PROTECTED protected void _showDialog_() { String strMethod = "_showDialog_()"; String[] strsTypeFileKstCur = _getTypeFileKstCur(); if (strsTypeFileKstCur == null) MySystem.s_printOutExit(this, strMethod, "nil strsTypeFileKstCur"); //String strFileExt = strsTypeFileKstCur.toLowerCase(); //String strFileDesc = "strsTypeFileKstCur + PSelBtnTfdFileAbs._f_s_strSuffixFileDesc_"; String strFileDesc = _getDescFileKstCur(); if (strFileDesc == null) MySystem.s_printOutExit(this, strMethod, "nil strFileDesc"); // ---- File fle = null; String strButtonTextOk = "Open file"; fle = S_FileChooserUI.s_getOpenFile( super._strTitleAppli_, super._frmParent_, strButtonTextOk, strsTypeFileKstCur, strFileDesc, S_FileExtensionUI.f_s_strDirNameDefaultKst); if (fle == null) { // cancelled return; } if (! _assignValues(fle)) MySystem.s_printOutExit(this, strMethod, "failed, fle.getName()=" + fle.getName()); } // ------- // PRIVATE private RBTypeKstAbs _btnTypeFileKstJks = null; private RBTypeKstAbs _btnTypeFileKstJceks = null; private RBTypeKstAbs _btnTypeFileKstPkcs12 = null; private RBTypeKstAbs _btnTypeFileKstBks = null; private RBTypeKstAbs _btnTypeFileKstUber = null; private void _construct( ItemListener itmListenerParent, boolean blnAllowTypeJks, boolean blnAllowTypeJceks, boolean blnAllowTypePkcs12, boolean blnAllowTypeBks, boolean blnAllowTypeUber ) { int intNbRadioButton = 0; if (blnAllowTypeJks) intNbRadioButton ++; if (blnAllowTypeJceks) intNbRadioButton ++; if (blnAllowTypePkcs12) intNbRadioButton ++; if (blnAllowTypeBks) intNbRadioButton ++; if (blnAllowTypeUber) intNbRadioButton ++; boolean blnEnabledButton = true; if (intNbRadioButton < 2) blnEnabledButton = false; if (blnAllowTypeJks) { this._btnTypeFileKstJks = new RBTypeKstJks( blnEnabledButton, // blnEnabledButton itmListenerParent); } if (blnAllowTypeJceks) { this._btnTypeFileKstJceks = new RBTypeKstJceks( blnEnabledButton, // blnEnabledButton itmListenerParent); } if (blnAllowTypePkcs12) { this._btnTypeFileKstPkcs12 = new RBTypeKstPkcs12( blnEnabledButton, // blnEnabledButton itmListenerParent); } if (blnAllowTypeBks) { this._btnTypeFileKstBks = new RBTypeKstBks( blnEnabledButton, // blnEnabledButton itmListenerParent); } if (blnAllowTypeUber) { this._btnTypeFileKstUber = new RBTypeKstUber( blnEnabledButton, // blnEnabledButton itmListenerParent); } if (this._btnTypeFileKstJks != null) this._btnTypeFileKstJks.addItemListener(this); if (this._btnTypeFileKstJceks != null) this._btnTypeFileKstJceks.addItemListener(this); if (this._btnTypeFileKstPkcs12 != null) this._btnTypeFileKstPkcs12.addItemListener(this); if (this._btnTypeFileKstBks != null) this._btnTypeFileKstBks.addItemListener(this); if (this._btnTypeFileKstUber != null) this._btnTypeFileKstUber.addItemListener(this); } private boolean _assignValues(File fle) { String strMethod = "_assignValues(fle)"; if (fle == null) { MySystem.s_printOutError(this, strMethod, "nil fle"); return false; } if (! fle.exists()) { MySystem.s_printOutWarning(this, strMethod, "! fle.exists(), fle.getAbsolutePath()=" + fle.getAbsolutePath()); String strBody = fle.getAbsolutePath(); strBody += ":\nFile not found."; OPAbstract.s_showDialogWarning(super._frmParent_, super._strTitleAppli_, strBody); return true; } if (fle.isDirectory()) { MySystem.s_printOutWarning(this, strMethod, "fle.isDirectory(), fle.getAbsolutePath()=" + fle.getAbsolutePath()); String strBody = fle.getAbsolutePath(); strBody += ":\nFile is a directory."; OPAbstract.s_showDialogWarning(super._frmParent_, super._strTitleAppli_, strBody); return true; } if (super._tfdCurSelection_ == null) { MySystem.s_printOutError(this, strMethod, "nil super._tfdCurSelection_"); return false; } super._tfdCurSelection_.setText(fle.getAbsolutePath()); super._setSelectedValue_(true); if (super._btnClearSelection_ == null) { MySystem.s_printOutError(this, strMethod, "nil super._btnClearSelection_"); return false; } super._btnClearSelection_.setEnabled(true); // -- // ending return true; } /** grouping Jks & JHR & RCR files **/ private boolean _addGroup() { String strMethod = "_addGroup()"; // adding radioButtons/labelChecks for selecting in between JAR, and JHR, and RCR files // ---- ButtonGroup bgp = new ButtonGroup(); if (this._btnTypeFileKstJks != null) bgp.add(this._btnTypeFileKstJks); if (this._btnTypeFileKstJceks != null) bgp.add(this._btnTypeFileKstJceks); if (this._btnTypeFileKstPkcs12 != null) bgp.add(this._btnTypeFileKstPkcs12); if (this._btnTypeFileKstBks != null) bgp.add(this._btnTypeFileKstBks); if (this._btnTypeFileKstUber != null) bgp.add(this._btnTypeFileKstUber); // -- if (this._btnTypeFileKstJks != null) this._btnTypeFileKstJks.setSelected(true); else if (this._btnTypeFileKstJceks != null) this._btnTypeFileKstJceks.setSelected(true); else if (this._btnTypeFileKstPkcs12 != null) this._btnTypeFileKstPkcs12.setSelected(true); else if (this._btnTypeFileKstBks != null) this._btnTypeFileKstBks.setSelected(true); else if (this._btnTypeFileKstUber != null) this._btnTypeFileKstUber.setSelected(true); else { MySystem.s_printOutError(this, strMethod, "no valid button found"); return false; } // else label: done at construction time // -- JPanel pnlTypeFileKst = new JPanel(); pnlTypeFileKst.setLayout(new BoxLayout(pnlTypeFileKst, BoxLayout.Y_AXIS)); if (this._btnTypeFileKstJks != null) pnlTypeFileKst.add(this._btnTypeFileKstJks); if (this._btnTypeFileKstJceks != null) pnlTypeFileKst.add(this._btnTypeFileKstJceks); if (this._btnTypeFileKstPkcs12 != null) pnlTypeFileKst.add(this._btnTypeFileKstPkcs12); if (this._btnTypeFileKstBks != null) pnlTypeFileKst.add(this._btnTypeFileKstBks); if (this._btnTypeFileKstUber != null) pnlTypeFileKst.add(this._btnTypeFileKstUber); // -- if (super._pnl_ == null) { MySystem.s_printOutError(this, strMethod, "nil super._pnl_"); return false; } //super._pnl_.add(Box.createRigidArea(PSelAbs.f_s_dimBoxX)); super._pnl_.add(pnlTypeFileKst); // ending return true; } private String[] _getTypeFileKstCur() { String strMethod = "_getTypeFileKstCur()"; if (this._btnTypeFileKstJks != null) if (this._btnTypeFileKstJks.isSelected()) { return this._btnTypeFileKstJks.getNamesFileExtension(); } if (this._btnTypeFileKstJceks != null) if (this._btnTypeFileKstJceks.isSelected()) { return this._btnTypeFileKstJceks.getNamesFileExtension(); } if (this._btnTypeFileKstPkcs12 != null) { if (this._btnTypeFileKstPkcs12.isSelected()) { return this._btnTypeFileKstPkcs12.getNamesFileExtension(); } } if (this._btnTypeFileKstBks != null) { if (this._btnTypeFileKstBks.isSelected()) { return this._btnTypeFileKstBks.getNamesFileExtension(); } } if (this._btnTypeFileKstUber!= null) { if (this._btnTypeFileKstUber.isSelected()) { return this._btnTypeFileKstUber.getNamesFileExtension(); } } // ---- // error MySystem.s_printOutError(this, strMethod, "failed"); return null; } private String _getDescFileKstCur() { String strMethod = "_getDescFileKstCur()"; if (this._btnTypeFileKstJks != null) if (this._btnTypeFileKstJks.isSelected()) { return this._btnTypeFileKstJks.getFileDesc(); } if (this._btnTypeFileKstJceks != null) if (this._btnTypeFileKstJceks.isSelected()) { return this._btnTypeFileKstJceks.getFileDesc(); } if (this._btnTypeFileKstPkcs12 != null) { if (this._btnTypeFileKstPkcs12.isSelected()) { return this._btnTypeFileKstPkcs12.getFileDesc(); } } if (this._btnTypeFileKstBks != null) { if (this._btnTypeFileKstBks.isSelected()) { return this._btnTypeFileKstBks.getFileDesc(); } } if (this._btnTypeFileKstUber != null) { if (this._btnTypeFileKstUber.isSelected()) { return this._btnTypeFileKstUber.getFileDesc(); } } // ---- // error MySystem.s_printOutError(this, strMethod, "failed"); return null; } }
cc50d6ba806c2fbcb75b01fd69cda1552aa5f227
affe223efe18ba4d5e676f685c1a5e73caac73eb
/clients/webservice/src/main/java/com/vmware/vim/AlarmTriggeringAction.java
2c0b18d3c88b90cdd50d590626636c93abefaec3
[]
no_license
RohithEngu/VM27
486f6093e0af2f6df1196115950b0d978389a985
f0f4f177210fd25415c2e058ec10deb13b7c9247
refs/heads/master
2021-01-16T00:42:30.971054
2009-08-14T19:58:16
2009-08-14T19:58:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,040
java
/** * AlarmTriggeringAction.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.vmware.vim; public class AlarmTriggeringAction extends com.vmware.vim.AlarmAction implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; private com.vmware.vim.Action action; private boolean green2Yellow; private boolean yellow2Red; private boolean red2Yellow; private boolean yellow2Green; public AlarmTriggeringAction() { } public AlarmTriggeringAction(java.lang.String dynamicType, com.vmware.vim.DynamicProperty[] dynamicProperty, com.vmware.vim.Action action, boolean green2Yellow, boolean yellow2Red, boolean red2Yellow, boolean yellow2Green) { super(dynamicType, dynamicProperty); this.action = action; this.green2Yellow = green2Yellow; this.yellow2Red = yellow2Red; this.red2Yellow = red2Yellow; this.yellow2Green = yellow2Green; } /** * Gets the action value for this AlarmTriggeringAction. * * @return action */ public com.vmware.vim.Action getAction() { return action; } /** * Sets the action value for this AlarmTriggeringAction. * * @param action */ public void setAction(com.vmware.vim.Action action) { this.action = action; } /** * Gets the green2Yellow value for this AlarmTriggeringAction. * * @return green2Yellow */ public boolean isGreen2Yellow() { return green2Yellow; } /** * Sets the green2Yellow value for this AlarmTriggeringAction. * * @param green2Yellow */ public void setGreen2Yellow(boolean green2Yellow) { this.green2Yellow = green2Yellow; } /** * Gets the yellow2Red value for this AlarmTriggeringAction. * * @return yellow2Red */ public boolean isYellow2Red() { return yellow2Red; } /** * Sets the yellow2Red value for this AlarmTriggeringAction. * * @param yellow2Red */ public void setYellow2Red(boolean yellow2Red) { this.yellow2Red = yellow2Red; } /** * Gets the red2Yellow value for this AlarmTriggeringAction. * * @return red2Yellow */ public boolean isRed2Yellow() { return red2Yellow; } /** * Sets the red2Yellow value for this AlarmTriggeringAction. * * @param red2Yellow */ public void setRed2Yellow(boolean red2Yellow) { this.red2Yellow = red2Yellow; } /** * Gets the yellow2Green value for this AlarmTriggeringAction. * * @return yellow2Green */ public boolean isYellow2Green() { return yellow2Green; } /** * Sets the yellow2Green value for this AlarmTriggeringAction. * * @param yellow2Green */ public void setYellow2Green(boolean yellow2Green) { this.yellow2Green = yellow2Green; } private java.lang.Object __equalsCalc = null; @Override public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof AlarmTriggeringAction)) { return false; } AlarmTriggeringAction other = (AlarmTriggeringAction) obj; if (obj == null) { return false; } if (this == obj) { return true; } if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj) && ((this.action == null && other.getAction() == null) || (this.action != null && this.action .equals(other.getAction()))) && this.green2Yellow == other.isGreen2Yellow() && this.yellow2Red == other.isYellow2Red() && this.red2Yellow == other.isRed2Yellow() && this.yellow2Green == other.isYellow2Green(); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; @Override public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); if (getAction() != null) { _hashCode += getAction().hashCode(); } _hashCode += (isGreen2Yellow() ? Boolean.TRUE : Boolean.FALSE) .hashCode(); _hashCode += (isYellow2Red() ? Boolean.TRUE : Boolean.FALSE).hashCode(); _hashCode += (isRed2Yellow() ? Boolean.TRUE : Boolean.FALSE).hashCode(); _hashCode += (isYellow2Green() ? Boolean.TRUE : Boolean.FALSE) .hashCode(); __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc( AlarmTriggeringAction.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("urn:vim2", "AlarmTriggeringAction")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("action"); elemField .setXmlName(new javax.xml.namespace.QName("urn:vim2", "action")); elemField .setXmlType(new javax.xml.namespace.QName("urn:vim2", "Action")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("green2Yellow"); elemField.setXmlName(new javax.xml.namespace.QName("urn:vim2", "green2yellow")); elemField.setXmlType(new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "boolean")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("yellow2Red"); elemField.setXmlName(new javax.xml.namespace.QName("urn:vim2", "yellow2red")); elemField.setXmlType(new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "boolean")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("red2Yellow"); elemField.setXmlName(new javax.xml.namespace.QName("urn:vim2", "red2yellow")); elemField.setXmlType(new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "boolean")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("yellow2Green"); elemField.setXmlName(new javax.xml.namespace.QName("urn:vim2", "yellow2green")); elemField.setXmlType(new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "boolean")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer(_javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer(_javaType, _xmlType, typeDesc); } }
2cc211afff26e2f7f21e09cb74c8a3eea93e036b
af8425466b9555dd1b53a67b0bfcc41192a398a6
/app/src/main/java/com/example/stammana/customadapter/Student.java
516f328be908c762aca1f860df530df8e1368209
[]
no_license
AndroidWorkshop/Custom-Adapter
eab3631983833513ba50d166429e3d6620766d18
ae633ff5e170ae8ad7adeaf715df0b83030f9a7c
refs/heads/master
2020-03-19T07:38:11.999202
2018-06-05T07:02:29
2018-06-05T07:02:29
136,134,330
0
0
null
null
null
null
UTF-8
Java
false
false
713
java
package com.example.stammana.customadapter; class Student { private int id; private String name; private String phoneNumber; public Student(int id, String name, String phoneNumber) { this.id = id; this.name = name; this.phoneNumber = phoneNumber; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } }
1e042f42d1ea4e1f9b8e62a7237e01b237a4cab5
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/zhihu/android/app/nextebook/p1215b/EBookThemeChangedEvent.java
36bcfaf79353eebdb6f775cd3fd9588fe049656a
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
233
java
package com.zhihu.android.app.nextebook.p1215b; import kotlin.Metadata; @Metadata /* renamed from: com.zhihu.android.app.nextebook.b.f */ /* compiled from: EBookThemeChangedEvent.kt */ public final class EBookThemeChangedEvent { }
3b2d228b8e1b98339e311d9deaa5b064f8878e4e
b4c631bdebe3b0092b19a86417f8f2909ce470f8
/src/essensvorschlag/MenueLeiste.java
14a5dfcafeaf57e267eb794c4319201cbb92ed3c
[]
no_license
UntotaufUrlaub/MealTool
e80d996908738763c161c2f28f1f633add8936a8
6e6117d520512d427578efccec3c90df1708efc6
refs/heads/master
2020-03-08T16:05:55.798529
2018-04-05T15:58:16
2018-04-05T15:58:16
127,960,841
0
0
null
null
null
null
UTF-8
Java
false
false
7,488
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 essensvorschlag; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; /** * * @author */ class MenueLeiste extends JLabel { MenueLeiste() { super(); setBackground(Color.BLUE); setOpaque(true); JButton hinzufuegen = new JButton("Hinzufügen"); hinzufuegen.setBounds(10, 5, 100, 30); hinzufuegen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.schreiben("!Warnung! Falls der planungsmodus aktiv ist dann könnte das hinzufuegen nicht funktunieren"); String name = JOptionPane.showInputDialog(null, "Wie heißt das Gericht?"); if (name == null) { return; } //abbrechen weil der abbrechen knopf gedrückt wurde; if(name.contains("#")){ JOptionPane.showMessageDialog(EssensVorschlag.fenster, "Der name eines Gerichts darf kein # enthalten.\nHinzufuegen abgebrochen"); return; } String wachstum = JOptionPane.showInputDialog(null, "Wie oft (Wachstum)?"); if (wachstum == null) { return; } //abbrechen weil der abbrechen knopf gedrückt wurde; int intWachstum; try { intWachstum = Integer.parseInt(wachstum); } catch (NumberFormatException ex) { EssensVorschlag.schreiben("hinzufuegen; wachstum; NumberFormatException"); intWachstum = 1; } int bald = JOptionPane.showConfirmDialog(null, "bald?", "An Insane Question", JOptionPane.YES_NO_OPTION); if (bald == 1) { //nicht bald bald = 0; } else { //bald bald = EssensVorschlag.liste.get(4).stand; } EssensVorschlag.schreiben("(hinzufuegen) stand: " + bald); EssensVorschlag.liste.add(new Gericht(name + "#" + bald + "#" + intWachstum + "#null#")); EssensVorschlag.build(); } }); add(hinzufuegen); JButton planungsmodusButton = new JButton(); planungsmodusButton.setBounds(120, 5, 200, 30); if (EssensVorschlag.planungsModus) { planungsmodusButton.setText("PlanungsModus aktiviert"); planungsmodusButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //deaktivieren EssensVorschlag.planungsModus = false; EssensVorschlag.liste.clear(); for (int i = 0; i < EssensVorschlag.listeZwischenSpeicher.size(); i++) { EssensVorschlag.liste.add(new Gericht(EssensVorschlag.listeZwischenSpeicher.get(i))); } EssensVorschlag.build(); } }); } else { planungsmodusButton.setText("PlanungsModus deaktiviert"); planungsmodusButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //aktivieren EssensVorschlag.planungsModus = true; EssensVorschlag.listeZwischenSpeicher.clear(); for (int i = 0; i < EssensVorschlag.liste.size(); i++) { EssensVorschlag.listeZwischenSpeicher.add(new Gericht(EssensVorschlag.liste.get(i))); } EssensVorschlag.build(); } }); } add(planungsmodusButton); JButton log = new JButton("Log"); log.setBounds(330, 5, 70, 30); log.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFrame fenster = EssensVorschlag.fenster; if (fenster.getBounds().height == 400) { fenster.setBounds(fenster.getX(), fenster.getY(), fenster.getWidth(), 600); } else { fenster.setBounds(fenster.getX(), fenster.getY(), fenster.getWidth(), 400); } } }); add(log); JButton hashtagEinblenden = new JButton("#"); hashtagEinblenden.setBounds(410, 5, 60, 30); hashtagEinblenden.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.MenueAnzeigeZoneZustand = 2; EssensVorschlag.build(); } }); add(hashtagEinblenden); JButton vorgemerktesEinblenden = new JButton("vorgemerktes"); vorgemerktesEinblenden.setBounds(480, 5, 130, 30); vorgemerktesEinblenden.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.MenueAnzeigeZoneZustand = 3; EssensVorschlag.build(); } }); add(vorgemerktesEinblenden); JButton statistikenEinblenden=new JButton("Stats"); statistikenEinblenden.setBounds(620, 5, 70, 30); statistikenEinblenden.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.MenueAnzeigeZoneZustand = 5; EssensVorschlag.build(); } }); add(statistikenEinblenden); JButton listeMöglicherInteresannterGerichteButton=new JButton("Anregungen"); listeMöglicherInteresannterGerichteButton.setBounds(10, 40, 110, 30); listeMöglicherInteresannterGerichteButton.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.MenueAnzeigeZoneZustand = 6; EssensVorschlag.build(); } }); add(listeMöglicherInteresannterGerichteButton); JButton tagebuchButton=new JButton("Tagebuch"); tagebuchButton.setBounds(130, 40, 90, 30); tagebuchButton.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.MenueAnzeigeZoneZustand = 7; EssensVorschlag.build(); } }); add(tagebuchButton); JButton notizenButton=new JButton("Notizen"); notizenButton.setBounds(230, 40, 80, 30); notizenButton.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { EssensVorschlag.MenueAnzeigeZoneZustand = 8; EssensVorschlag.build(); } }); add(notizenButton); } }
866065c3d3b440ee50b0ba478afac762d63eb0b9
0cffa6dad1d755d9687f526c8cfa762210082396
/Realisations_Logicielles/CloudComputing_Docker/Codes_Sources_Annuaire/src/gpe/tp/servlets/Deconnexion.java
916a73da08bd13854f6ca09310d8e9a35f6a84a5
[ "CC0-1.0" ]
permissive
stuenofotso/Cloud-Computing-Project-Ressources
ec1f2d48a6f224e8bb68172146c204abd6b5a3c1
ebf1eddd97ebb2cec57dc52fa6eafd77dc9ecebd
refs/heads/master
2021-01-10T03:07:28.271608
2015-11-22T15:39:47
2015-11-22T15:39:47
46,642,792
0
0
null
null
null
null
UTF-8
Java
false
false
710
java
package gpe.tp.servlets; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @SuppressWarnings("serial") public class Deconnexion extends HttpServlet { public static final String URL_REDIRECTION = "/Annuaire/login"; public void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { /* Récupération et destruction de la session en cours */ HttpSession session = request.getSession(); session.invalidate(); response.sendRedirect( URL_REDIRECTION ); } }
413e7d121502e001c349851e3f4650a52bb41a3b
50f508d99942e7ea7c8a2dddca3406a420f34c85
/Bomb/src/main/java/bomberman/gui/ImageLoader.java
b14231428abae00a594347b9e93a63b747edb4ba
[]
no_license
NguyenTuanVu2105/BombGame
a3984350979bee5d22f5ea2c81a5f5e3e54a226b
d84d0063fa492b8b5cacc3bddd53aebda96088e3
refs/heads/master
2020-04-05T11:58:49.621695
2018-12-05T07:57:00
2018-12-05T07:57:00
156,853,088
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package bomberman.gui; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; public class ImageLoader { public static BufferedImage loadImage(String path) { try { return ImageIO.read(ImageLoader.class.getResource(path)); }catch (IOException e){ System.out.println("image fall"); } return null; } }
8d29581b957b0b88db680d2dc4160fc823612530
17646c773bb1ed00d49a94525fa00b2ab26c0ee9
/diboot-iam-starter/src/main/java/com/diboot/iam/auth/IamCustomize.java
b46c3e9d3035b235c496d5b4e89ae37448eeeeac
[ "Apache-2.0" ]
permissive
startime-h/diboot
5d921d2e382b536c13e99ba8f3e3176353d1f491
2fa77c3fde3ddbab3accbc055e97ee9d8ee503be
refs/heads/master
2023-08-26T20:10:15.624788
2021-09-29T00:50:36
2021-09-29T00:50:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,062
java
/* * Copyright (c) 2015-2020, www.dibo.ltd ([email protected]). * <p> * 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 * <p> * https://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.diboot.iam.auth; import com.diboot.iam.entity.BaseLoginUser; import com.diboot.iam.entity.IamAccount; import com.diboot.iam.exception.PermissionException; import java.lang.reflect.Method; /** * IAM自定义接口 * @author [email protected] * @version v2.0 * @date 2020/11/04 */ public interface IamCustomize { /** * 获取当前登录用户 * @return */ BaseLoginUser getCurrentUser(); /*** * 对用户密码加密 * @param iamAccount */ void encryptPwd(IamAccount iamAccount); /** * 加密 * @param password * @param salt * @return */ String encryptPwd(String password, String salt); /** * 检查权限码 * @param permissionCode * @throws PermissionException */ void checkPermission(String permissionCode) throws PermissionException; /** * 检查当前用户是否拥有某角色 * @param role * @return */ boolean checkCurrentUserHasRole(String role); /** * 清空缓存 * @param username */ void clearAuthorizationCache(String username); /** * 清空所有权限 */ void clearAllAuthorizationCache(); /** * 是否启用权限检查 * @return */ boolean isEnablePermissionCheck(); /** * 获取原生的权限码 * @return */ String[] getOrignPermissionCodes(Method method); }
ffabd62fdf1b423894ead50ccd2266b978988199
097df92ce1bfc8a354680725c7d10f0d109b5b7d
/com/amazon/ws/emr/hadoop/fs/shaded/com/amazonaws/services/s3/AmazonS3ClientBuilder.java
eb947a818befb58644aab6afd795cbc8b9af4e72
[]
no_license
cozos/emrfs-hadoop
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
ba5dfa631029cb5baac2f2972d2fdaca18dac422
refs/heads/master
2022-10-14T15:03:51.500050
2022-10-06T05:38:49
2022-10-06T05:38:49
233,979,996
2
2
null
2022-10-06T05:41:46
2020-01-15T02:24:16
Java
UTF-8
Java
false
false
1,631
java
package com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.s3; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.ClientConfigurationFactory; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.annotation.NotThreadSafe; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.annotation.SdkTestInternalApi; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.client.AwsSyncClientParams; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.internal.SdkFunction; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.regions.AwsRegionProvider; @NotThreadSafe public final class AmazonS3ClientBuilder extends AmazonS3Builder<AmazonS3ClientBuilder, AmazonS3> { private AmazonS3ClientBuilder() {} @SdkTestInternalApi AmazonS3ClientBuilder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory, ClientConfigurationFactory clientConfigFactory, AwsRegionProvider regionProvider) { super(clientFactory, clientConfigFactory, regionProvider); } public static AmazonS3ClientBuilder standard() { return (AmazonS3ClientBuilder)new AmazonS3ClientBuilder().withCredentials(new S3CredentialsProviderChain()); } public static AmazonS3 defaultClient() { return (AmazonS3)standard().build(); } protected AmazonS3 build(AwsSyncClientParams clientParams) { return (AmazonS3)clientFactory.apply(new AmazonS3ClientParamsWrapper(clientParams, resolveS3ClientOptions())); } } /* Location: * Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.s3.AmazonS3ClientBuilder * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
cda1b0ab4538d1ba54cefb443c7e88e751b2041a
368c663f8d031f576e3add37dde8e9052dc628d8
/OBDUI/src/org/obd/ws/coreResource/sorter/AutocompleteNodeSorter.java
bf40913dee19b846ed2fc742c748b5b8d2df6f8d
[]
no_license
mahmoudimus/obo-edit
494a588830758ddbd7cf43d2e70550ddd542cb1b
61c146958fd7d0ba7f78cda77f56d45849897b3e
refs/heads/master
2022-01-31T22:59:21.316185
2014-03-20T17:05:47
2014-03-20T17:05:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
805
java
package org.obd.ws.coreResource.sorter; import java.util.Comparator; import org.obd.model.Node; public class AutocompleteNodeSorter implements Comparator<Node>{ private String pattern; public int compare(Node o1, Node o2) { String label1 = o1.getLabel(); String label2 = o2.getLabel(); if (label1==null){ label1 = o1.getId(); } if (label2==null){ label2 = o2.getId(); } int index1 = label1.indexOf(pattern); int index2 = label2.indexOf(pattern); if (index1<index2){ return -1; } else if (index1>index2){ return 1; } else { if (label1.length()<label2.length()){ return -1; } else if (label1.length()>label2.length()){ return 1; } else { return 0; } } } public void setPattern(String pattern){ this.pattern = pattern; } }
[ "rbruggne@6f0e8829-b336-0410-acfb-cb9b228023ad" ]
rbruggne@6f0e8829-b336-0410-acfb-cb9b228023ad
0db56bc25169c4e2e57e1ffabbc95d7a8a85b0e3
5f63a60fd029b8a74d2b1b4bf6992f5e4c7b429b
/com/planet_ink/coffee_mud/Abilities/Prayers/Prayer_ReflectPrayer.java
a6b2460daab0ec59ab65f3e44b0f530bf2a7339f
[ "Apache-2.0" ]
permissive
bozimmerman/CoffeeMud
5da8b5b98c25b70554ec9a2a8c0ef97f177dc041
647864922e07572b1f6c863de8f936982f553288
refs/heads/master
2023-09-04T09:17:12.656291
2023-09-02T00:30:19
2023-09-02T00:30:19
5,267,832
179
122
Apache-2.0
2023-04-30T11:09:14
2012-08-02T03:22:12
Java
UTF-8
Java
false
false
8,260
java
package com.planet_ink.coffee_mud.Abilities.Prayers; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2020-2023 Bo Zimmerman 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. */ public class Prayer_ReflectPrayer extends Prayer { @Override public String ID() { return "Prayer_ReflectPrayer"; } private final static String localizedName = CMLib.lang().L("Reflect Prayer"); @Override public String name() { return localizedName; } private final static String localizedStaticDisplay = CMLib.lang().L("(Reflect Prayer)"); @Override public String displayText() { return localizedStaticDisplay; } @Override protected int canAffectCode() { return CAN_MOBS; } @Override protected int canTargetCode() { return CAN_ITEMS; } protected long timeToNextCast = 0; @Override protected int getTicksBetweenCasts() { return 15; } @Override protected long getTimeOfNextCast() { return timeToNextCast; } @Override protected void setTimeOfNextCast(final long absoluteTime) { timeToNextCast=absoluteTime; } @Override public int classificationCode() { return Ability.ACODE_PRAYER|Ability.DOMAIN_SHIELDUSE; } @Override public int abstractQuality() { return Ability.QUALITY_BENEFICIAL_SELF; } @Override public long flags() { return 0; // no, part of its skillness is being unaligned } protected Shield shield = null; @Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) return; final MOB mob=(MOB)affected; super.unInvoke(); if((canBeUninvoked())&&(!mob.amDead())) mob.tell(L("Your reflection faith fades.")); } @Override public boolean tick(final Tickable ticking, final int tickID) { if(!super.tick(ticking, tickID)) return false; if(!(affected instanceof MOB)) { unInvoke(); return false; } final MOB mob=(MOB)affected; if(shield == null) { final Item I=mob.fetchHeldItem(); if(I instanceof Shield) shield=(Shield)I; else { unInvoke(); return true; } } if((shield==null) ||(shield.amDestroyed()) ||(!shield.amBeingWornProperly()) ||(mob.fetchHeldItem()!=shield)) { unInvoke(); return false; } return true; } @Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!super.okMessage(myHost,msg)) return false; if(!(affected instanceof MOB)) return true; final MOB mob=(MOB)affected; if(shield == null) { final Item I=mob.fetchHeldItem(); if(I instanceof Shield) shield=(Shield)I; else { unInvoke(); return true; } } if((msg.amITarget(mob)) &&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS)) &&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL) &&(msg.tool() instanceof Ability) &&((((Ability)msg.tool()).classificationCode()&Ability.ALL_ACODES)==Ability.ACODE_PRAYER) &&(invoker!=null) &&((shield!=null)&&(mob.fetchHeldItem()==shield)) &&(!mob.amDead())) { mob.location().show(mob,shield,CMMsg.MSG_OK_VISUAL,L("^S<S-YOUPOSS> <T-NAMENOART> reflects @x1!^?",msg.tool().name())); if(shield.subjectToWearAndTear()) { final int prayerLevel=CMLib.ableMapper().lowestQualifyingLevel(msg.tool().ID()); int damage = prayerLevel-(2*super.getXLEVELLevel(mob)); if(damage < 1) damage = 1; shield.setUsesRemaining(shield.usesRemaining()-damage); if((shield.usesRemaining()<10) &&(shield.usesRemaining()>0)) mob.tell(L("@x1 is nearly destroyed! (@x2%)",name(),""+shield.usesRemaining())); else if(shield.usesRemaining()<=0) { shield.setUsesRemaining(100); msg.addTrailerMsg(CMClass.getMsg(mob,null,null, CMMsg.MSG_OK_VISUAL,L("^I@x1 is destroyed!!^?",name()),CMMsg.NO_EFFECT,null, CMMsg.MSG_OK_VISUAL,L("^I@x1 being worn by <S-NAME> is destroyed!^?",name()))); shield.unWear(); shield.destroy(); mob.recoverPhyStats(); mob.recoverCharStats(); mob.recoverMaxState(); if(mob.location()!=null) mob.location().recoverRoomStats(); } } ((Ability)msg.tool()).invoke(mob, msg.source(), true, ((Ability)msg.tool()).adjustedLevel(msg.source(),0)); unInvoke(); return false; } return true; } protected boolean hasAppropriateItem(final MOB mob) { if(mob==null) return false; final Item shield=mob.fetchHeldItem(); if(!(shield instanceof Shield)) return false; if(CMLib.flags().isEnchanted(shield)) return false; return true; } @Override public int castingQuality(final MOB mob, final Physical target) { if(mob!=null) { if(!hasAppropriateItem(mob)) return Ability.QUALITY_INDIFFERENT; final MOB victim=mob.getVictim(); if((victim!=null)&&(CMLib.flags().domainAbilities(victim,Ability.ACODE_PRAYER).size()==0)) return Ability.QUALITY_INDIFFERENT; } return super.castingQuality(mob,target); } @Override public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(this.ID())!=null) { failureTell(mob,target,auto,L("<S-NAME> <S-IS-ARE> already reflecting prayers.")); return false; } final Item shield=mob.fetchHeldItem(); if(!hasAppropriateItem(mob)) { if(!(shield instanceof Shield)) { mob.tell(L("You aren't holding a shield to hide behind.")); return false; } mob.tell(L("@x1 is enchanted and can not be bolstered by faith alone.",shield.name(mob))); return false; } if(mob.charStats().getMyDeity()==null) { mob.tell(L("You need to have faith in a deity to do this.")); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?"":L("^S<S-NAME> @x1 that <T-NAME> be protected behind @x1.^?",prayWord(mob),shield.name())); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); final Prayer_ReflectPrayer A=(Prayer_ReflectPrayer)beneficialAffect(mob,target,asLevel,15); if(A!=null) { A.shield=(Shield)shield; mob.location().show(target,shield,CMMsg.MSG_OK_VISUAL,L("An aura of faith surrounds <S-YOUPOSS> <T-NAMENOART>.")); A.setTimeOfNextCast(mob); } } } else return beneficialWordsFizzle(mob,target,L("<S-NAME> @x1 for protection behind @x1, but <S-HIS-HER> plea is not answered.",prayWord(mob),shield.name())); // return whether it worked return success; } }
7ea63989fbe6bccd81cf7ad7deb424211ca0b67c
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-11/u-11-f5347.java
dcd828dd7292b3159d57fcab65802ff51e3ae0e7
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 3259265107260
69a1adbf2a5fac527b2eff7677aec775aa61a4cc
0799b6054c3de3d4e546dfefa99dfcd14c417c76
/Igor_Dianin/src/main/java/HibernateHomework2/App.java
6c8b3b568f9dd4a7b049f155e0738fd6fe5f25c0
[]
no_license
alex-zr/Proff1
0c8fb8408cd1a4cc67e2b292977199f002b231d8
f28589a650dec478a0e379c70e04d8422f2b5b6a
refs/heads/master
2020-04-09T11:12:57.898038
2019-03-21T17:32:36
2019-03-21T17:32:36
160,300,111
0
5
null
2018-12-23T17:06:29
2018-12-04T05:03:38
Java
UTF-8
Java
false
false
2,103
java
package HibernateHomework2; import java.util.Scanner; public class App { public static void main(String[] args) { BankDAO bank = new Bank(); Scanner scanner = new Scanner(System.in); try { bank.initialDB(); while (true){ System.out.println(""); System.out.println("1.Add user"); System.out.println("2.Delete user"); System.out.println("3.Add account"); System.out.println("4.Delete account"); System.out.println("5.Replenish Account"); System.out.println("6.Transfer Money"); System.out.println("7.Convert Currency"); System.out.println("8.View Total Amount Of Money In The Account UAH "); String s = scanner.nextLine(); switch (s){ case "1" : bank.addUser(); break; case "2" : bank.deleteUser(); break; case "3" : bank.addAccount(); break; case "4" : bank.deleteAccount(); break; case "5" : bank.replenishAccount(); break; case "6" : bank.transferMoney(); break; case "7" : bank.convertCurrency(); break; case "8" : bank.viewTotalAmountOfMoneyInTheAccountUAH(); break; default: return; } } } catch (Exception e) { e.printStackTrace(); System.out.println("Something went wrong.."); } finally { bank.closeDB(); System.out.println("Thank you for using our bank!"); } } }
9d19021d8be5d28a20e61199d583ef881b9936cb
39283e6f85ed52b43b34b0af15fb0e0e7ff554a6
/NokonaAPI/src/com/nokona/resource/NokonaLabelsResource.java
df012bf69999b963150e41c64cbf0944138b0404
[]
no_license
grut666/Nokona2019
855f56bfc02c74605c00bf3d78c0783d8e0ec865
7d34984bf6db51334080856204ddeccca2e75c57
refs/heads/master
2023-07-20T07:21:18.528603
2023-07-17T03:44:30
2023-07-17T03:44:30
176,864,890
2
0
null
null
null
null
UTF-8
Java
false
false
2,090
java
package com.nokona.resource; import javax.enterprise.context.ApplicationScoped; import javax.print.Doc; import javax.print.DocFlavor; import javax.print.DocPrintJob; import javax.print.PrintException; import javax.print.PrintService; import javax.print.SimpleDoc; import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.standard.Copies; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.nokona.model.Labels; import com.nokona.printer.PrintJobWatcher; import com.nokona.utilities.BarCodeUtilities; @Path("/labels") @ApplicationScoped public class NokonaLabelsResource { // @Inject // private NokonaDatabaseTicket db; @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/") public Response printLabels(Labels labels) { System.out.println("******** Entering printLabels ***********************"); try { printIt(labels); return Response.status(200).entity("{\"Success\":\"" + "Success" + "\"}").build(); } catch (PrintException e) { return Response.status(404).entity("{\"error\":\"" + "Could Not Find Barcode Printer" + "\"}").build(); } } protected void printIt(Labels labels) throws PrintException { System.out.println("******** Entering printIt ***********************"); PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet(); pras.add(new Copies(1)); DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE; Doc doc = new SimpleDoc(labels.getLabels().getBytes(), flavor, null); PrintService printService = BarCodeUtilities.getBarCodePrinter(); if (printService == null) { return; } DocPrintJob job = printService.createPrintJob(); PrintJobWatcher pjw = new PrintJobWatcher(job); job.print(doc, pras); System.out.println("******************Before pjw.waitForDone"); pjw.waitForDone(); System.out.println("******************After pjw.waitForDone"); } }
96e9b898e718aef02b9eef53f3153a4791b8ea4d
7005851126f6a30ae637f28d0aa9b3ef639556cd
/core/tags/1.1/service/src/main/java/org/extensiblecatalog/ncip/v2/service/AuthenticationDataFormatType.java
be6b9c1ae24ed05c121ddbb0b2b747df5e9830f4
[ "MIT" ]
permissive
eXtensibleCatalog/NCIP2-Toolkit
c1c0f482e7fa34c3ac5dd8e2842ea0c0db6764a7
3e2603c2010dd2bcbdbe104eb46d64c38c539dc6
refs/heads/master
2022-09-19T23:43:55.650756
2017-02-20T08:39:02
2017-02-20T08:39:02
44,343,498
0
3
null
2022-08-25T20:20:18
2015-10-15T20:25:44
Java
UTF-8
Java
false
false
1,612
java
/** * Copyright (c) 2010 eXtensible Catalog Organization * * This program is free software; you can redistribute it and/or modify it * under the terms of the MIT/X11 license. The text of the license can be * found at http://www.opensource.org/licenses/mit-license.php. */ package org.extensiblecatalog.ncip.v2.service; import org.apache.commons.lang.builder.ReflectionToStringBuilder; import java.util.concurrent.CopyOnWriteArrayList; import org.apache.log4j.Logger; import java.util.List; /** * Identifies the type of AuthenticationDataFormatType. */ public class AuthenticationDataFormatType extends SchemeValuePair { private static final Logger LOG = Logger.getLogger(AuthenticationDataFormatType.class); private static final List<AuthenticationDataFormatType> VALUES_LIST = new CopyOnWriteArrayList<AuthenticationDataFormatType>(); public AuthenticationDataFormatType(String scheme, String value) { super(scheme, value); VALUES_LIST.add(this); } /** * Find the AuthenticationDataFormatType that matches the scheme & value strings supplied. * * @param scheme a String representing the Scheme URI. * @param value a String representing the Value in the Scheme. * @return an AuthenticationDataFormatType that matches, or null if none is found to match. */ public static AuthenticationDataFormatType find(String scheme, String value) throws ServiceException { return (AuthenticationDataFormatType)find(scheme, value, VALUES_LIST, AuthenticationDataFormatType.class); } }
98643c8bd76c2f92e0f3726cabf0adca20cba854
73a0de585c5a89d07d2293fc4bf4efe779f5221d
/src/com/appspot/diabeteselsewhere/activity/ActivitiesPagerActivity.java
acf2e0109b763545124932ffec7dc45186ab6074
[]
no_license
ztao/d-e
27a618391d850ca05bf32f6a332ae769d64e2d30
dd7d90ca019f0a213b42ba656089142ef6a164db
refs/heads/master
2016-09-05T19:01:35.796842
2013-08-17T11:52:38
2013-08-17T11:52:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,634
java
package com.appspot.diabeteselsewhere.activity; import com.appspot.diabeteselsewhere.R; import com.appspot.diabeteselsewhere.adapter.ActivitiesPagerAdapter; import com.appspot.diabeteselsewhere.helper.DEJsonParser; import com.appspot.diabeteselsewhere.helper.DepthPageTransformer; import com.appspot.diabeteselsewhere.model.EventModel; import com.appspot.diabeteselsewhere.sub_fragment.CurrentActivityFragment; import android.app.ActionBar; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.support.v4.view.ViewPager; import android.util.Log; import android.view.Menu; import android.view.MenuItem; public class ActivitiesPagerActivity extends FragmentActivity implements CurrentActivityFragment.OnTipsUpdatedListener { private static final String SETTINGS = "my_setting"; private static final String SUBSCRIBED_EVENT_NUMBER = "the number of subscribed event"; private static final String USER_DATA = "data of the user"; private static final String CURRENT_EVENT = "current event subscribed"; private static final int CHANGE_YEAH = 1; private static final int CHANGE_NOPE = 0; private int NUM_ITEMS; private int current_item; private final String ACTIVITY_AMOUNT = "Activity Amount"; private final String ACTIVITY_POSITION = "Activity Position"; ActivitiesPagerAdapter mAdapter; ViewPager mPager; private String dtag = "ActivitiesPagerActivity"; private SharedPreferences mPrefs; private EventModel mEvent; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_activities_pager); // get the activity number of the event and set adapter Bundle b = getIntent().getExtras(); current_item = b.getInt(ACTIVITY_POSITION); mPrefs = getSharedPreferences(USER_DATA, 0); mEvent = DEJsonParser.eventParser(mPrefs.getString(CURRENT_EVENT, "")); NUM_ITEMS = mEvent.activityList.size(); mAdapter = new ActivitiesPagerAdapter(getSupportFragmentManager(), NUM_ITEMS, current_item); mPager = (ViewPager) findViewById(R.id.pager); mPager.setAdapter(mAdapter); // animation mPager.setPageTransformer(true, new DepthPageTransformer()); mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { invalidateOptionsMenu(); } }); mPager.setCurrentItem(current_item); // Watch for button clicks. final ActionBar actionBar = getActionBar(); // Specify that the Home button should show an "Up" caret, indicating that touching the // button will take the user one step up in the application's hierarchy. actionBar.setDisplayHomeAsUpEnabled(true); } @Override public void onResume() { super.onResume(); Bundle b = getIntent().getExtras(); current_item = b.getInt(ACTIVITY_POSITION); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.activity_screen_slide, menu); menu.findItem(R.id.action_previous).setEnabled(mPager.getCurrentItem() > 0); // Add either a "next" or "finish" button to the action bar, depending on which page // is currently selected. MenuItem item = menu.add(Menu.NONE, R.id.action_next, Menu.NONE, (mPager.getCurrentItem() == mAdapter.getCount() - 1) ? R.string.action_finish : R.string.action_next); item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: NavUtils.navigateUpTo(this, new Intent(this, NavigationActivity.class)); return true; case R.id.action_previous: // Go to the previous step in the wizard. If there is no previous step, // setCurrentItem will do nothing. mPager.setCurrentItem(mPager.getCurrentItem() - 1); return true; case R.id.action_next: // Advance to the next step in the wizard. If there is no next step, setCurrentItem // will do nothing. mPager.setCurrentItem(mPager.getCurrentItem() + 1); return true; } return super.onOptionsItemSelected(item); } @Override public void updateCurrentItem(String newTips, int activityId) { mEvent.activityList.get(activityId).tips = newTips; mPager.setCurrentItem(activityId); } // @Override // protected void onActivityResult(int requestCode, int resultCode, Intent data) { // mPager.setCurrentItem(data.getIntExtra(ACTIVITY_POSITION, 0)); // } }
cdcbf1711c4b548013483b9f264675a326c91e1b
34eddc63b31ae265fad20980c8391ba533ccc1c5
/generateorder-rabbit/src/main/java/com/lip/training/Order.java
a9d15670febdb77015ba7affba4e5046c05b30e4
[]
no_license
LipCao/spring-cloud-training
2c43a5d809a30501068650e35213c2399b201f98
25f8cc1e20bb7232853cd6fc0849b384c263b367
refs/heads/master
2023-03-25T06:37:35.954497
2021-03-19T03:52:08
2021-03-19T03:52:08
332,481,585
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package com.lip.training; import lombok.Data; import java.math.BigDecimal; /** * ***************************************************************************************** * * @ClassName Order * @Author: cjc * @Descripeion TODO * @Date: 2/7/21 00:08 * @Version 1.0 * <p> * <p> * Version Date ModifiedBy Content * -------- --------- ---------- ----------------------- * 1.0.0 00:082/7/21 cjc 初版 * ****************************************************************************************** */ @Data public class Order { private String orderNo; private BigDecimal amount; private int state = 0; private String remark; }
6e2fd722612ade41edbc08e8d53a3d0a9c4ef8f0
70fb9f95f1902ae247fcfc7062427e942bd395d9
/app/src/main/java/com/example/dummyapplication/ResponseModel/Client.java
fc40f7b9d0d5151a82c12476329fb4834092601c
[]
no_license
RakeshSingh12/Demo_PayPal
a86f6f5df4fb52a20505ed721925e9ec6f006b24
2ff8ad816b13c14dc659637ed83c5644f242a2ce
refs/heads/master
2023-01-03T01:11:07.162652
2020-10-14T21:10:48
2020-10-14T21:10:48
304,134,763
1
0
null
null
null
null
UTF-8
Java
false
false
1,250
java
package com.example.dummyapplication.ResponseModel; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.io.Serializable; public class Client implements Serializable { @SerializedName("environment") @Expose private String environment; @SerializedName("paypal_sdk_version") @Expose private String paypalSdkVersion; @SerializedName("platform") @Expose private String platform; @SerializedName("product_name") @Expose private String productName; public String getEnvironment() { return environment; } public void setEnvironment(String environment) { this.environment = environment; } public String getPaypalSdkVersion() { return paypalSdkVersion; } public void setPaypalSdkVersion(String paypalSdkVersion) { this.paypalSdkVersion = paypalSdkVersion; } public String getPlatform() { return platform; } public void setPlatform(String platform) { this.platform = platform; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } }
4e230bbd53158d9afed54e4f3ad89a8ef96cc0b1
5527d701841fab2434b6fda32b85e1d75ffb60c2
/app/src/main/java/com/example/ruru/sophiesblog/java/threaddemo/readWriteLock/GoodsService.java
55a46a59b7c49a9130a998856ffffad7688acad9
[]
no_license
2211785113/AndroidBlog
621f6ffce71f5ac45592ad0eec51d02ac05b0535
de8053455ff6808405aeb3dd7a4b0659caa18006
refs/heads/master
2021-06-20T15:37:07.314800
2021-05-09T13:20:34
2021-05-09T13:20:34
213,535,055
6
2
null
2021-01-06T14:08:37
2019-10-08T02:51:37
Java
UTF-8
Java
false
false
335
java
package com.example.ruru.sophiesblog.java.threaddemo.readWriteLock; /** * 抽象出了: * UseReadWriteLock & UseSynchronized * 两个类里边的操作:getNum & setNum。 */ public interface GoodsService { GoodsInfoBean getNum();//获得商品的信息 void setNum(int number);//设置商品的数量 }
372bb93298e7253fd13310186a82b7b49a42227c
4f84ba6ca99684bae6a211f85b673b302021875c
/src/de/fhb/polyencoder/geo/GeographicCoordinate.java
37e2a055e4625356e37610c3e3334123f49988ab
[]
no_license
petpen/JavaPolylineEncoder2
7ee1ef3f19e9dec0d978db5bb8711fbfd77e51e1
d4d1ec42a1eb659fb0a454bc1b8fe23cd73d05eb
refs/heads/master
2021-01-01T18:12:16.930531
2012-01-11T16:24:08
2012-01-11T16:24:08
2,805,549
0
0
null
null
null
null
UTF-8
Java
false
false
1,766
java
package de.fhb.polyencoder.geo; /** * * @author Peter Pensold * @version 1 */ public enum GeographicCoordinate { LATITUDE, LONGITUDE, ALTITUDE; public static boolean isValidLatitude(double value) { return (-90d <= value && value <= 90d); } public static boolean isInvalidLatitude(double value) { return !isValidLatitude(value); } public static boolean isValidLongitude(double value) { return (-180d < value && value <= 180d); } public static boolean isInvalidLongitude(double value) { return !isValidLongitude(value); } /** * Swaps a geographic coordinate from double to integer. As defined by the * geographic coordinate system the latitude (-90 <= lat <= 90) and the * longitude (-180 < lng <= 180) have ranges as described in the braces. After * swapping the value will be multiplied by 1e5 (100000) and floored to match * into an integer. * * @param value * @param coordinate * * @throws CoordinateOutOfRangeException * * @return */ public static int toInt(double value, GeographicCoordinate coordinate) throws CoordinateOutOfRangeException { switch (coordinate) { case LATITUDE: if (isInvalidLatitude(value)) throw new CoordinateOutOfRangeException("The latitude must be in a range of -90 <= lat <= 90."); break; case LONGITUDE: if (isInvalidLongitude(value)) throw new CoordinateOutOfRangeException("The longitude must be in a range of -180 < lng <= 180."); double smallestLongitudeForFlooring = -179.999990; if(value < smallestLongitudeForFlooring) value = smallestLongitudeForFlooring; break; } return (int) Math.floor(value*1e5); } }
0107abdb5d5cfa612d7a3f71706675b2d6f3c76c
bbd7af7ba6febbe3e1d16b2dabd63b0b76455218
/JAVA/Sorting/src/com/ustglobal/sorting/set/Test6.java
5a9107e8124f2259cdd8b66ed5c3a5d707eb6896
[]
no_license
ManeeshaVangimalla/USTGlobal-16Sep19-Maneesha1998
b0df9b4f66f9f9044f78be2e9cc84bc9be68eb62
8e7a466bf919310e557a13a769f44ff3eb062807
refs/heads/master
2023-01-13T13:57:18.160214
2019-12-21T13:34:53
2019-12-21T13:34:53
215,543,059
0
0
null
2023-01-07T13:04:36
2019-10-16T12:29:37
Java
UTF-8
Java
false
false
609
java
package com.ustglobal.sorting.set; import java.util.Iterator; import java.util.TreeSet; public class Test6 { public static void main(String[] args) { TreeSet<String> ts=new TreeSet<String>(); ts.add("roopa"); ts.add("jaya"); ts.add("sushma"); ts.add("munni"); ts.add("sheela"); System.out.println("***using for each***"); for(Object o:ts) { System.out.println(o); } System.out.println("***using iterator"); Iterator it=ts.iterator(); while(it.hasNext()) { Object s=it.next(); System.out.println(s); } } }
8c3f3272fac4e6f4710241d257a71918e389bc8b
07909ef1436128ba1fd244b03bd643bae0be476e
/src/CF_71A.java
5bc8c6cd1d0eccd2e0b6297c7a9fb3b8434bfed6
[]
no_license
arif334/Contest
4cda0edbbcef9483225007743827c40888d869d3
e7047d6b57205753cc7fb793bf1b75039f8be24e
refs/heads/master
2020-05-21T17:47:54.251403
2017-06-30T06:23:20
2017-06-30T06:23:20
64,211,259
0
0
null
null
null
null
UTF-8
Java
false
false
2,071
java
import java.io.*; import java.util.*; public class CF_71A{ /* START OF IO ROUTINE */ //-----------PrintWriter for faster output--------------------------------- public static PrintWriter out; //-----------MyInputReader class for faster input---------- public static class MyInputReader { BufferedReader br; StringTokenizer st; public MyInputReader(InputStream stream) { br = new BufferedReader(new InputStreamReader(stream), 32768); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine(){ String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } // end of class MyInputReader /* END OF IO ROUTINE */ public static void main(String[] args) { MyInputReader in = new MyInputReader(System.in); out = new PrintWriter(new BufferedOutputStream(System.out)); int n = in.nextInt(); while(n-- > 0) { String s = in.nextLine(); int len = s.length(); if(len > 10) { String ans = s.charAt(0) + Integer.toString(len-2) + s.charAt(len-1); out.println(ans); } else { out.println(s); } } out.close(); } // end of method main() } // end of class Main
75b3aaf71fcfd19124d745d1c461d2b85d416248
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.browser-base/sources/defpackage/St1.java
4fa017bbbb5657a3fb956fef9a0b296caede4477
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
1,748
java
package defpackage; import android.view.View; /* renamed from: St1 reason: default package */ /* compiled from: chromium-OculusBrowser.apk-stable-281887347 */ public class St1 { /* renamed from: a reason: collision with root package name */ public final Rt1 f8923a; public Qt1 b = new Qt1(); public St1(Rt1 rt1) { this.f8923a = rt1; } public View a(int i, int i2, int i3, int i4) { int d = this.f8923a.d(); int a2 = this.f8923a.a(); int i5 = i2 > i ? 1 : -1; View view = null; while (i != i2) { View c = this.f8923a.c(i); int b2 = this.f8923a.b(c); int e = this.f8923a.e(c); Qt1 qt1 = this.b; qt1.b = d; qt1.c = a2; qt1.d = b2; qt1.e = e; if (i3 != 0) { qt1.f8791a = 0; qt1.f8791a = i3 | 0; if (qt1.a()) { return c; } } if (i4 != 0) { Qt1 qt12 = this.b; qt12.f8791a = 0; qt12.f8791a = i4 | 0; if (qt12.a()) { view = c; } } i += i5; } return view; } public boolean b(View view, int i) { Qt1 qt1 = this.b; int d = this.f8923a.d(); int a2 = this.f8923a.a(); int b2 = this.f8923a.b(view); int e = this.f8923a.e(view); qt1.b = d; qt1.c = a2; qt1.d = b2; qt1.e = e; if (i == 0) { return false; } Qt1 qt12 = this.b; qt12.f8791a = 0; qt12.f8791a = 0 | i; return qt12.a(); } }
01b09bbdea9e5bf8b94cfd8b333c175a0d1461a0
3a4918250a0841ad484e38165db8b2bad158a036
/src/main/java/Launcher.java
e18a8cd7f34483f222587d4f1be28fe2609af7d9
[]
no_license
Mikeh627/OOPproject
b7b6bdeff09afd875424c1d5f52d83e8b5a28d81
34d853761fe5e824a521bb5c374077a90b63148f
refs/heads/master
2023-01-20T22:49:45.405269
2020-12-03T18:15:02
2020-12-03T18:15:02
306,998,979
0
0
null
null
null
null
UTF-8
Java
false
false
105
java
public class Launcher { public static void main(String[] args) { Main.main(args); } }
262a6a744669973bca1dcd82237772209cba200d
552d0404c13f90a61d4852d20a93eda6835b4816
/Minehut-Native/src/main/java/hundeklemmen/minehut/api/handlers/SpigotConfig.java
e9b53929b11e11fe4c005367018541d90ce209a9
[ "Apache-2.0" ]
permissive
eilon40/Drupi-JS
785538468d6b0fedb69fbcbbc0cce3444ce2cd42
01ff0b35bd41de58c948da18204d654261cf647a
refs/heads/master
2020-07-01T09:20:17.767748
2019-08-21T21:36:09
2019-08-21T21:36:09
201,125,133
0
0
Apache-2.0
2019-08-07T20:43:23
2019-08-07T20:43:22
null
UTF-8
Java
false
false
401
java
package hundeklemmen.minehut.api.handlers; import hundeklemmen.minehut.MainPlugin; import org.bukkit.configuration.file.FileConfiguration; public class SpigotConfig extends hundeklemmen.shared.api.config { public FileConfiguration config; public SpigotConfig(MainPlugin instance) { super(true, true); this.VC_checkOnLoad = false; this.VC_notifyOP = false; } }
55ef4ea5f7563efc1daaae20a8dd12d970a52ea2
1c5a123b8c9191d1527ec568b11565fae3e08bf6
/taotao-common/src/main/java/com/xull/common/pojo/EasyUIResult.java
cdd2c07d94ba5c3cdf1b37716ed9ac3f24779dc6
[]
no_license
longctw/taotao
e75cb07f67b5296d12847b4c921742213f120aa1
4356804304d284e42a9cd6924e533c80253f6e50
refs/heads/master
2020-03-19T17:41:21.372956
2018-06-10T04:03:27
2018-06-10T04:03:27
136,730,536
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.xull.common.pojo; import java.io.Serializable; import java.util.List; public class EasyUIResult implements Serializable{ private Integer total; private List<?> rows; public EasyUIResult(Integer total, List<?> rows) { this.total = total; this.rows = rows; } public EasyUIResult(Long total, List<?> rows) { this.total = total.intValue(); this.rows = rows; } public Integer getTotal() { return total; } public void setTotal(Integer total) { this.total = total; } public List<?> getRows() { return rows; } public void setRows(List<?> rows) { this.rows = rows; } }
cc309b38314b3a295ee5b96906cd74172c4ffa03
5f94db8741fecbbbbe7add9ffd7fa9cb37655737
/dashboard/src/main/java/com/google/cloud/tools/opensource/cloudbomdashboard/DashboardArguments.java
4499a505c43b66022f8906b2197b5c0a07438cc8
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/java-cloud-bom
74fb7f4d94265c6dfff4f15ef1e6b4775a0c0ca1
119c5e201d9d3071027a20cd6801a6e3215fa298
refs/heads/main
2023-09-06T07:45:06.883195
2023-08-09T18:31:57
2023-08-09T18:31:57
203,461,770
31
28
Apache-2.0
2023-09-14T21:27:38
2019-08-20T22:10:10
Java
UTF-8
Java
false
false
5,272
java
/* * Copyright 2019 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.tools.opensource.cloudbomdashboard; import java.nio.file.Path; import java.nio.file.Paths; import javax.annotation.Nullable; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionGroup; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; /** * Command-line option for {@link DashboardMain}. The tool takes either a pom.xml file path or Maven * coordinates for a BOM. */ final class DashboardArguments { private static final Options options = configureOptions(); private static final HelpFormatter helpFormatter = new HelpFormatter(); private final CommandLine commandLine; private DashboardArguments(CommandLine commandLine) { this.commandLine = commandLine; } /** * Returns true if the argument for a file is specified. False if the argument for coordinates is * specified. * * <p>It is guaranteed that either a file path or Maven coordinates for a BOM are available. */ boolean hasFile() { return commandLine.hasOption('f'); } /** * Returns true if the argument for a versionless coordinates is specified; otherwise false. * * <p>It is guaranteed that either a file path or Maven coordinates for a BOM are available. */ boolean hasVersionlessCoordinates() { return commandLine.hasOption('a'); } /** Returns an absolute path to pom.xml file of a BOM. Null if file is not specified. */ @Nullable Path getBomFile() { if (!commandLine.hasOption('f')) { return null; } // Trim the value so that maven exec plugin can pass arguments with exec.arguments="-f pom.xml" return Paths.get(commandLine.getOptionValue('f').trim()).toAbsolutePath(); } /** Returns the Maven coordinates of a BOM. Null if coordinates are not specified. */ @Nullable String getBomCoordinates() { if (!commandLine.hasOption('c')) { return null; } return commandLine.getOptionValue('c').trim(); } /** * Returns the versionless Maven coordinates of a BOM. Null if versionless coordinates are not * specified. */ @Nullable String getVersionlessCoordinates() { if (!commandLine.hasOption('a')) { return null; } return commandLine.getOptionValue('a').trim(); } boolean getReport() { return commandLine.hasOption('r'); } Path getOutputFile() { if (!commandLine.hasOption('o')) { return null; } return Paths.get(commandLine.getOptionValue('o').trim()).toAbsolutePath(); } static DashboardArguments readCommandLine(String... arguments) throws ParseException { CommandLineParser parser = new DefaultParser(); try { // Throws ParseException if required option group ('-f' or '-c') is not specified return new DashboardArguments(parser.parse(options, arguments)); } catch (ParseException ex) { helpFormatter.printHelp("DashboardMain", options); throw ex; } } private static Options configureOptions() { Options options = new Options(); OptionGroup inputGroup = new OptionGroup(); inputGroup.setRequired(true); Option inputFileOption = Option.builder("f").longOpt("bom-file").hasArg().desc("File to a BOM (pom.xml)").build(); inputGroup.addOption(inputFileOption); Option inputCoordinatesOption = Option.builder("c") .longOpt("bom-coordinates") .hasArg() .desc("Maven coordinates of a BOM. For example, com.google.cloud:libraries-bom:1.0.0") .build(); inputGroup.addOption(inputCoordinatesOption); Option versionlessCoordinatesOption = Option.builder("a") .longOpt("all-versions") .hasArg() .desc( "Maven coordinates of a BOM without version. " + "For example, com.google.cloud:libraries-bom") .build(); inputGroup.addOption(versionlessCoordinatesOption); options.addOptionGroup(inputGroup); Option reportOption = Option.builder("r") .longOpt("report") .hasArg(false) .desc("Whether to print the report or build the dashboard") .build(); options.addOption(reportOption); Option outputOption = Option.builder("o") .longOpt("output-file") .hasArg() .desc("Whether to print the report to a file or display on console") .build(); options.addOption(outputOption); return options; } }
e334426197fac7ffe7a35b124def0f593ca26348
331445390a8a8ea480ecb2fa2362adcd80b7ef2a
/C001/src/main/java/de/tubs/prog2/ex/nfa/student/Word.java
9437ff85d77e7217747c86586fa1f790beddd429
[]
no_license
sbtree/HaJava
d0de13c04441355dbebefdf672b08ff465e4a205
b6db11ac8300fd31aba108161a68cbdbd2d5a11b
refs/heads/master
2022-12-03T18:52:15.965907
2020-08-14T16:42:15
2020-08-14T16:42:15
287,576,296
0
0
null
null
null
null
UTF-8
Java
false
false
2,107
java
package de.tubs.prog2.ex.nfa.student; public final class Word { // TODO: you may want to add a PRIVATE constructor that is called by the other constructors, but you don't need to /** * Constructs a new word as the concatenation of the specified symbols. * * @param symbols the symbols that shall constitute this word */ public Word(Symbol... symbols) { // TODO: implement } /** * Constructs a new word based on an array of integers. * <p> * Each integer represents a symbol of the word. * * @param symbols the IDs of the symbols */ public Word(int... symbols) { // TODO: implement } /** * Constructs a new word based on the specified string. * <p> * Each character in the string is converted to a symbol in the word. * * @param word a string representation of the word */ public Word(String word) { // TODO: implement } /** * Checks if this word is empty. * * @return true iff this word is empty */ public boolean isEmpty() { // TODO: implement return false; } /** * Returns the head symbol of this word. * <p> * If the word is empty, the behavior of this method is undefined. * * @return the head symbol of this word * @see #isEmpty() * @see #tail() */ public Symbol head() { // TODO: implement return null; } /** * Returns the remaining word after skipping the head symbol. * <p> * If the word is already empty, the tail is also empty. * * @return the suffix after skipping the head * @see #head() */ public Word tail() { // TODO: implement return null; } @Override public boolean equals(Object other) { // TODO: implement - a word is equal to another iff the sequence of symbols is equal return false; } @Override public int hashCode() { // TODO: implement - equal words shall have the same hash code return 0; } }
5fec7c225c886ce09b266a0e0f8da0d11b324908
4359aaa28cacceb42f76437509e2325cd118d8ed
/Presidentti-peli/src/main/java/presidenttipeli/logiikka/Peli.java
6ed42e3834160d0fc25ba53320ad6085c6f887f2
[]
no_license
eerojala/Presidentti-peli
b8a13028e4dd2c95b860f4d9618e0e2c015c8c3d
516d6ef55cbf07783e7608bc35808531cab6d200
refs/heads/master
2021-01-01T19:28:10.517602
2015-05-03T20:56:26
2015-05-03T20:56:26
31,963,379
0
0
null
null
null
null
UTF-8
Java
false
false
10,537
java
package presidenttipeli.logiikka; import java.util.Collections; import java.util.Random; import presidenttipeli.domain.Pelaaja; import presidenttipeli.domain.Pelilauta; import presidenttipeli.domain.Ruutu; import presidenttipeli.domain.tapahtumat.Tapahtuma; import presidenttipeli.gui.PeliGUI; import presidenttipeli.logiikka.luojat.TapahtumienLuoja; /** * Pelin päälogiikkaluokka joka pitää muistissa tämänhetkistä pelaajaa sekä * huolehtii ruutujen tapahtumien suorittamisesta. */ public class Peli { private Pelilauta lauta; private TapahtumienLuoja tapahtumienluoja; private Liikuttelija liikuttelija; private Pankinjohtaja pankinjohtaja; private Kiinteistonvalittaja kiinteistonvalittaja; private Vaalienjarjestaja vaalienjarjestaja; private Putka putka; private Pelaaja nykyinenPelaaja; private Vuoronvaihtaja vuoronvaihtaja; private PeliGUI peligui; // haters will haters public Peli(Pelilauta lauta) { this.lauta = lauta; tapahtumienluoja = new TapahtumienLuoja(lauta); liikuttelija = new Liikuttelija(lauta, tapahtumienluoja); pankinjohtaja = new Pankinjohtaja(lauta); kiinteistonvalittaja = new Kiinteistonvalittaja(lauta, pankinjohtaja); vaalienjarjestaja = new Vaalienjarjestaja(lauta); putka = new Putka(tapahtumienluoja); arvoJarjestys(); nykyinenPelaaja = lauta.getNappulat().get(0).getOmistaja(); vuoronvaihtaja = new Vuoronvaihtaja(lauta); } private void arvoJarjestys() { Collections.shuffle(lauta.getNappulat()); } public Pelilauta getLauta() { return lauta; } public Pelaaja getNykyinenPelaaja() { return nykyinenPelaaja; } public TapahtumienLuoja getTapahtumienluoja() { return tapahtumienluoja; } public Pankinjohtaja getPankinjohtaja() { return pankinjohtaja; } public Kiinteistonvalittaja getKiinteistonvalittaja() { return kiinteistonvalittaja; } public Putka getPutka() { return putka; } public Liikuttelija getLiikuttelija() { return liikuttelija; } public Vaalienjarjestaja getVaalienjarjestaja() { return vaalienjarjestaja; } public void setNykyinenPelaaja(Pelaaja nykyinenPelaaja) { this.nykyinenPelaaja = nykyinenPelaaja; } public void setPeligui(PeliGUI peligui) { this.peligui = peligui; } public int heitaNoppaa() { Random random = new Random(); return random.nextInt(6) + 1; } /** * Suorittaa ruutuun liittyvät tapahtumat, tai jos kyseessä on erikoisruutu * käskee guita avaamaan niihin liittyvät GUIt. * * @return True jos ruudun tapahtumien suorittaminen onnistui, muuten false. */ public boolean suoritaRuudunTapahtumat() { Ruutu ruutu = nykyinenPelaaja.getNappula().getSijainti(); if (onkoErikoisruutu(ruutu)) { return suoritaErikoisruutu(); } else { if (ruutu.getNumero() == 19 && !onkoPinossaLiikkeita()) { peligui.liikkeitaEiOleEnaaJaljella(); return true; } naytaKortti(ruutu.getNumero()); return suoritaRuudunTapahtumat(ruutu); } } private boolean suoritaRuudunTapahtumat(Ruutu ruutu) { Ruutu vanha = nykyinenPelaaja.getNappula().getSijainti(); for (Tapahtuma tapahtuma : ruutu.getTapahtumat()) { if (tapahtuma.suoritaTapahtuma(nykyinenPelaaja) == false) { return false; } } Ruutu uusi = nykyinenPelaaja.getNappula().getSijainti(); return suoritaRuudunTapahtumat2(uusi, vanha); } private boolean suoritaRuudunTapahtumat2(Ruutu ruutu, Ruutu vanha) { if (ruutu.getNumero() == 22 || (ruutu.getNumero() == 12 && nykyinenPelaaja.isPuolueenJasen())) { peligui.naytaKortinSisalto(nykyinenPelaaja.getAmmatti().toString()); } if (nykyinenPelaaja.getNappula().getSijainti().getNumero() == 1) { pankinjohtaja.annaPelaajalleKuukaudenTuotot(nykyinenPelaaja); peligui.uusiKierros(); } if (!vanha.equals(nykyinenPelaaja.getNappula().getSijainti())) { peligui.naytaSelostus(); return suoritaRuudunTapahtumat(); } return true; } private boolean suoritaErikoisruutu() { Ruutu ruutu = nykyinenPelaaja.getNappula().getSijainti(); if (ruutu.isOstoJaMyyntiruutu()) { return suoritaOstoJaMyyntiruutu(ruutu); } else if (ruutu.isVaaliruutu()) { suoritaVaaliruutu(ruutu); } else if (ruutu.isPutkaruutu()) { suoritaPutkaruutu(); } return true; } private void suoritaVaaliruutu(Ruutu ruutu) { if (ruutu.getNumero() == 10 || ruutu.getNumero() == 25) { suoritaEduskuntavaaliruutu(ruutu); } else if (ruutu.getNumero() == 30) { suoritaPresidentinvaaliruutu(); } } private void suoritaEduskuntavaaliruutu(Ruutu ruutu) { if (nykyinenPelaaja.isKansanedustaja()) { peligui.pelaajaJoKansanedustaja(); } else { if (ruutu.getNumero() == 10) { Eduskuntavaalienhallinta hallinta = new Eduskuntavaalienhallinta(nykyinenPelaaja, vaalienjarjestaja, pankinjohtaja); peligui.avaaEduskuntavaalienHallintaGUI(hallinta); } else if (ruutu.getNumero() == 25) { if (nykyinenPelaaja.getAmmatti().getPalkka() > 4000 && nykyinenPelaaja.isPuolueenJasen()) { peligui.avaaRuutu25KyselyGUI(); } } } } private void suoritaPresidentinvaaliruutu() { Presidentinvaalienhallinta hallinta = new Presidentinvaalienhallinta(nykyinenPelaaja, vaalienjarjestaja, pankinjohtaja, kiinteistonvalittaja); if (hallinta.pystyykoPelaajaOsallistumaanVaaleihin() == false) { peligui.varallisuusEiRiitaVaaleihin(); } else { peligui.avaaPresidentinvaalienHallintaGUI(hallinta); } } private void naytaKortti(int ruudunNro) { String sisalto = ""; if ((ruudunNro == 12 && !nykyinenPelaaja.isPuolueenJasen()) || ruudunNro == 16 || ruudunNro == 28) { sisalto = lauta.getTapahtumakortit().peek().getSeloste(); } else if (ruudunNro == 7) { sisalto = lauta.getSattumaAmmatit().peek().toString(); } else if (ruudunNro == 19) { sisalto = lauta.getLiikkeet().peek().toString(); } else { return; } peligui.naytaKortinSisalto(sisalto); } /** * Tarkistaa onko kyseinen ruutu erikoisruutu * * @param ruutu Ruutu joka tarkastetaan * * @return True jos tarkasteltava ruutu on erikoisruutu, muuten false. */ public boolean onkoErikoisruutu(Ruutu ruutu) { return ruutu.isOstoJaMyyntiruutu() || ruutu.isPutkaruutu() || ruutu.isVaaliruutu(); } /** * Vaihtaa vuoroa, nykyinen pelaaja vaihtuu seuraavaan. */ public void vaihdaVuoroa() { nykyinenPelaaja = vuoronvaihtaja.vaihdaVuoroa(nykyinenPelaaja); } /** * Tiputtaa nykyisen pelaajan pelistä ja tarkistaa onko pelaajia enää * jäljellä. * * @return True jos pelaajia on vielä jäljellä, muuten false. */ public boolean tiputaPelaajaPelista() { lauta.getNappulat().remove(nykyinenPelaaja.getNappula()); return lauta.getNappulat().isEmpty(); } private boolean suoritaOstoJaMyyntiruutu(Ruutu ruutu) { OstoJaMyynti ostoJaMyynti; if (ruutu.getNumero() == 1) { ostoJaMyynti = luoUusiOstoJaMyynti(true, 1, false, false); peligui.avaaOstoJaMyyntiGUI(ostoJaMyynti); } else if (ruutu.getNumero() == 16) { return suoritaRuutu16(ruutu); } else if (ruutu.getNumero() == 20) { ostoJaMyynti = luoUusiOstoJaMyynti(false, 0.1, true, false); peligui.avaaOstoJaMyyntiGUI(ostoJaMyynti); } return true; } private boolean suoritaRuutu16(Ruutu ruutu) { OstoJaMyynti ostoJaMyynti; naytaKortti(ruutu.getNumero()); if (suoritaRuudunTapahtumat(ruutu) == false) { return false; } else if (nykyinenPelaaja.getNappula().getSijainti().getNumero() == 16) { // jos tulee tapahtumakortti joka siirtää pelaajan muualle niin // pelaaja ei voi enää ostaa tai myydä omistuskirjojaan int silmaluku = heitaNoppaa(); boolean tarjous = false; if (silmaluku == 6) { tarjous = true; } ostoJaMyynti = luoUusiOstoJaMyynti(true, 1, false, tarjous); peligui.avaaOstoJaMyyntiGUI(ostoJaMyynti); } return true; } private OstoJaMyynti luoUusiOstoJaMyynti(boolean saaMyyda, double kerroin, boolean ruutu20, boolean ruutu16Tarjous) { OstoJaMyynti ostojamyynti = new OstoJaMyynti(saaMyyda, kerroin, ruutu20, nykyinenPelaaja, kiinteistonvalittaja, lauta.getMokit().peek(), lauta.getLiikkeet().peek(), lauta, ruutu16Tarjous); return ostojamyynti; } /** * Tarkistaa onko laudan liikepinossa enää kortteja jäljellä. * * @return True jos laudan liikepinossa on vielä liikkeitä, muuten false. */ public boolean onkoPinossaLiikkeita() { return !lauta.getLiikkeet().isEmpty(); } private void suoritaPutkaruutu() { if (nykyinenPelaaja.getRahat() >= 4000) { peligui.avaaPutkakyselyGUI(); } else { peligui.pelaajaJoutuuPutkaan(); } } /** * Suorittaa ruudun tapahtumat. Tätä metodia kutsutaan jos pelaaja * epäonnistui suorittaa ruudun tapahtumat ensimmäisellä kerralla. Jos * pelaaja epäonnistuu jälleen tiputetaan hänet pelistä, ja mikäli hän oli * viimeinen pelaaja, lopetetaan ohjelman suoritus. */ public void yritaSuorittaaTapahtumaaToisenKerran() { naytaKortti(nykyinenPelaaja.getNappula().getSijainti().getNumero()); if (suoritaRuudunTapahtumat() == false) { peligui.pelaajaTippuuPelista(); if (tiputaPelaajaPelista() == true) { peligui.kaikkiHavisivat(); } } } }
c0456f552b808da9a980908ce38eaa83018dd526
072216667ef59e11cf4994220ea1594538db10a0
/googleplay/com/google/android/finsky/utils/Utils.java
4ba8b5ca54d01b0d7cb5e6e387171531bc25b1ea
[]
no_license
jackTang11/REMIUI
896037b74e90f64e6f7d8ddfda6f3731a8db6a74
48d65600a1b04931a510e1f036e58356af1531c0
refs/heads/master
2021-01-18T05:43:37.754113
2015-07-03T04:01:06
2015-07-03T04:01:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,380
java
package com.google.android.finsky.utils; import android.content.ComponentName; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.NetworkInfo.DetailedState; import android.net.Uri; import android.os.AsyncTask; import android.os.Build.VERSION; import android.os.Looper; import com.google.android.finsky.activities.DebugActivity; import com.google.android.finsky.config.G; import com.google.android.play.utils.PlayUtils; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; import java.util.regex.Pattern; public class Utils { private static Pattern COMMA_PATTERN; private static String[] EMPTY_ARRAY; static { COMMA_PATTERN = Pattern.compile(","); EMPTY_ARRAY = new String[0]; } public static void ensureOnMainThread() { if (Looper.myLooper() != Looper.getMainLooper()) { throw new IllegalStateException("This method must be called from the UI thread."); } } public static void ensureNotOnMainThread() { if (Looper.myLooper() == Looper.getMainLooper()) { throw new IllegalStateException("This method cannot be called from the UI thread."); } } public static <P> void executeMultiThreaded(AsyncTask<P, ?, ?> asyncTask, P... params) { if (VERSION.SDK_INT >= 11) { asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params); } else { asyncTask.execute(params); } } public static String getPreferenceKey(String key, String accountName) { return accountName + ":" + key; } public static boolean isBackgroundDataEnabled(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity"); if (VERSION.SDK_INT < 14) { return connectivityManager.getBackgroundDataSetting(); } for (NetworkInfo info : connectivityManager.getAllNetworkInfo()) { if (info != null && info.getDetailedState() == DetailedState.BLOCKED) { return false; } } return true; } public static String urlEncode(String decodedUrl) { try { return URLEncoder.encode(decodedUrl, "UTF-8"); } catch (UnsupportedEncodingException e) { FinskyLog.wtf("%s", e); throw new RuntimeException(e); } } public static String urlDecode(String encodedUrl) { try { return URLDecoder.decode(encodedUrl, "UTF-8"); } catch (IllegalArgumentException e) { FinskyLog.d("Unable to parse %s - %s", encodedUrl, e.getMessage()); return null; } catch (UnsupportedEncodingException e2) { FinskyLog.wtf("%s", e2); throw new RuntimeException(e2); } } public static void checkUrlIsSecure(String url) { checkUrlIsSecure(url, PlayUtils.isTestDevice()); } static void checkUrlIsSecure(String url, boolean isTestDevice) { Uri parsed = Uri.parse(url); if (!parsed.getScheme().equals("https")) { if (!isTestDevice || (!parsed.getHost().toLowerCase().endsWith("corp.google.com") && !parsed.getHost().startsWith("192.168.0") && !parsed.getHost().startsWith("127.0.0"))) { throw new RuntimeException("Insecure URL: " + url); } } } public static String commaPackStrings(String[] strings) { if (strings == null || strings.length == 0) { return ""; } if (strings.length == 1) { return strings[0]; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < strings.length; i++) { if (i != 0) { sb.append(','); } sb.append(strings[i]); } return sb.toString(); } public static String[] commaUnpackStrings(String stringsList) { if (stringsList == null || stringsList.length() == 0) { return EMPTY_ARRAY; } if (stringsList.indexOf(44) != -1) { return COMMA_PATTERN.split(stringsList); } return new String[]{stringsList}; } public static void syncDebugActivityStatus(Context context) { context.getPackageManager().setComponentEnabledSetting(new ComponentName(context, DebugActivity.class), ((Boolean) G.debugOptionsEnabled.get()).booleanValue() ? 1 : 2, 1); } public static byte[] readBytes(InputStream in) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { copy(in, out); byte[] toByteArray = out.toByteArray(); return toByteArray; } finally { out.close(); } } public static void copy(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[8192]; while (true) { try { int bytesRead = in.read(buffer); if (bytesRead == -1) { break; } out.write(buffer, 0, bytesRead); } finally { in.close(); } } } public static void safeClose(Closeable resource) { if (resource != null) { try { resource.close(); } catch (IOException e) { } } } public static boolean isEmptyOrSpaces(CharSequence text) { return text == null || text.length() == 0 || trim(text).length() == 0; } public static CharSequence trim(CharSequence text) { if (text == null) { return null; } int start = 0; int last = text.length() - 1; int end = last; while (start <= end && text.charAt(start) <= ' ') { start++; } while (end >= start && text.charAt(end) <= ' ') { end--; } return (start == 0 && end == last) ? text : text.subSequence(start, end + 1); } public static String getItalicSafeString(String source) { return source + " "; } }
f55146dcd2154fbe61d53bff859117aaec0664ca
1b307344a0dd5590e204529b7cc7557bed02d2b9
/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java
e4d121bedc91481ffa0a05917052289b3e1e9aa7
[ "LicenseRef-scancode-generic-cla", "LGPL-2.1-or-later", "BSD-3-Clause", "MIT", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "CC0-1.0" ]
permissive
alzimmermsft/azure-sdk-for-java
7e72a194e488dd441e44e1fd12c0d4c1cacb1726
9f5c9b2fd43c2f9f74c4f79d386ae00600dd1bf4
refs/heads/main
2023-09-01T00:13:48.628043
2023-03-27T09:00:31
2023-03-27T09:00:31
176,596,152
4
0
MIT
2023-03-08T18:13:24
2019-03-19T20:49:38
Java
UTF-8
Java
false
false
67,977
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.mobilenetwork.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mobilenetwork.fluent.DataNetworksClient; import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; import com.azure.resourcemanager.mobilenetwork.models.DataNetworkListResult; import com.azure.resourcemanager.mobilenetwork.models.TagsObject; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in DataNetworksClient. */ public final class DataNetworksClientImpl implements DataNetworksClient { /** The proxy service used to perform REST calls. */ private final DataNetworksService service; /** The service client containing this operation class. */ private final MobileNetworkManagementClientImpl client; /** * Initializes an instance of DataNetworksClientImpl. * * @param client the instance of the service client containing this operation class. */ DataNetworksClientImpl(MobileNetworkManagementClientImpl client) { this.service = RestProxy.create(DataNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** * The interface defining all the services for MobileNetworkManagementClientDataNetworks to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "MobileNetworkManagem") public interface DataNetworksService { @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<Flux<ByteBuffer>>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("mobileNetworkName") String mobileNetworkName, @PathParam("dataNetworkName") String dataNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<DataNetworkInner>> get( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("mobileNetworkName") String mobileNetworkName, @PathParam("dataNetworkName") String dataNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<Flux<ByteBuffer>>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("mobileNetworkName") String mobileNetworkName, @PathParam("dataNetworkName") String dataNetworkName, @BodyParam("application/json") DataNetworkInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<DataNetworkInner>> updateTags( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("mobileNetworkName") String mobileNetworkName, @PathParam("dataNetworkName") String dataNetworkName, @BodyParam("application/json") TagsObject parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + "/mobileNetworks/{mobileNetworkName}/dataNetworks") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<DataNetworkListResult>> listByMobileNetwork( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mobileNetworkName") String mobileNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<DataNetworkListResult>> listByMobileNetworkNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, accept, context); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux<PollResult<Void>, Void> beginDeleteAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName) { Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName); return this .client .<Void, Void>getLroResult( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux<PollResult<Void>, Void> beginDeleteAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { context = this.client.mergeContext(context); Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller<PollResult<Void>, Void> beginDelete( String resourceGroupName, String mobileNetworkName, String dataNetworkName) { return this.beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName).getSyncPoller(); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller<PollResult<Void>, Void> beginDelete( String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { return this.beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context).getSyncPoller(); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Void> deleteAsync(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { return beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Void> deleteAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { return beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { deleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName).block(); } /** * Deletes the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { deleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context).block(); } /** * Gets information about the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the specified data network along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<DataNetworkInner>> getWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets information about the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the specified data network along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<DataNetworkInner>> getWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, accept, context); } /** * Gets information about the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the specified data network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<DataNetworkInner> getAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName) { return getWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets information about the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the specified data network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response<DataNetworkInner> getWithResponse( String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { return getWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context).block(); } /** * Gets information about the specified data network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the specified data network. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataNetworkInner get(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { return getWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, Context.NONE).getValue(); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, parameters, accept, context); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of data network resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux<PollResult<DataNetworkInner>, DataNetworkInner> beginCreateOrUpdateAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { Mono<Response<Flux<ByteBuffer>>> mono = createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters); return this .client .<DataNetworkInner, DataNetworkInner>getLroResult( mono, this.client.getHttpPipeline(), DataNetworkInner.class, DataNetworkInner.class, this.client.getContext()); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of data network resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux<PollResult<DataNetworkInner>, DataNetworkInner> beginCreateOrUpdateAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters, Context context) { context = this.client.mergeContext(context); Mono<Response<Flux<ByteBuffer>>> mono = createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context); return this .client .<DataNetworkInner, DataNetworkInner>getLroResult( mono, this.client.getHttpPipeline(), DataNetworkInner.class, DataNetworkInner.class, context); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of data network resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller<PollResult<DataNetworkInner>, DataNetworkInner> beginCreateOrUpdate( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { return this .beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters) .getSyncPoller(); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of data network resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller<PollResult<DataNetworkInner>, DataNetworkInner> beginCreateOrUpdate( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters, Context context) { return this .beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context) .getSyncPoller(); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<DataNetworkInner> createOrUpdateAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<DataNetworkInner> createOrUpdateAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataNetworkInner createOrUpdate( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { return createOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters).block(); } /** * Creates or updates a data network. Must be created in the same location as its parent mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to the create or update data network operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataNetworkInner createOrUpdate( String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters, Context context) { return createOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context).block(); } /** * Updates data network tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to update data network tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<DataNetworkInner>> updateTagsWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .updateTags( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates data network tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to update data network tags. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<DataNetworkInner>> updateTagsWithResponseAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } if (dataNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .updateTags( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), mobileNetworkName, dataNetworkName, parameters, accept, context); } /** * Updates data network tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to update data network tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<DataNetworkInner> updateTagsAsync( String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) { return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Updates data network tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to update data network tags. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response<DataNetworkInner> updateTagsWithResponse( String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters, Context context) { return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context) .block(); } /** * Updates data network tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param dataNetworkName The name of the data network. * @param parameters Parameters supplied to update data network tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data network resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataNetworkInner updateTags( String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) { return updateTagsWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, Context.NONE) .getValue(); } /** * Lists all data networks in the mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<DataNetworkInner>> listByMobileNetworkSinglePageAsync( String resourceGroupName, String mobileNetworkName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .listByMobileNetwork( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, mobileNetworkName, accept, context)) .<PagedResponse<DataNetworkInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all data networks in the mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<DataNetworkInner>> listByMobileNetworkSinglePageAsync( String resourceGroupName, String mobileNetworkName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (mobileNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByMobileNetwork( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, mobileNetworkName, accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all data networks in the mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux<DataNetworkInner> listByMobileNetworkAsync(String resourceGroupName, String mobileNetworkName) { return new PagedFlux<>( () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName), nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink)); } /** * Lists all data networks in the mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux<DataNetworkInner> listByMobileNetworkAsync( String resourceGroupName, String mobileNetworkName, Context context) { return new PagedFlux<>( () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName, context), nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink, context)); } /** * Lists all data networks in the mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable<DataNetworkInner> listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName)); } /** * Lists all data networks in the mobile network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param mobileNetworkName The name of the mobile network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable<DataNetworkInner> listByMobileNetwork( String resourceGroupName, String mobileNetworkName, Context context) { return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName, context)); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items * <p>The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<DataNetworkInner>> listByMobileNetworkNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context)) .<PagedResponse<DataNetworkInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items * <p>The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for data network API service call along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<DataNetworkInner>> listByMobileNetworkNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } }
d691992d080fa0ae971037c4a40a3cd8d09dbf36
f3194f8176e93c73aa950cb06c8427bb95fee8d5
/src/Leet232.java
0ae2661cd45d2abfe2bee29746b594871f09ce25
[]
no_license
yd613/LeetCode
f2ae0de53750b230e9659177b0aa609b736c543b
3da552cc1489eeac817dce4e51c0e09985f042d4
refs/heads/main
2023-03-22T12:45:25.235121
2021-03-17T15:59:43
2021-03-17T15:59:43
342,323,498
0
0
null
null
null
null
UTF-8
Java
false
false
2,896
java
import java.util.HashSet; import java.util.Stack; /** * 232. 用栈实现队列 * 请你仅使用两个栈实现先入先出队列。队列应当支持一般队列的支持的所有操作(push、pop、peek、empty): * 实现 MyQueue 类: * void push(int x) 将元素 x 推到队列的末尾 * int pop() 从队列的开头移除并返回元素 * int peek() 返回队列开头的元素 * boolean empty() 如果队列为空,返回 true ;否则,返回 false * <p> * 说明: * 你只能使用标准的栈操作 —— 也就是只有 push to top, peek/pop from top, size, 和 is empty 操作是合法的。 * 你所使用的语言也许不支持栈。你可以使用 list 或者 deque(双端队列)来模拟一个栈,只要是标准的栈操作即可。 * <p> * 进阶: * 你能否实现每个操作均摊时间复杂度为 O(1) 的队列?换句话说,执行 n 个操作的总时间复杂度为 O(n) ,即使其中一个操作可能花费较长时间。 * <p> * 示例: * 输入: * ["MyQueue", "push", "push", "peek", "pop", "empty"] * [[], [1], [2], [], [], []] * 输出: * [null, null, null, 1, 1, false] * <p> * 解释: * MyQueue myQueue = new MyQueue(); * myQueue.push(1); // queue is: [1] * myQueue.push(2); // queue is: [1, 2] (leftmost is front of the queue) * myQueue.peek(); // return 1 * myQueue.pop(); // return 1, queue is [2] * myQueue.empty(); // return false * <p> * 提示: * 1 <= x <= 9 * 最多调用 100 次 push、pop、peek 和 empty * 假设所有操作都是有效的 (例如,一个空的队列不会调用 pop 或者 peek 操作) */ public class Leet232 { } class MyQueue { Stack<Integer> inStack, outStack; /** * Initialize your data structure here. */ public MyQueue() { inStack = new Stack<>(); outStack = new Stack<>(); } /** * Push element x to the back of queue. */ public void push(int x) { inStack.push(x); } /** * Removes the element from in front of queue and returns that element. */ public int pop() { if (outStack.isEmpty()) { inTransferOut(); } return outStack.pop(); } /** * Get the front element. */ public int peek() { if (outStack.isEmpty()) { inTransferOut(); } return outStack.peek(); } /** * Returns whether the queue is empty. */ public boolean empty() { return inStack.isEmpty() && outStack.isEmpty(); } private void inTransferOut() { while (!inStack.isEmpty()) { outStack.push(inStack.pop()); } } } /** * Your MyQueue object will be instantiated and called as such: * MyQueue obj = new MyQueue(); * obj.push(x); * int param_2 = obj.pop(); * int param_3 = obj.peek(); * boolean param_4 = obj.empty(); */
2d6d29d83ec233d7c31e95710efa0ef75f308818
41af5005d1039c0f8b875f695c618aaf1a541c9a
/app/src/main/java/weizhengzhou/top/dagger2fristdemo/Demo/Shop.java
fec8f5c9bd5ef7429422354669152900ca2d569d
[ "Apache-2.0" ]
permissive
weigg520/Dagger2FristDemo
2af78701d13056de2bbbf7af3240e0d0cc41a84d
404de621117803bf5349345c2733d79c4dbbe988
refs/heads/master
2021-01-21T21:32:34.869186
2017-06-21T03:24:00
2017-06-21T03:28:43
94,861,504
2
0
null
null
null
null
UTF-8
Java
false
false
228
java
package weizhengzhou.top.dagger2fristdemo.Demo; /** * Created by 75213 on 2017/6/20. * 构造器 */ public class Shop { public Shop(){ } @Override public String toString() { return "鞋子"; } }
03e64044dbc2e57b84f2a925c29c602a3868cafa
061e8e71e83899beb60374e956ca2bb4966aac17
/src/main/java/com/johns/dynamicdatasource/exception/GlobalExceptionHandler.java
5a96dcd6fcc322b2d37c641795bed6634310c8d4
[]
no_license
li-qishan/dynamic-datasource-core
b25fd579b7a4911dc9e7c56ed9c2640d4042fc01
101c5d347c443fb2bdfbaa7f9a60f553ed268a78
refs/heads/main
2023-05-31T14:59:25.211057
2021-07-03T07:46:27
2021-07-03T07:46:27
382,555,970
0
1
null
null
null
null
UTF-8
Java
false
false
2,070
java
package com.johns.dynamicdatasource.exception; import com.alibaba.fastjson.JSONObject; import com.johns.dynamicdatasource.constants.ExceptionConstants; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestControllerAdvice; import javax.servlet.http.HttpServletRequest; @Slf4j @RestControllerAdvice public class GlobalExceptionHandler { @ExceptionHandler(value = Exception.class) @ResponseBody public Object handleException(Exception e, HttpServletRequest request) { JSONObject status = new JSONObject(); // 针对业务参数异常的处理 if (e instanceof BusinessParamCheckingException) { status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ((BusinessParamCheckingException) e).getCode()); status.put(ExceptionConstants.GLOBAL_RETURNS_DATA, ((BusinessParamCheckingException) e).getData()); return status; } //针对业务运行时异常的处理 if (e instanceof BusinessRunTimeException) { status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ((BusinessRunTimeException) e).getCode()); status.put(ExceptionConstants.GLOBAL_RETURNS_DATA, ((BusinessRunTimeException) e).getData()); return status; } status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ExceptionConstants.SERVICE_SYSTEM_ERROR_CODE); status.put(ExceptionConstants.GLOBAL_RETURNS_DATA, ExceptionConstants.SERVICE_SYSTEM_ERROR_MSG); log.error("Global Exception Occured => url : {}, msg : {}", request.getRequestURL(), e.getMessage()); /** * create by: qiankunpingtai * create time: 2019/4/18 17:41 * 这里输出完整的堆栈信息,否则有些异常完全不知道哪里出错了。 */ log.error("Global Exception Occured => url : {}", request.getRequestURL(), e); e.printStackTrace(); return status; } }
febd87503839bf6c63e24e824958465b6faf6327
516dcf6e659c40f87dd705bb41bebd1517b83ecb
/src/java/Dao.java
2600552fff88151663d40396cebf47c64c67bbe3
[ "MIT" ]
permissive
BBloggsbott/RAKU
fa45f1cf08ea4b10390aedae06d82b3a3ee6f8b6
a5b599b82a8773a6659f76d79f5b2e945d42c28b
refs/heads/master
2020-03-10T12:01:52.420873
2018-04-14T19:06:59
2018-04-14T19:06:59
128,655,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Dao{ //User Login public boolean login(String username, String password){ boolean result = false; try{ Connection cn=DBUtil.getConnection(); PreparedStatement ps=cn.prepareStatement("SELECT * FROM USERS WHERE Username=? AND Password=?"); ps.setString(1, username); ps.setString(2, password); ResultSet rs=ps.executeQuery(); int i=0; while(rs.next()) { i+=1; } if(i!=0){ result=true; } } catch(SQLException e) { System.out.println(e.getMessage()); } return result; } //register User public boolean register(String username,String password,String emailID){ boolean result=false; int t=0; try { Connection cn=DBUtil.getConnection(); PreparedStatement ps=cn.prepareStatement("INSERT INTO USERS VALUES(?,?,?)"); ps.setString(1, username); ps.setString(2, password); ps.setString(3, emailID); t=ps.executeUpdate(); if(t>0) { result=true; } } catch(SQLException ex) { System.out.println(ex.getMessage()); } return result; } }
0ed7ec5cd3fbcac0b2ae528cf7150366c85b7420
403a4ca7213e23afa8456bb024d6ec1b2265baad
/src/controller/GameController.java
c402b90ecbd5a5460d921417a4a36f07757e25bd
[]
no_license
aj470/Chess
e882df730c333903c15f3d1e1c7990f62218efc2
74f4a7e0db307836dfb15b535e261bf3de7888c2
refs/heads/master
2021-08-18T21:24:05.665439
2017-11-23T22:45:33
2017-11-23T22:45:33
111,855,162
0
0
null
null
null
null
UTF-8
Java
false
false
7,947
java
/** * @author Anil Tilve * @author Ayush Joshi */ package controller; import java.awt.Color; import java.util.ArrayList; import model.Board; import model.Board.Square; import model.ChessCoordinates; import model.pieces.*; public class GameController { /** * Declaration of the variables. */ private Board board; public boolean isEndGame; private Color curPlayer; /** * Constructor to Initialize the variables. */ public GameController() { this.board = new Board(); this.isEndGame = false; this.curPlayer = Color.WHITE; } /** * Returns the Current Board. * * @return the current board */ public Board getBoard() { return this.board; } /** * Takes two coordinates, start and end from the user to move the piece. Also * takes the third token for the promotion. Do the checks for the coordinates * and perform the move. Alerts for the Check or final checkmate. * * @param start * : The start coordinate of the piece to be moved. * @param end * : The end coordinate for the piece to be moved at. * @param promotion * : If promotion applied by the user, the token for the piece to be * promoted to. */ public void attemptMove(ChessCoordinates start, ChessCoordinates end, Piece promotion) { if (start.equals(end)) { System.out.println("Illegal move, try again"); return; } Piece movingPiece = this.board.getSquare(start).getOccupier(), takenPiece = this.board.getSquare(end).getOccupier(); SpecialCases specialCases = new SpecialCases(); specialCases.isCapturing = takenPiece == null ? false : true; specialCases.isPromoting = promotion == null ? false : true; specialCases.pieceInPath = this.isPieceInPath(start, end); if (movingPiece == null || !movingPiece.getColor().equals(curPlayer) || takenPiece != null && takenPiece.getColor().equals(curPlayer)) System.out.println("Illegal move, try again"); else if (movingPiece.isValidMove(start, end, specialCases)) { int startRank = start.getRank(), startFile = start.getFile(), endRank = end.getRank(), endFile = end.getFile(); if (movingPiece instanceof Pawn && specialCases.canPromote) this.board.getSquare(endRank, endFile).setOccupier(promotion); else this.board.getSquare(endRank, endFile).setOccupier(movingPiece); this.board.getSquare(startRank, startFile).setOccupier(null); if (takenPiece instanceof King) { this.isEndGame = true; System.out.println("Checkmate"); } else if (kingIsInCheck()) System.out.println("Check"); switchCurPlayer(); } else { System.out.println("Illegal move, try again"); } } /** * Takes the starting and the ending coordinates for the move and Checks if * there is any other piece in the part for the move to be performed. * * @param start * : Starting coordinates from the user * @param end * : Ending coordinate of the move from the user. * @return : Returns the true if a piece is blocking the path of the current * player's piece. */ private boolean isPieceInPath(ChessCoordinates start, ChessCoordinates end) { int startRank = start.getRank(), startFile = start.getFile(), endRank = end.getRank(), endFile = end.getFile(); if (start.isVerticalTo(end)) { if (startRank < endRank) { for (int curRank = startRank + 1; curRank < endRank; curRank++) if (this.board.getSquare(curRank, startFile).isOccupied()) return true; } else { for (int curRank = startRank - 1; curRank > endRank; curRank--) if (this.board.getSquare(curRank, startFile).isOccupied()) return true; } } else if (start.isHorizontalTo(end)) { if (startFile < endFile) { for (int curFile = startFile + 1; curFile < endFile; curFile++) if (this.board.getSquare(startRank, curFile).isOccupied()) return true; } else { for (int curFile = start.getFile() - 1; curFile > endFile; curFile--) if (this.board.getSquare(startRank, curFile).isOccupied()) return true; } } else if (start.isDiagonalTo(end)) { if (start.isAdjacentTo(end)) return this.board.getSquare(endRank, endFile).isOccupied(); else { int fileChange = endFile > startFile ? 1 : -1, rankChange = endRank > startRank ? 1 : -1; for (int curRank = startRank + rankChange; curRank != endRank; curRank += rankChange) for (int curFile = startFile + fileChange; curFile != endFile; curFile += fileChange) if (this.board.getSquare(curRank, curFile).isOccupied()) return true; } } return false; } /** * Checks if a piece at a given rank and file is colliding with the king * * @param rank * : Starting coordinated from the user * @param file * : Ending coordinate of the move from the user. * @return : Returns the true if the piece is colliding with the king, false * otherwise. */ public boolean isPieceCollidingWithKing(int rank, int file) { Piece piece = this.board.getSquare(rank, file).getOccupier(); ChessCoordinates start = new ChessCoordinates(rank, file); ArrayList<ChessCoordinates> farthestMoves = piece.farthestMovesFrom(start); if (farthestMoves != null) for (int curMove = 0; curMove < farthestMoves.size(); curMove++) if (this.isKingFirstCollision(start, farthestMoves.get(curMove))) return true; return false; } /** * Checks if a king is in check by a piece * * @return : Returns the true if the king is in check, false otherwise. */ private boolean kingIsInCheck() { for (int curRank = 0; curRank < 8; curRank++) for (int curFile = 0; curFile < 8; curFile++) { Square curSquare = this.board.getSquare(curRank, curFile); if (curSquare.isOccupied() && curSquare.getOccupier().getColor().equals(curPlayer)) return isPieceCollidingWithKing(curRank, curFile); } return false; } /** * Checks if a king is the first collision for given coordinates * * @param start * : Starting coordinates * @param end * : Ending coordinates * @return : Returns the true if the king is the first collision, false otherwise. */ public boolean isKingFirstCollision(ChessCoordinates start, ChessCoordinates end) { int startRank = start.getRank(), startFile = start.getFile(), endRank = end.getRank(), endFile = end.getFile(); if (start.isVerticalTo(end)) { for (int curRank = startRank + 1; curRank < endRank; curRank++) { Square curSquare = this.board.getSquare(curRank, startFile); if (curSquare.isOccupied()) return curSquare.getOccupier() instanceof King; } } else if (start.isHorizontalTo(end)) { for (int curFile = startFile + 1; curFile < endFile; curFile++) { Square curSquare = this.board.getSquare(startRank, curFile); if (curSquare.isOccupied()) return curSquare.getOccupier() instanceof King; } } else if (start.isDiagonalTo(end)) { int rankChange = endRank > startRank ? 1 : -1, fileChange = endFile > startFile ? 1 : -1; for (int curRank = startRank + rankChange; curRank != endRank; curRank += rankChange) for (int curFile = startRank + rankChange; curFile != endFile; curFile += fileChange) { Square curSquare = this.board.getSquare(curRank, curFile); if (curSquare.isOccupied()) return curSquare.getOccupier() instanceof King; } } return false; } /** * Gets the current pklayer * @return the current player */ public Color getCurPlayer() { return this.curPlayer; } /** * Switches the players from white to black or black to white. */ public void switchCurPlayer() { this.curPlayer = this.curPlayer.equals(Color.WHITE) ? Color.BLACK : Color.WHITE; } }
71d4837bccd17abf1bb06e317e91f073320dcfdd
556b32f9deeb80dae41baa035c0719e6096aab27
/Consumer/src/com/inzpiral/consumer/models/Section.java
fea4f20d2c7871a62c99a40e979323c3168e40e2
[]
no_license
jplazcano87/android_library_tests
1de3b22123d7bc01dbfb575c1a61f63dc53599bc
c78d93c282e74725b59e2cc8344f24bbd02229d9
refs/heads/master
2021-01-22T14:28:56.020032
2014-01-07T15:56:25
2014-01-07T15:56:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,068
java
package com.inzpiral.consumer.models; import android.app.Activity; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.inzpiral.consumer.R; public class Section extends PresentationNode implements IDisplayable { transient protected Activity mActivity; transient protected View mParentView; transient protected int mParentId; @Override public void display(Activity activity, View parentView, int parentId) { mActivity = activity; mParentView = parentView; mParentId = parentId; System.out.println("MOSTRANDOME! Soy un 'Section' de nombre: " + getName()); SectionController controller = new SectionController(new SectionView()); } // @Override // public int countAnswers() { // int count = 0; // for (BaseNode baseNode : getChildren()) { // if(baseNode instanceof IAnwerable) { // count += ((IAnwerable) baseNode).countAnswers(); // } // } // return count; // } // // @Override // public int totalAnswers() { // int count = 0; // for (BaseNode baseNode : getChildren()) { // if(baseNode instanceof IAnwerable) { // count += ((IAnwerable) baseNode).totalAnswers(); // } // } // return count; // } private class SectionController { public SectionController(SectionView sectionView) { ((LinearLayout) mParentView.findViewById(mParentId)).addView(sectionView); sectionView.getSectionTitle().setText(getName()); for (BaseNode baseNode : getChildren()) { if(baseNode instanceof IDisplayable) { ((IDisplayable)baseNode).display(mActivity, sectionView, R.id.section_content); } } } } private class SectionView extends LinearLayout { public SectionView() { super(mActivity); LayoutInflater mInflater = LayoutInflater.from(mActivity); addView(mInflater.inflate(R.layout.module_section, null)); } public TextView getSectionTitle() { return (TextView)findViewById(R.id.textview_section_title); } } }
fc4a9c6fa5d0f84cd515a30b1abc0b2a394e2ee9
a286e688d57066d2c333db87d2b1391929addda6
/TratamentoErrosSolucao1/src/model/entities/Reservation.java
ce27d44b44460d4f113c2cfd6b63322f8143836e
[ "MIT" ]
permissive
CD-Laboratory/AcelerateJava
747de547a50505f7627b5f5b4e90b57ef90c58fc
725f68c73c7d9d0f2b9b2464f0f70b180b58e55a
refs/heads/main
2023-04-21T07:10:16.759355
2021-05-02T18:00:30
2021-05-02T18:00:30
337,855,793
0
0
MIT
2021-05-02T18:00:30
2021-02-10T21:14:37
Java
UTF-8
Java
false
false
1,193
java
package model.entities; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.TimeUnit; public class Reservation { private Integer roomNumber; private Date checkIn; private Date checkOut; private static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); public Reservation(Integer roomNumber, Date checkIn, Date checkOut) { this.roomNumber = roomNumber; this.checkIn = checkIn; this.checkOut = checkOut; } public Integer getRoomNumber() { return roomNumber; } public void setRoomNumber(Integer roomNumber) { this.roomNumber = roomNumber; } public Date getCheckIn() { return checkIn; } public Date getCheckOut() { return checkOut; } public long duration() { long diff = checkOut.getTime() - checkIn.getTime(); return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); } public void updateDates(Date checkIn, Date checkOut) { this.checkIn = checkIn; this.checkOut = checkOut; } @Override public String toString() { return "Room " + roomNumber + ", check-in: " + sdf.format(checkIn) + ", check-out: " + sdf.format(checkOut) + ", " + duration() + " nights"; } }
de56a2f784ee6a4b336c997087247d01dd4e55bb
9579911c5dc334a5f7babadc98cf3ba9d316220a
/src/test/Manager.java
d9300cf94fbf04c88dffae4d7c933be250417a69
[]
no_license
dinhanh2832/IO
92112493b6a1e21c2dee4481edbf03b268445a4d
75de8063e2dbf03c10200e0181fe8c65c843fb27
refs/heads/master
2023-08-21T09:25:06.158792
2021-10-25T14:25:48
2021-10-25T14:25:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
98
java
package test; public interface Manager<T> { void add(T t); void update(int index,T t); }
5edeeba59ba097168c86bf1bcd2a39ac3d152a01
fc93554f66f36691612c43c2cdc8ffbb50d27b81
/app/src/main/java/com/brandappz/alpcord/events/constants/AppConstants.java
d3e3dd39bfe7234bd6d7295743d0dc1a285952f1
[]
no_license
MEHAK17BANSAL/bb
871e7983e50ed1e1513c54429a5eeee1787c9fd5
a3b6b0ce198ca4d9c5659d5c83cc4748844eb5e7
refs/heads/master
2020-03-25T04:56:32.113864
2018-08-01T13:32:18
2018-08-01T13:32:18
143,421,369
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.brandappz.alpcord.events.constants; public class AppConstants { public static final String DATABASE_NAME = "DFHLEvenyDB"; public static final String DATA_SEPARATOR = "\\|"; public static final String IMAGE_FILEPATH = "photos/"; public static final String TWITTER_API_KEY = "tmdBapLaRq9iFA7DynVN35ffM"; public static final String TWITTER_API_SECRET = "lzedfNVvKwpfqIaptDIp650WkHL6S13Wc51ie2dQywCjafxzHi"; }
eafaeb0f0f8bc05866175190507dbf25e7626be5
5765c87fd41493dff2fde2a68f9dccc04c1ad2bd
/Variant Programs/1-4/35/memorialize/SymposiumSufferance.java
bafb9524a6ca2cde45c04985d08ff09a8c45dcb1
[ "MIT" ]
permissive
hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism
42e4c2061c3f8da0dfce760e168bb9715063645f
a42ced1d5a92963207e3565860cac0946312e1b3
refs/heads/master
2020-08-09T08:10:08.888384
2019-11-25T01:14:23
2019-11-25T01:14:23
214,041,532
0
0
null
null
null
null
UTF-8
Java
false
false
1,305
java
package memorialize; import disk.ArrangedRanking; public class SymposiumSufferance { public synchronized int indictment() { int higherChained = 208444887; return this.expositionPlaylist.consider(); } static String jesusExtent = "tvciVN3nR3wUGgAk"; public synchronized memorialize.VintnerGathering firstParade() { String significance = "lHbm9eZNKAje6"; return this.expositionPlaylist.installForemost(); } public static memorialize.SymposiumSufferance typicalCola; public synchronized void embedCarnival(memorialize.VintnerGathering radicalForum) { int souvenir = -1871893965; this.expositionPlaylist.infix(radicalForum); } public SymposiumSufferance() { this.expositionPlaylist = new disk.ArrangedRanking<VintnerGathering>(); typicalCola = this; } public synchronized String toString() { String ister = "NFtjB941g"; return this.expositionPlaylist.toString(); } public disk.ArrangedRanking<VintnerGathering> expositionPlaylist; public static synchronized memorialize.SymposiumSufferance prevailingWaiting() { int numberPieces = -1813770757; return typicalCola; } public synchronized memorialize.VintnerGathering overviewLast() { int asset = 2110285583; return this.expositionPlaylist.premierOppose(); } }
d75ea601f536c68638fb4c1ed3ae4630d35cfb05
7689a011e43e6c667ec24a8abb684a9939b94f09
/app/src/main/java/home/fragment/bean/ResultBeanData.java
326c14b61746c3a0e7fbbb7c8ff33cfeab847107
[]
no_license
Guosihan/Shopping
76da9a64991646bb998e470c503e8c889db0a573
f788a2510c7da5e2e3cb4c6c59e2ab35873a69a7
refs/heads/master
2021-09-08T01:19:32.765208
2018-03-05T02:34:22
2018-03-05T02:34:22
109,082,039
0
0
null
null
null
null
UTF-8
Java
false
false
22,785
java
package home.fragment.bean; import java.util.List; public class ResultBeanData { /** * code : 200 * msg : 请求成功 * result : {"act_info":[{"icon_url":"/operation/img/1478169868/1478761370286.png","name":"尚硅谷福利专区之111.1专区","url":"/oper/1478169868app.html"},{"icon_url":"/operation/img/1478763176/1478762941492.png","name":"尚硅谷福利专区 黄金狗粮限量11.1元抢","url":"/oper/1478763176app.html"}],"banner_info":[{"image":"/1478770583834.png","option":3,"type":0,"value":{"url":"/act20161111?cyc_app=1"}},{"image":"/1478770583835.png","option":2,"type":0,"value":{"url":"/act20161111?cyc_app=1"}},{"image":"/1478770583836.png","option":1,"type":0,"value":{"url":"/act20161111?cyc_app=1"}}],"channel_info":[{"channel_name":"服饰","image":"/app/img/menu-cyc.png","option":2,"type":1,"value":{"channel_id":"8"}},{"channel_name":"游戏","image":"/app/img/menu-game.png","option":2,"type":1,"value":{"channel_id":"4"}},{"channel_name":"动漫","image":"/app/img/menu-carttoon.png","option":2,"type":1,"value":{"channel_id":"3"}},{"channel_name":"装扮","image":"/app/img/menu-cosplay.png","option":2,"type":1,"value":{"channel_id":"5"}},{"channel_name":"古风","image":"/app/img/menu-oldage.png","option":2,"type":1,"value":{"channel_id":"6"}},{"channel_name":"漫展票务","image":"/app/img/menu-collect.png","option":2,"type":1,"value":{"channel_id":"9"}},{"channel_name":"文具","image":"/app/img/menu-stationery.png","option":2,"type":1,"value":{"channel_id":"11"}},{"channel_name":"零食","image":"/app/img/menu-snack.png","option":2,"type":1,"value":{"channel_id":"10"}},{"channel_name":"首饰","image":"/app/img/menu-jewelry.png","option":2,"type":1,"value":{"channel_id":"12"}},{"channel_name":"更多","image":"/app/img/menu-more.png","option":6,"type":1,"value":{"channel_id":"13"}}],"hot_info":[{"cover_price":"159.00","figure":"/1477984921265.jpg","name":"现货【一方尘寰】剑侠情缘三剑三七秀 干将莫邪 90橙武仿烧蓝复古对簪","product_id":"9356"},{"cover_price":"159.00","figure":"/1477984931882.jpg","name":"现货【一方尘寰】剑侠情缘三剑三七秀 干将莫邪 90橙武仿烧蓝复古对簪-特典版","product_id":"10391"},{"cover_price":"29.00","figure":"/1452161899947.jpg","name":"【喵鹿酱】超萌 假透肉 拼接 踩脚过膝打底袜 裤袜-加绒保暖","product_id":"3831"},{"cover_price":"199.00","figure":"/1447232577216.jpg","name":"【漫踪】原创 宫崎骏 龙猫 可爱雪地靴动漫保暖鞋周边冬季毛绒鞋子","product_id":"2691"},{"cover_price":"70.00","figure":"/1474370572805.jpg","name":"【现货】【GIRLISM少女主义】 第4期 2016夏秋刊 lolita","product_id":"9414"},{"cover_price":"4.80","figure":"/1465268743242.jpg","name":"【艾漫】全职高手-蜜饯系列","product_id":"6869"},{"cover_price":"143.10","figure":"/1477360350123.png","name":"【高冷猫】暗黑系软妹病娇药丸少女秋装假俩件加厚卫衣帽衫 预售","product_id":"10136"},{"cover_price":"329.00","figure":"/supplier/1467702094592.jpg","name":"【wacom】数位板画板ctl471手绘板bamboo电脑绘画电子绘图板ps","product_id":"7752"}],"recommend_info":[{"cover_price":"138.00","figure":"/supplier/1478873740576.jpg","name":"【尚硅谷】日常 萌系小天使卫衣--白色款","product_id":"10659"},{"cover_price":"138.00","figure":"/supplier/1478873369497.jpg","name":"【尚硅谷】日常 萌系小恶魔卫衣--黑色款","product_id":"10658"},{"cover_price":"32.00","figure":"/supplier/1478867468462.jpg","name":"预售【漫友文化】全职高手6 天闻角川 流地徽章 全新典藏版 蝴蝶蓝 猫树绘 赠精美大海报+首刷限定赠2017年活页台历","product_id":"10657"},{"cover_price":"18.00","figure":"/1478860081305.jpg","name":"【幸运星】烫金雪纺JSK的配件小物:手 套、项链","product_id":"10656"},{"cover_price":"178.00","figure":"/1478850234799.jpg","name":"【尚硅谷】妖狐图腾 阴阳师同人元素卫衣","product_id":"10655"},{"cover_price":"138.00","figure":"/1478849792177.jpg","name":"【尚硅谷】学院风 日常百搭 宽松长袖衬衫","product_id":"10654"}],"seckill_info":{"end_time":"1479052800","list":[{"cover_price":"20.00","figure":"/1478489000522.png","name":"尚硅谷购物节特供优惠券 满600-120优惠券","origin_price":"20.00","product_id":"7100"},{"cover_price":"10.00","figure":"/1478489035167.png","name":"尚硅谷购物节特供优惠券 满300-80优惠券","origin_price":"10.00","product_id":"7101"},{"cover_price":"5.00","figure":"/1478489878735.png","name":"尚硅谷购物节特供优惠券 满160-40优惠券","origin_price":"5.00","product_id":"7102"},{"cover_price":"49.00","figure":"/1475045805488.jpg","name":"【古风原创】 自动直柄伞 晴雨伞 【云鹤游】包邮 新增折叠伞","origin_price":"69.00","product_id":"9593"},{"cover_price":"5.00","figure":"/1478678511949.png","name":"尚硅谷购物节特供优惠券 满60-20优惠券","origin_price":"5.00","product_id":"10536"},{"cover_price":"49.00","figure":"/1438680345318.jpg","name":"【古风原创】 自动直柄伞 晴雨伞 【青竹词】包邮 新增折叠伞","origin_price":"59.00","product_id":"555"}],"start_time":"1478772000"}} */ private int code; private String msg; private ResultBean result; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public ResultBean getResult() { return result; } public void setResult(ResultBean result) { this.result = result; } public static class ResultBean { /** * act_info : [{"icon_url":"/operation/img/1478169868/1478761370286.png","name":"尚硅谷福利专区之111.1专区","url":"/oper/1478169868app.html"},{"icon_url":"/operation/img/1478763176/1478762941492.png","name":"尚硅谷福利专区 黄金狗粮限量11.1元抢","url":"/oper/1478763176app.html"}] * banner_info : [{"image":"/1478770583834.png","option":3,"type":0,"value":{"url":"/act20161111?cyc_app=1"}},{"image":"/1478770583835.png","option":2,"type":0,"value":{"url":"/act20161111?cyc_app=1"}},{"image":"/1478770583836.png","option":1,"type":0,"value":{"url":"/act20161111?cyc_app=1"}}] * channel_info : [{"channel_name":"服饰","image":"/app/img/menu-cyc.png","option":2,"type":1,"value":{"channel_id":"8"}},{"channel_name":"游戏","image":"/app/img/menu-game.png","option":2,"type":1,"value":{"channel_id":"4"}},{"channel_name":"动漫","image":"/app/img/menu-carttoon.png","option":2,"type":1,"value":{"channel_id":"3"}},{"channel_name":"装扮","image":"/app/img/menu-cosplay.png","option":2,"type":1,"value":{"channel_id":"5"}},{"channel_name":"古风","image":"/app/img/menu-oldage.png","option":2,"type":1,"value":{"channel_id":"6"}},{"channel_name":"漫展票务","image":"/app/img/menu-collect.png","option":2,"type":1,"value":{"channel_id":"9"}},{"channel_name":"文具","image":"/app/img/menu-stationery.png","option":2,"type":1,"value":{"channel_id":"11"}},{"channel_name":"零食","image":"/app/img/menu-snack.png","option":2,"type":1,"value":{"channel_id":"10"}},{"channel_name":"首饰","image":"/app/img/menu-jewelry.png","option":2,"type":1,"value":{"channel_id":"12"}},{"channel_name":"更多","image":"/app/img/menu-more.png","option":6,"type":1,"value":{"channel_id":"13"}}] * hot_info : [{"cover_price":"159.00","figure":"/1477984921265.jpg","name":"现货【一方尘寰】剑侠情缘三剑三七秀 干将莫邪 90橙武仿烧蓝复古对簪","product_id":"9356"},{"cover_price":"159.00","figure":"/1477984931882.jpg","name":"现货【一方尘寰】剑侠情缘三剑三七秀 干将莫邪 90橙武仿烧蓝复古对簪-特典版","product_id":"10391"},{"cover_price":"29.00","figure":"/1452161899947.jpg","name":"【喵鹿酱】超萌 假透肉 拼接 踩脚过膝打底袜 裤袜-加绒保暖","product_id":"3831"},{"cover_price":"199.00","figure":"/1447232577216.jpg","name":"【漫踪】原创 宫崎骏 龙猫 可爱雪地靴动漫保暖鞋周边冬季毛绒鞋子","product_id":"2691"},{"cover_price":"70.00","figure":"/1474370572805.jpg","name":"【现货】【GIRLISM少女主义】 第4期 2016夏秋刊 lolita","product_id":"9414"},{"cover_price":"4.80","figure":"/1465268743242.jpg","name":"【艾漫】全职高手-蜜饯系列","product_id":"6869"},{"cover_price":"143.10","figure":"/1477360350123.png","name":"【高冷猫】暗黑系软妹病娇药丸少女秋装假俩件加厚卫衣帽衫 预售","product_id":"10136"},{"cover_price":"329.00","figure":"/supplier/1467702094592.jpg","name":"【wacom】数位板画板ctl471手绘板bamboo电脑绘画电子绘图板ps","product_id":"7752"}] * recommend_info : [{"cover_price":"138.00","figure":"/supplier/1478873740576.jpg","name":"【尚硅谷】日常 萌系小天使卫衣--白色款","product_id":"10659"},{"cover_price":"138.00","figure":"/supplier/1478873369497.jpg","name":"【尚硅谷】日常 萌系小恶魔卫衣--黑色款","product_id":"10658"},{"cover_price":"32.00","figure":"/supplier/1478867468462.jpg","name":"预售【漫友文化】全职高手6 天闻角川 流地徽章 全新典藏版 蝴蝶蓝 猫树绘 赠精美大海报+首刷限定赠2017年活页台历","product_id":"10657"},{"cover_price":"18.00","figure":"/1478860081305.jpg","name":"【幸运星】烫金雪纺JSK的配件小物:手 套、项链","product_id":"10656"},{"cover_price":"178.00","figure":"/1478850234799.jpg","name":"【尚硅谷】妖狐图腾 阴阳师同人元素卫衣","product_id":"10655"},{"cover_price":"138.00","figure":"/1478849792177.jpg","name":"【尚硅谷】学院风 日常百搭 宽松长袖衬衫","product_id":"10654"}] * seckill_info : {"end_time":"1479052800","list":[{"cover_price":"20.00","figure":"/1478489000522.png","name":"尚硅谷购物节特供优惠券 满600-120优惠券","origin_price":"20.00","product_id":"7100"},{"cover_price":"10.00","figure":"/1478489035167.png","name":"尚硅谷购物节特供优惠券 满300-80优惠券","origin_price":"10.00","product_id":"7101"},{"cover_price":"5.00","figure":"/1478489878735.png","name":"尚硅谷购物节特供优惠券 满160-40优惠券","origin_price":"5.00","product_id":"7102"},{"cover_price":"49.00","figure":"/1475045805488.jpg","name":"【古风原创】 自动直柄伞 晴雨伞 【云鹤游】包邮 新增折叠伞","origin_price":"69.00","product_id":"9593"},{"cover_price":"5.00","figure":"/1478678511949.png","name":"尚硅谷购物节特供优惠券 满60-20优惠券","origin_price":"5.00","product_id":"10536"},{"cover_price":"49.00","figure":"/1438680345318.jpg","name":"【古风原创】 自动直柄伞 晴雨伞 【青竹词】包邮 新增折叠伞","origin_price":"59.00","product_id":"555"}],"start_time":"1478772000"} */ private SeckillInfoBean seckill_info; private List<ActInfoBean> act_info; private List<BannerInfoBean> banner_info; private List<ChannelInfoBean> channel_info; private List<HotInfoBean> hot_info; private List<RecommendInfoBean> recommend_info; public SeckillInfoBean getSeckill_info() { return seckill_info; } public void setSeckill_info(SeckillInfoBean seckill_info) { this.seckill_info = seckill_info; } public List<ActInfoBean> getAct_info() { return act_info; } public void setAct_info(List<ActInfoBean> act_info) { this.act_info = act_info; } public List<BannerInfoBean> getBanner_info() { return banner_info; } public void setBanner_info(List<BannerInfoBean> banner_info) { this.banner_info = banner_info; } public List<ChannelInfoBean> getChannel_info() { return channel_info; } public void setChannel_info(List<ChannelInfoBean> channel_info) { this.channel_info = channel_info; } public List<HotInfoBean> getHot_info() { return hot_info; } public void setHot_info(List<HotInfoBean> hot_info) { this.hot_info = hot_info; } public List<RecommendInfoBean> getRecommend_info() { return recommend_info; } public void setRecommend_info(List<RecommendInfoBean> recommend_info) { this.recommend_info = recommend_info; } public static class SeckillInfoBean { /** * end_time : 1479052800 * list : [{"cover_price":"20.00","figure":"/1478489000522.png","name":"尚硅谷购物节特供优惠券 满600-120优惠券","origin_price":"20.00","product_id":"7100"},{"cover_price":"10.00","figure":"/1478489035167.png","name":"尚硅谷购物节特供优惠券 满300-80优惠券","origin_price":"10.00","product_id":"7101"},{"cover_price":"5.00","figure":"/1478489878735.png","name":"尚硅谷购物节特供优惠券 满160-40优惠券","origin_price":"5.00","product_id":"7102"},{"cover_price":"49.00","figure":"/1475045805488.jpg","name":"【古风原创】 自动直柄伞 晴雨伞 【云鹤游】包邮 新增折叠伞","origin_price":"69.00","product_id":"9593"},{"cover_price":"5.00","figure":"/1478678511949.png","name":"尚硅谷购物节特供优惠券 满60-20优惠券","origin_price":"5.00","product_id":"10536"},{"cover_price":"49.00","figure":"/1438680345318.jpg","name":"【古风原创】 自动直柄伞 晴雨伞 【青竹词】包邮 新增折叠伞","origin_price":"59.00","product_id":"555"}] * start_time : 1478772000 */ private String end_time; private String start_time; private List<ListBean> list; public String getEnd_time() { return end_time; } public void setEnd_time(String end_time) { this.end_time = end_time; } public String getStart_time() { return start_time; } public void setStart_time(String start_time) { this.start_time = start_time; } public List<ListBean> getList() { return list; } public void setList(List<ListBean> list) { this.list = list; } public static class ListBean { /** * cover_price : 20.00 * figure : /1478489000522.png * name : 尚硅谷购物节特供优惠券 满600-120优惠券 * origin_price : 20.00 * product_id : 7100 */ private String cover_price; private String figure; private String name; private String origin_price; private String product_id; public String getCover_price() { return cover_price; } public void setCover_price(String cover_price) { this.cover_price = cover_price; } public String getFigure() { return figure; } public void setFigure(String figure) { this.figure = figure; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getOrigin_price() { return origin_price; } public void setOrigin_price(String origin_price) { this.origin_price = origin_price; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } } } public static class ActInfoBean { private String icon_url; private String name; private String url; public String getIcon_url() { return icon_url; } public void setIcon_url(String icon_url) { this.icon_url = icon_url; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } } public static class BannerInfoBean { /** * image : /1478770583834.png * option : 3 * type : 0 * value : {"url":"/act20161111?cyc_app=1"} */ private String image; private int option; private int type; private ValueBean value; public String getImage() { return image; } public void setImage(String image) { this.image = image; } public int getOption() { return option; } public void setOption(int option) { this.option = option; } public int getType() { return type; } public void setType(int type) { this.type = type; } public ValueBean getValue() { return value; } public void setValue(ValueBean value) { this.value = value; } public static class ValueBean { /** * url : /act20161111?cyc_app=1 */ private String url; public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } } } public static class ChannelInfoBean { /** * channel_name : 服饰 * image : /app/img/menu-cyc.png * option : 2 * type : 1 * value : {"channel_id":"8"} */ private String channel_name; private String image; private int option; private int type; private ValueBeanX value; public String getChannel_name() { return channel_name; } public void setChannel_name(String channel_name) { this.channel_name = channel_name; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public int getOption() { return option; } public void setOption(int option) { this.option = option; } public int getType() { return type; } public void setType(int type) { this.type = type; } public ValueBeanX getValue() { return value; } public void setValue(ValueBeanX value) { this.value = value; } public static class ValueBeanX { /** * channel_id : 8 */ private String channel_id; public String getChannel_id() { return channel_id; } public void setChannel_id(String channel_id) { this.channel_id = channel_id; } } } public static class HotInfoBean { /** * cover_price : 159.00 * figure : /1477984921265.jpg * name : 现货【一方尘寰】剑侠情缘三剑三七秀 干将莫邪 90橙武仿烧蓝复古对簪 * product_id : 9356 */ private String cover_price; private String figure; private String name; private String product_id; public String getCover_price() { return cover_price; } public void setCover_price(String cover_price) { this.cover_price = cover_price; } public String getFigure() { return figure; } public void setFigure(String figure) { this.figure = figure; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } } public static class RecommendInfoBean { /** * cover_price : 138.00 * figure : /supplier/1478873740576.jpg * name : 【尚硅谷】日常 萌系小天使卫衣--白色款 * product_id : 10659 */ private String cover_price; private String figure; private String name; private String product_id; public String getCover_price() { return cover_price; } public void setCover_price(String cover_price) { this.cover_price = cover_price; } public String getFigure() { return figure; } public void setFigure(String figure) { this.figure = figure; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } } } }
cd4194ad41d9de7ed6a74ca8968db3ef331dfb08
45e56742b3528c8f8e46037237b4cf653fcb5a13
/src/main/java/com/example/glmrbackend/config/SwaggerConfig.java
5b0d8544182d4d0a3443db34722cfe4ca8ac6472
[]
no_license
qismet862/master
976309558f36e4381f741c18a773e921918ba7cc
cc1eaa64f37c57cedf52e0cb4d4c9ce422ab81fb
refs/heads/master
2023-08-28T19:09:23.331800
2021-10-18T18:22:26
2021-10-18T18:22:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
929
java
package com.example.glmrbackend.config; import com.google.common.collect.ImmutableSet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api(){ return new Docket(DocumentationType.SWAGGER_2) .produces(ImmutableSet.of(MediaType.APPLICATION_JSON_VALUE)) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build(); } }
d549ae8fd2d6d24ad6dbfe570c66a4d4092116d4
ebbb7ea63ac70363d50ccc4d81664cb30fbe0d52
/Java_Ex_02/src/com/biz/ex02/vo/BookVO.java
4e1d0c968230cd0b8e63e7803c15a83f05f0093f
[]
no_license
hyosunjeong/Java
c9096cacfee677037f19e80fef7f62042bfd057b
ef770b0beae5249a7adfa0a00f7f5684c1a2c05e
refs/heads/master
2020-05-16T23:00:40.619383
2019-04-25T03:53:02
2019-04-25T03:53:02
183,352,220
0
0
null
null
null
null
UTF-8
Java
false
false
100
java
package com.biz.ex02.vo; public class BookVO { public String strTitle; public int intPrice; }
21c929c4dccb4dbbd7d60a70271bc44a7834a414
f66fc1aca1c2ed178ac3f8c2cf5185b385558710
/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/ConfigParameter.java
75af00aace60b2c05e47141ccf84730acbfe648e
[ "Apache-2.0", "BSD-3-Clause", "MIT", "LicenseRef-scancode-public-domain" ]
permissive
goldmansachs/reladomo
9cd3e60e92dbc6b0eb59ea24d112244ffe01bc35
a4f4e39290d8012573f5737a4edc45d603be07a5
refs/heads/master
2023-09-04T10:30:12.542924
2023-07-20T09:29:44
2023-07-20T09:29:44
68,020,885
431
122
Apache-2.0
2023-07-07T21:29:52
2016-09-12T15:17:34
Java
UTF-8
Java
false
false
1,634
java
/* Copyright 2016 Goldman Sachs. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.gs.fw.common.mithra.cacheloader; public class ConfigParameter { private final String key; private final String value; public ConfigParameter(String key, String value) { this.key = key; this.value = value; } public String getKey() { return key; } public String getValue() { return value; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ConfigParameter that = (ConfigParameter) o; if (key != null ? !key.equals(that.key) : that.key != null) return false; if (value != null ? !value.equals(that.value) : that.value != null) return false; return true; } @Override public int hashCode() { int result = key != null ? key.hashCode() : 0; result = 31 * result + (value != null ? value.hashCode() : 0); return result; } }
0ec2531556442053f85572989b918c59c61aaae7
323517075ab96ab63c51381616c08c69732262d4
/src/tools/transferTools/DataActTransferable.java
39cea80954748a04d80b61f96b9ae02f4c920dc6
[]
no_license
mashimaroa15/test
58afda39bdf76e2274322ecda57106ef39c099e8
6b5040c6b9898e7a87083d6f85dd2deaa37f706a
refs/heads/master
2021-01-06T20:46:51.348047
2015-02-23T09:39:21
2015-02-23T09:39:21
29,542,060
0
0
null
null
null
null
UTF-8
Java
false
false
1,313
java
/* * Mise en place d'un langage graphique pour l'editeur SEPIA * MIF20 - PRIM - TER || Janvier - Fevrier 2015 * Universite Lyon 1 || Departement Informatique */ package tools.transferTools; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; /** * * @author */ public class DataActTransferable implements Transferable { public static DataFlavor FLAVOR = new DataFlavor(DataEvt.class,"DataEvt"); DataFlavor flavors[]; DataEvt dataEvt; public DataActTransferable(String id, String type, String desc) { this.dataEvt = new DataEvt(id, type, desc); this.flavors = new DataFlavor[] { FLAVOR }; } @Override public DataFlavor[] getTransferDataFlavors() { return flavors; } @Override public boolean isDataFlavorSupported(DataFlavor flavor) { return flavor.equals(FLAVOR); } @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if(flavor.equals(FLAVOR)){ return dataEvt; } else { throw new UnsupportedFlavorException(flavor); } } }
512c9b2c68e6678ef4876bd4b634c82fe8115869
746a5d6a86f3c97da44c7cf0b2fdbfabf3d38691
/ADS/day8/day6/asgn2/SequentialSearchST.java
c1efa68e3db408afefde1421356f76a65ef3c39d
[]
no_license
manisha251097/manisha
bdc4c3d1439688a1722df4566a8f8d778a348eff
28d87513de867a09420884c15c703a3ab53b29d8
refs/heads/master
2022-04-13T02:34:45.308625
2020-04-06T16:32:27
2020-04-06T16:32:27
210,339,233
0
0
null
null
null
null
UTF-8
Java
false
false
2,947
java
/** * Sequential search symbol table. * * @author manisha. */ public class SequentialSearchST<Key extends Comparable<Key>, Value> { private Node first; private class Node { private Key key; private Value val; private Node next; public Node(Key key, Value val) { this.key = key; this.val = val; } } /** * Initializes an empty symbol table. */ public SequentialSearchST() { } /** * Returns true if this symbol table contains the specified key. * * @param key the key * @return true if this symbol table contains key. false otherwise. * Complexity:O(n). */ public boolean contains(Key key) { return get(key) != null; } /** * Returns the value associated with the given key in this symbol table. * * @param key the key * @return the value associated with the given key Complexity:O(n). */ public Value get(Key key) { if (key == null) { return null; } if (first.key.compareTo(key) == 0) { return exchange(first); } Node current = first; while (current != null) { if (current.next.key.compareTo(key) == 0) { return exchange(current); } current = current.next; } return null; } /** * Inserts the specified key-value pair into the symbol table * * @param key the key * @param val the value Complexity:O(n). */ public void put(Key key, Value val) { Node node = new Node(key, val); if (first == null) { first = node; return; } Node current = first; while (current != null) { if (current.key.compareTo(key) == 0) { current.val = val; return; } current = current.next; } Node oldFirst = first; first = new Node(key, val); first.next = oldFirst; } /** * exchange method * * @param current current node. complexity:O(n). */ private Value exchange(Node current) { Node temp = current.next; Value val = temp.val; current.next = current.next.next; Node node = first; while (node.next != null) { node = node.next; } node.next = temp; temp.next = null; return val; } /** * Returns all keys in the symbol table as an Iterable. * * @return all keys in the symbol table Complexity:O(n). */ public Iterable<Key> keys() { ResizingArrayQueue<Key> queue = new ResizingArrayQueue<Key>(); Node current = first; while (current != null) { queue.enqueue(current.key); current = current.next; } return queue; } }
b91efebee4aac7fef5e1f223c1f9de548b4d0fcb
160a7178be3df8fe19d414510652b138fd5078c4
/design-model/src/main/java/com/qyd/play/designModel/factory/PythonNote.java
7466277848a432d1ed69c022ba2835f7dcc7611d
[]
no_license
qiuyadongsite/LeBlanc
80468621b75ab46a4fb68d0dc913c75bd1f390cb
67e21265824bff75eebae026224994936dd30aa3
refs/heads/master
2023-01-07T20:37:41.478964
2020-04-02T11:54:32
2020-04-02T11:54:32
242,632,052
0
0
null
2023-01-07T16:38:53
2020-02-24T02:46:07
Java
UTF-8
Java
false
false
261
java
package com.qyd.play.designModel.factory; import com.qyd.play.designModel.factory.INote; /** * Python笔记 * Created by qyd. */ public class PythonNote implements INote { public void edit() { System.out.println("编写Python笔记"); } }
fed4ade3d5be0276ffd5f85104d9b8887e5259ec
fc160694094b89ab09e5c9a0f03db80437eabc93
/java-migrationcenter/samples/snippets/generated/com/google/cloud/migrationcenter/v1/migrationcenter/getreportconfig/AsyncGetReportConfig.java
3655d23df6f2db38a719ccf1632e93d99cf96902
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-java
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
6e23c3a406e19af410a1a1dd0d0487329875040e
refs/heads/main
2023-09-04T09:09:02.481897
2023-08-31T20:45:11
2023-08-31T20:45:11
26,181,278
1,122
685
Apache-2.0
2023-09-13T21:21:23
2014-11-04T17:57:16
Java
UTF-8
Java
false
false
2,197
java
/* * Copyright 2023 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.migrationcenter.v1.samples; // [START migrationcenter_v1_generated_MigrationCenter_GetReportConfig_async] import com.google.api.core.ApiFuture; import com.google.cloud.migrationcenter.v1.GetReportConfigRequest; import com.google.cloud.migrationcenter.v1.MigrationCenterClient; import com.google.cloud.migrationcenter.v1.ReportConfig; import com.google.cloud.migrationcenter.v1.ReportConfigName; public class AsyncGetReportConfig { public static void main(String[] args) throws Exception { asyncGetReportConfig(); } public static void asyncGetReportConfig() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (MigrationCenterClient migrationCenterClient = MigrationCenterClient.create()) { GetReportConfigRequest request = GetReportConfigRequest.newBuilder() .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) .build(); ApiFuture<ReportConfig> future = migrationCenterClient.getReportConfigCallable().futureCall(request); // Do something. ReportConfig response = future.get(); } } } // [END migrationcenter_v1_generated_MigrationCenter_GetReportConfig_async]
52730f72b4cfbb5539e64df200fe6e93fc281c25
e83aab61eaa882f83f40c1040aff36632d3fd246
/src/main/java/com/mongodb/MongoMain.java
0d6e5eaed80e311396ce9e2757dbb841ec7723a7
[]
no_license
upanshu21/mongodb-java-crud
4f993061a6c453a89b37a68d291e589d78548d57
251a6c3a0246e4175e0425e82662514deac74621
refs/heads/master
2022-12-01T02:24:39.892190
2020-08-13T06:30:46
2020-08-13T06:30:46
286,837,870
1
1
null
null
null
null
UTF-8
Java
false
false
593
java
package com.mongodb; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import org.bson.Document; public class MongoMain { public MongoCollection<Document> getCollection() { String uri = "mongodb://localhost:27017"; MongoClientURI mongoClientURI = new MongoClientURI(uri); MongoClient mongoClient = new MongoClient(mongoClientURI); MongoDatabase mongoDatabase = mongoClient.getDatabase("CrudDB"); MongoCollection<Document> collection = mongoDatabase.getCollection("test1"); return collection; } }
866d154912ef8b20975f50f09efe0783a559270f
2b0a7fa07261d775079599fa385d40a21848c3fb
/src/main/java/com/mycompany/webapp/dto/Ch14Board.java
08ec2750110135c9b9b599ebbb92610509fd19fb
[]
no_license
Goni-DA/webapp1
d27629f18f4bcd75526861aa1437d84fa45ba2ce
4957fced7d40335bd3235187a25a23aa97e96b0d
refs/heads/master
2023-07-28T06:02:20.941817
2021-09-15T04:14:21
2021-09-15T04:14:21
329,203,449
0
0
null
null
null
null
UTF-8
Java
false
false
1,688
java
package com.mycompany.webapp.dto; import java.util.Date; import org.springframework.web.multipart.MultipartFile; public class Ch14Board { private int bno; private String btitle; private String bcontent; private String bwriter; private Date bdate; private int bhitcount; private MultipartFile battach; private String battachsname; private String battachoname; private String battachtype; public int getBno() { return bno; } public void setBno(int bno) { this.bno = bno; } public String getBtitle() { return btitle; } public void setBtitle(String btitle) { this.btitle = btitle; } public String getBcontent() { return bcontent; } public void setBcontent(String bcontent) { this.bcontent = bcontent; } public String getBwriter() { return bwriter; } public void setBwriter(String bwriter) { this.bwriter = bwriter; } public Date getBdate() { return bdate; } public void setBdate(Date bdate) { this.bdate = bdate; } public int getBhitcount() { return bhitcount; } public void setBhitcount(int bhitcount) { this.bhitcount = bhitcount; } public String getBattachsname() { return battachsname; } public void setBattachsname(String battachsname) { this.battachsname = battachsname; } public String getBattachoname() { return battachoname; } public void setBattachoname(String battachoname) { this.battachoname = battachoname; } public String getBattachtype() { return battachtype; } public void setBattachtype(String battachtype) { this.battachtype = battachtype; } public MultipartFile getBattach() { return battach; } public void setBattach(MultipartFile battach) { this.battach = battach; } }
9effa79c7ef9b7f9c6571f9d4b38b11ec360c597
2f267fb656312a0fd6dba8b639e1845630c081af
/springfuse/mesindicateurssispringfuse/trunk/src/main/java/fr/cora/mesindicateurssi/repository/support/ByRangeSpecifications.java
9c8b0af6037787e3a0df6cdd4ca78f694775ff53
[]
no_license
stbland/stbland
88e949616b5c2db1343a817c4633364449e4d89c
39e32c398d41cef3109dcfb21c7635b4884b5a90
refs/heads/master
2020-06-04T05:55:21.817441
2014-04-08T11:45:58
2014-04-08T11:45:58
32,307,696
0
0
null
null
null
null
UTF-8
Java
false
false
3,160
java
/* * (c) Copyright 2005-2012 JAXIO, www.jaxio.com * Source code generated by Celerio, a Jaxio product * Want to use Celerio within your company? email us at [email protected] * Follow us on twitter: @springfuse * Template pack-backend-sd:src/main/java/project/repository/support/ByRangeSpecifications.p.vm.java */ package fr.cora.mesindicateurssi.repository.support; import static com.google.common.collect.Iterables.toArray; import static com.google.common.collect.Lists.newArrayList; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.springframework.data.jpa.domain.Specification; /** * Helper to create {@link Specification} out of {@link Range}s. */ public class ByRangeSpecifications { public static <E> Specification<E> byRanges(final List<Range<E, ?>> ranges) { return new Specification<E>() { @Override public Predicate toPredicate(Root<E> root, CriteriaQuery<?> query, CriteriaBuilder builder) { List<Predicate> predicates = newArrayList(); for (Range<E, ?> range : ranges) { if (range.isSet()) { Predicate rangePredicate = buildRangePredicate(range, root, builder); if (rangePredicate != null) { if (!range.isIncludeNullSet() || range.getIncludeNull() == FALSE) { predicates.add(rangePredicate); } else { predicates.add(builder.or(rangePredicate, builder.isNull(root.get(range.getField())))); } } // no range at all, let's take the opportunity to keep only null... if (TRUE == range.getIncludeNull()) { predicates.add(builder.isNull(root.get(range.getField()))); } else if (FALSE == range.getIncludeNull()) { predicates.add(builder.isNotNull(root.get(range.getField()))); } } } return predicates.isEmpty() ? builder.conjunction() : builder.and(toArray(predicates, Predicate.class)); } private <D extends Comparable<? super D>> Predicate buildRangePredicate(Range<E, D> range, Root<E> root, CriteriaBuilder builder) { if (range.isBetween()) { return builder.between(root.get(range.getField()), range.getFrom(), range.getTo()); } else if (range.isFromSet()) { return builder.greaterThanOrEqualTo(root.get(range.getField()), range.getFrom()); } else if (range.isToSet()) { return builder.lessThanOrEqualTo(root.get(range.getField()), range.getTo()); } return null; } }; } }
[ "stbland@f6deccbe-e060-11de-8d18-5b59c22968bc" ]
stbland@f6deccbe-e060-11de-8d18-5b59c22968bc
ddaa57edaca55cd9f044719a16c4dc59094926ea
246a56988342d1349e8cc03140da29b39b2a9033
/src/main/case/log_mointor/logAnalyze/storm/domain/LogMessage.java
aa383474092b67955b8709e218031cd213492de5
[]
no_license
SuperWangCarl/StudyProject
08e9fa07eb780e17c70b0935bb7c93a7dc0f1fc7
1a6047d03bc81ea5209d58b568f1aa8ed57fedf2
refs/heads/master
2020-03-25T18:30:02.627575
2019-03-30T01:06:07
2019-03-30T01:06:07
144,033,896
0
0
null
null
null
null
UTF-8
Java
false
false
4,787
java
package logAnalyze.storm.domain; import java.io.Serializable; /** * Describe: 根据用户行为记录的信息 * Author: maoxiangyi * Domain: www.itcast.cn * Data: 2015/10/13. */ public class LogMessage implements Serializable { private static final long serialVersionUID = 7270840760720823716L; private int type;//1:浏览日志、2:点击日志、3:搜索日志、4:购买日志 private String hrefTag;//标签标识 private String hrefContent;//标签对应的标识,主要针对a标签之后的内容 private String referrerUrl;//来源网址 private String requestUrl;//来源网址 private String clickTime;//点击时间 private String appName;//浏览器类型 private String appVersion;//浏览器版本 private String language;//浏览器语言 private String platform;//操作系统 private String screen;//屏幕尺寸 private String coordinate;//鼠标点击时的坐标 private String systemId; //产生点击流的系统编号 private String userName;//用户名称 public LogMessage(int type, String requestUrl, String referrerUrl, String userName) { this.type = type; this.requestUrl = requestUrl; this.referrerUrl = referrerUrl; this.userName = userName; } public String getCompareFieldValue(String field) { if ("hrefTag".equalsIgnoreCase(field)) { return hrefTag; } else if ("referrerUrl".equalsIgnoreCase(field)) { return referrerUrl; } else if ("requestUrl".equalsIgnoreCase(field)) { return requestUrl; } return ""; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getSystemId() { return systemId; } public void setSystemId(String systemId) { this.systemId = systemId; } public int getType() { return type; } public void setType(int type) { this.type = type; } public String getHrefTag() { return hrefTag; } public void setHrefTag(String hrefTag) { this.hrefTag = hrefTag; } public String getHrefContent() { return hrefContent; } public void setHrefContent(String hrefContent) { this.hrefContent = hrefContent; } public String getReferrerUrl() { return referrerUrl; } public void setReferrerUrl(String referrerUrl) { this.referrerUrl = referrerUrl; } public String getRequestUrl() { return requestUrl; } public void setRequestUrl(String requestUrl) { this.requestUrl = requestUrl; } public String getClickTime() { return clickTime; } public void setClickTime(String clickTime) { this.clickTime = clickTime; } public String getAppName() { return appName; } public void setAppName(String appName) { this.appName = appName; } public String getAppVersion() { return appVersion; } public void setAppVersion(String appVersion) { this.appVersion = appVersion; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public String getPlatform() { return platform; } public void setPlatform(String platform) { this.platform = platform; } public String getScreen() { return screen; } public void setScreen(String screen) { this.screen = screen; } public String getCoordinate() { return coordinate; } public void setCoordinate(String coordinate) { this.coordinate = coordinate; } @Override public String toString() { return "LogMessage{" + "type='" + type + '\'' + ", hrefTag='" + hrefTag + '\'' + ", hrefContent='" + hrefContent + '\'' + ", referrerUrl='" + referrerUrl + '\'' + ", requestUrl='" + requestUrl + '\'' + ", clickTime='" + clickTime + '\'' + ", appName='" + appName + '\'' + ", appVersion='" + appVersion + '\'' + ", language='" + language + '\'' + ", platform='" + platform + '\'' + ", screen='" + screen + '\'' + ", coordinate='" + coordinate + '\'' + ", systemId='" + systemId + '\'' + '}'; } }
79e970b418e4915c5bb8f94cdfd1e9e1cdb415f8
e8656deff8cea4aa254cfdc02c67fc75a052cc72
/Wxmini/src/cn/guddqs/wxmini/entity/Address.java
2971e2e41765cb704d65c0a17d4b737d8429612c
[]
no_license
yuhuafeng/wxmini
bf18589be026b9d80d3508333509ffa5871637ca
5b63235ab85be991e220ccda40703680cc718f43
refs/heads/master
2020-05-17T16:57:56.881770
2017-02-01T07:33:56
2017-02-01T07:33:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,061
java
package cn.guddqs.wxmini.entity; public class Address implements java.io.Serializable { private static final long serialVersionUID = 4366754153138107897L; @Override public String toString() { return "Address [id=" + id + ", userId=" + userId + ", name=" + name + ", phone=" + phone + ", postNo=" + postNo + ", province=" + province + ", city=" + city + ", area=" + area + ", street=" + street + ", desc=" + desc + ", isDefault=" + isDefault + "]"; } private Integer id; private Integer userId; private String name; private String phone; private String postNo; private String province; private String city; private String area; private String street; private String desc; private Boolean isDefault; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getPostNo() { return postNo; } public void setPostNo(String postNo) { this.postNo = postNo; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getArea() { return area; } public void setArea(String area) { this.area = area; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public Boolean getIsDefault() { return isDefault; } public void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } public static long getSerialversionuid() { return serialVersionUID; } }
b6693682bad6ca72104cfe6d96c5b50b86202cd4
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/MATH-58b-1-5-Single_Objective_GGA-IntegrationSingleObjective-/org/apache/commons/math/analysis/function/Gaussian$Parametric_ESTest_scaffolding.java
cc57813b3bf843e362d5f294fd63783bc6518c75
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
3,113
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat May 16 22:32:20 UTC 2020 */ package org.apache.commons.math.analysis.function; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class Gaussian$Parametric_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.analysis.function.Gaussian$Parametric"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Gaussian$Parametric_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math.exception.util.Localizable", "org.apache.commons.math.exception.NumberIsTooSmallException", "org.apache.commons.math.analysis.function.Gaussian$Parametric", "org.apache.commons.math.exception.MathRuntimeException", "org.apache.commons.math.exception.MathIllegalArgumentException", "org.apache.commons.math.exception.NullArgumentException", "org.apache.commons.math.analysis.ParametricUnivariateRealFunction", "org.apache.commons.math.util.FastMath", "org.apache.commons.math.exception.DimensionMismatchException", "org.apache.commons.math.exception.NotStrictlyPositiveException", "org.apache.commons.math.exception.util.LocalizedFormats", "org.apache.commons.math.exception.util.MessageFactory", "org.apache.commons.math.exception.MathIllegalNumberException", "org.apache.commons.math.exception.MathThrowable", "org.apache.commons.math.analysis.DifferentiableUnivariateRealFunction", "org.apache.commons.math.analysis.UnivariateRealFunction", "org.apache.commons.math.analysis.function.Gaussian", "org.apache.commons.math.exception.util.ArgUtils" ); } }
c65a553cbc81bee361ba0d1e563123aebd42c570
cd9ac9b585e1f59b239dd2bdd121043a6e668d8e
/Gen-code/nextest_cgen-r4-0a-pre47/iServer/java/com/nextone/common/Hello.java
24d54308fbcf16021bdd370ffbc5f267fcca46ba
[]
no_license
gvsurenderreddy/Automation
26666872a5d741576531471bff402900e039a4e3
9974760ae41ea26d4d8b6a483b246f09ae38298e
refs/heads/master
2021-01-15T08:43:15.616066
2015-05-12T08:08:11
2015-05-12T08:08:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,207
java
package com.nextone.common; import java.io.*; import java.net.*; import java.util.*; import com.nextone.util.LimitedDataInputStream; import com.nextone.util.NextoneMulticastSocket; /** * some utility methods to be used in the hello protocol between the iEdge * and iView/iServer */ public class Hello { private Hello () {}; /** * fills in the permission string * after writing the string, it adds a pad so that 20 bytes would * be written to the underlying stream */ public static void fillPermission (DataOutputStream ds, String s) throws IOException { int bytesWritten = 0; if (s != null) { if (s.length() > 18) throw new IOException("permission string length too long (" + s.length() + ")"); ds.writeUTF(s); bytesWritten = 2 + s.length(); } for (int i = bytesWritten; i < 20; i++) ds.writeByte((byte)0); ds.flush(); } /** * creates the packet content for the hello message sent from a * device identifying itself as a remote device */ public static byte [] createRemoteHelloData (String read, String write, short protocolVersion) throws IOException { return createHelloData(read, write, protocolVersion, CommonConstants.REMOTE); } /** * creates the packet content for the hello message sent from a * device identifying itself as a local device (on the same LAN) */ public static byte [] createHelloData (String read, String write, short protocolVersion) throws IOException { return createHelloData(read, write, protocolVersion, (short)0); } private static byte [] createHelloData (String read, String write, short protocolVersion, short deviceType) throws IOException { ByteArrayOutputStream rbos = new ByteArrayOutputStream(47); DataOutputStream rdos = new DataOutputStream(rbos); rdos.writeShort(CommonConstants.HELLO); rdos.writeShort(protocolVersion); Hello.fillPermission(rdos, read); Hello.fillPermission(rdos, write); rdos.writeShort(deviceType); rdos.writeShort(0); rdos.writeByte(0); return rbos.toByteArray(); } /** * get the registration message from an edge device using * NORMAL protocol version */ public static Registration getRegistration (InetAddress addr, String read, String write, TimeoutProvider tp) throws IOException { return getRegistration(addr, read, write, CommonConstants.HELLO_VERSION_NORMAL, tp); } /** * get the registration message from an edge device using * NO_AUTH protocol version */ public static Registration getRegistration (InetAddress addr, TimeoutProvider tp) throws IOException { return getRegistration(addr, null, null, CommonConstants.HELLO_VERSION_NO_AUTH, tp); } private static Registration getRegistration (InetAddress addr, String read, String write, short protVersion, TimeoutProvider tp) throws IOException { byte [] d = Hello.createRemoteHelloData(read, write, protVersion); DatagramPacket dpo = new DatagramPacket(d, d.length, addr, CommonConstants.MCAST_SEND_PORT); byte [] in = new byte [512]; DatagramPacket dpi = new DatagramPacket(in, in.length); DatagramSocket ds = new DatagramSocket(); ds.setSoTimeout(tp.getGetTimeout()*1000); ds.send(dpo); ds.receive(dpi); return new Registration(dpi); } /** * sends a reboot command to the iedge */ public static void reboot (InetAddress addr, int code) throws IOException { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(47); DataOutputStream dos = new DataOutputStream(bos); dos.writeShort(CommonConstants.COMMAND); dos.writeShort(CommonConstants.HELLO_VERSION_NO_AUTH); Hello.fillPermission(dos, null); Hello.fillPermission(dos, null); dos.writeShort(CommonConstants.REBOOT_COMMAND); dos.writeShort(code); dos.writeByte(0); dos.close(); DatagramPacket dpo = new DatagramPacket(bos.toByteArray(), bos.size(), addr, CommonConstants.MCAST_SEND_PORT); DatagramSocket ds = new DatagramSocket(); ds.send(dpo); ds.close(); } catch (InterruptedIOException ie) { throw new IOException("No response from the iEdge"); } } /** * sends a reboot command to the iedge1000 */ public static void rebootI1000(InetAddress addr, int mode,String sno) throws IOException { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(47); DataOutputStream dos = new DataOutputStream(bos); dos.writeShort(CommonConstants.COMMAND); dos.writeShort(CommonConstants.REBOOT_OS_COMMAND); dos.writeShort(sno.length()); dos.writeBytes(sno); dos.writeShort(mode); dos.writeByte(0); DatagramPacket dpo = new DatagramPacket(bos.toByteArray(), bos.size(), addr, CommonConstants.MCAST_SEND_PORT); DatagramSocket ds = new DatagramSocket(); ds.send(dpo); ds.close(); System.out.println("succesfully send the packet"); } catch (InterruptedIOException ie) { throw new IOException("No response from the iEdge"); } } /** * sends an initiate download command to the iedge */ public static void initiateDownload (InetAddress addr, int softwareCode, int timeout) throws IOException { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(47); DataOutputStream dos = new DataOutputStream(bos); dos.writeShort(CommonConstants.COMMAND); dos.writeShort(CommonConstants.HELLO_VERSION_NO_AUTH); Hello.fillPermission(dos, null); Hello.fillPermission(dos, null); dos.writeShort(CommonConstants.DOWNLOAD_REBOOT_COMMAND); dos.writeShort(softwareCode); dos.writeByte(0); dos.close(); DatagramPacket dpo = new DatagramPacket(bos.toByteArray(), bos.size(), addr, CommonConstants.MCAST_SEND_PORT); byte [] in = new byte [128]; DatagramPacket dpi = new DatagramPacket(in, in.length); DatagramSocket ds = new DatagramSocket(); ds.setSoTimeout(timeout*1000); ds.send(dpo); ds.receive(dpi); LimitedDataInputStream dis = new LimitedDataInputStream(new ByteArrayInputStream(in), dpi.getLength()); ds.close(); if (!LimitedCommandComm.extractSetReply(dis)) throw new IOException("iEdge could not initiate download"); } catch (InterruptedIOException ie) { throw new IOException("No response from the iEdge"); } } /** * send the set commands to the iedge */ public static void sendCommands (InetAddress addr, int timeout, String commands) throws IOException { Hello.sendPackets(LimitedCommandComm.createSetRequest(new BufferedReader(new StringReader(commands)), null, addr, false), timeout); } /** * send the datagram packets in the vector... * (if there are any multicast packets in the vectors, they should * be the first packet in the vector) */ public static void sendPackets (Vector v, int timeout) throws IOException { if (v == null) return; int packetsLeft = v.size(); Enumeration e = v.elements(); InetAddress replyAddr = null; DatagramSocket s = null; boolean saveStatus = true; while (e.hasMoreElements()) { try { byte [] in = new byte [24]; DatagramPacket dpi = new DatagramPacket(in, in.length); DatagramPacket toSend = (DatagramPacket)e.nextElement(); if (s == null) { if (toSend.getAddress().isMulticastAddress()) { NextoneMulticastSocket m = new NextoneMulticastSocket(); m.joinGroupOnAllIf(InetAddress.getByName(CommonConstants.MCAST_ADDRESS)); s = m; } else s = new DatagramSocket(); s.setSoTimeout(timeout*1000); } if (replyAddr != null && !toSend.getAddress().isMulticastAddress()) toSend.setAddress(replyAddr); s.send(toSend); s.receive(dpi); replyAddr = dpi.getAddress(); LimitedDataInputStream ldis = new LimitedDataInputStream(new ByteArrayInputStream(in), dpi.getLength()); saveStatus = LimitedCommandComm.extractSetReply(ldis); ldis.close(); if (!saveStatus) break; if (--packetsLeft > 0) { try { Thread.sleep(500); } catch (InterruptedException ie) {} } } catch (InterruptedIOException iie) { try { if (s.getClass().equals(com.nextone.util.NextoneMulticastSocket.class)) ((NextoneMulticastSocket)s).leaveGroupOnAllIf(InetAddress.getByName(CommonConstants.MCAST_ADDRESS)); s.close(); } catch (IOException ee) {} throw new IOException("iEdge not responding"); } catch (IOException ie) { try { if (s.getClass().equals(com.nextone.util.NextoneMulticastSocket.class)) ((NextoneMulticastSocket)s).leaveGroupOnAllIf(InetAddress.getByName(CommonConstants.MCAST_ADDRESS)); s.close(); } catch (IOException ee) {} throw ie; } } try { if (s != null) { if (s.getClass().equals(com.nextone.util.NextoneMulticastSocket.class)) ((NextoneMulticastSocket)s).leaveGroupOnAllIf(InetAddress.getByName(CommonConstants.MCAST_ADDRESS)); s.close(); } } catch (IOException ie) {} if (!saveStatus) throw new IOException("iEdge rejected commands (incompatible software?)"); } /** * send the download parameters to the iedge */ /* public static void sendDownloadParams (InetAddress addr, int mode, int timeout, DTServer server, int devType) throws IOException { if (server == null) throw new IOException("Internal error: server is null"); StringBuffer sb = new StringBuffer(); if (server.getServerAddress() == null) throw new IOException("no server address configured"); else sb.append("set download_server_address " + server.getServerAddress().getHostAddress() + "\n"); sb.append("set download_user " + server.getUsername() + "\n"); sb.append("set download_password " + server.getPassword() + "\n"); sb.append("set download_directory " + server.getDirectory(devType) + "\n"); if (mode == CommonConstants.ROM_MODE) sb.append("set softrom_download_file " + server.getFile(devType) + "\n"); else sb.append("set download_file " + server.getFile(devType) + "\n"); sendCommands(addr, timeout, sb.toString()); } */ }
ca53ea1d02c624ad96d180d6d2ff0e5a1f7543e4
279593115f51475c7265134d35864350af317c53
/src/main/java/com/flame_springbootdo/blog/service/impl/ContentServiceImpl.java
7af486ffe60e7d0bb030c0b597eb647a9be4f852
[]
no_license
flamebobo/flame_springbootdo
480748ff5812aa054336def69c2d1b66d27e80b8
579923b5355f70e4511c954c7e47946c2e73762a
refs/heads/master
2020-04-15T10:03:44.606479
2019-01-10T01:03:41
2019-01-10T01:04:38
164,578,788
1
0
null
null
null
null
UTF-8
Java
false
false
1,220
java
package com.flame_springbootdo.blog.service.impl; import com.flame_springbootdo.blog.dao.ContentDao; import com.flame_springbootdo.blog.domain.ContentDO; import com.flame_springbootdo.blog.service.ContentService; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; /** * @Author Flame * @Date 2018/10/31 16:04 * @Version 1.0 */ @Service public class ContentServiceImpl implements ContentService { private ContentDao contentDao; @Override public ContentDO get(Long cid) { return contentDao.get(cid); } @Override public List<ContentDO> list(Map<String, Object> map) { return contentDao.list(map); } @Override public int count(Map<String, Object> map) { return contentDao.count(map); } @Override public int save(ContentDO contentDO) { return contentDao.save(contentDO); } @Override public int update(ContentDO contentDO) { return contentDao.update(contentDO); } @Override public int remove(Long cid) { return contentDao.remove(cid); } @Override public int batchRemove(Long[] cids) { return contentDao.batchRemove(cids); } }
b952b3b967a994cf6eec0d1f55f72cc2bda5cc9c
deb0153ee36a2cd92e6056888178416d895b91e5
/common_adapter_library/src/main/java/com/allin/commonadapter/listview/MultiItemListViewAdapter.java
c100f863e1dab44a89f7f535dbc03083f8389e96
[]
no_license
LoggerWang/LegendFastApp
ae1de51b8fe8f750fe94731c38ba8ca26d35813d
b117e99336bc0ea163e861ec3bd920c726120b83
refs/heads/master
2021-08-16T22:25:07.001554
2020-09-21T15:02:28
2020-09-21T15:02:28
223,550,246
0
0
null
null
null
null
UTF-8
Java
false
false
1,723
java
package com.allin.commonadapter.listview; import android.content.Context; import android.view.View; import android.view.ViewGroup; import com.allin.commonadapter.IMulItemViewType; import com.allin.commonadapter.ViewHolder; import java.util.List; /** * Description:多item的ListView适配器 * * @author: legend * @date: 2016/4/17 17:19 */ public abstract class MultiItemListViewAdapter<T> extends ListViewBaseAdapter<T> { protected IMulItemViewType<T> mTIMulItemViewType; public MultiItemListViewAdapter(Context context, List<T> datas, IMulItemViewType<T> multiItemTypeSupport) { super(context, -1, datas); mTIMulItemViewType = multiItemTypeSupport; if (mTIMulItemViewType == null) throw new IllegalArgumentException("the mMultiItemTypeSupport can not be null."); } @Override public int getItemViewType(int position) { if (mTIMulItemViewType != null) return mTIMulItemViewType.getItemViewType(position, mDatas.get(position)); return super.getItemViewType(position); } @Override public int getViewTypeCount() { if (mTIMulItemViewType != null) return mTIMulItemViewType.getViewTypeCount(); return super.getViewTypeCount(); } @Override public View getView(int position, View convertView, ViewGroup parent) { if (mTIMulItemViewType == null) { return super.getView(position, convertView, parent); } ViewHolder holder = ViewHolder.get(mContext, convertView, parent, mTIMulItemViewType.getLayoutId(getItemViewType(position)), position); convert(holder, mDatas.get(position), position); return holder.getConvertView(); } }
79a6b0a93646cc8d63da262d790c682d5a3375c4
3fe458b6d72aca4ef18232247e14ba9c21c31ca0
/QueueMessagingSender/src/main/java/by/deniskruglik/queuemessagingsender/jobs/MessageSendJob.java
4397f6dacec1c46246494d4cba4318c01af35711
[]
no_license
DenisKruglik/WebServices
d3651d9a34166030eb5fb237412f34dc343f5bb5
adff63d60f8704e699fc7eba752a9bd6f8c9c348
refs/heads/master
2022-12-01T21:46:17.008850
2019-12-15T19:20:22
2019-12-15T19:20:22
213,179,698
0
0
null
2022-11-16T08:57:25
2019-10-06T14:06:41
Java
UTF-8
Java
false
false
967
java
package by.deniskruglik.queuemessagingsender.jobs; import by.deniskruglik.queuemessagingsender.exception.MessageServiceException; import by.deniskruglik.queuemessagingsender.services.MessageService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; public class MessageSendJob implements Job { private MessageService messageService = new MessageService(); private Logger logger = LogManager.getLogger(MessageSendJob.class); @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { logger.info("Sending message with cron job"); try { messageService.sendMessage("Message sent automatically, current timestamp: " + System.currentTimeMillis()); } catch (MessageServiceException e) { logger.catching(e); } } }
6410cf6ad0f2c14b50063cc826e69e8b15a57733
5f2c4acf8917048d84e86797f56908608a49f041
/app/src/main/java/com/example/lijuan/myapplication/UserLoginTask.java
aa02f9f15c2e2cbadf900fd09601f9ce9128862f
[]
no_license
Vitafin/FinancialSystem
fcae215b01a1a135e2995230184f43e66a8a3cbc
fde56010a02e663b4ce5d5a3b1c0087cb1c758f3
refs/heads/master
2020-05-28T09:49:01.732954
2019-05-28T06:05:07
2019-05-28T06:05:07
188,955,984
0
0
null
null
null
null
UTF-8
Java
false
false
1,402
java
package com.example.lijuan.myapplication; import android.os.AsyncTask; /** * Created by Lijuan on 2019/4/2. */ public class UserLoginTask /*extends AsyncTask<Void, Void, Boolean>*/ { /*private static final String[] DUMMY_CREDENTIALS = ; @Override protected Boolean doInBackground(Void... params) { try { //模拟用户验证耗时 Thread.sleep(2000); } catch (InterruptedException e) { return false; } for (String credential : DUMMY_CREDENTIALS) {//遍历数组验证自定义用户及密码 String[] pieces = credential.split(":");//分割字符串,将密码个邮箱分离开 if (pieces[0].equals(mEmail)) { return pieces[1].equals(mPassword); } } return true; } @Override protected void onPostExecute(final Boolean success) {//线程结束后的ui处理 mAuthTask = null; showProgress(false);//隐藏验证延时对话框 if (success) { finish(); } else {//密码错误,输入框获得焦点,并提示错误 mPasswordView.setError(getString(R.string.error_incorrect_password)); mPasswordView.requestFocus(); } } //取消验证 @Override protected void onCancelled() { mAuthTask = null; showProgress(false); }*/ }
8e9d681a159ce6e9d77d2e5b4daa16c121464aed
61419f1494267b2cc991d1ce144c8dc34a2ae717
/freshday-member/src/main/java/com/haoliang/freshday/member/controller/MemberReceiveAddressController.java
4a957c105a7149b5b6c88bce788777726113e66c
[ "Apache-2.0" ]
permissive
ibytedance/freshDay-Market
47bff2ce20e149e78f5d323c2385dca5213ad31c
a362e2620a0c6351106b56356efef9ce814e1af4
refs/heads/master
2023-07-26T02:59:42.381416
2021-08-30T13:35:47
2021-08-30T13:35:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,522
java
package com.haoliang.freshday.member.controller; import java.util.Arrays; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.haoliang.freshday.member.entity.MemberReceiveAddressEntity; import com.haoliang.freshday.member.service.MemberReceiveAddressService; import com.haoliang.common.utils.PageUtils; import com.haoliang.common.utils.R; /** * 会员收货地址 * * @author zhouhaoliang * @email [email protected] * @date 2021-04-06 15:26:40 */ @RestController @RequestMapping("member/memberreceiveaddress") public class MemberReceiveAddressController { @Autowired private MemberReceiveAddressService memberReceiveAddressService; /** * 列表 */ @RequestMapping("/list") //@RequiresPermissions("member:memberreceiveaddress:list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = memberReceiveAddressService.queryPage(params); return R.ok().put("page", page); } /** * 信息 */ @RequestMapping("/info/{id}") //@RequiresPermissions("member:memberreceiveaddress:info") public R info(@PathVariable("id") Long id){ MemberReceiveAddressEntity memberReceiveAddress = memberReceiveAddressService.getById(id); return R.ok().put("memberReceiveAddress", memberReceiveAddress); } /** * 保存 */ @RequestMapping("/save") //@RequiresPermissions("member:memberreceiveaddress:save") public R save(@RequestBody MemberReceiveAddressEntity memberReceiveAddress){ memberReceiveAddressService.save(memberReceiveAddress); return R.ok(); } /** * 修改 */ @RequestMapping("/update") //@RequiresPermissions("member:memberreceiveaddress:update") public R update(@RequestBody MemberReceiveAddressEntity memberReceiveAddress){ memberReceiveAddressService.updateById(memberReceiveAddress); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") //@RequiresPermissions("member:memberreceiveaddress:delete") public R delete(@RequestBody Long[] ids){ memberReceiveAddressService.removeByIds(Arrays.asList(ids)); return R.ok(); } }
623b24c3c37542029ce4a79a1e5dd68fe7bb41aa
293c94a2b8cb86c8b9466e6ab8624cd04b9353d0
/distributed_systems/Assignment2/ClassManagement/src/com/classmanagement/utils/corba/holder/InvalidLastNameExceptionHolder.java
26b935223c67282239b6c6c4eb004aaec89a28ac
[]
no_license
shyam-kantesariya/Concordia-University
144c70256e3725e09a3c899283b654e65fd44569
5c9310b66ca9228298730e746450a6ff533a8a9d
refs/heads/master
2021-06-05T06:28:51.793438
2019-07-30T20:46:42
2019-07-30T20:46:42
91,926,460
0
1
null
null
null
null
UTF-8
Java
false
false
1,069
java
package com.classmanagement.utils.corba.holder; import com.classmanagement.exceptions.InvalidLastNameException; import com.classmanagement.utils.corba.helper.InvalidLastNameExceptionHelper; /** * CenterServerIdl/CenterServerPackage/InvalidLastNameExceptionHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from CenterServerIdl.idl * Sunday, June 18, 2017 12:56:33 PM EDT */ public final class InvalidLastNameExceptionHolder implements org.omg.CORBA.portable.Streamable { public InvalidLastNameException value = null; public InvalidLastNameExceptionHolder () { } public InvalidLastNameExceptionHolder (InvalidLastNameException initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = InvalidLastNameExceptionHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { InvalidLastNameExceptionHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return InvalidLastNameExceptionHelper.type (); } }
bcc7f85efb65849dad45b11b85c283bb26dd2f83
14e083a48cc7d129af4d6cdd34c10db3bfc8b453
/src/envelo/ryszka/starships/ship/Ship.java
0418aa3662294008e53f0daff7cb0f6dead6c442
[]
no_license
rysiek98/Starships
14c62ed287d6a2cb4f30c131220b63a84fad94af
41f5b8e690001c20236b19177bfe1e16009f3ff0
refs/heads/main
2023-07-15T01:15:40.279315
2021-08-16T10:10:23
2021-08-16T10:18:47
395,333,156
0
0
null
null
null
null
UTF-8
Java
false
false
1,812
java
package envelo.ryszka.starships.ship; import envelo.ryszka.starships.enums.Direction; import envelo.ryszka.starships.enums.Field; import envelo.ryszka.starships.map.Map; import java.util.ArrayList; import java.util.List; public class Ship { private List<Pos> posList; private int hitCounter; public Ship(int x, int y, Direction dir, int length) { if (length > 4) { length = 4; } posList = new ArrayList<>(); posList.add(new Pos(x, y)); for (int i = 0; i < length-1; i++) { switch (dir) { case RIGHT: x++; break; case DOWN: y++; break; } posList.add(new Pos(x, y)); } } public boolean isHere(int x, int y){ for (Pos p : posList) { if (p.isHere(x, y)) { return true; } } return false; } public boolean isHit(int x, int y) { for (Pos p : posList) { if (p.isHere(x, y)) { if (!p.getIsHit()) { hitCounter++; } p.hit(); return true; } } return false; } public boolean isDead(){ for (Pos p : posList) { if(!p.getIsHit()){ return false; } } return true; } public void render(Map map){ for (Pos p : posList) { map.getMapArray()[p.getX()][p.getY()] = Field.SHIP; } } public boolean isOnMap(int mapSize) { for (Pos p : posList) { if (p.getX() > mapSize || p.getY() > mapSize) return false; } return true; } }
3f884ecb88f21a31ef7ea1fe121d31ae896e9530
d8a2a05407f6ae7822080417014aaeb6d8e9b52e
/homework2-books/src/main/java/ru/otus/dao/CommentRepository.java
ddd1c2b0a60986c7a92db1ff5ce9d7fb8efb70c4
[]
no_license
alinayu/otus-spring
c91e8792b93c7806fc798541cd6d7cb428ac0f36
175b4f82c60fd3095e89b24a414ad399dd006c52
refs/heads/master
2022-12-17T09:07:39.435927
2019-07-03T20:30:59
2019-07-03T20:30:59
160,729,053
0
0
null
2022-11-16T12:22:58
2018-12-06T20:37:04
Java
UTF-8
Java
false
false
262
java
package ru.otus.dao; import org.springframework.data.jpa.repository.JpaRepository; import ru.otus.domain.Comment; import java.util.List; public interface CommentRepository extends JpaRepository<Comment, Long> { List<Comment> findByBookId(long bookId); }
d7be06c1337b8e1f8650336b801b34079159f39d
1f83a8d6779b073af6bbe42d5f334a24598158ef
/app/src/main/java/com/example/android/gransantiago/GcmIntentService.java
8d1365116843b3c72cd78b57b6ad7b3e8f8c3dd3
[]
no_license
huesoluis/gsantiago
570cfaaf596ef58f25f2dbdb30f02525982b82ef
070d26d0133a208d324016acd0b80cb346397402
refs/heads/master
2021-01-10T10:10:16.211604
2015-11-25T11:10:06
2015-11-25T11:10:06
46,118,030
2
0
null
null
null
null
UTF-8
Java
false
false
4,520
java
package com.example.android.gransantiago; /** * Created by multimedia on 17/03/2015. */ import android.app.IntentService; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.NotificationCompat; import com.google.android.gms.gcm.GoogleCloudMessaging; /** * This {@code IntentService} does the actual handling of the GCM message. * {@code GcmBroadcastReceiver} (a {@code WakefulBroadcastReceiver}) holds a * partial wake lock for this service while the service does its work. When the * service is finished, it calls {@code completeWakefulIntent()} to release the * wake lock. */ public class GcmIntentService extends IntentService { public static final int NOTIFICATION_ID = 1; private NotificationManager mNotificationManager; NotificationCompat.Builder builder; public GcmIntentService() { super("GcmIntentService"); } public static final String TAG = "gsa"; public Boolean guardia=true; @Override protected void onHandleIntent(Intent intent) { String notificacion; Bundle extras = intent.getExtras(); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); // The getMessageType() intent parameter must be the intent you received // in your BroadcastReceiver. String messageType = gcm.getMessageType(intent); if (!extras.isEmpty()) { // has effect of unparcelling Bundle /* * Filter messages based on message type. Since it is likely that GCM will be * extended in the future with new message types, just ignore any message types you're * not interested in, or that you don't recognize. */ if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { sendNotification("Error de envio: " + extras.toString(),guardia); } else if (GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)) { sendNotification("Se han eliminado mensajes del servidor: " + extras.toString(),guardia); // If it's a regular GCM message, do some work. } else if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) { //Diferenciamos entre avisos (nuevas guardias) y notificaciones personales if(extras.getString("sesion","").isEmpty()) { notificacion = extras.getString("aviso"); guardia=false; } else notificacion="Tienes Guardia\n Sesion:\t"+extras.getString("sesion","")+ "\nProfesor falta:\t"+extras.getString("pfalta","nadie")+"\nAsignatura:\t"+extras.getString("asignatura","ninguna"); sendNotification(notificacion,guardia); } } // Release the wake lock provided by the WakefulBroadcastReceiver. GcmBroadcastReceiver.completeWakefulIntent(intent); } // Put the message into a notification and post it. // This is just one simple example of what you might choose to do with // a GCM message. private void sendNotification(String msg, Boolean guardia) { mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); PendingIntent contentIntent; if (guardia) { Intent i = new Intent(this, Portada.class); i.putExtra("pi", true); contentIntent = PendingIntent.getActivity(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT); } else { Intent i = new Intent(this, Aviso.class); i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); i.putExtra("mensaje",msg); contentIntent = PendingIntent.getActivity(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT); } NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.sh) .setContentTitle("Aviso") .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) .setContentText(msg).setAutoCancel(guardia); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); } }
a69c9ae27c35773a89459ecf0ecf5d29ef0e7f5c
4479180177a183d114594536737925f37a0eac07
/src/homeWork/homeWork5/WarAirTransport.java
8463702723f06d6258e8f91624540be6bd9b835f
[]
no_license
kirillfursau/TMS
56fd216e2ba9b8fe1937009e86689d1973c7eaf5
a8fd7ef026a7b115b83808c4e604bb7a841648f6
refs/heads/master
2020-09-24T09:08:56.133306
2020-04-01T20:31:15
2020-04-01T20:31:15
225,466,423
0
0
null
null
null
null
UTF-8
Java
false
false
2,142
java
package homeWork.homeWork5; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; import javax.xml.bind.annotation.XmlRootElement; import java.io.File; @XmlRootElement public class WarAirTransport extends AirTransport { private boolean bailoutSystem; private int totalRockets; public WarAirTransport() { } WarAirTransport(int power, int maxSpeed, int weight, String brand, int wingspan, int minimumRunway, boolean bailoutSystem, int totalRockets) { super(power, maxSpeed, weight, brand, wingspan, minimumRunway); this.totalRockets = totalRockets; this.bailoutSystem = bailoutSystem; try { File file = new File("/Users/kirylfursau/Desktop/TMS/src/homeWork/homeWork5/" + power + brand + "WarAirTransport.xml"); JAXBContext context = JAXBContext.newInstance(WarAirTransport.class); Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(this, file); } catch (Exception e) { e.printStackTrace(); } } String getInformation() { return "Power in horses : " + getPower() + ". Max speed km/h : " + getMaxSpeed() + "/ Weight(Kg) : " + getWeight() + ". Brand : " + getBrand() + ". Wingspan(M) : " + getWingspan() + " Minimum distance to fly away(M) : " + getMinimumRunway() + ". Total rockets : " + totalRockets + ". Bailout system : " + bailoutSystem + ". Power in kilowat : " + powerKW(); } void shot() { int shots = totalRockets; for (int i = 0; i <= shots; i++) { if (totalRockets > 0) { System.out.println("Rocket launch"); totalRockets--; } else { System.out.println("No ammo"); } } } void bailout() { if (bailoutSystem) { System.out.println("Bailout was successful"); } else { System.out.println("No bailout system"); } } }
d074a3a90b2e2a662ca1db7f6cc4f448bde1b6a7
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-neptune/src/main/java/com/amazonaws/services/neptune/model/transform/VpcSecurityGroupMembershipStaxUnmarshaller.java
3f67bfac6df4499ea49fe7e3b027d1ded88eb0ba
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
2,786
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.neptune.model.transform; import javax.xml.stream.events.XMLEvent; import javax.annotation.Generated; import com.amazonaws.services.neptune.model.*; import com.amazonaws.transform.Unmarshaller; import com.amazonaws.transform.StaxUnmarshallerContext; import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*; /** * VpcSecurityGroupMembership StAX Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class VpcSecurityGroupMembershipStaxUnmarshaller implements Unmarshaller<VpcSecurityGroupMembership, StaxUnmarshallerContext> { public VpcSecurityGroupMembership unmarshall(StaxUnmarshallerContext context) throws Exception { VpcSecurityGroupMembership vpcSecurityGroupMembership = new VpcSecurityGroupMembership(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return vpcSecurityGroupMembership; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("VpcSecurityGroupId", targetDepth)) { vpcSecurityGroupMembership.setVpcSecurityGroupId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Status", targetDepth)) { vpcSecurityGroupMembership.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return vpcSecurityGroupMembership; } } } } private static VpcSecurityGroupMembershipStaxUnmarshaller instance; public static VpcSecurityGroupMembershipStaxUnmarshaller getInstance() { if (instance == null) instance = new VpcSecurityGroupMembershipStaxUnmarshaller(); return instance; } }
[ "" ]
2e5315a6beadc635e5d82fc13986328dfa7eef3d
e63079ddc83cf2f794ba00718e4c81815df7ddd8
/src/Department.java
8f4d17d6af381e8523bbc76afa39deea2832342c
[]
no_license
Naimcse56/Office-Management-System
84245d592402e8d5bc2f5dd366246eae396a8c32
0d38599936d350c12ec7626855f2349530c31704
refs/heads/master
2021-01-18T22:27:51.124379
2017-04-03T09:12:05
2017-04-03T09:12:05
87,055,970
1
1
null
null
null
null
UTF-8
Java
false
false
10,651
java
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; /* * 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. */ /** * * @author Naim */ public class Department extends javax.swing.JFrame { Connection conn; PreparedStatement pst; ResultSet rs; public Department() { super("Department"); initComponents(); conn=javaconnect.ConnecrDb(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); back = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); addEmployee = new javax.swing.JButton(); viewInfo = new javax.swing.JButton(); viewInfo1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 153), 3)); jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\Naim\\Documents\\NetBeansProjects\\Office Management System\\Image\\Dept.png")); // NOI18N back.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N back.setText("BACK"); back.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 0, 102))); back.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backActionPerformed(evt); } }); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 30)); // NOI18N jLabel1.setText("NAME OF ALL DEPARTMENT"); jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2)); addEmployee.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N addEmployee.setText("ADD EMPLOYEE"); addEmployee.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); addEmployee.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addEmployeeActionPerformed(evt); } }); viewInfo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N viewInfo.setText("VIEW INFO"); viewInfo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); viewInfo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { viewInfoActionPerformed(evt); } }); viewInfo1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N viewInfo1.setText("UPDATE SALARY"); viewInfo1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); viewInfo1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { viewInfo1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(44, 44, 44) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(addEmployee, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE) .addComponent(viewInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(viewInfo1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel1)) .addContainerGap(47, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(31, 31, 31) .addComponent(jLabel1) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(jLabel2)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(92, 92, 92) .addComponent(addEmployee) .addGap(41, 41, 41) .addComponent(viewInfo) .addGap(30, 30, 30) .addComponent(viewInfo1))) .addGap(8, 8, 8) .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(89, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); setSize(new java.awt.Dimension(556, 494)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void backActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backActionPerformed setVisible(false); Home ob=new Home(); ob.setVisible(true); }//GEN-LAST:event_backActionPerformed private void addEmployeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addEmployeeActionPerformed setVisible(false); AddEmployee ob=new AddEmployee(); ob.setVisible(true); }//GEN-LAST:event_addEmployeeActionPerformed private void viewInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewInfoActionPerformed setVisible(false); ViewEmployee ob=new ViewEmployee(); ob.setVisible(true); }//GEN-LAST:event_viewInfoActionPerformed private void viewInfo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewInfo1ActionPerformed setVisible(false); EmployeeInfoSearch ob = new EmployeeInfoSearch(); ob.setVisible(true); }//GEN-LAST:event_viewInfo1ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Department.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Department.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Department.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Department.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Department().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton addEmployee; private javax.swing.JButton back; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; private javax.swing.JButton viewInfo; private javax.swing.JButton viewInfo1; // End of variables declaration//GEN-END:variables }
d9ad66bad19da811b2234feabbb04ce1af949ed0
15e0054231e8cc77ea925033b6c18a5b3f860fbf
/src/main/java/com/sh/zfc/graph/bfs/BFS.java
da380c7c75c4a2455354331d0a66e7ecaf2f2173
[]
no_license
tony820418github/arithmetic
e7783f854536147e8d4d7dcb2069aec81b295558
3fdb76facced54af6c69820fce54be23fde185c6
refs/heads/master
2021-06-27T02:18:45.437635
2019-01-31T09:25:11
2019-01-31T09:25:11
158,799,593
0
0
null
2020-10-13T10:58:28
2018-11-23T07:59:49
Java
UTF-8
Java
false
false
3,139
java
package com.sh.zfc.graph.bfs; /* * * */ import javax.xml.soap.Node; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; import java.util.Queue; import java.util.stream.Collectors; public class BFS { /** * 生成广度优先算法数 */ public Node createBFSTree(){ return null; } /** * 计算两点之间的一条最短路径,邻接矩阵法表示图 * */ // public List<Point> shortestPath(Point start , Point end, int[][] map){ // return null; // } /** * 广度优先遍历图,邻接矩阵实现 * {0101 * 1010 * 0100 * 1000} * */ public List<Integer> BFSTraverse(int[][] graph){ int vertexNum = graph.length; List<Integer> visited = new ArrayList<>(); Queue<Integer> visiting = new ArrayDeque<>(); visiting.add(0); while (visiting.size() >0) { Integer vertex = visiting.poll(); visited.add(vertex); for (int i = 0; i < vertexNum; i++) { if (graph[vertex][i] ==1 && !visited.contains(i)) { visiting.add(i); } } } return visited; } /** * 广度优先遍历图,邻接表实现 * 假设数结点存储的是字符串。 * */ public List<VerText> BFSTraverseTable(VerText[] graph){ int vertexNum = graph.length; List<VerText> visited = new ArrayList<>(); Queue<VerText> visiting = new ArrayDeque<>(); visiting.add(graph[0]); while (visiting.size() >0) { VerText vertex = visiting.poll(); visited.add(vertex); LinkNode linknode = vertex.getFirstChild(); while (linknode != null){ if (!visited.contains(graph[linknode.getIndex()])) { visiting.add(graph[linknode.getIndex()]); linknode = linknode.getNext(); } } } return visited; } /** 邻接表的vertex结点 */ public static class VerText{ public String data; LinkNode firstChild; public VerText(String data) { this.data = data; } public String getData() { return data; } public void setData(String data) { this.data = data; } public LinkNode getFirstChild() { return firstChild; } public void setFirstChild(LinkNode firstChild) { this.firstChild = firstChild; } } /** * 邻接表的连接接点 */ public static class LinkNode{ public int index; LinkNode next; public LinkNode(int index) { this.index = index; } public int getIndex() { return index; } public LinkNode getNext() { return next; } public void setIndex(int index) { this.index = index; } public void setNext(LinkNode next) { this.next = next; } } }
7da8a20947c52f34e5984a356e10940023baad26
525a2d2f3e530639999865e0e5f6bdc86ee2dbc2
/ArrayListDouble.java
9b72e08229cc7629e34df806150536a31416c78a
[]
no_license
jumardiardi/tugas-3-ASD
f5b11ad8ea20465df1d213872103eb580519a3b3
2ac66b4c0beb4612c775511475bc24bb38e321fe
refs/heads/master
2020-04-03T21:44:49.931921
2018-10-31T15:33:31
2018-10-31T15:33:31
155,580,281
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
import java.util.ArrayList; public class ArrayListDouble { public static void main(String[] args) { ArrayList<Double> TinggiBadan = new ArrayList<Double>(); TinggiBadan.add(170.0); TinggiBadan.add(180.5); TinggiBadan.add(190.5); TinggiBadan.add(200.8); System.out.println("Apakah ArrayList Kosong : " + TinggiBadan.isEmpty()); System.out.println("Tinggi Badan : " + TinggiBadan); System.out.println("Berapa Jumlah Data : " + TinggiBadan.size()); TinggiBadan.remove(3); System.out.println("Tinggi Badan : " + TinggiBadan); } }
6fbb7e2bbd97b23e7c94bfcbb96d227045823042
254c928adc78938472b60d027b33a78f84d4f979
/20180711 Laura Camara/src/test/java/com/example/administrador/camera/ExampleUnitTest.java
b0eb7128d88ec8030896da5084644e02db166089
[]
no_license
Alfonfdez/Desarrollo_tecnologias_web-Ejercicios_Android_Studio
e3f154d7892e5e7c754bb831387dc7f12c9ca9f4
1a3626f31c78ec53e172212f80bbd9b0de2b3daa
refs/heads/master
2020-03-31T18:06:33.122067
2018-10-10T15:40:38
2018-10-10T15:40:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
393
java
package com.example.administrador.camera; 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); } }
ca26d48b60974126c04d3089344ae355531bbaad
ab7ce3dc28ddcc9ef1f2f4c5281b566f64a4b923
/src/test/java/com/servme/tes/todoapp/service/UserServiceTest.java
a1024eee8f02e39c703d5245d342b1872a7d6d1f
[]
no_license
m-yassine1/todo-app
49b2c45f66f9d841cebf5c4df3f0b53c1fef063c
95fdf4662c6f92762aa383d449643298109f902a
refs/heads/master
2022-12-14T03:09:50.302875
2020-09-12T12:48:51
2020-09-12T12:48:51
294,651,533
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.servme.tes.todoapp.service; import com.servme.tes.todoapp.repository.ForgotPasswordRepository; import com.servme.tes.todoapp.repository.LoginTokenRepository; import com.servme.tes.todoapp.repository.UserRepository; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class UserServiceTest { @Mock private UserRepository userRepository; @Mock private LoginTokenRepository loginTokenRepository; @Mock private ForgotPasswordRepository forgotPasswordRepository; @Mock private EmailService emailService; @InjectMocks private UserService userService; @Test public void register() { } }
32ed8d9ca665131cd71e89a11f29cff7afd17c8c
61655a278de5e0efaff94ff1e148f2bd833d0e50
/src/main/java/com/zaurtregulov/spring/security/configuration/MyConfig.java
cd63e96a4bd7a23f42be0cb62e07045e877c0200
[]
no_license
Didar83/spring_security
e69254830ffa1cb4bd28f53bb93285d763132124
6c6f276c60db204b6c1709ac0ff39b0d6dcefee9
refs/heads/main
2023-02-02T16:59:12.031183
2020-12-22T11:36:10
2020-12-22T11:36:10
323,609,490
0
0
null
null
null
null
UTF-8
Java
false
false
1,513
java
package com.zaurtregulov.spring.security.configuration; import com.mchange.v2.c3p0.ComboPooledDataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.view.InternalResourceViewResolver; import javax.sql.DataSource; import java.beans.PropertyVetoException; @Configuration @ComponentScan(basePackages = "com.zaurtregulov.spring.security") @EnableWebMvc public class MyConfig { @Bean public ViewResolver viewResolver(){ InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver(); internalResourceViewResolver.setPrefix("/WEB-INF/view/"); internalResourceViewResolver.setSuffix(".jsp"); return internalResourceViewResolver; } @Bean public DataSource dataSource(){ ComboPooledDataSource dataSource = new ComboPooledDataSource(); try { dataSource.setDriverClass("com.mysql.cj.jdbc.Driver"); dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/my_db?useSSL=false"); dataSource.setUser("bestuser"); dataSource.setPassword("bestuser"); } catch (PropertyVetoException e) { e.printStackTrace(); } return dataSource; } }
fbd13d335fbb839805824dec0ecda885ba3ab47f
0434c3a0358bb27a31fe18bbfdf981d5c446c56b
/src/test/java/io/itelligmanagement/gestionprojet/GestionProjetApplicationTests.java
ad188ee273747b6d360b9c0d202523eeac48b38e
[]
no_license
oussamaerrachki/GestionProjet
baf3e99d9b3988e0e44fd0bc501d9b61bc8d5fd9
bac4ce2b30348f53281f09b0f1e85d8abec3f152
refs/heads/master
2020-08-08T21:37:19.806884
2019-10-09T15:04:40
2019-10-09T15:04:40
213,925,859
0
0
null
2019-10-09T15:15:18
2019-10-09T13:26:48
Java
UTF-8
Java
false
false
367
java
package io.itelligmanagement.gestionprojet; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class GestionProjetApplicationTests { @Test public void contextLoads() { } }
742ce15366034bc0f8feb7d93aea83ce26505edb
567429dcb0ef3f2216a555469764d1336625a778
/src/gsontest/People.java
d5beb58fd3a806e6a77508bf1d6857479075c97c
[]
no_license
star1606/JavaStudyNew3
73af9b6a01aa0ef6e74d89e20a5a92c5703c2fc3
0a0b0688a6f6f9fad6e2eff2575bdae81de072d8
refs/heads/master
2021-05-24T07:29:29.310793
2020-04-29T03:22:41
2020-04-29T03:22:41
253,450,493
0
0
null
null
null
null
UHC
Java
false
false
683
java
package gsontest; import java.util.HashMap; import java.util.Map; public class People { //자바오브젝트 원형을 만들었음 private String name; private Integer age; private Map<String, Object> additionalProperties = new HashMap<String, Object>(); public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
595b14ff6c00ad3ad04acef0ccbea7cc1c95bbe1
abb472fc5b75db511acd2144815d9d24be653b9e
/bc-chronos-core/src/main/java/bg/bc/tools/chronos/core/usecases/crud/project/IProjectCrud.java
46abd9e1caef579acbac74f5e7158a069f9bb694
[]
no_license
gIliev94/Chronos
4ba5ca343d757df981579049ac89d771482847c0
33c97fa33800327fa72eda195792316281b0d003
refs/heads/master
2020-12-30T16:46:52.770851
2018-02-25T18:50:08
2018-02-25T18:50:08
91,027,828
0
0
null
null
null
null
UTF-8
Java
false
false
156
java
package bg.bc.tools.chronos.core.usecases.crud.project; public interface IProjectCrud extends IAddProject, IGetProject, IUpdateProject, IRemoveProject { }
1c0444b97636ca6bb5a57c151538d5fc7f3975ae
1e6a14ad73b3cc798e015afc235966d1431748c8
/test/test/RLECompressorTest.java
03c8c6a4db511cd09401ef35a09e33e2efc2bf1f
[]
no_license
anisbet/jpegger
fb9c7229caabedca3e8396ade288d8ca13c9f76f
1c933ff9fea66dab4ad117c4cb0a7f4c5353384d
refs/heads/master
2020-04-12T08:26:45.444071
2015-02-01T19:26:16
2015-02-01T19:26:16
30,156,846
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package nisbet.andrew.test; import static org.junit.Assert.*; import org.junit.Test; public class RLECompressorTest { @Test public void testRLEEncoder() { fail("Not yet implemented"); // TODO } @Test public void testCompress() { fail("Not yet implemented"); // TODO } }
4183025f5c9da724df5eb23785086f31cb7ebc02
0ca9a0873d99f0d69b78ed20292180f513a20d22
/saved/sources/com/google/android/gms/common/api/internal/zzcp.java
ab5374bfd61fd24ff9b33e6efd11820708097eac
[]
no_license
Eliminater74/com.google.android.tvlauncher
44361fbbba097777b99d7eddd6e03d4bbe5f4d60
e8284f9970d77a05042a57e9c2173856af7c4246
refs/heads/master
2021-01-14T23:34:04.338366
2020-02-24T16:39:53
2020-02-24T16:39:53
242,788,539
1
0
null
null
null
null
UTF-8
Java
false
false
2,613
java
package com.google.android.gms.common.api.internal; import android.support.annotation.NonNull; import com.google.android.gms.common.api.OptionalPendingResult; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.common.api.ResultStore; import com.google.android.gms.common.api.ResultTransform; import com.google.android.gms.common.api.TransformedResult; import com.google.android.gms.common.internal.Hide; import java.util.concurrent.TimeUnit; /* compiled from: OptionalPendingResultImpl */ public final class zzcp<R extends Result> extends OptionalPendingResult<R> { private final BasePendingResult<R> zza; public zzcp(PendingResult<R> pendingResult) { if (pendingResult instanceof BasePendingResult) { this.zza = (BasePendingResult) pendingResult; return; } throw new IllegalArgumentException("OptionalPendingResult can only wrap PendingResults generated by an API call."); } public final boolean isDone() { return this.zza.zze(); } public final R get() { if (isDone()) { return await(0, TimeUnit.MILLISECONDS); } throw new IllegalStateException("Result is not available. Check that isDone() returns true before calling get()."); } public final R await() { return this.zza.await(); } public final R await(long j, TimeUnit timeUnit) { return this.zza.await(j, timeUnit); } public final void cancel() { this.zza.cancel(); } public final boolean isCanceled() { return this.zza.isCanceled(); } public final void setResultCallback(ResultCallback<? super R> resultCallback) { this.zza.setResultCallback(resultCallback); } public final void setResultCallback(ResultCallback<? super R> resultCallback, long j, TimeUnit timeUnit) { this.zza.setResultCallback(resultCallback, j, timeUnit); } public final void store(ResultStore resultStore, int i) { this.zza.store(resultStore, i); } @Hide public final void zza(PendingResult.zza zza2) { this.zza.zza(zza2); } @NonNull public final <S extends Result> TransformedResult<S> then(@NonNull ResultTransform<? super R, ? extends S> resultTransform) { return this.zza.then(resultTransform); } @Hide public final void zzb(int i) { this.zza.zzb(i); } @Hide public final Integer zzb() { return this.zza.zzb(); } }
1ccf55bc4888a3f88747e63157609a2123636cc4
d60f65e4788bf03d0aa50e3f15a79f5f9ddf966b
/src/main/java/types/IntPairPrefixPartitioner.java
e6f9f14866751a504674aeed7733c84ef75a6c0b
[]
no_license
Djentleman2414/BigDataWS20
86ebc2df8784bc87877cae70bde79b63e7b75f56
d06e2c156ae2a828e7f4d6f7737b9dbdcc885cca
refs/heads/master
2023-02-17T16:15:36.299337
2021-01-10T20:21:39
2021-01-10T20:21:39
305,551,635
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package types; import org.apache.hadoop.mapreduce.Partitioner; public class IntPairPrefixPartitioner<T> extends Partitioner<IntPairWritable, T> { @Override public int getPartition(IntPairWritable key, T val, int numPartitions) { int hash = key.getX(); int partition = (hash % numPartitions) & Integer.MAX_VALUE; return partition; } }
23fccc103c8f91dfd91f0dc8e8b16b631b343ff1
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13141-48-14-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/resource/servlet/RoutingFilter_ESTest_scaffolding.java
0148f1844be6b6308af0ab1fe0771ebdba8e7989
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Jan 20 20:34:42 UTC 2020 */ package org.xwiki.resource.servlet; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class RoutingFilter_ESTest_scaffolding { // Empty scaffolding for empty test suite }
34c0f38495305a7a2d5f4e35b082174071606391
4c0f2e360c3450bb654f35c3185ffc4d9cfd26c5
/src/main/java/com/example/pointypatient/core/utils/Utils.java
c48d1ccbb8c56d274cb46b635ebee4ad1ea233cb
[]
no_license
mboshernitsan/dropwizard-angular-example
3075a4d9b385194d0b831728b1f9e11b6a1162cd
abf91e07989678aa7eb70899cb71ee98baf40158
refs/heads/master
2021-05-15T01:35:22.234552
2018-08-10T00:41:05
2018-08-10T00:41:05
13,130,141
2
1
null
null
null
null
UTF-8
Java
false
false
773
java
package com.example.pointypatient.core.utils; import io.dropwizard.jackson.Jackson; import java.io.ByteArrayOutputStream; import com.example.pointypatient.db.MongoUtils; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Charsets; public class Utils { private static final ObjectMapper toStringMapper = MongoUtils.configureObjectMapper(Jackson.newObjectMapper()); public static String toString(Object obj) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); toStringMapper.writeValue(out, obj); return out.toString(Charsets.UTF_8.name()); } catch (Exception e) { return String.format("<json conversion failed: @%x>", obj.hashCode()); } } }
f4fa23b0bbdec0a4d8ef5de17155a3606d5b9ce0
440dd06fe62a305fa2f8fa89b115e046227c6734
/wyc-common/wyc-http/src/main/java/com/ga/wyc/domain/bean/StatelessAuthcFilter.java
1114cb81ee881a84616adf8bade0281ad39b6625
[]
no_license
teemo2009/wyc-server
c2a34341731a9805c92ff0dafdb06797cef2dd8c
9d59bdafa0740ce6f392a1ddf048a95fdfe10d15
refs/heads/master
2020-03-23T04:16:14.398934
2018-07-25T00:17:00
2018-07-25T00:17:00
141,073,464
0
0
null
null
null
null
UTF-8
Java
false
false
3,541
java
package com.ga.wyc.domain.bean; import org.apache.shiro.authc.DisabledAccountException; import org.apache.shiro.web.filter.AccessControlFilter; import org.springframework.util.ObjectUtils; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class StatelessAuthcFilter extends AccessControlFilter { private final String PARAM_TOKEN="Access-token"; private final String PARAM_DIGEST="Client-digest"; @Override protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception { return false; } @Override protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { HttpServletRequest httpServletRequest = (HttpServletRequest) request; if ("OPTIONS".equals(httpServletRequest.getMethod())) { return true; } //1、客户端生成的消息摘要 String accessToken = httpServletRequest.getHeader(PARAM_TOKEN); //2、客户端传入的用户身份 String username = httpServletRequest.getHeader(PARAM_DIGEST); if(ObjectUtils.isEmpty(accessToken)||ObjectUtils.isEmpty(username)){ //登录失败 onLoginFail(response); return false; } //4、生成无状态Token StatelessToken token = new StatelessToken(username, accessToken); try { //5、委托给Realm进行登录 getSubject(request, response).login(token); } catch (Exception e) { if(e instanceof DisabledAccountException){ //远程异常登录 onRemoteFail(response); }else{ //6、登录失败 onLoginFail(response); } return false; } return true; } /** * 登录失败时默认返回401状态码 * * @param response * @throws IOException */ private void onLoginFail(ServletResponse response) throws IOException { HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("Content-type", "text/html;charset=UTF-8"); httpResponse.setCharacterEncoding("utf-8"); wrapCorsResponse(httpResponse); httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); httpResponse.getWriter().write("登录异常"); } /** * 异地时默认返回4010状态码 * * @param response * @throws IOException */ private void onRemoteFail(ServletResponse response) throws IOException { HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("Content-type", "text/html;charset=UTF-8"); httpResponse.setCharacterEncoding("utf-8"); wrapCorsResponse(httpResponse); httpResponse.setStatus(4010); httpResponse.getWriter().write("账号在异地登录"); } /** * 添加cors支持 * * @param response */ private void wrapCorsResponse(HttpServletResponse response) { response.addHeader("Access-Control-Allow-Origin", "*"); response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE"); response.addHeader("Access-Control-Allow-Headers", "Content-Type"); response.addHeader("Access-Control-Max-Age", "1800"); } }
c2665a3543716287af2d1f7953059452361c750c
f7660bfd9e89fba1ecdfd6709ec09e05c4b61f4e
/src/polyphormism/Building.java
ac9d47ea20299e66cb12a6f535dd8971e25ce64d
[]
no_license
mmannan04/HomeWork3
ca575b2173be7f6d09de6a6f346b588adfde7c36
d82d32adbac257ee7d9a200c1e82936e035c42d6
refs/heads/master
2020-06-10T04:54:21.107501
2016-12-10T02:22:14
2016-12-10T02:22:14
76,085,016
0
0
null
null
null
null
UTF-8
Java
false
false
182
java
package polyphormism; public class Building extends BuildingShape { public int rectangle(int a, int b, int c,int d,int e){ int total = a + b + c + d + 6; return total; } }
8222c5e6a6066c9a69ede3ac013f4880251e5487
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/airrequest/TransformResponseOperator.java
e722fa059432aa483d8ff07724d2827352d6e41a
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
778
java
package com.airbnb.airrequest; import p032rx.Observable; import p032rx.functions.Func1; final class TransformResponseOperator<T> implements Func1<AirResponse<T>, Observable<AirResponse<T>>> { private final AirRequest request; TransformResponseOperator(AirRequest request2) { this.request = request2; } public Observable<AirResponse<T>> call(AirResponse<T> airResponse) { if (!(this.request instanceof BaseRequest)) { return Observable.just(airResponse); } try { return Observable.just(((BaseRequest) this.request).transformResponse(airResponse)); } catch (RuntimeException e) { return Observable.error(new AirRequestNetworkException(this.request, (Throwable) e)); } } }
804c0c2d6673d27c4b8d56eeef746c10e5805354
1ab925fbb97ebaa8f96a3c03c7150e62610c084e
/src/main/java/jim/sums/common/db/CourseLevel.java
66d483ba29537e96d270af1206074506aefa600b
[]
no_license
AndrewStanton94/APSW_Group_Z
8166da8b87b6946d2dcb96c6a38d59ba78927886
ae14b200679a05aa7f5765b09caf0b95c6ea94fb
refs/heads/master
2021-07-19T17:21:49.597927
2018-03-20T11:46:27
2018-03-20T11:46:27
120,441,686
1
0
null
2021-06-03T19:38:05
2018-02-06T10:55:34
Java
UTF-8
Java
false
false
3,701
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jim.sums.common.db; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * * @author Nicolas Dossou-Gbete */ @Entity //@Table(name = "GRADE") @NamedQueries({ @NamedQuery(name = "CourseLevel.findAll", query = "SELECT g FROM CourseLevel g"), @NamedQuery(name = "CourseLevel.findById", query = "SELECT g FROM CourseLevel g WHERE g.id = :id"), @NamedQuery(name = "CourseLevel.findByName", query = "SELECT g FROM CourseLevel g WHERE g.name = :name")}) public class CourseLevel implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) // @Basic(optional = false) // @NotNull private Long id; // @Basic(optional = false) // @NotNull // @Size(min = 1, max = 32) // @Column(name = "GRADENAME") private String name; // BerardiD ******* @ManyToMany(mappedBy = "gradeList") private List<Projectidea> projectideaList = new ArrayList<>(); // ******* @OneToMany(cascade = CascadeType.ALL, mappedBy = "courseLevel") private List<Unit> unitList = new ArrayList<>(); public CourseLevel() { } public CourseLevel(Long id) { this.id = id; } public CourseLevel(Long id, String name) { this.id = id; this.name = name; } static private final String[] levelnames = {"First Degree", "Second Degree", "Third Degree", "Masters Degree Not Mainly By Research"}; static private List<CourseLevel> allCourseLevels = null; static public List<CourseLevel> getAllValues() { if (allCourseLevels == null) { allCourseLevels = new ArrayList<CourseLevel>(); long id = 0L; for (String s : levelnames) { id++; CourseLevel k = new CourseLevel(id, s); allCourseLevels.add(k); } } return allCourseLevels; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Projectidea> getProjectideaList() { return projectideaList; } public void setProjectideaList(List<Projectidea> projectideaList) { this.projectideaList = projectideaList; } public List<Unit> getUnitList() { return unitList; } public void setUnitList(List<Unit> unitList) { this.unitList = unitList; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof CourseLevel)) { return false; } CourseLevel other = (CourseLevel) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } }
dcc9a05db3712b8945c7b270717594bce22180e9
efad5ac5b4388dff15aedd80ad76483f25eb09b8
/retrofit/src/main/java/com/hannesdorfmann/mosby/retrofit/exception/NetworkException.java
4f99f8a0372cf4d61d11b69bac73b5f8ef628c3a
[ "Apache-2.0" ]
permissive
princepspolycap/mosby
f1e90d3d84e2955e1f532079d3528576a5ade8a0
f5ae114edb6eb8f25c85de554583415d36f56820
refs/heads/master
2021-06-01T01:03:12.545205
2015-09-01T12:20:10
2015-09-01T12:20:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
/* * Copyright 2015 Hannes Dorfmann. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hannesdorfmann.mosby.retrofit.exception; /** * Used to wrap network errors (like no active internet connection) * into a Exception so that the view can generate the desired error message * * @author Hannes Dorfmann * @since 1.0.0 */ public class NetworkException extends Exception { public NetworkException() { } public NetworkException(String detailMessage) { super(detailMessage); } public NetworkException(String detailMessage, Throwable throwable) { super(detailMessage, throwable); } public NetworkException(Throwable throwable) { super(throwable); } }
2e577ae079cde8e3c694e7efe4dcc25b773c7048
0fc70bce1cd7a8bc4acad70306596e3b51f1969a
/billpayosgiBlueprint/rest/html/jetty-6.1.7/modules/servlet-api-2.5/src/main/java/javax/servlet/SingleThreadModel.java
ab2b5d02b9dcf89146bd068565dbd70107eb56f7
[]
no_license
pragkirk/billpayevolutiondemo
c3a8f324d5bbaa7ee929c6cd78d993dc392a5c9e
c00cc4b86b3b305f91491b43b1ac103a88f8cd37
refs/heads/master
2023-07-21T03:20:29.446093
2023-07-06T20:44:21
2023-07-06T20:44:21
6,296,960
12
11
null
null
null
null
UTF-8
Java
false
false
2,172
java
/* * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the "License"). You may not use this file except * in compliance with the License. * * You can obtain a copy of the license at * glassfish/bootstrap/legal/CDDLv1.0.txt or * https://glassfish.dev.java.net/public/CDDLv1.0.html. * See the License for the specific language governing * permissions and limitations under the License. * * When distributing Covered Code, include this CDDL * HEADER in each file and include the License file at * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, * add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] * * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * * Portions Copyright Apache Software Foundation. */ package javax.servlet; /** * Ensures that servlets handle * only one request at a time. This interface has no methods. * * <p>If a servlet implements this interface, you are <i>guaranteed</i> * that no two threads will execute concurrently in the * servlet's <code>service</code> method. The servlet container * can make this guarantee by synchronizing access to a single * instance of the servlet, or by maintaining a pool of servlet * instances and dispatching each new request to a free servlet. * * <p>Note that SingleThreadModel does not solve all thread safety * issues. For example, session attributes and static variables can * still be accessed by multiple requests on multiple threads * at the same time, even when SingleThreadModel servlets are used. * It is recommended that a developer take other means to resolve * those issues instead of implementing this interface, such as * avoiding the usage of an instance variable or synchronizing * the block of the code accessing those resources. * This interface is deprecated in Servlet API version 2.4. * * * @author Various * * @deprecated As of Java Servlet API 2.4, with no direct * replacement. */ public interface SingleThreadModel { }
9ebdcd219f3ff41d0a3dc03082f8a8405303a209
1f159f951e2b125d2defe8b3fa679d81b8de3b84
/src/main/java/net/imwork/yangyuanjian/common/annotation/SetUtf8.java
9c85360d4cbc4b0c8aaa1d58f5ec5577fcc1930f
[]
no_license
LuckyMagacian/park
2e05a452fefabe878f6f58270734f560b7edae73
0dbf3c785bcd24d325c8ed5fd9d15e017f567a22
refs/heads/master
2021-09-01T13:35:38.500698
2017-12-27T08:15:54
2017-12-27T08:15:54
111,293,679
1
0
null
null
null
null
UTF-8
Java
false
false
327
java
package net.imwork.yangyuanjian.common.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD,ElementType.TYPE}) public @interface SetUtf8 { }
10a13832125fa5b31dafa35050cb19d2fc1952c5
6532f4e5f904a871d27ad9e44daccf32839b4733
/src/com/csci5448/content/SportFactory.java
6beda402149d139ee9cd7309e48af9c196c8d5c5
[]
no_license
John459/CSCI5448_Project
9899140a6548b88cfb8986098de0876005eff2f5
7383935aef6f379bde2b67c167aca1f4f41dbc73
refs/heads/master
2021-01-11T08:41:07.762560
2016-12-07T09:50:29
2016-12-07T09:50:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package com.csci5448.content; public class SportFactory { public static Sport chooseSport(String type) { Sport sport = null; if (type.equalsIgnoreCase("BASKETBALL")) sport = Sport.BASKETBALL; else if (type.equalsIgnoreCase("BASEBALL")) sport = Sport.BASEBALL; else if (type.equalsIgnoreCase("FOOTBALL")) sport = Sport.FOOTBALL; return sport; } }
765a69c3bb2a4f96f2d3f68a9d4a0fb8fdd5feef
0fdb0b3d1d41102be8b48fe739b68fa2d3d85eac
/cassandraloader/src/main/java/com/reds/service/cassandraloader/dos/AssetCassandraTransactionHistory.java
d8f846b600fd0401de10a73f08545584efbf102f
[]
no_license
RohithRetnakumar/sfmigration
408ce0e0ab63ca2ddba783f721cd9128a5ffec83
7b45bb0626824f5b4f5818400489b68effbbcba7
refs/heads/main
2023-03-13T15:16:13.173101
2021-03-12T09:58:52
2021-03-12T09:58:52
347,007,495
0
0
null
null
null
null
UTF-8
Java
false
false
7,196
java
package com.reds.service.cassandraloader.dos; import java.util.Date; //Table("asset_transaction_status_history") public class AssetCassandraTransactionHistory { //PrimaryKey private AssetTransactionKey key; //Column("master_transaction_id") private Long assetTransactionMasterId; //Column("transactionAmount") private Double transactionAmount; //Column("product_name") private String productName; //Column("product_category") private String productCategory; //Column("product_category_name") private String productCategoryName; //Column("from_channel_id") private String fromChannelId; //Column("to_channle_id") private String toChannelId; //Column("from_region") private String fromRegionId; //Column("to_region") private String toRegion; //Column("from_cluster") private String fromCluster; //Column("to_cluster") private String toCluster; //Column("from_owner_id") private String fromOwnerId; //Column("to_owner_id") private String toOwnerId; //Column("from_owner_type") private String fromOwnerType; //Column("to_owner_type") private String toOwnerType; //Column("from_warehouse_id") private String fromWareHouseId; //Column("to_warehouse_id") private String toWareHouseId; //Column("cross_channel") private Boolean crossChannel; //Column("cross_region") private Boolean crossRegion; //Column("cross_cluster") private Boolean crossCluster; //Column("description") private String description; //Column("asset_status") private String assetStatus; //Column("price") private Double price; //Column("access_via") private String accessVia; //Column("payment_mode") private String paymentMode; //Column("checkin_id") private String checkinId; //Column("program_id") private String programId; //Column("program_name") private String programName; //Column("cancelled") private Boolean cancelled = false; //Column("created_on") private Date createdOn; //Column("created_user") private String createdUser; //Column("distributor_warehouse_id") private String distributorWarehouseId; public AssetTransactionKey getKey() { return key; } public void setKey(AssetTransactionKey key) { this.key = key; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public String getProductCategory() { return productCategory; } public void setProductCategory(String productCategory) { this.productCategory = productCategory; } public String getProductCategoryName() { return productCategoryName; } public void setProductCategoryName(String productCategoryName) { this.productCategoryName = productCategoryName; } public Long getAssetTransactionMasterId() { return assetTransactionMasterId; } public void setAssetTransactionMasterId(Long assetTransactionMasterId) { this.assetTransactionMasterId = assetTransactionMasterId; } public Double getTransactionAmount() { return transactionAmount; } public void setTransactionAmount(Double transactionAmount) { this.transactionAmount = transactionAmount; } public String getFromChannelId() { return fromChannelId; } public void setFromChannelId(String fromChannelId) { this.fromChannelId = fromChannelId; } public String getToChannelId() { return toChannelId; } public void setToChannelId(String toChannelId) { this.toChannelId = toChannelId; } public String getFromOwnerId() { return fromOwnerId; } public void setFromOwnerId(String fromOwnerId) { this.fromOwnerId = fromOwnerId; } public String getToOwnerId() { return toOwnerId; } public void setToOwnerId(String toOwnerId) { this.toOwnerId = toOwnerId; } public String getFromRegionId() { return fromRegionId; } public void setFromRegionId(String fromRegionId) { this.fromRegionId = fromRegionId; } public String getToRegion() { return toRegion; } public void setToRegion(String toRegion) { this.toRegion = toRegion; } public String getFromCluster() { return fromCluster; } public void setFromCluster(String fromCluster) { this.fromCluster = fromCluster; } public String getToCluster() { return toCluster; } public void setToCluster(String toCluster) { this.toCluster = toCluster; } public String getFromOwnerType() { return fromOwnerType; } public void setFromOwnerType(String fromOwnerType) { this.fromOwnerType = fromOwnerType; } public String getToOwnerType() { return toOwnerType; } public void setToOwnerType(String toOwnerType) { this.toOwnerType = toOwnerType; } public String getFromWareHouseId() { return fromWareHouseId; } public void setFromWareHouseId(String fromWareHouseId) { this.fromWareHouseId = fromWareHouseId; } public String getToWareHouseId() { return toWareHouseId; } public void setToWareHouseId(String toWareHouseId) { this.toWareHouseId = toWareHouseId; } public Boolean getCrossChannel() { return crossChannel; } public void setCrossChannel(Boolean crossChannel) { this.crossChannel = crossChannel; } public Boolean getCrossRegion() { return crossRegion; } public void setCrossRegion(Boolean crossRegion) { this.crossRegion = crossRegion; } public Boolean getCrossCluster() { return crossCluster; } public void setCrossCluster(Boolean crossCluster) { this.crossCluster = crossCluster; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getAssetStatus() { return assetStatus; } public void setAssetStatus(String assetStatus) { this.assetStatus = assetStatus; } public Double getPrice() { return price; } public void setPrice(Double price) { this.price = price; } public String getAccessVia() { return accessVia; } public void setAccessVia(String accessVia) { this.accessVia = accessVia; } public String getCheckinId() { return checkinId; } public void setCheckinId(String checkinId) { this.checkinId = checkinId; } public String getProgramId() { return programId; } public void setProgramId(String programId) { this.programId = programId; } public String getProgramName() { return programName; } public void setProgramName(String programName) { this.programName = programName; } public String getPaymentMode() { return paymentMode; } public void setPaymentMode(String paymentMode) { this.paymentMode = paymentMode; } public Boolean getCancelled() { if(null == cancelled) { return false; } return cancelled; } public void setCancelled(Boolean cancelled) { this.cancelled = cancelled; } public Date getCreatedOn() { return createdOn; } public void setCreatedOn(Date createdOn) { this.createdOn = createdOn; } public String getCreatedUser() { return createdUser; } public void setCreatedUser(String createdUser) { this.createdUser = createdUser; } public String getDistributorWarehouseId() { return distributorWarehouseId; } public void setDistributorWarehouseId(String distributorWarehouseId) { this.distributorWarehouseId = distributorWarehouseId; } }
30ae31cec0b4c7502cab9562bc10620e2942a5f8
9988744bbbd99c91594a425283370b6143749a83
/app/src/androidTest/java/com/hanifhudha/aplikasisederhana/ExampleInstrumentedTest.java
98fac8ae21f21472b85a775a0618001eafb14cff
[]
no_license
hanifhudha/Aplikasi-Sederhana
a6d68fafae2f4ebc6418d8aa1c6f1b5248e5c94f
15b8aba947cda4d40bcd8652e9cfdf2ce9a9801a
refs/heads/main
2023-07-10T15:23:19.935406
2021-08-13T00:26:30
2021-08-13T00:26:30
394,463,321
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package com.hanifhudha.aplikasisederhana; 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.hanifhudha.aplikasisederhana", appContext.getPackageName()); } }
5c86f58abaa497ead7cee8ceb22c6c4fe913a149
aeb29cfc0e49ce39f6c99cb516f70b1e74e87739
/src/uk/ac/ed/inf/op/model/Person.java
18cb58ce03caf563f2a16333a1881c636b2d05e0
[]
no_license
Kyriakosk/Inf1OP
1eb25ec4107345f513651e016ccdf867d915c393
562ae515180d7aaf0a91d2421478826554f96dff
refs/heads/master
2020-04-05T23:26:16.630657
2015-03-06T12:50:05
2015-03-06T12:50:05
31,925,744
0
0
null
2015-03-12T21:44:13
2015-03-09T22:18:13
Java
UTF-8
Java
false
false
82
java
package uk.ac.ed.inf.op.model; public class Person { public String firstName; }