blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
0
313
1979db8189d65a77e15ccca91b3da95a82fd793e
c87176ed15135df616111f8de3e8b836ab32d91a
/Dialog1/app/src/main/java/com/example/cglin/dialog1/MainActivity.java
fc556dd17530d97bca4c0ddbf760ad3325ea1d2a
[]
no_license
CGLingit/Android
8759247d79015804bb8280892102929902a550ea
ce1e979a9aa4d13994fbf16b16dd7ee8828a8013
refs/heads/master
2021-01-22T17:52:30.234660
2017-04-25T13:03:14
2017-04-25T13:03:14
85,038,791
0
0
null
null
null
null
UTF-8
Java
false
false
1,227
java
package com.example.cglin.dialog1; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); AlertDialog.Builder dialog=new AlertDialog.Builder(MainActivity.this); dialog.setIcon(android.R.drawable.ic_dialog_info); dialog.setTitle("Welcome"); dialog.setMessage("欢迎使用本程序"); dialog.setPositiveButton("肯定", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //确定完成的事情 } }); dialog.setNegativeButton("否定", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //否定的事情 } }); dialog.create(); dialog.show(); } }
ebadb4ff76490c28586a52bab2eaa2742b3ba5fb
159f75d12bb51bff89497499c2dbc2971ad8dc3e
/edelta.parent/edelta/old/EdeltaEObjectAtOffsetHelper.java
a700098cb6dc9cb74735558929cbdb7e629da1d9
[]
no_license
LorenzoBettini/edelta
f406a305b99bdf30e373cb26d097df8ae256da6c
b011c66859f7751bd8434e91d87ace681978f1c1
refs/heads/master
2023-07-02T10:07:46.624753
2023-06-08T11:36:36
2023-06-08T11:36:36
97,230,480
8
7
null
2023-06-08T10:02:02
2017-07-14T12:13:27
Java
UTF-8
Java
false
false
1,720
java
package edelta.resource; import org.eclipse.emf.ecore.ENamedElement; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.EcoreUtil2; import org.eclipse.xtext.nodemodel.INode; import org.eclipse.xtext.nodemodel.util.NodeModelUtils; import org.eclipse.xtext.xbase.XExpression; import org.eclipse.xtext.xbase.linking.BrokenConstructorCallAwareEObjectAtOffsetHelper; import com.google.inject.Inject; import edelta.edelta.EdeltaEcoreReference; import edelta.edelta.EdeltaEcoreReferenceExpression; import edelta.resource.derivedstate.EdeltaDerivedStateHelper; /** * Customization for ecoreref references, using the original enamed element. * * @author Lorenzo Bettini */ public class EdeltaEObjectAtOffsetHelper extends BrokenConstructorCallAwareEObjectAtOffsetHelper { @Inject private EdeltaDerivedStateHelper edeltaDerivedStateHelper; @Override protected EObject resolveCrossReferencedElement(final INode node) { final EObject referenceOwner = NodeModelUtils.findActualSemanticObjectFor(node); if (referenceOwner instanceof EdeltaEcoreReference) { final EdeltaEcoreReference ecoreReference = (EdeltaEcoreReference) referenceOwner; final ENamedElement original = edeltaDerivedStateHelper .getEcoreReferenceState(ecoreReference) .getOriginalEnamedelement(); if (original != null) return original; XExpression expression = edeltaDerivedStateHelper .getEcoreReferenceExpressionState( EcoreUtil2.getContainerOfType(ecoreReference, EdeltaEcoreReferenceExpression.class)) .getEnamedElementXExpressionMap() .get(ecoreReference.getEnamedelement()); if (expression != null) return expression; } return super.resolveCrossReferencedElement(node); } }
b0bc8a815e355b07e1556605b9d0003be1fc6663
5d5d989ddcc8b16b09c8884569f96941d4b4c3bd
/src/doodledrop/db/UserNotExistException.java
c8510c4dc6340118fae0af6c1e2c8018fbe56a70
[]
no_license
robinbach/DoodleDropJavaGame
5bc712e3f1af4eb25d8576178fcc5a45c3826282
04d1504f86c6f0f491094d532b27753d82e47491
refs/heads/master
2021-01-15T20:29:22.506946
2014-12-01T19:33:37
2014-12-01T19:33:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
140
java
package doodledrop.db; public class UserNotExistException extends Exception { UserNotExistException(String str){ super(str); } }
71404a2b0201bafb1179321c648d20ea08093b82
244a5ccba8b06d930d90f88584aca488f4a307e4
/tracker/src/main/java/com/all/tracker/service/VersionService.java
877fcfa3d15560b3f1b3e7fc69cf3ad7336f7ba8
[ "Apache-2.0" ]
permissive
josdem/client-backend
31513adef063fcf7eaeb4633077c69ddbd21e3e9
cfa2bfbba258406f23714480ff1d061103b5450c
refs/heads/master
2020-12-24T13:17:51.994904
2013-02-13T22:03:01
2013-02-13T22:03:01
2,869,206
1
1
null
2016-03-10T00:23:04
2011-11-28T18:34:54
Java
UTF-8
Java
false
false
15,346
java
/** Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2011 Eric Haddad Koenig 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.all.tracker.service; import java.io.File; import java.io.FileNotFoundException; import java.util.List; import java.util.Properties; import javax.annotation.PostConstruct; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.orm.hibernate3.HibernateTemplate; import org.springframework.stereotype.Service; import com.all.commons.Md5FileGenerator; import com.all.tracker.model.Version; @Service public class VersionService { public static final String QUERY_VERSION = "from Version where artifactId = ?"; private static final Log log = LogFactory.getLog(VersionService.class); private static final String EXTENSION = ".zip"; private static final String UNDERSCORE = "_"; public static final String UPDATE_FILE_PATH = "version.update.base.file.path"; @Autowired private HibernateTemplate ht; @Autowired private Properties settings; private Md5FileGenerator md5FileGenerator = new Md5FileGenerator(); private String updatePath; @PostConstruct public void initialize() { updatePath = settings.getProperty(UPDATE_FILE_PATH); if (updatePath == null) { throw new IllegalStateException("Property not found in settings.properties file: " + UPDATE_FILE_PATH); } } @SuppressWarnings("unchecked") public Version getUpdatedVersion(String clientArtifactId, String clientVersion, String os) throws NoUpdateException, FileNotFoundException { List<Version> allVersions = ht.find(QUERY_VERSION, clientArtifactId); if (allVersions.isEmpty()) { throw new NoUpdateException("Artifact ID not found", new IllegalArgumentException("Could not find the artifactId: " + clientArtifactId)); } Version latestUpdateVersion = findLatestVersion(allVersions, new Version(clientArtifactId, clientVersion)); if (latestUpdateVersion == null) { throw new NoUpdateException("No new updates found for artifact ID: " + clientArtifactId); } String artifactId = latestUpdateVersion.getArtifactId(); String latestVersion = latestUpdateVersion.getVersion(); String updateFilePath = getUpdateFilePath(artifactId, latestVersion, os); File updateFile = new File(updateFilePath); log.debug("update file path: " + updateFilePath); if (!updateFile.exists()) { throw new NoUpdateException("Cannot find update file", new FileNotFoundException(updateFilePath)); } latestUpdateVersion.setUpdateFile(updateFile); latestUpdateVersion.setMd5Checksum(calculateMd5Checksum(updateFile)); return latestUpdateVersion; } private Version findLatestVersion(List<Version> versions, Version clientVersion) { Version latestVersion = null; for (Version version : versions) { if (version.compareTo(clientVersion) > 0) { latestVersion = version; clientVersion = version; } } return latestVersion; } // TODO cache the md5 checksum so it gets only calculated once private String calculateMd5Checksum(File updateFile) { byte[] calculatedMd5Checksum = md5FileGenerator.calculateMd5Checksum(updateFile); return md5FileGenerator.getByteToBase64String(calculatedMd5Checksum); } private String getUpdateFilePath(String artifactId, String version, String os) { StringBuilder sb = new StringBuilder(updatePath); sb.append(File.separator); sb.append(artifactId.toUpperCase()); sb.append(File.separator); sb.append(version.toUpperCase()); sb.append(File.separator); sb.append(artifactId.toUpperCase()); sb.append(UNDERSCORE); sb.append(version.toUpperCase()); sb.append(UNDERSCORE); sb.append(os.toUpperCase()); sb.append(EXTENSION); return sb.toString(); } }
c2e877c85e4d8ae9a06be653e86158ec7eaea33a
32f0659b89082607d271d05e95718698b44fab64
/15_Quiz/4팀_신동오_권연주_이민용_이수진/QuizGui/Game.java
b1952f41f65c5d7ed3e79d2d21ca59622e24823b
[]
no_license
lzhxxn/ToyProject
fbd753fd2d1d37a0d45c3a474161aaf3fb6037e3
31e7d61b880d831b5180af447040c8f73df1d658
refs/heads/main
2023-03-09T00:24:53.929978
2021-02-28T07:54:01
2021-02-28T07:54:01
341,750,233
0
0
null
null
null
null
UHC
Java
false
false
4,190
java
import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.border.*; class Game extends JFrame{ Container c; JPanel pN,pS,pC; JPanel pN1,pN2; JLabel laName, laScore, laT; JButton bRe, bPass, bExit; JButton bSB, bCC; JButton qB[] = new JButton[20]; int timeI; String timeS; int scoreI; String scoreS; Color bgc = new Color(59, 89, 182); Color pbgc = new Color(237,239,236); Color txtc = new Color(45,48,54); //JButton text; Game(String nameG){ //컴포넌트 컨테이너 생성 c = getContentPane(); pN = new JPanel(new GridLayout(1,2)); pN1 = new JPanel(new GridLayout(1,2)); laName = new JLabel("<html>Player<br>"+nameG+"</html>"); scoreI = 0; scoreS = Integer.toString(scoreI); laScore = new JLabel("<html>Score<br>"+scoreS+"</html>"); pN2 = new JPanel(new GridLayout(1,2)); bSB = new JButton("Board"); timeI = 15; timeS = Integer.toString(timeI); laT = new JLabel(timeS); pC = new JPanel(new CardLayout()); makeButton(); // 문제버튼 얹기 pS = new JPanel(new BorderLayout()); ImageIcon normalIcon1 = new ImageIcon("img\\Restart.png"); bRe = new JButton(null,normalIcon1); bPass = new JButton("Pass"); ImageIcon normalIcon2 = new ImageIcon("img\\exit.png"); bExit = new JButton(null,normalIcon2); pN.add(pN1); pN.add(pN2); pN1.add(laName);pN1.add(laScore); pN2.add(laT); pN2.add(bSB); pS.add(bRe, BorderLayout.WEST); pS.add(bExit, BorderLayout.EAST); pS.add(bPass); c.add(pN, BorderLayout.NORTH); c.add(pS, BorderLayout.SOUTH); c.add(pC); designC(); listenerSet(); setUI(); new IntTime().start(); } void makeButton(){ //#1 문제버튼 만들기(현재 배열로 햇는데, 컬렉션으로 바꿔야할듯) for(int i=0;i<qB.length;i++){ qB[i] = new JButton(Integer.toString(i)); qB[i].setBackground(bgc); qB[i].setForeground(Color.WHITE); qB[i].setFocusPainted(false); qB[i].setFont(new Font("굴림체", Font.BOLD, 20)); pC.add(qB[i]); } } void designC(){ //여기서 컴포넌트 꾸며주세요~~ pN.setBackground(bgc); pN1.setBackground(pbgc); Border oBN = laName.getBorder(); Border eBorder = new EmptyBorder(20, 10, 20, 10); CompoundBorder cBN = new CompoundBorder(oBN, eBorder); laName.setBorder(cBN); laName.setFont(new Font("Tahoma", Font.BOLD, 15)); laName.setBackground(pbgc); laName.setForeground(txtc); laName.setOpaque(true); Border oBS = laScore.getBorder(); CompoundBorder cBS = new CompoundBorder(oBS, eBorder); laScore.setBorder(cBS); laScore.setFont(new Font("Tahoma", Font.BOLD, 15)); laScore.setBackground(pbgc); laScore.setForeground(txtc); laScore.setOpaque(true); pN2.setBackground(pbgc); laT.setFont(new Font("Tahoma", Font.BOLD, 25)); laT.setHorizontalAlignment(JLabel.CENTER); bSB.setFont(new Font("Tahoma", Font.BOLD, 15)); bSB.setBackground(pbgc); bSB.setForeground(txtc); pC.setBackground(bgc); bRe.setBackground(pbgc); bPass.setFont(new Font("Tahoma", Font.BOLD, 30)); bPass.setBackground(pbgc); bPass.setForeground(txtc); bExit.setBackground(pbgc); } void listenerSet(){ ActionListener gameH = new GameHandler(this); bSB.addActionListener(gameH); bPass.addActionListener(gameH); bRe.addActionListener(gameH); bExit.addActionListener(gameH); for(int i=0;i<qB.length;i++){ qB[i].addActionListener(gameH); } } class IntTime extends Thread{ public void run(){ while(true){ try{ Thread.sleep(1000); timeI -= 1; timeS = Integer.toString(timeI); //System.out.println(timeS); if(timeI == 10) laT.setFont(new Font("Tahoma", Font.BOLD, 45)); laT.setText(timeS); if(timeI == 0) break; }catch(InterruptedException iie){ } } //text = new JButton("Time Out"); laT.setFont(new Font("Tahoma", Font.BOLD, 18)); laT.setText("Time Over"); validate(); } } void setUI(){ setTitle("PLAY"); setSize(400, 400); setVisible(true); //setLocation(350, 200); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); } public static void main(String[] args) { //new Game("신동오"); } }
bc0e5725b683ca76eb58d3594790d2ab3eabb400
772d3e6ac425b1e6fa13ef3858adecf4eb51e8dc
/test/NullPointerExceptionExam.java
f373a26322b0544b73b1a5d04ebd9c4288aee7c6
[]
no_license
go88hoontops/java
2723a13decbf5eaf7a4928476a76e94341f5c58c
ea7c4f2f577874dc1ec8ab5d5f7f910432ab3f37
refs/heads/master
2023-04-06T09:10:10.373247
2021-04-06T01:09:46
2021-04-06T01:09:46
355,005,350
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package com.jh.test; public class NullPointerExceptionExam { public static void main(String[] args) { String data =null; //전처리 //에러가 생기지않게 처리. System.out.println("asdasdasd"); } }
cefed1884d836c6cbea0d44f4f431f0e5ab9cb01
2cbb913f97b7b918d16015b1aca459a32b8e594f
/src/main/java/latmod/ftbu/mod/FTBUFinals.java
47715b00e81964a00af92a86dcf545bc4a0a7035
[]
no_license
labolet/FTBUtilities
6a1c4f48530fec6e38185b0035a5165f77b5e528
4b9d4b12de7e35ecd33584da042d9d75c9fce7a3
refs/heads/1.7.10
2021-01-18T04:59:33.423572
2015-10-29T03:50:36
2015-10-29T03:50:36
45,157,748
0
0
null
2015-10-29T03:24:29
2015-10-29T03:24:29
null
UTF-8
Java
false
false
427
java
package latmod.ftbu.mod; import ftb.lib.mod.FTBLibFinals; public class FTBUFinals // FTBU { public static final String MOD_ID = "FTBU"; public static final String MOD_VERSION = "@VERSION@"; public static final String MOD_NAME = "FTBUtilities"; public static final String MOD_DEP = "required-after:FTBL;after:Baubles;after:Waila"; public static final String MOD_VERSION_DISPLAY = FTBLibFinals.DEV ? "Dev" : MOD_VERSION; }
475d642b56480de71e0f367b83394eec457b0e44
fca7ff6789824ac9af76794de6df23f8b1d50158
/Online_Charity_Website_SpringBoot_Project/src/main/java/com/capgemini/exception/NoSuchEventFoundException.java
783154914492e2b4593591d61e8914e5fa33fb2c
[]
no_license
wefouryou143/wefouryou143-Online_Charity_Website
d3d3a0cf3a0049a6b863bb938f107ecedd89fb34
8fd159ac9ae10d8e2d207e5a49cce6427fa832b7
refs/heads/master
2023-07-02T03:00:41.716140
2021-08-05T14:02:22
2021-08-05T14:02:22
393,053,517
1
0
null
null
null
null
UTF-8
Java
false
false
233
java
package com.capgemini.exception; public class NoSuchEventFoundException extends Exception{ /** * */ private static final long serialVersionUID = 1L; public NoSuchEventFoundException(String message) { super(message); } }
9a6f70e759e336c264ca0b3d3d8214bcbc6b65eb
4c80a78ea7dd17a81b3beeafc2510452431a756a
/src/main/java/com/hcl/ing/hungerbox/dto/ItemResponseDto.java
053617df4cf2b9cdfb76383da6badb7c62def755
[]
no_license
bojjasrirajesh/HungerBox
2f5ad59d11007b8d6030fe9b996e4c4ab8421182
b2e8cf47db60cee890a573b2b5b22aa92bed3d2d
refs/heads/master
2020-12-28T14:54:56.892606
2020-02-06T10:26:35
2020-02-06T10:26:35
238,378,330
0
1
null
2020-02-05T08:46:16
2020-02-05T05:52:36
Java
UTF-8
Java
false
false
847
java
package com.hcl.ing.hungerbox.dto; import java.io.Serializable; import java.util.List; import com.hcl.ing.hungerbox.entity.Items; public class ItemResponseDto implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private String message; private Integer statusCode; private List<Items> items; private Items item; public Items getItem() { return item; } public void setItem(Items item) { this.item = item; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Integer getStatusCode() { return statusCode; } public void setStatusCode(Integer statusCode) { this.statusCode = statusCode; } public List<Items> getItems() { return items; } public void setItems(List<Items> items) { this.items = items; } }
7e4734dc25d83cb71af4b8e7d9abda1c73a453a9
0403b0ed061eb22ac185f3981952c67b771551be
/CucumberLatestFramework/src/main/java/com/Pages/HotelsPage.java
df2e179df3fa3967234522bb07f676365f195496
[]
no_license
lileshbansal/Cucumberframework
395abef20297e18df27957e1508702528bf47304
1cb65dbba076ea1887866fc100e9da5c6168cbbf
refs/heads/master
2020-04-16T03:07:46.543762
2019-01-14T10:55:56
2019-01-14T10:55:56
165,221,130
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.Pages; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import com.TestBase.TestBase; public class HotelsPage extends TestBase{ @FindBy(id = "hp-widget__sDest") WebElement city_dropdown; @FindBy(id = "hp-widget__chkIn") WebElement checkin; @FindBy(id = "hp-widget__chkOut") WebElement checkout; @FindBy(id = "hp-widget__paxCounter") WebElement rooms; @FindBy(id = "searchBtn") WebElement searchBtn; public HotelsPage() { PageFactory.initElements(driver, this); } public void enter_city() { city_dropdown.click(); try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } driver.findElement(By.id("//ul[@id='ui-id-1']//span[text()='Mumbai, India']")).click(); } public void clickonSubmit() { try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } searchBtn.click(); } }
ce3e15d39770b5146ce72697146addecbd8a40a1
22967aea1664d9bb13a096888031217920024334
/src/main/java/com/example/demo/config/WebSecurityConfiguration.java
f93281e4bec1f261b1101ee8fdba2a8360ac4bdf
[]
no_license
dileepkeeppalli/backend
ae2fb2edb1c850e7320377275d08cbae8bb68db8
ea1b3c9dd0b2a8e96995bd608a9eb9de07c3a95e
refs/heads/master
2021-05-21T21:52:37.484285
2020-04-03T19:28:13
2020-04-03T19:28:13
252,817,636
2
0
null
null
null
null
UTF-8
Java
false
false
694
java
package com.example.demo.config; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @EnableWebSecurity public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public void configure(HttpSecurity http) throws Exception { http.csrf().disable().authorizeRequests().anyRequest().permitAll(); } }
253c992930bdedfb9788c24451237c50bcb16c34
857a1fda631712321b78ae9b9f9ca6482365a657
/src/HomeWork16/myThread.java
941acd0cfed7629f4f88eef70584c33b2e41fe6e
[]
no_license
fekdas/CSvorob_JHomeWork
f7b8bb05b80d4e700ba91ca37f3f9dd27534698d
90ef418b2122b602b9fb7bc7af769256aa7011bb
refs/heads/master
2021-01-10T11:28:20.143800
2016-03-14T15:53:26
2016-03-14T15:53:26
51,298,930
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
372
java
package HomeWork16; public class myThread extends Thread { public void run() { for (int i = 0; i<11;i++) { HomeWork16task2task3.print10(); try { Thread.sleep(505); } catch (InterruptedException e) { System.out.println("sleep не отработал как надо" + e.getMessage()); } } } }
bdbdd2c4da8c7b9c5e1936a007a161a8147fc044
99129174f5044768333f09796274b63c737c0eed
/app/src/test/java/com/anysoftkeyboard/keyboards/ExternalAnyKeyboardTest.java
bf44d7ee08aa38df5ff06b215bfef816f2ff543d
[ "Apache-2.0" ]
permissive
jannat412/AnySoftKeyboard
ed96d3dc9badbc59eedf049c68a04cedca921d74
58f7291ef91cafac01d88614b10c7b2e1a956484
refs/heads/master
2021-05-11T21:19:10.652669
2018-01-13T03:34:42
2018-01-13T03:34:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,816
java
package com.anysoftkeyboard.keyboards; import android.content.Context; import android.text.TextUtils; import com.anysoftkeyboard.AnySoftKeyboardTestRunner; import com.anysoftkeyboard.addons.AddOn; import com.anysoftkeyboard.addons.DefaultAddOn; import com.anysoftkeyboard.api.KeyCodes; import com.anysoftkeyboard.keyboards.views.KeyDrawableStateProvider; import com.menny.android.anysoftkeyboard.AnyApplication; import com.menny.android.anysoftkeyboard.R; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RuntimeEnvironment; @RunWith(AnySoftKeyboardTestRunner.class) public class ExternalAnyKeyboardTest { public static final KeyboardDimens SIMPLE_KeyboardDimens = new KeyboardDimens() { @Override public int getKeyboardMaxWidth() { return 480; } @Override public float getKeyHorizontalGap() { return 1; } @Override public float getRowVerticalGap() { return 2; } @Override public int getNormalKeyHeight() { return 5; } @Override public int getSmallKeyHeight() { return 4; } @Override public int getLargeKeyHeight() { return 6; } }; private AddOn mDefaultAddOn; private Context mContext; @Before public void setup() { mContext = RuntimeEnvironment.application; mDefaultAddOn = new DefaultAddOn(mContext, mContext); } @Test public void testGeneralProperties() throws Exception { AnyKeyboard keyboard = AnyApplication.getKeyboardFactory(RuntimeEnvironment.application).getEnabledAddOn().createKeyboard(Keyboard.KEYBOARD_ROW_MODE_NORMAL); Assert.assertNotNull(keyboard); Assert.assertTrue(keyboard instanceof ExternalAnyKeyboard); Assert.assertEquals("en", keyboard.getDefaultDictionaryLocale()); Assert.assertEquals("English", keyboard.getKeyboardName()); Assert.assertEquals("c7535083-4fe6-49dc-81aa-c5438a1a343a", keyboard.getKeyboardId()); Assert.assertEquals(R.drawable.ic_stat_en, keyboard.getKeyboardIconResId()); Assert.assertEquals(1, keyboard.getKeyboardMode()); } @Test public void testLoadedKeyboard() throws Exception { AnyKeyboard keyboard = AnyApplication.getKeyboardFactory(RuntimeEnvironment.application).getEnabledAddOn().createKeyboard(Keyboard.KEYBOARD_ROW_MODE_NORMAL); Assert.assertNotNull(keyboard); keyboard.loadKeyboard(SIMPLE_KeyboardDimens); Assert.assertEquals(SIMPLE_KeyboardDimens.getKeyboardMaxWidth(), keyboard.getMinWidth()); Assert.assertEquals(48, keyboard.getHeight()); Assert.assertEquals(40, keyboard.getKeys().size()); Assert.assertNotNull(keyboard.getShiftKey()); Assert.assertEquals(KeyCodes.SHIFT, keyboard.getShiftKey().mCodes[0]); } @Test public void testDrawableState() throws Exception { //NOTE: this is used ONLY for the key's background drawable! AnyKeyboard keyboard = AnyApplication.getKeyboardFactory(RuntimeEnvironment.application).getEnabledAddOn().createKeyboard(Keyboard.KEYBOARD_ROW_MODE_NORMAL); Assert.assertNotNull(keyboard); keyboard.loadKeyboard(SIMPLE_KeyboardDimens); KeyDrawableStateProvider provider = new KeyDrawableStateProvider(1, 2, 3, 4, 5); AnyKeyboard.AnyKey key = (AnyKeyboard.AnyKey) keyboard.getKeys().get(4); Assert.assertFalse(key.isFunctional()); Assert.assertArrayEquals(provider.KEY_STATE_NORMAL, key.getCurrentDrawableState(provider)); key.onPressed(); Assert.assertArrayEquals(provider.KEY_STATE_PRESSED, key.getCurrentDrawableState(provider)); key.onReleased(); Assert.assertArrayEquals(provider.KEY_STATE_NORMAL, key.getCurrentDrawableState(provider)); AnyKeyboard.AnyKey shiftKey = (AnyKeyboard.AnyKey) keyboard.getShiftKey(); Assert.assertNotNull(shiftKey); Assert.assertEquals(KeyCodes.SHIFT, shiftKey.getPrimaryCode()); Assert.assertTrue(shiftKey.isFunctional()); Assert.assertArrayEquals(provider.KEY_STATE_FUNCTIONAL_NORMAL, shiftKey.getCurrentDrawableState(provider)); shiftKey.onPressed(); Assert.assertArrayEquals(provider.KEY_STATE_FUNCTIONAL_PRESSED, shiftKey.getCurrentDrawableState(provider)); shiftKey.onReleased(); Assert.assertArrayEquals(provider.KEY_STATE_FUNCTIONAL_NORMAL, shiftKey.getCurrentDrawableState(provider)); //enter AnyKeyboard.AnyKey enterKey = (AnyKeyboard.AnyKey) keyboard.getKeys().get(keyboard.getKeys().size() - 1); Assert.assertNotNull(enterKey); Assert.assertEquals(KeyCodes.ENTER, enterKey.getPrimaryCode()); Assert.assertTrue(enterKey.isFunctional()); Assert.assertArrayEquals(provider.KEY_STATE_ACTION_NORMAL, enterKey.getCurrentDrawableState(provider)); enterKey.onPressed(); Assert.assertArrayEquals(provider.KEY_STATE_ACTION_PRESSED, enterKey.getCurrentDrawableState(provider)); enterKey.onReleased(); Assert.assertArrayEquals(provider.KEY_STATE_ACTION_NORMAL, enterKey.getCurrentDrawableState(provider)); } @Test public void testCodesParsing() throws Exception { ExternalAnyKeyboard keyboard = new ExternalAnyKeyboard(mDefaultAddOn, mContext, mContext, R.xml.keyboard_with_codes_as_letters, R.xml.keyboard_with_codes_as_letters, "test", R.drawable.sym_keyboard_notification_icon, 0, "en", "", "", Keyboard.KEYBOARD_ROW_MODE_NORMAL); keyboard.loadKeyboard(SIMPLE_KeyboardDimens); final Keyboard.Key keyZ = keyboard.getKeys().get(0); Assert.assertNotNull(keyZ); Assert.assertEquals((int) 'z', keyZ.getPrimaryCode()); Assert.assertEquals((int) 'z', keyZ.getCodeAtIndex(0, false)); Assert.assertEquals((int) 'Z', keyZ.getCodeAtIndex(0, true)); Assert.assertEquals("1żžź", keyZ.popupCharacters.toString()); Assert.assertEquals(R.xml.popup_one_row, keyZ.popupResId); final Keyboard.Key keyX = keyboard.getKeys().get(1); Assert.assertNotNull(keyX); Assert.assertEquals((int) 'x', keyX.getPrimaryCode()); Assert.assertEquals((int) 'x', keyX.getCodeAtIndex(0, false)); Assert.assertEquals((int) 'X', keyX.getCodeAtIndex(0, true)); Assert.assertTrue(TextUtils.isEmpty(keyX.popupCharacters)); Assert.assertEquals(0, keyX.popupResId); /*disabled due to Robolectric issue: https://github.com/robolectric/robolectric/pull/3671 final AnyKeyboard.AnyKey key3 = (AnyKeyboard.AnyKey) keyboard.getKeys().get(2); Assert.assertNotNull(key3); Assert.assertEquals("\'", key3.label.toString()); Assert.assertEquals((int) '\'', key3.getPrimaryCode()); Assert.assertEquals((int) '\'', key3.getCodeAtIndex(0, false)); Assert.assertEquals((int) '\"', key3.getCodeAtIndex(0, true)); Assert.assertEquals("„\"”", key3.popupCharacters.toString()); Assert.assertEquals(R.xml.popup_one_row, key3.popupResId); Assert.assertTrue(key3.isFunctional()); */ final AnyKeyboard.AnyKey keyMinus4 = (AnyKeyboard.AnyKey) keyboard.getKeys().get(3); Assert.assertNotNull(keyMinus4); Assert.assertEquals(-4, keyMinus4.getPrimaryCode()); Assert.assertEquals(-4, keyMinus4.getCodeAtIndex(0, false)); Assert.assertEquals(-4, keyMinus4.getCodeAtIndex(0, true)); Assert.assertEquals("f", keyMinus4.popupCharacters.toString()); Assert.assertEquals(R.xml.popup_one_row, keyMinus4.popupResId); Assert.assertTrue(keyMinus4.isFunctional()); final AnyKeyboard.AnyKey keyMinus5 = (AnyKeyboard.AnyKey) keyboard.getKeys().get(4); Assert.assertNotNull(keyMinus5); Assert.assertEquals(-5, keyMinus5.getPrimaryCode()); Assert.assertEquals(-5, keyMinus5.getCodeAtIndex(0, false)); Assert.assertEquals(-5, keyMinus5.getCodeAtIndex(0, true)); Assert.assertTrue(TextUtils.isEmpty(keyMinus5.popupCharacters)); Assert.assertEquals(0, keyMinus5.popupResId); Assert.assertTrue(keyMinus5.isFunctional()); final AnyKeyboard.AnyKey keyP = (AnyKeyboard.AnyKey) keyboard.getKeys().get(5); Assert.assertNotNull(keyP); Assert.assertEquals((int) 'p', keyP.getPrimaryCode()); Assert.assertEquals('p', keyP.getCodeAtIndex(0, false)); Assert.assertEquals('P', keyP.getCodeAtIndex(0, true)); Assert.assertEquals('a', keyP.getCodeAtIndex(1, false)); Assert.assertEquals('A', keyP.getCodeAtIndex(1, true)); Assert.assertEquals('b', keyP.getCodeAtIndex(2, false)); Assert.assertEquals('B', keyP.getCodeAtIndex(2, true)); Assert.assertTrue(TextUtils.isEmpty(keyP.popupCharacters)); Assert.assertEquals(0, keyP.popupResId); Assert.assertFalse(keyP.isFunctional()); final AnyKeyboard.AnyKey key99 = (AnyKeyboard.AnyKey) keyboard.getKeys().get(6); Assert.assertNotNull(keyP); Assert.assertEquals(99, key99.getPrimaryCode()); Assert.assertEquals('c', key99.getCodeAtIndex(0, false)); Assert.assertEquals('C', key99.getCodeAtIndex(0, true)); Assert.assertEquals('d', key99.getCodeAtIndex(1, false)); Assert.assertEquals('D', key99.getCodeAtIndex(1, true)); Assert.assertEquals('e', key99.getCodeAtIndex(2, false)); Assert.assertEquals('E', key99.getCodeAtIndex(2, true)); Assert.assertEquals("ĥ", key99.popupCharacters.toString()); Assert.assertEquals(R.xml.popup_one_row, key99.popupResId); Assert.assertFalse(key99.isFunctional()); } }
0b5aae8b114bf0fc55269fb2fca73feebd0548c8
63db96cd587c04b4f99bb1839c5feb88000aaa54
/src/test/java/ar/edu/itba/sia/gps/eightpuzzle/E8State.java
4da19a47a9fe2cecbe50e8c9e31d3a45656e8b69
[]
no_license
pabloito/GenericProblemSolver
1e65403f2e9e12cbbb4842adfb4bd14163276f1c
c09a45bc5885924375f4d328c336fbddd1110103
refs/heads/master
2020-05-16T21:27:51.452971
2019-04-24T21:18:32
2019-04-24T21:18:32
183,307,014
1
0
null
null
null
null
UTF-8
Java
false
false
2,744
java
package ar.edu.itba.sia.gps.eightpuzzle; import ar.edu.itba.sia.gps.api.State; import java.util.Arrays; public class E8State implements State{ private Pair array[]; Pair blank; @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof E8State)) return false; E8State e8State = (E8State) o; // Probably incorrect - comparing Object[] arrays with Arrays.equals if (array == null){ if (e8State.array != null) return false; } else { for (int i = 0;i < 8; i++){ if(!array[i].equals(e8State.array[i])) return false; } } return blank.equals(e8State.blank); } @Override public int hashCode() { int result = Arrays.hashCode(array); result = 31 * result + blank.hashCode(); return result; } /*@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; E8State other = (E8State) obj; if (blank == null) { if (other.blank != null) return false; else if (array == null) if (other.array != null) return false; } else if (array == null){ if (other.array != null) return false; } else { for (int i = 0;i < 8; i++){ if(!array[i].equals(other.array[i])) return false; } } return true; }*/ public Pair getBlank() { return blank; } public Pair[] getArray() { return array; } public E8State(Pair blank, Pair[] array){ this.blank = blank; this.array = array; } private static StringBuilder stringBuilder = new StringBuilder(); @Override public String toString() { int strOrder[] = new int[9]; for (int i = 0; i < 8; i++) { strOrder[array[i].getX()+array[i].getY()*3] = i+1; } strOrder[blank.getX()+blank.getY()*3] = -1; int a; stringBuilder.delete(0,stringBuilder.capacity()); for (int i = 0; i < 9; i++) { a = strOrder[i]; if(a > 0) stringBuilder.append(a).append(' '); else stringBuilder.append('B').append(' '); if(i%3 == 2) stringBuilder.append('\n'); } return stringBuilder.append('\n').toString(); } @Override public String getRepresentation() { return toString(); } }
4f87bd1974c3b2dc6852a6b7d04ee5a6f89616a1
eaf875dc2300c5257de58f23a0be0ba6f23c224d
/src/main/java/com/nate/eddiebot/listener/EventDispatcher.java
23255fb4a72ba74547f4ef1652f87a1ff8682e57
[]
no_license
nsedler/EddieBot
940688131c11df2a28099695de215b2b3cee8765
2564c46dc23d485b79705a8ba908cf08b7bc16b2
refs/heads/master
2022-11-27T16:32:56.542177
2020-07-24T16:49:08
2020-07-24T16:49:08
152,156,336
3
1
null
2018-12-09T03:20:42
2018-10-08T22:46:38
Java
UTF-8
Java
false
false
520
java
package com.nate.eddiebot.listener; import com.nate.eddiebot.EddieBot; import com.nate.eddiebot.listener.events.BetterMessageEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.hooks.ListenerAdapter; public class EventDispatcher extends ListenerAdapter { @Override public void onMessageReceived(MessageReceivedEvent event) { EddieBot.sendToCommands(new BetterMessageEvent(event)); EddieBot.sendToPassives(new BetterMessageEvent(event)); } }
97811f699b0c5af711fb9e53abdf579f47d5b6ff
a09da10b7e2902a3fa1db09bf7e292fdb8279962
/jk_web/src/main/java/com/xy/webservice/EpServiceService.java
7f1781d9c8a92066e8e9cad317f17bdb4bf709a1
[]
no_license
xieyanfds/jk_parent
ba1f371320b41456695e27202f6c7fc56d9d979d
6e72e3c103fbb7b89d125bd72e7bb21179fa9893
refs/heads/master
2021-10-26T04:15:38.529618
2019-04-10T08:27:44
2019-04-10T08:27:44
115,376,032
0
0
null
null
null
null
UTF-8
Java
false
false
2,964
java
package com.xy.webservice; import java.net.MalformedURLException; import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.2.4-b01 * Generated source version: 2.2 * */ @WebServiceClient(name = "EpServiceService", targetNamespace = "http://webservice.xy.com/", wsdlLocation = "http://localhost/jk_ws1/ws/export?wsdl") public class EpServiceService extends Service { private final static URL EPSERVICESERVICE_WSDL_LOCATION; private final static WebServiceException EPSERVICESERVICE_EXCEPTION; private final static QName EPSERVICESERVICE_QNAME = new QName("http://webservice.xy.com/", "EpServiceService"); static { URL url = null; WebServiceException e = null; try { url = new URL("http://localhost/jk_ws1/ws/export?wsdl"); } catch (MalformedURLException ex) { e = new WebServiceException(ex); } EPSERVICESERVICE_WSDL_LOCATION = url; EPSERVICESERVICE_EXCEPTION = e; } public EpServiceService() { super(__getWsdlLocation(), EPSERVICESERVICE_QNAME); } public EpServiceService(WebServiceFeature... features) { super(__getWsdlLocation(), EPSERVICESERVICE_QNAME, features); } public EpServiceService(URL wsdlLocation) { super(wsdlLocation, EPSERVICESERVICE_QNAME); } public EpServiceService(URL wsdlLocation, WebServiceFeature... features) { super(wsdlLocation, EPSERVICESERVICE_QNAME, features); } public EpServiceService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public EpServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); } /** * * @return * returns EpService */ @WebEndpoint(name = "EpServicePort") public EpService getEpServicePort() { return super.getPort(new QName("http://webservice.xy.com/", "EpServicePort"), EpService.class); } /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. * @return * returns EpService */ @WebEndpoint(name = "EpServicePort") public EpService getEpServicePort(WebServiceFeature... features) { return super.getPort(new QName("http://webservice.xy.com/", "EpServicePort"), EpService.class, features); } private static URL __getWsdlLocation() { if (EPSERVICESERVICE_EXCEPTION!= null) { throw EPSERVICESERVICE_EXCEPTION; } return EPSERVICESERVICE_WSDL_LOCATION; } }
df9930dc795d7eb0e8378587cd36fdbdbcdc5fe8
9cc385c40f6342fed3dc76e0f54b649e764bf79c
/src/adapter/BirdAdapter.java
e257dd97d191b042d48ec825d4d56189e57c3e56
[]
no_license
SerheosMorello/patterns
6230db549d6a1b7a205812689b9310def2c6db79
b45d67bd6612fd22b1eb4cc7577eb55d5fde72d4
refs/heads/master
2021-01-03T21:12:10.303787
2020-02-18T13:01:26
2020-02-18T13:01:26
240,237,256
0
0
null
null
null
null
UTF-8
Java
false
false
224
java
package adapter; public class BirdAdapter implements ToyDuck { Bird bird; public BirdAdapter(Bird bird) { this.bird = bird; } @Override public void squeak() { bird.makeSound(); } }
34509f7cfa4ee5eb1f3d150cffd1e5fc28f301cb
5a896a60704b137fdc5cea77f1848edd53562b00
/app/src/main/java/com/example/my/fragmentSG.java
017ec06d18557bb13663401b847d5aaeeaec1540
[]
no_license
weiwangqiang/-jianmi
06a7df015af3e5a9038baa9d93fd6e5af63b00fe
4ae9a92ea5f89e5b003176b043b910e029e4b2c6
refs/heads/master
2021-01-21T11:18:34.418229
2017-11-12T03:34:51
2017-11-12T03:34:51
83,548,036
0
0
null
null
null
null
UTF-8
Java
false
false
3,092
java
package com.example.my; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import com.example.adapter.baomingAdapter; import com.example.object.Orders; import com.example.wangqiang.jianmi1.R; import java.util.ArrayList; import java.util.List; /** * Created by wangqiang on 2016/7/10. * 上岗 */ public class fragmentSG extends Fragment{ private ListView listview; private List<Orders> list = new ArrayList<>(); private baomingAdapter adapter; private View view; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.inflate(R.layout.main_my_apply_list,container,false); init(); return view; } public void init(){ listview = (ListView)view.findViewById(R.id.my_apply_list); adapter = new baomingAdapter(getActivity(),list, R.layout.main_my_apply_worklistitem, new String[]{"image","title","time","money","location"}, new int[]{R.id.my_apply_listItem_image, R.id.my_apply_listItem_title, R.id.my_apply_listItem_time, R.id.my_apply_listItem_money, R.id.my_apply_listItem_location, R.id.my_apply_listItem_connect, R.id.my_apply_listItem_cancel }); listview.setAdapter(adapter); } @Override public void onStart() { // TODO Auto-generated method stub Log.e("HJJ", "fragmentSG **** onStart..."); super.onStart(); } @Override public void onResume() { Log.e("HJJ", "fragmentSG **** onResume..."); // TODO Auto-generated method stub super.onResume(); } /** * 打开另一个activity,退出程序,调用onPause,onStop */ @Override public void onPause() { Log.e("HJJ", "fragmentSG **** onPause..."); // TODO Auto-generated method stub super.onPause(); } @Override public void onStop() { Log.e("HJJ", "fragmentSG **** onStop..."); // TODO Auto-generated method stub super.onStop(); } @Override public void onDestroyView() { Log.e("HJJ", "fragmentSG **** onDestroyView..."); // TODO Auto-generated method stub super.onDestroyView(); } @Override public void onDestroy() { // TODO Auto-generated method stub Log.e("HJJ", "fragmentSG **** onDestroy..."); super.onDestroy(); } @Override public void onDetach() { Log.e("HJJ", "fragmentSG **** onDetach..."); // TODO Auto-generated method stub super.onDetach(); } //fragment 是否被隐藏,解决viewPager 有白画面的情况 @Override public void onHiddenChanged (boolean hidden){ Log.e("fragmentSG is ",""+hidden); } }
79c630153c40128a80ae7c95c2a50046f352bb68
cd956b956e8bd1e97dde854b73b76c96449a09bc
/app/src/main/java/com/raymondqk/raymusicplayer/activity/MusicListActivity.java
117ae8652a9a818d9e7913544c39cf08f280b5cf
[]
no_license
mason0510/RayMusicPlayer
ee361963a33c16a387bfa90407740d38b8895692
b2a0f28e35017cf440c5d99ed9c0774e0f9f6696
refs/heads/master
2022-12-06T02:03:38.797412
2016-09-04T15:20:01
2016-09-04T15:20:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,311
java
package com.raymondqk.raymusicplayer.activity; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.Window; import android.widget.AdapterView; import android.widget.ImageButton; import android.widget.ListView; import android.widget.SeekBar; import android.widget.Toast; import com.raymondqk.raymusicplayer.MusicMode; import com.raymondqk.raymusicplayer.R; import com.raymondqk.raymusicplayer.adapter.MusicListAdapter; import com.raymondqk.raymusicplayer.service.MusicService; import com.raymondqk.raymusicplayer.utils.ConstantUtils; import com.raymondqk.raymusicplayer.utils.MusicUtils; import java.util.List; /** * Created by 陈其康 raymondchan on 2016/8/3 0003. */ public class MusicListActivity extends AppCompatActivity implements View.OnClickListener { private ListView mListView; private MusicListAdapter mAdapter; private ImageButton mIb_play; private ImageButton mIb_next; private ImageButton mIb_preview; private ImageButton mIb_play_mode; private ImageButton mIb_favor; private SeekBar mProgressBar; private List<MusicMode> mMusicList; private Messenger mMessenger = new Messenger(new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case ConstantUtils.WHAT_REGIST_MSGER_LIST_ACTIVITY: Bundle data = msg.getData(); data.setClassLoader(MusicMode.class.getClassLoader()); mMusicList = data.getParcelableArrayList(ConstantUtils.CURRENT_MUSIC_LIST); // mMusicList = (List<MusicMode>) data.get(ConstantUtils.CURRENT_MUSIC_LIST); if (mMusicList != null) { mAdapter = new MusicListAdapter(MusicListActivity.this, mMusicList); mListView.setAdapter(mAdapter); } boolean isPlaying = data.getBoolean(ConstantUtils.IS_PLAYING); if (isPlaying) { mIb_play.setImageResource(R.drawable.pause); } else { mIb_play.setImageResource(R.drawable.play); } break; case ConstantUtils.WHAT_PLAY_PLAY_BTN: break; case ConstantUtils.WHAT_PLAY_NEXT_BTN: break; case ConstantUtils.WHAT_PLAY_PRE_BTN: break; case ConstantUtils.WHAT_PLAY_DURATION: int position = msg.arg1; int duration = msg.arg2; mProgressBar.setProgress(position * 100 / duration); break; case ConstantUtils.WHAT_PLAYED: setPlaying(msg); default: super.handleMessage(msg); break; } } private void setPlaying(Message msg) { Bundle data = msg.getData(); //就算没用到对应的对象,也要设置class loader,否则会出错。 data.setClassLoader(MusicMode.class.getClassLoader()); boolean isPlaying = data.getBoolean(ConstantUtils.IS_PLAYING); MusicMode musicMode = data.getParcelable(ConstantUtils.CURRENT_MUSIC); if (isPlaying) { mIb_play.setImageResource(R.drawable.pause); } else { mIb_play.setImageResource(R.drawable.play); } } }); private ServiceConnection mServiceConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { mService = new Messenger(service); if (mService != null) { // Toast.makeText(MusicListActivity.this, "服务连接成功", Toast.LENGTH_SHORT).show(); Message msg = Message.obtain(); msg.replyTo = mMessenger; msg.what = ConstantUtils.WHAT_REGIST_MSGER_LIST_ACTIVITY; try { mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } } } @Override public void onServiceDisconnected(ComponentName name) { mService = null; } }; private Messenger mService; private float mPercent; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); supportRequestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_musiclist); initView(); Intent intent = new Intent(this, MusicService.class); bindService(intent, mServiceConnection, BIND_AUTO_CREATE); } @Override protected void onResume() { super.onResume(); } @Override protected void onPause() { super.onPause(); } @Override protected void onStop() { super.onStop(); } @Override protected void onDestroy() { Message msg = Message.obtain(); msg.what = ConstantUtils.WHAT_UN_REGIST_MSGER_LIST_ACTIVITY; try { mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } super.onDestroy(); } private void initView() { //去掉默认导航栏 Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_musiclist); //设置导航图标 左上角 toolbar.setNavigationIcon(R.drawable.nav_back); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); toolbar.setTitle(R.string.app_name); toolbar.setSubtitle(R.string.menu_list); toolbar.inflateMenu(R.menu.list_menu); toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_item_search: Toast.makeText(MusicListActivity.this, "search", Toast.LENGTH_SHORT).show(); break; case R.id.menu_item_setting: Toast.makeText(MusicListActivity.this, "setting", Toast.LENGTH_SHORT).show(); break; } return true; } }); mListView = (ListView) findViewById(R.id.lv_music); mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mMusicList.get(position); Message msg = Message.obtain(); msg.what = ConstantUtils.WHAT_MUSIC_SELECTED; msg.arg1 = position; try { mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } } }); mIb_play = (ImageButton) findViewById(R.id.ib_play); mIb_next = (ImageButton) findViewById(R.id.ib_next); mIb_preview = (ImageButton) findViewById(R.id.ib_preview); mIb_play_mode = (ImageButton) findViewById(R.id.ib_play_mode); mIb_favor = (ImageButton) findViewById(R.id.ib_favor); mIb_favor.setOnClickListener(this); mIb_next.setOnClickListener(this); mIb_preview.setOnClickListener(this); mIb_play.setOnClickListener(this); mIb_play_mode.setOnClickListener(this); mProgressBar = (SeekBar) findViewById(R.id.progressbar); mProgressBar.setProgress(0); mProgressBar.setMax(100); mProgressBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { mPercent = (float) progress * 100 / (float) mProgressBar.getMax(); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { //当用户释放SeekBar之后,在通知service更新进度,解决拖动过程中卡顿问题 Message msg = Message.obtain(); msg.what = ConstantUtils.WHAT_CHANGE_PROGRESS; msg.arg1 = (int) mPercent; try { mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.list_menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { unbindService(mServiceConnection); super.onBackPressed(); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.ib_play_mode: break; case R.id.ib_play: MusicUtils.playCurrent(mService); break; case R.id.ib_next: MusicUtils.playNext(mService); break; case R.id.ib_preview: MusicUtils.playPreview(mService); break; case R.id.ib_favor: break; } } }
5c311b3c55887f993b84edbd1da6fd02fbe4f886
1809d94fc23e1a971b20262581c892e328873a8e
/src/filters/FreePassFilter.java
b5aeb3f37fca5c580ecf99f80cdec5c9e3881036
[]
no_license
pyj0807/exer02
c4bd45d86cbac7fe83faeab2a12e42078a813630
f8184001a4205583f14bcbf3910ec1574500464a
refs/heads/master
2020-03-27T17:20:58.224872
2018-09-18T04:22:19
2018-09-18T04:22:19
146,845,877
0
0
null
null
null
null
UTF-8
Java
false
false
949
java
package filters; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class FreePassFilter extends HttpFilter { protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { HttpSession session = request.getSession(); Cookie[] ar = request.getCookies(); if (ar != null) { chain.doFilter(request, response); } else { for (int i = 0; i < ar.length; i++) { Cookie c = ar[i]; String name = c.getName(); String value = c.getValue(); String path = c.getPath(); String domain = c.getDomain(); int maxage = c.getMaxAge(); } } } }
[ "kgitbank@DESKTOP-U6AB831" ]
kgitbank@DESKTOP-U6AB831
73f743f85b3e136c9b42cddc802cb7856029c2c8
9673e33e34e5d7607458bf4867b836f66e659cfe
/src/testing/java/org/msyu/reinforce/target/testing/junit/JUnitTarget.java
0229e06d62f48ad256308095aa6b90aaf82e0dc9
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
ypoluektovich/reinforce
32a2ea05ca9bb130e68429ddc8c11eb2ea27def1
99530276ed51f5e6202a95bde3bc32b6b269efd2
refs/heads/master
2021-01-10T20:13:39.028353
2013-10-09T12:13:55
2013-10-09T12:13:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,887
java
package org.msyu.reinforce.target.testing.junit; import org.hamcrest.Matcher; import org.junit.runner.JUnitCore; import org.msyu.reinforce.Build; import org.msyu.reinforce.ExecutionException; import org.msyu.reinforce.Log; import org.msyu.reinforce.TargetInitializationException; import org.msyu.reinforce.TargetInvocation; import org.msyu.reinforce.target.ActionOnEmptySource; import org.msyu.reinforce.target.testing.AJavaBasedTestingTarget; import org.msyu.reinforce.util.definition.SettingParserUtil; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; public class JUnitTarget extends AJavaBasedTestingTarget<TestDescription> { public JUnitTarget(TargetInvocation invocation) { super(invocation); } @Override protected final Set<Class<?>> getRequiredClassesForRunner() { return new HashSet<>(Arrays.asList(JUnitRunner.class, JUnitCore.class, Matcher.class)); } @Override protected final TestDescription newTestDescription(ActionOnEmptySource onMissing, Map testMap) throws TargetInitializationException { TestDescription testDescription = new TestDescription(onMissing); try { SettingParserUtil.parseSingle( testMap, Arrays.asList(new AllInCollectionTestParser(testDescription)) ); } catch (TargetInitializationException e) { throw new TargetInitializationException("could not determine what tests to run", e); } return testDescription; } @Override protected void run(TestDescription testDescription, int index, Path workingDir) throws ExecutionException { Path testDescFile = prepareDescriptionFile(workingDir, index, testDescription); executeRunner(testDescFile); } private Path prepareDescriptionFile(Path workingDir, int testIndex, TestDescription testDescription) throws ExecutionException { Path testDescriptionFile = workingDir.resolve("tests." + testIndex + ".dat"); try (ObjectOutput output = new ObjectOutputStream(Files.newOutputStream(testDescriptionFile))) { testDescription.serialize(output); } catch (IOException e) { throw new ExecutionException("error while writing test description file"); } return testDescriptionFile; } private void executeRunner(Path testDescFile) throws ExecutionException { int exitCode; try { List<String> commandLine = getCommandLineArray(testDescFile); Log.debug("Command line arguments: %s", commandLine); Log.verbose("Starting external process..."); Process process = new ProcessBuilder(commandLine) .directory(Build.getCurrent().getBasePath().toFile()) .inheritIO() .start(); while (true) { try { exitCode = process.waitFor(); break; } catch (InterruptedException e) { Log.debug("The thread waiting for the JUnit runner got interrupted. Ignoring..."); } } } catch (IOException e) { throw new ExecutionException("exception during JUnit invocation", e); } Log.verbose("Process exited with code %d", exitCode); if (exitCode != 0) { throw new ExecutionException("JUnit runner exited with status code: " + exitCode); } } private List<String> getCommandLineArray(Path testDescFile) { List<String> commandArgs = new ArrayList<>(); commandArgs.add(getJavaExecutable()); commandArgs.add("-cp"); commandArgs.add(getRunnerClasspathString()); commandArgs.add(JUnitRunner.class.getName()); commandArgs.add(testDescFile.toString()); return commandArgs; } private String getRunnerClasspathString() { StringBuilder sb = new StringBuilder(); for (String entry : myRunnerClasspath) { if (sb.length() > 0) { sb.append(System.getProperty("path.separator")); } sb.append(entry); } return sb.toString(); } }
ee44dfc32f7070c70c8cf72551d987e94978a0e8
70239077fca3aab680309a3a12c9f0c0e6a12131
/Lab1/ChangingPeople.java
50d8ea0e1e26caa99b13c8f20b3035411b0ee6e6
[]
no_license
jessicagerson/Chapter5
b4f7245d7ec9822e94c4956aea77030f16dad442
eba4c72b3fa968daeaf4e9b0eb5a069dd8a133c9
refs/heads/master
2021-08-23T11:35:28.693173
2017-12-04T18:43:50
2017-12-04T18:43:50
111,021,251
0
0
null
null
null
null
UTF-8
Java
false
false
2,546
java
// ********************************************************************** // ChangingPeople.java // // Demonstrates parameter passing -- contains a method that should // change to Person objects. // ********************************************************************** package Lab1; public class ChangingPeople { // --------------------------------------------------------- // Sets up two person objects, one integer, and one String // object. These are sent to a method that should make // some changes. // --------------------------------------------------------- public static void main (String[] args) { Person person1 = new Person ("Sally", 13); Person person2 = new Person ("Sam", 15); int age = 21; String name = "Jill"; System.out.println ("\nParameter Passing... Original values..."); System.out.println ("person1: " + person1); System.out.println ("person2: " + person2); System.out.println ("age: " + age + "\tname: " + name + "\n"); changePeople (person1, person2, age, name); System.out.println ("\nValues after calling changePeople..."); System.out.println ("person1: " + person1); System.out.println ("person2: " + person2); System.out.println ("age: " + age + "\tname: " + name + "\n"); } // ------------------------------------------------------------------- // Change the first actual parameter to "Jack - Age 101" and change // the second actual parameter to be a person with the age and // name given in the third and fourth parameters. // ------------------------------------------------------------------- public static void changePeople (Person p1, Person p2, int age, String name) { System.out.println ("\nInside changePeople... Original parameters..."); System.out.println ("person1: " + p1); System.out.println ("person2: " + p2); System.out.println ("age: " + age + "\tname: " + name + "\n"); // Make changes p2.changeName(name); p2.changeAge(age); Person p3 = new Person (name, age); p2 = p3; name = "Jack"; age = 101; p1.changeName (name); p1.changeAge (age); // Print changes System.out.println ("\nInside changePeople... Changed values..."); System.out.println ("person1: " + p1); System.out.println ("person2: " + p2); System.out.println ("age: " + age + "\tname: " + name + "\n"); } }
e2d9e2c9e2798b96f2b982b3d549b453fcc55e92
8f8cbbde08bf43879c64bcd926651d49bac981e0
/client/app/src/main/java/com/example/taskone/activities/MainActivity.java
e84d30c2f7f4a16337909d76c4a9e47bedf2ddfc
[]
no_license
fedya2303/Task1
1d9938e05947c28d27776dee5d4edd0a0e46b458
599f8a28ce232d2b6a10432448c3f6a289914dcb
refs/heads/main
2022-12-28T10:51:55.128653
2020-10-15T19:18:05
2020-10-15T19:18:05
304,004,400
0
0
null
2020-10-15T19:18:07
2020-10-14T12:13:00
Java
UTF-8
Java
false
false
2,677
java
package com.example.taskone.activities; import android.content.Context; import android.os.Bundle; import android.provider.Settings; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import com.example.taskone.viewmodel.MyViewModel; import com.example.taskone.R; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.InterstitialAd; import com.google.android.gms.ads.MobileAds; public class MainActivity extends AppCompatActivity { private MyViewModel viewModel = new MyViewModel(); ; EditText hostEditText; Button sendReqButton; EditText portEditText; TextView responseText; private String mAppUnitId = "ca-app-pub-7526080045582593~7855797963"; private String mInterstitialAdUnitId = "ca-app-pub-3940256099942544/1033173712"; private InterstitialAd mInterstitialAd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sendReqButton = findViewById(R.id.btn_req); hostEditText = findViewById(R.id.host_edit_text); portEditText = findViewById(R.id.port_edit_text); responseText = findViewById(R.id.grpc_response_text); mInterstitialAd = new InterstitialAd(this); initializeInterstitialAd(mAppUnitId); mInterstitialAd.setAdUnitId(mInterstitialAdUnitId); loadInterstitialAd(mInterstitialAdUnitId); mInterstitialAd.setAdListener(new AdListener() { @Override public void onAdClosed() { mInterstitialAd.loadAd(new AdRequest.Builder().build()); } }); sendReqButton.setOnClickListener(view -> { if ("1".contentEquals(responseText.getText())) { viewModel.downloadFile(getFilesDir(), getApplicationContext()); } if ("3".contentEquals(responseText.getText())) { mInterstitialAd.show(); responseText.setText("0"); } else { viewModel.sendRequest(hostEditText.getText().toString(), portEditText.getText().toString()); } }); viewModel.getNumber().observe(this, number -> responseText.setText(number.toString())); } private void initializeInterstitialAd(String appUnitId) { MobileAds.initialize(this, appUnitId); } private void loadInterstitialAd(String interstitialAdUnitId) { mInterstitialAd.loadAd(new AdRequest.Builder().build()); } }
ebf13310d6f113b218ec610cfe6328c69fdbfd01
f2e493bf3fe8398128742c57ad088adca4a7efd2
/baselibrary/src/main/java/com/fastaoe/baselibrary/permission/PermissionUtils.java
a73ea69ad0e8333b835e0b36053e1373d13c0cc7
[]
no_license
jsntjinjin/android-proficient
8f6744f97c95cb1ca92938285666de60684e0dc6
3dd341c4736d95932550d64a3c40dd8b2f12e049
refs/heads/master
2020-12-03T00:10:39.645770
2017-07-07T09:50:55
2017-07-07T09:50:55
95,995,504
0
0
null
null
null
null
UTF-8
Java
false
false
2,732
java
package com.fastaoe.baselibrary.permission; import android.app.Activity; import android.content.Context; import android.content.pm.PackageManager; import android.os.Build; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; /** * Created by jinjin on 2017/6/11. */ public class PermissionUtils { private PermissionUtils() { throw new UnsupportedOperationException("can not instantiated!"); } public static boolean isOverM() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return true; } else { return false; } } // 执行授权成功方法 public static void executeSuccessMethod(Object object, int requestCode) { Method[] methods = object.getClass().getDeclaredMethods(); for (Method method : methods) { PermissionSuccess success = method.getAnnotation(PermissionSuccess.class); if (success != null && success.requestCode() == requestCode) { executeMethod(method, object); } } } private static void executeMethod(Method method, Object object) { try { method.setAccessible(true); method.invoke(object); } catch (Exception e) { e.printStackTrace(); } } // 获取没有授权的权限 public static List<String> getDeniedPermission(Object object, String[] requestPermissions) { List<String> deniedPermissions = new ArrayList<>(); for (String requestPermission : requestPermissions) { // 遍历获取到没有授权的权限 if (ContextCompat.checkSelfPermission(getActivity(object), requestPermission) == PackageManager.PERMISSION_DENIED) { deniedPermissions.add(requestPermission); } } return deniedPermissions; } public static Activity getActivity(Object object) { if (object instanceof Activity) { return (Activity) object; } else { return ((Fragment) object).getActivity(); } } // 执行授权拒绝方法 public static void executeFailureMethod(Object object, int requestCode) { Method[] methods = object.getClass().getDeclaredMethods(); for (Method method : methods) { PermissionFailure success = method.getAnnotation(PermissionFailure.class); if (success != null && success.requestCode() == requestCode) { executeMethod(method, object); } } } }
40824a3f9fe55b324e46bda4a9d53d5418f387cc
7dd1ab6a4825399851feab8aff8e85cd1f5d9aaf
/src/Glav_form/Bukhgalter.java
ae2f9f8f6243e5065364f1eca6ac502c0b5cd858
[]
no_license
RuslanMen7/realt
0d6f05261b3e35b998d9c4165f71e2a6ae1bc044
0f083b96852207922cc07c3da1d8317c61ef43ad
refs/heads/master
2020-04-09T16:07:24.794805
2018-12-05T01:52:20
2018-12-05T01:52:20
160,444,256
0
0
null
null
null
null
UTF-8
Java
false
false
18,934
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 Glav_form; import Bukhdalter.sozdaniye_kvitka; import Bukhdalter.zarplata; import Delete_dannye.delete; import Dopol_Form.otchet; import Dopol_Form.otchet_sotrudnikov; import Sotrudniki.Sotrudniki; import java.awt.Component; import javax.swing.JOptionPane; /** * * @author Asus */ public class Bukhgalter extends javax.swing.JFrame { /** * Creates new form Bukhgalter */ public Bukhgalter() { initComponents(); } /** * 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(); jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); jMenuItem6 = new javax.swing.JMenuItem(); jMenuItem7 = new javax.swing.JMenuItem(); jMenuItem8 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); jMenuItem3 = new javax.swing.JMenuItem(); jMenuItem4 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("Бухгалтер"); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); jPanel1.setBackground(new java.awt.Color(255, 99, 177)); jButton1.setText("Выход"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Logotip/Безымянный_1.png"))); // NOI18N jButton2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton2.setText("Сотрудники"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton3.setText("Начисление зарплаты"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton4.setText("Создание квитка"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jButton6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton6.setText("Отчеты"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jButton7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton7.setText("Удаленная информация"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Добро пожаловать в систему Бухгалтера"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(35, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton7, javax.swing.GroupLayout.Alignment.LEADING)) .addGap(35, 35, 35)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1)))) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton1) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton4) .addGap(11, 11, 11) .addComponent(jButton3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton6) .addContainerGap(30, Short.MAX_VALUE)) ); jMenu1.setText("Файл"); jMenuItem1.setText("Действия по сотрудникам"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuItem5.setText("Создание квитка"); jMenuItem5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem5ActionPerformed(evt); } }); jMenu1.add(jMenuItem5); jMenuItem6.setText("Начисление зарплаты"); jMenuItem6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem6ActionPerformed(evt); } }); jMenu1.add(jMenuItem6); jMenuItem7.setText("Удаленная информация"); jMenuItem7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem7ActionPerformed(evt); } }); jMenu1.add(jMenuItem7); jMenuItem8.setText("Отчеты"); jMenuItem8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem8ActionPerformed(evt); } }); jMenu1.add(jMenuItem8); jMenuItem2.setText("Выход"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu1.add(jMenuItem2); jMenuBar1.add(jMenu1); jMenu2.setText("Помощь"); jMenuItem3.setText("О программе"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem3ActionPerformed(evt); } }); jMenu2.add(jMenuItem3); jMenuItem4.setText("Справка"); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem4ActionPerformed(evt); } }); jMenu2.add(jMenuItem4); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed Component frame = null; int n = JOptionPane.showConfirmDialog( frame, "Выдествительно хотите покинуть форму?", "", JOptionPane.YES_NO_OPTION); if (n == 0) { dispose(); Authorization form1 = new Authorization(); form1.setVisible(true); } }//GEN-LAST:event_jButton1ActionPerformed private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed }//GEN-LAST:event_formWindowClosed private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing Component frame = null; int n = JOptionPane.showConfirmDialog( frame, "Выдествительно хотите выйти из системы ?", "", JOptionPane.YES_NO_OPTION); if (n == 0) { dispose(); Authorization form1 = new Authorization(); form1.setVisible(true); } }//GEN-LAST:event_formWindowClosing private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed new Sotrudniki().setVisible(true); }//GEN-LAST:event_jButton2ActionPerformed private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed new delete().setVisible(true); }//GEN-LAST:event_jButton7ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed new otchet().setVisible(true); }//GEN-LAST:event_jButton6ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed new zarplata().setVisible(true); }//GEN-LAST:event_jButton3ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed new sozdaniye_kvitka().setVisible(true); }//GEN-LAST:event_jButton4ActionPerformed private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed new Sotrudniki().setVisible(true); }//GEN-LAST:event_jMenuItem1ActionPerformed private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed new sozdaniye_kvitka().setVisible(true); }//GEN-LAST:event_jMenuItem5ActionPerformed private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed new zarplata().setVisible(true); }//GEN-LAST:event_jMenuItem6ActionPerformed private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed Component frame = null; int n = JOptionPane.showConfirmDialog( frame, "Выдествительно хотите покинуть форму?", "", JOptionPane.YES_NO_OPTION); if (n == 0) { dispose(); Authorization form1 = new Authorization(); form1.setVisible(true); } }//GEN-LAST:event_jMenuItem2ActionPerformed private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed JOptionPane.showMessageDialog(null, "Программа СТО Бурятия \n" + " Разработчик:Хуснутдинов Руслан Фиргатович \n Проектировщик:Сизинцев Денис Сергевич"); }//GEN-LAST:event_jMenuItem3ActionPerformed private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed JOptionPane.showMessageDialog(null, "Для получения информации или редоктирования\n в систеие бухгалтера не обходимо\n нажать одну из пяти кнопак. "); }//GEN-LAST:event_jMenuItem4ActionPerformed private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed new delete().setVisible(true); }//GEN-LAST:event_jMenuItem7ActionPerformed private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed new otchet().setVisible(true); }//GEN-LAST:event_jMenuItem8ActionPerformed /** * @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(Bukhgalter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Bukhgalter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Bukhgalter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Bukhgalter.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 Bukhgalter().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JMenuItem jMenuItem6; private javax.swing.JMenuItem jMenuItem7; private javax.swing.JMenuItem jMenuItem8; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables }
[ "ASUS@DESKTOP-2JMSBTH" ]
ASUS@DESKTOP-2JMSBTH
a0ba48d978f52cab84c463a26b38fbf934f52519
dc6fa886881d6dce63564fabc956b2867897ef91
/src/main/java/school/lemon/changerequest/java/FractionNumber.java
70a6b2a141970c3ac5b4c7038ee9cb59ec83a815
[ "Apache-2.0" ]
permissive
dianasinenchenko/oop.pr1
3c7b504d67b0a6277eb71b8fe080211ea5f1a43a
84d462397d43bca12bf19f962d9dd11813621a56
refs/heads/master
2021-01-12T08:19:49.428674
2017-01-06T14:14:05
2017-01-06T14:14:05
76,540,722
0
0
null
2016-12-15T08:40:48
2016-12-15T08:40:48
null
UTF-8
Java
false
false
3,374
java
package school.lemon.changerequest.java; /** * Created by Diana on 05.01.2017. */ public class FractionNumber { private int dividend; private int divisor; public FractionNumber(int dividend, int divisor) { if (divisor == 0) throw new ArithmeticException("You divisor is 0, incorrect value"); if (dividend == 0) { this.dividend = dividend; this.divisor = 1; } this.dividend = dividend; this.divisor = divisor; int GreatestCommonDivisor = GreatestCommonDivisor(this.dividend, this.divisor); this.dividend = dividend / GreatestCommonDivisor; this.divisor = divisor / GreatestCommonDivisor; } public int GreatestCommonDivisor(int dividend, int divisor) { return divisor == 0 ? dividend : GreatestCommonDivisor(divisor, dividend % divisor); } public FractionNumber(int dividend) { this.dividend = dividend; this.divisor = 1; } public int GetDividend() { return dividend; } public int GetDivisor() { return divisor; } public double GetDecimalValue() { return (double) dividend / (double) divisor; } public String ToString() { return String.format("%1$d/%2$d", dividend, divisor); } public FractionNumber AddAnotherFractionNumber(FractionNumber anotherFractionNumber) { int anotherDividend; int anotherDivisor; if (divisor == anotherFractionNumber.divisor) { anotherDividend = divisor + anotherFractionNumber.dividend; anotherDivisor = divisor; } else { anotherDivisor = anotherFractionNumber.divisor * divisor; anotherDividend = anotherFractionNumber.dividend * divisor + dividend * anotherFractionNumber.divisor; } return new FractionNumber(anotherDividend, anotherDivisor); } public FractionNumber SubtractAnotherFractionNumber(FractionNumber anotherFractionNumber) { int anotherDividend; int anotherDivisor; if (divisor == anotherFractionNumber.divisor) { anotherDividend = divisor - anotherFractionNumber.dividend; anotherDivisor = divisor; } else { anotherDivisor = anotherFractionNumber.divisor * divisor; anotherDividend = anotherFractionNumber.dividend * divisor - dividend * anotherFractionNumber.divisor; } return new FractionNumber(anotherDividend, anotherDivisor); } public FractionNumber MultiplyAnotherFractionNumber(FractionNumber anotherFractionNumber) { int anotherDividend; int anotherDivisor; anotherDivisor = anotherFractionNumber.divisor * divisor; anotherDividend = anotherFractionNumber.dividend * dividend; return new FractionNumber(anotherDividend, anotherDivisor); } public FractionNumber DivideAnotherFractionNumber(FractionNumber anotherFractionNumber) { int anotherDividend; int anotherDivisor; anotherDivisor = anotherFractionNumber.divisor * dividend; anotherDividend = anotherFractionNumber.dividend * divisor; return new FractionNumber(anotherDividend, anotherDivisor); } public final static FractionNumber ONE = new FractionNumber(1, 1); public final static FractionNumber ZERRo = new FractionNumber(0, 1); }
7a980b5783b75b198bbd8e6984643181f3a4beb7
a02b5b260c1311bd1d0956943d8792c98eecaf8a
/src/eg/edu/alexu/ehr/ontology/OWLObjectVisitor.java
8429e9ab4a9e69c3a1d8c02c75328b6b913ebc1b
[]
no_license
SamehHany/OntologyGraph
862e6acf4ce5650027ccb42dc5a9eef9003fe10a
5df8592cca39e0768b7a85450f88a272c832d96f
refs/heads/master
2021-01-21T02:10:16.225564
2016-07-08T14:00:54
2016-07-08T14:00:54
44,068,551
0
2
null
null
null
null
UTF-8
Java
false
false
2,713
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 eg.edu.alexu.ehr.ontology; import org.semanticweb.owlapi.model.OWLAnnotation; import org.semanticweb.owlapi.model.OWLDataExactCardinality; import org.semanticweb.owlapi.model.OWLDataMaxCardinality; import org.semanticweb.owlapi.model.OWLDataMinCardinality; import org.semanticweb.owlapi.model.OWLDataPropertyRangeAxiom; import org.semanticweb.owlapi.model.OWLObjectExactCardinality; import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; import org.semanticweb.owlapi.model.OWLObjectMinCardinality; import org.semanticweb.owlapi.util.OWLObjectVisitorAdapter; public class OWLObjectVisitor extends OWLObjectVisitorAdapter { @Override public void visit(OWLDataMaxCardinality desc) { super.visit(desc); System.out.println("Max Cardinality =[" + desc.getCardinality() + "]"); } @Override public void visit(OWLDataMinCardinality desc) { super.visit(desc); System.out.println("Min Cardinality =[" + desc.getCardinality() + "]"); } @Override public void visit(OWLObjectMaxCardinality desc) { super.visit(desc); System.out.println("Object Max Cardinality =[" + desc.getCardinality() + "]"); } @Override public void visit(OWLObjectMinCardinality desc) { super.visit(desc); System.out.println("Object Min Cardinality =[" + desc.getCardinality() + "]"); } @Override public void visit(OWLDataExactCardinality desc) { super.visit(desc); System.out.println("Exact Data Cardinality =[" + desc.getCardinality() + "]" + desc.getProperty()); } @Override public void visit(OWLObjectExactCardinality desc) { super.visit(desc); System.out.println("Exact Object Cardinality =[" + desc.getCardinality() + "]"); } @Override public void visit(OWLAnnotation node) { super.visit(node); System.out.println("visitng owlannoation node =[" + node + "]"); } // @Override // public void visit(OWLAnonymousIndividual individual) { // super.visit(individual); // System.out.println("indivual =["+individual+"]"); // } // public void visit(OWLClass c){ // super.visit(c); // System.out.println("*********"+c.getIRI()); // } @Override public void visit(OWLDataPropertyRangeAxiom owldpr) { super.visit(owldpr); System.out.println(owldpr); } }
81f853d92f6df605be56ef33a72e36eac3f3ae79
400bbe1f189d1a91ef43bd87110908d8a4f3da7e
/src/main/java/com/example/demo/persistence/model/Author.java
5e3568a5542759b96d3e8051aab7f584de84dc72
[]
no_license
anushghazaryan261/authors_books
7fcfd8070a56e869e42c4d9b2a0dc64a1971c7f0
b8d30e391a44d1fbc8bc604d15a11d2ddff6401f
refs/heads/master
2021-04-14T18:35:14.587281
2020-03-22T19:17:26
2020-03-22T19:17:26
249,248,669
0
0
null
null
null
null
UTF-8
Java
false
false
1,642
java
package com.example.demo.persistence.model; import javax.persistence.*; import java.util.HashSet; import java.util.Objects; import java.util.Set; @Entity @Table(name = "authors") public class Author extends AbstractBaseEntity { private String name; private String surname; public Author() { } @ManyToMany(fetch = FetchType.LAZY,cascade = {CascadeType.PERSIST,CascadeType.MERGE},mappedBy = "authors") private Set<Book> books=new HashSet<>(); public Set<Book> getBooks() { return books; } public void setBooks(Set<Book> books) { this.books = books; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; Author author = (Author) o; return Objects.equals(name, author.name) && Objects.equals(surname, author.surname) && Objects.equals(books, author.books); } @Override public int hashCode() { return Objects.hash(super.hashCode(), name, surname, books); } @Override public String toString() { return "Author{" + "name='" + name + '\'' + ", surname='" + surname + '\'' + ", books=" + books + '}'; } }
ed50957bb0f8353c18fda1a5e9fe85bc65f71129
3bbbd4909366c845d2f6734a575ac9542bbff2d5
/src/main/java/com/zxtech/ess/module/base/service/impl/BaseFaultDutyParamServiceImpl.java
45e7214fad1bf8f4bc2c546718b0ee19dbeba17e
[]
no_license
lanbohello163/hyss
3c4e57ad5d6018a691c4ce56ffc3a27b9afa4d82
e9c97542a443e5add8888686628b95ecdd8f8535
refs/heads/master
2022-12-22T03:39:43.366505
2019-09-02T01:29:48
2019-09-02T01:29:48
205,752,991
0
0
null
2022-12-16T09:56:05
2019-09-02T01:13:29
Java
UTF-8
Java
false
false
3,150
java
package com.zxtech.ess.module.base.service.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.Page; import com.zxtech.ess.module.base.bean.BaseFaultDutyParamSearchBean; import com.zxtech.ess.module.base.mapper.BaseFaultDutyParamManagerMapper; import com.zxtech.ess.module.base.service.IBaseFaultDutyParamService; import com.zxtech.ess.module.gen.bean.CalFaultDutyParam; import com.zxtech.ess.module.gen.mapper.CalFaultDutyParamMapper; import com.zxtech.platform.constant.ResultConstants; import com.zxtech.platform.utils.page.PageHandler; import com.zxtech.platform.vo.UserBean; @Service("baseFaultDutyParamServiceImpl") public class BaseFaultDutyParamServiceImpl implements IBaseFaultDutyParamService { @Autowired private CalFaultDutyParamMapper calFaultDutyParamMapper; @Autowired private BaseFaultDutyParamManagerMapper baseFaultDutyParamManagerMapper; @Override public Map<String, Object> getListWithPaging(BaseFaultDutyParamSearchBean queryInfo) { Page<Map<String, Object>> pageResult = PageHandler.buildPage(queryInfo) .doSelectPage(() -> baseFaultDutyParamManagerMapper.getListWithPaging(queryInfo)); return PageHandler.wrapPageMap(pageResult); } //新增、编辑时判断不良分类编码是否存在重复记录 private Boolean checkRepeatColumn(CalFaultDutyParam bean){ CalFaultDutyParam calFaultDutyParam = new CalFaultDutyParam(); calFaultDutyParam.setBad_code(bean.getBad_code()); List<CalFaultDutyParam> list = calFaultDutyParamMapper.selectBySqlConditions(calFaultDutyParam); if (list.stream().filter(javaBean ->!javaBean.getId().equals(bean.getId())).count()==0) return false; return true; } @Override public String add(CalFaultDutyParam bean, UserBean user) { String resStr = ResultConstants.SUCCESS; if (checkRepeatColumn(bean)) return ResultConstants.REPEAT; int ret = calFaultDutyParamMapper.insertSelective(bean); if (ret == 0) resStr = ResultConstants.ERROR; return resStr; } @Override public String update(CalFaultDutyParam bean, UserBean user) { String resStr = ResultConstants.SUCCESS; if (checkRepeatColumn(bean)) return ResultConstants.REPEAT; CalFaultDutyParam calFaultDutyParam = calFaultDutyParamMapper.selectByPrimaryKey(bean.getId()); bean.setEnable_flag(calFaultDutyParam.getEnable_flag()); int ret = calFaultDutyParamMapper.updateByPrimaryKey(bean); if(ret == 0) resStr = ResultConstants.ERROR; return resStr; } @Override public String enable(CalFaultDutyParam bean, UserBean user) { String resStr = ResultConstants.SUCCESS; bean.setEnable_flag("1"); int ret = calFaultDutyParamMapper.updateByPrimaryKeySelective(bean); if(ret == 0) resStr = ResultConstants.ERROR; return resStr; } @Override public String disable(CalFaultDutyParam bean, UserBean user) { String resStr = ResultConstants.SUCCESS; bean.setEnable_flag("0"); int ret = calFaultDutyParamMapper.updateByPrimaryKeySelective(bean); if(ret == 0) resStr = ResultConstants.ERROR; return resStr; } }
267588e004457a5a7003670061640243f314c1ec
6bac1a560bf008cb2d898438050d720653ce628a
/telekom/Siebel/gensrc/com/siebel/selfservice/common/account/query/ListOfContactAlternatePhoneQuery.java
04daf2bf3473dbadef81b9dfd58b96b4e33453c0
[]
no_license
vkscorpio3/TelekomPOC
8ff40774bbbfc6868b4a3f84a971d972b9dc9ab7
c437ef7c30e93ea24c1d8acc0110b985401d049b
refs/heads/master
2020-03-08T16:54:42.639312
2017-08-26T22:25:25
2017-08-26T22:25:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,890
java
package com.siebel.selfservice.common.account.query; import java.io.Serializable; import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ListOfContactAlternatePhoneQuery complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ListOfContactAlternatePhoneQuery"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ContactAlternatePhone" type="{http://www.siebel.com/SelfService/Common/Account/Query}ContactAlternatePhoneQuery" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="pagesize" type="{http://www.w3.org/2001/XMLSchema}integer" /> * &lt;attribute name="startrownum" type="{http://www.w3.org/2001/XMLSchema}integer" /> * &lt;attribute name="recordcountneeded" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ListOfContactAlternatePhoneQuery", propOrder = { "contactAlternatePhone" }) public class ListOfContactAlternatePhoneQuery implements Serializable { @XmlElement(name = "ContactAlternatePhone") protected ContactAlternatePhoneQuery contactAlternatePhone; @XmlAttribute protected BigInteger pagesize; @XmlAttribute protected BigInteger startrownum; @XmlAttribute protected Boolean recordcountneeded; /** * Gets the value of the contactAlternatePhone property. * * @return * possible object is * {@link ContactAlternatePhoneQuery } * */ public ContactAlternatePhoneQuery getContactAlternatePhone() { return contactAlternatePhone; } /** * Sets the value of the contactAlternatePhone property. * * @param value * allowed object is * {@link ContactAlternatePhoneQuery } * */ public void setContactAlternatePhone(ContactAlternatePhoneQuery value) { this.contactAlternatePhone = value; } /** * Gets the value of the pagesize property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getPagesize() { return pagesize; } /** * Sets the value of the pagesize property. * * @param value * allowed object is * {@link BigInteger } * */ public void setPagesize(BigInteger value) { this.pagesize = value; } /** * Gets the value of the startrownum property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getStartrownum() { return startrownum; } /** * Sets the value of the startrownum property. * * @param value * allowed object is * {@link BigInteger } * */ public void setStartrownum(BigInteger value) { this.startrownum = value; } /** * Gets the value of the recordcountneeded property. * * @return * possible object is * {@link Boolean } * */ public Boolean isRecordcountneeded() { return recordcountneeded; } /** * Sets the value of the recordcountneeded property. * * @param value * allowed object is * {@link Boolean } * */ public void setRecordcountneeded(Boolean value) { this.recordcountneeded = value; } }
e60da6db4f68f7dee6b5af69bb774d39115348e1
4873409187e29d2ff7ad8d1090a5d04767ea72b4
/src/main/java/se/gustavkarlsson/rocketchat/models/from_rocket_chat/FromRocketChatMessage.java
7d85df4107a3fc930d667d480ec513008d18fa48
[ "MIT" ]
permissive
alefq/rocketchat-jira-trigger
3796e59030e459765932dce06d9a3f07b7053c10
6c4fb458d85968393a1ff6793adaa29e6c561def
refs/heads/master
2020-08-11T02:40:00.435174
2020-06-10T20:19:05
2020-06-10T20:19:05
214,474,175
1
0
MIT
2019-10-11T15:45:50
2019-10-11T15:45:50
null
UTF-8
Java
false
false
4,380
java
package se.gustavkarlsson.rocketchat.models.from_rocket_chat; import com.google.gson.annotations.SerializedName; import java.util.Date; import java.util.Objects; public final class FromRocketChatMessage { @SerializedName("token") private String token; @SerializedName("channel_id") private String channelId; @SerializedName("channel_name") private String channelName; @SerializedName("user_id") private String userId; @SerializedName("user_name") private String userName; @SerializedName("text") private String text; @SerializedName("bot") private Object bot; @SerializedName("isEdited") private Boolean edited; @SerializedName("alias") private String alias; @SerializedName("message_id") private String messageId; @SerializedName("timestamp") private Date timestamp; @SerializedName("trigger_word") private String triggerWord; public FromRocketChatMessage() { } public FromRocketChatMessage(String token, String channelId, String channelName, String userId, String userName, String text, Object bot, Boolean edited, String alias, String messageId, Date timestamp, String triggerWord) { this.token = token; this.channelId = channelId; this.channelName = channelName; this.userId = userId; this.userName = userName; this.text = text; this.bot = bot; this.edited = edited; this.alias = alias; this.messageId = messageId; this.timestamp = timestamp; this.triggerWord = triggerWord; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } public String getChannelId() { return channelId; } public void setChannelId(String channelId) { this.channelId = channelId; } public String getChannelName() { return channelName; } public void setChannelName(String channelName) { this.channelName = channelName; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Object getBot() { return bot; } public void setBot(Object bot) { this.bot = bot; } public Boolean isEdited() { return edited; } public void setEdited(Boolean edited) { this.edited = edited; } public String getAlias() { return alias; } public void setAlias(String alias) { this.alias = alias; } public String getMessageId() { return messageId; } public void setMessageId(String messageId) { this.messageId = messageId; } public Date getTimestamp() { return timestamp; } public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } public String getTriggerWord() { return triggerWord; } public void setTriggerWord(String triggerWord) { this.triggerWord = triggerWord; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FromRocketChatMessage that = (FromRocketChatMessage) o; return Objects.equals(token, that.token) && Objects.equals(channelId, that.channelId) && Objects.equals(channelName, that.channelName) && Objects.equals(userId, that.userId) && Objects.equals(userName, that.userName) && Objects.equals(text, that.text) && Objects.equals(bot, that.bot) && Objects.equals(edited, that.edited) && Objects.equals(alias, that.alias) && Objects.equals(messageId, that.messageId) && Objects.equals(timestamp, that.timestamp) && Objects.equals(triggerWord, that.triggerWord); } @Override public int hashCode() { return Objects.hash(token, channelId, channelName, userId, userName, text, bot, edited, alias, messageId, timestamp, triggerWord); } @Override public String toString() { return "FromRocketChatMessage{" + "token='" + token + '\'' + ", channelId='" + channelId + '\'' + ", channelName='" + channelName + '\'' + ", userId='" + userId + '\'' + ", userName='" + userName + '\'' + ", text='" + text + '\'' + ", bot=" + bot + ", isEdited=" + edited + ", alias='" + alias + '\'' + ", messageId='" + messageId + '\'' + ", timestamp=" + timestamp + ", triggerWord='" + triggerWord + '\'' + '}'; } }
2a1394a0a757babf1716c5805fab8dee94302c69
57de39b55754148c160051a4cf73117e86e630f9
/JEM Application/Mobile/J-Application/app/src/main/java/com/example/jmora/webservicesoap/validator/AbstractValidate.java
4564d74d5228f5721edaf8d0e542c725a0514f61
[]
no_license
joelmora9618/J-Application
8e9dd91ea9b6b90f3ba492f76dfc39c9db3445d4
e46a188736577433f4b6b17c52db1b13ea126210
refs/heads/master
2021-05-14T13:01:53.516378
2018-01-05T20:51:39
2018-01-05T20:51:39
116,423,946
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package com.example.jmora.webservicesoap.validator; /** * Created by JMora on 22/05/2017. */ public abstract class AbstractValidate { /** * * @return verdadero si todos los validadores son válidos, si no, falsa */ public abstract boolean isValid(); }
128d9bab5847924896701c78a0fcf309170edc10
b298ea7ad46f9a66feae768e4a5df3ea1783e47c
/src/main/java/com/fawad/walletapp/entity/Transaction.java
8aa5825a9c600bcbf195e78e25a6f9b83cb13942
[]
no_license
rdsandrds/khatabook1
2248965b9374bf814a2a28a16dcacc1f87fcd701
405e911bfa81309b1ee5019a86c57f756ab2abe1
refs/heads/main
2023-02-15T00:04:43.942094
2021-01-05T18:29:36
2021-01-05T18:29:36
326,885,993
0
0
null
null
null
null
UTF-8
Java
false
false
2,148
java
package com.fawad.walletapp.entity; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.util.Date; @Entity @Data @AllArgsConstructor @NoArgsConstructor public class Transaction { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Min(1) @NotNull(message = "amount cann't be null") private Double amount; private String description; @Min(1) @Max(3) private int type;//1 for Income, 2 for expense, 3 for transfer @JsonFormat(pattern = "yyyy-mm-dd") private Date transactionDate; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "wallet_id",nullable = false) @JsonIgnore private Wallet wallet; @PrePersist public void setTransactionDate(){ this.transactionDate = new Date(); } public Double getAmount() { return amount; } public void setAmount(Double amount) { this.amount = amount; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getType() { return type; } public void setType(int type) { this.type = type; } public Date getTransactionDate() { return transactionDate; } public void setTransactionDate(Date transactionDate) { this.transactionDate = transactionDate; } public Long getId() { return id; } public Wallet getWallet() { return wallet; } public void setId(Long id2) { // TODO Auto-generated method stub } public void setWallet(Wallet wallet2) { // TODO Auto-generated method stub } @Override public String toString() { return "Transaction [id=" + id + ", amount=" + amount + ", description=" + description + ", type=" + type + ", transactionDate=" + transactionDate + ", wallet=" + wallet + "]"; } }
898b4042e5676042e092de259f19ef670c3e8d4c
ca526552fcd6d4572e13dbb3868594563a7c8024
/src/main/java/dyoon/innocent/lp/ILPSolver.java
d94ff07760feb9a38ec0b097f3048024d3de8b76
[]
no_license
dongyoungy/innocent
e0e4fa45ee914a4bac4a80b9c5ca43bfb92fa076
09bc2b39aedcec915dea5b30d0874c278f7d6601
refs/heads/master
2021-07-16T19:39:29.540043
2019-02-06T03:12:32
2019-02-06T03:12:32
153,812,486
0
0
null
null
null
null
UTF-8
Java
false
false
2,720
java
package dyoon.innocent.lp; import dyoon.innocent.Query; import dyoon.innocent.data.PartitionSpace; import org.chocosolver.solver.Model; import org.chocosolver.solver.Solution; import org.chocosolver.solver.variables.IntVar; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; /** Created by Dong Young Yoon on 2018-12-17. */ public class ILPSolver { public static List<PartitionSpace> solveForBestColumnForPartition( List<PartitionSpace> partitionSpaces, int k) { Model m = new Model("test"); Set<String> querySet = new HashSet<>(); Map<String, List<IntVar>> qToPs = new HashMap<>(); Map<String, IntVar> qMap = new HashMap<>(); int i = 0; IntVar[] psVar = new IntVar[partitionSpaces.size()]; for (PartitionSpace space : partitionSpaces) { String ps = String.format("ps_%d", i); psVar[i] = m.intVar(ps, 0, 1); for (Query query : space.getQueries()) { String q = String.format("q_%s", query.getId()); querySet.add(q); if (!qToPs.containsKey(q)) { qToPs.put(q, new ArrayList<>()); } List<IntVar> psList = qToPs.get(q); psList.add(psVar[i]); } ++i; } // objective function IntVar qCovered = m.intVar("qCovered", 0, 100000); IntVar[] qVar = new IntVar[querySet.size()]; i = 0; for (String q : querySet) { qVar[i] = m.intVar(q, 0, 1); qMap.put(q, qVar[i]); ++i; } m.sum(qVar, "=", qCovered).post(); // constraint 1: no more than k sets IntVar numPs = m.intVar("numPs", 0, partitionSpaces.size()); m.sum(psVar, "=", numPs).post(); m.arithm(numPs, "<=", k).post(); // constraint 2: a query needs at least one ps chosen for (String q : qToPs.keySet()) { IntVar qVar1 = qMap.get(q); List<IntVar> psVarList = qToPs.get(q); IntVar[] psVars = psVarList.toArray(new IntVar[psVarList.size()]); IntVar qSum = m.intVar(q + "_sum", 0, 100000); m.sum(psVars, "=", qSum).post(); m.arithm(qSum, ">=", qVar1).post(); } m.setObjective(Model.MAXIMIZE, qCovered); m.getSolver().limitTime("30s"); Solution solution = new Solution(m); while (m.getSolver().solve()) { m.getSolver().printStatistics(); solution.record(); } m.getSolver().printStatistics(); List<PartitionSpace> result = new ArrayList<>(); for (i = 0; i < psVar.length; ++i) { System.out.println(String.format("ps_%d = %d", i, solution.getIntVal(psVar[i]))); if (solution.getIntVal(psVar[i]) == 1) { result.add(partitionSpaces.get(i)); } } return result; } }
8448c9872156aa32fad0d2b895626f766232fbf7
4b26b54fcd7a02c291105b6f8be1ab00a5b1b7e2
/sunlands-study-examplan-parent/study-examplan-server/src/main/java/com/sunlands/examplan/base/entity/DataEntity.java
2dab079853dd191d0eb67c99e2feb47af34de73f
[]
no_license
NaM0729/kekeguo
cbfa1ea26faeb207ebcf493b5560fe22c671077c
3e0350b37a77c911f1d6940e06468c2cb09f80ea
refs/heads/master
2020-03-30T06:37:56.919308
2018-12-26T02:55:13
2018-12-26T02:55:13
150,876,099
0
0
null
null
null
null
UTF-8
Java
false
false
1,353
java
package com.sunlands.examplan.base.entity; import com.sunlands.examplan.constant.DeleteFlag; import org.apache.commons.lang.StringUtils; import java.io.Serializable; import java.util.Date; /** * 数据实体类 * * @author 周宇 * @Class Name DataEntity * @Create In 2018年08月10日14:20:40 */ public abstract class DataEntity implements Serializable { private static final long serialVersionUID = 1L; protected String createBy; // 创建者 protected Date createDate; // 创建日期 protected String updateBy; // 更新者 protected Date updateDate; // 更新日期 /** * 删除标示(0:正常,1:删除) */ protected Integer deleteFlag; /** * 插入之前执行方法,需要手动调用 */ public void preInsert(String userId) { if (StringUtils.isNotBlank(userId)) { this.updateBy = userId; this.createBy = userId; this.deleteFlag = DeleteFlag.NORMAL.getValue(); } this.updateDate = new Date(); this.createDate = this.updateDate; } /** * 更新之前执行方法,需要手动调用 */ public void preUpdate(String userId) { if (StringUtils.isNotBlank(userId)) { this.updateBy = userId; } this.updateDate = new Date(); } }
cebaa50fb192674a4731fc451cf5b25c0b7eab4e
efa8f185b5c7ebfe56d425a960cb0b2fef40d5cc
/poc-concordion/src/main/java/com/examples/vo/Forecast.java
84d5e6e449b1029b6e07758642c5cfe0cee549e8
[]
no_license
carlosricor/poc-concordion
55a539d48a3acc39af1b121fb203be2743f026ef
fed5bf8a8db5b543a9b38a757593b533796bfc71
refs/heads/master
2021-09-05T17:31:25.771833
2018-01-29T22:59:43
2018-01-29T22:59:43
119,452,404
0
0
null
null
null
null
UTF-8
Java
false
false
1,798
java
package com.examples.vo; import java.util.ArrayList; public class Forecast { private Integer dt; private Temp temp; private Double pressure; private Integer humidity; private java.util.List<Weather> weather = new ArrayList<>(); private Double speed; private Integer deg; private Integer clouds; private Double rain; private Double snow; public Integer getDt() { return dt; } public void setDt(Integer dt) { this.dt = dt; } public Temp getTemp() { return temp; } public void setTemp(Temp temp) { this.temp = temp; } public Double getPressure() { return pressure; } public void setPressure(Double pressure) { this.pressure = pressure; } public Integer getHumidity() { return humidity; } public void setHumidity(Integer humidity) { this.humidity = humidity; } public java.util.List<Weather> getWeather() { return weather; } public void setWeather(java.util.List<Weather> weather) { this.weather = weather; } public Double getSpeed() { return speed; } public void setSpeed(Double speed) { this.speed = speed; } public Integer getDeg() { return deg; } public void setDeg(Integer deg) { this.deg = deg; } public Integer getClouds() { return clouds; } public void setClouds(Integer clouds) { this.clouds = clouds; } public Double getRain() { return rain; } public void setRain(Double rain) { this.rain = rain; } public Double getSnow() { return snow; } public void setSnow(Double snow) { this.snow = snow; } }
[ "Carlos Rico@EM2014000400" ]
Carlos Rico@EM2014000400
a04377ef22dd892bbc5f64ebdb1277524ecc25a0
9cbf152fcdd6540f31092e68a9dac9eab1bdd7e1
/src/main/java/com/rfb/demo/rxjavatest/asm/Music.java
dfc94d09558ab3bdaec9513be5dcdb6433d013bf
[]
no_license
RFBGH/javaTest
17f8eac24b89e0729fd67981934b50c5b6db4cec
f59e606a6903ed70013ffdd4d18159d94623d10c
refs/heads/master
2022-11-26T23:29:05.501679
2021-03-04T14:22:37
2021-03-04T14:22:37
131,824,449
0
0
null
2022-11-16T08:39:13
2018-05-02T08:54:56
Java
UTF-8
Java
false
false
414
java
package com.rfb.demo.rxjavatest.asm; public class Music { public void run(){ System.out.println("this is run"); } public int getValue(){ System.out.println("this is run"); return 1; } public void put(String value){ } private void add(String value, Thread thread){ } protected Music fake(int[] nums, String[] values){ return null; } }
bf52fe08dad48f8125e426144c01d27c2e3c56f7
15729a88912bb86c61063891385268fa9fabdd62
/src/test/java/com/mycompany/guice/AppControllerMockitoTest.java
9797c8a41019a5b99c47c39982b6070d8baf3414
[]
no_license
vamsiampolu/guice-app
93821b9cd5afc98f7f47ad48086af75b44cf8597
5ed239b77ec311969b7fa57e1a5de3a446a3f0f7
refs/heads/master
2021-04-15T06:40:23.447615
2018-03-22T00:00:48
2018-03-22T00:00:48
126,754,467
0
0
null
null
null
null
UTF-8
Java
false
false
1,258
java
package com.mycompany.guice; import org.junit.Before; import org.junit.Test; import org.junit.Assert; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.InjectMocks; import org.mockito.junit.MockitoJUnitRunner; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.mockito.Mockito.times; import static org.mockito.Mockito.anyString; import com.mycompany.guice.controllers.AppController; import com.mycompany.guice.services.MessageService; @RunWith(MockitoJUnitRunner.class) public class AppControllerMockitoTest { @Mock(name="msgSvc") private MessageService service; private AppController subject; @Before public void setup() { MockitoAnnotations.initMocks(this); } @Test public void should_call_message_service_with_message_and_email() { String recepient = "[email protected]"; String message = "Where are the awesome swiss watches?"; when(service.sendMessage(recepient, message)).thenReturn(true); subject = new AppController(service); boolean received = subject.doSomething(); Assert.assertEquals(true, received); verify(service, times(1)).sendMessage(anyString(), anyString()); } }
6eb4bd8ddb80cc94ff7585b8ea9fb039850d12c7
8b606d476da07a66a64914113c44bbdb79ef8990
/src/test/java/Ciphers/CesarCipherTest.java
54a83756a28d55cadf6f4953959c2fe973a47fdf
[]
no_license
Dominik166/Enigma1
f6db134045115936d747228845d0852271878ea2
086acc6910ec3c9b05cc2d0001cabaf4a1da2080
refs/heads/master
2021-01-04T17:09:08.278996
2020-03-01T10:50:05
2020-03-01T10:50:05
240,678,451
0
0
null
null
null
null
UTF-8
Java
false
false
1,971
java
package Ciphers; import ciphers.impl.impl.CesarCipher; import ciphers.impl.Cipher; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; public class CesarCipherTest { protected final String textWitnNoAlphabeticLetters = "12312[]]["; protected final String textWithAlphabeticLetters = "abcdd"; protected final String expectedTextForAlphabeticLetters = "defgg"; protected final String mixedText = "123ac"; protected final String expectedTextForMixedText = "123df//"; protected Cipher cesarCipher = new CesarCipher(); // @Test // public void testOnlyAlphabeticLettersAreEncoded(){ // String encode = cesarCipher.encode(mixedText); // Assertions.assertEquals(mixedText, encode); // String decode = cesarCipher.decode(textWithAlphabeticLetters); // Assertions.assertEquals(textWithAlphabeticLetters,decode); @DisplayName("Testing correction of encoding text with no alphabetic letters") @Test public void testOnlyAlphabeticLettersAreEncoded() { String encode = cesarCipher.encode(mixedText); Assertions.assertEquals(mixedText, encode); String decode = cesarCipher.decode(textWithAlphabeticLetters); Assertions.assertEquals(textWithAlphabeticLetters, decode); } @DisplayName("Testing correction of encoding text with no alphabetic letters") @Test public void testIfEncodingModifyTextWithAlphabeticChars (){ String encoded = cesarCipher.encode(textWithAlphabeticLetters); Assertions.assertEquals(expectedTextForAlphabeticLetters, encoded); } @DisplayName("Testing correction of encoding text with no alphabetic letters") @Test public void testIfDecodingModifyTextWithAlphabeticChars (){ String decoded = cesarCipher.decode(expectedTextForAlphabeticLetters); Assertions.assertEquals(textWithAlphabeticLetters, decoded); } }
aa7949a12ae13972849da60a5d0c7e04efa1e2ad
c7e094cb46600f22ca026eaa3997c2bd25c0a81e
/src/main/java/io/mercer/dp/visitor/File.java
71ea214fad520da6aedb4860fa5949a4542a3b7e
[]
no_license
mercer/DesignPatterns
119dd7f93b678426f16ea70d5811a7b37a3806c4
727bab336a97b38ed6bd78119caa966e37df5874
refs/heads/master
2020-05-18T17:14:23.120713
2014-06-04T06:02:29
2014-06-04T06:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,005
java
package io.mercer.dp.visitor; import java.util.ArrayList; import java.util.List; public class File implements Item { private String name; private boolean directory = false; private List<File> children = new ArrayList<File>(); private int level = 0; public File (String name, boolean isDirectory) { this.name = name; this.directory = isDirectory; } public void addChild(File file) { this.children.add(file); file.incrementLevel(); } public String getName() { return name; } public int getLevel() { return level; } public void incrementLevel() { this.level++; for (File file : children) { file.incrementLevel(); } } public boolean isDirectory() { return directory; } @Override public void accept(Visitor visitor) { visitor.visit(this); for (File file : children) { file.accept(visitor); } } }
3f552631d58415b5add80dbd40a4ed2cdd251daf
1dc15816590dbe49d69eed6ea579cc745cc76e08
/src/imu/pcloud/app/model/TimeConfig.java
fb3e6e80f91aec2b987992c70b1269ad49e53a89
[]
no_license
Zyzzz/PCloudApp
8578a7114b7a015fdd7851758e6d6c96bebd6a37
c96946a04857fa88c28b4ea681f0af537fc98cfb
refs/heads/master
2020-12-24T06:53:03.816503
2016-09-19T08:13:18
2016-09-19T08:13:18
58,203,527
2
1
null
2016-06-09T18:10:52
2016-05-06T11:44:24
Java
UTF-8
Java
false
false
1,086
java
package imu.pcloud.app.model; import java.util.Date; /** * Created by guyu on 2016/6/9. */ public class TimeConfig { int planId; int planMode; int timeMode; //plan mode final public static int MODE_PERSONAL_PLAN = 0; final public static int MODE_MULTI_PLAN = 1; //time mode final public static int MODE_WEEKS = 0; final public static int MODE_DAYS = 1; final public static int MODE_ALL = 2; boolean []weeks = new boolean[8]; Date startDate; Date endDate; public int getPlanId() { return planId; } public void setPlanId(int planId) { this.planId = planId; } public int getPlanMode() { return planMode; } public void setPlanMode(int planMode) { this.planMode = planMode; } public int getTimeMode() { return timeMode; } public void setTimeMode(int timeMode) { this.timeMode = timeMode; } public boolean[] getWeeks() { return weeks; } public void setWeeks(boolean[] weeks) { this.weeks = weeks; } }
b83253eea766a98179a410882213b761cf420a00
444eedd67e672d46e7244308bf9b0f6559cdd994
/app/src/main/java/android/example/com/pembimbingintern/Model/PostPutDelMhs.java
b05d94a9c9395ad30920e420cf4aaba854421f97
[]
no_license
FahrizalAziFerdiansyah/PembimbingIntern
c69c9d39bf53de5fa55094815196214fdec2b927
3bfbadfd061e535e3b97faccaf11b68ca1b8249c
refs/heads/master
2023-01-31T10:05:13.170312
2020-12-15T16:08:54
2020-12-15T16:08:54
308,878,492
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package android.example.com.pembimbingintern.Model; import com.google.gson.annotations.SerializedName; public class PostPutDelMhs { @SerializedName("status") String status; @SerializedName("result") Mahasiswa mMahasiswa; @SerializedName("message") String message; public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Mahasiswa getmMahasiswa() { return mMahasiswa; } public void setmMahasiswa(Mahasiswa mMahasiswa) { this.mMahasiswa = mMahasiswa; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
e77aa506073261a476dca1027a5cd4e33a32bcc2
152b07644c2f7c3ebcc3831998b05eb46786d6dc
/Accurate-Parent/Accurate-Dao/src/main/java/com/jhg/marketing/dao/mapper/DiseasesTypeMapper.java
8060b5402489fa6d229a27bdaeefc9c5f50728d1
[ "AFL-3.0" ]
permissive
gongboGit/JhgWechatDevolepment
e24fdf6656540b20c6d8d706478e51bd99309049
75565786e2cdde65fc0aeb3821d39554d2b94ed4
refs/heads/master
2022-12-15T12:28:42.533256
2019-11-26T05:28:47
2019-11-26T05:28:47
224,101,251
0
0
AFL-3.0
2022-12-11T20:35:36
2019-11-26T04:20:16
JavaScript
UTF-8
Java
false
false
200
java
package com.jhg.marketing.dao.mapper; import com.jhg.marketing.dao.domin.DiseasesType; import tk.mybatis.mapper.common.Mapper; public interface DiseasesTypeMapper extends Mapper<DiseasesType> { }
139f5fff307b1f887ff8c7aed5d580a2bd5e21c9
e6d74f0a56bfbd35664bb1345f9c75420b7f62a5
/StreamBaseParse/src/Parser/OutputStream.java
a72074f884dda9cf078db29aaa31df46bad72ee8
[]
no_license
gokhansa/StramBase-Eventflow-Parser-.sbapp-
65291bd4eae7f4bd6a7c7195b11f83e8d5e11c00
5456675be98b3a9fe071ae919c61102966878a9e
refs/heads/master
2021-01-10T10:50:53.292511
2016-02-24T16:13:39
2016-02-24T16:13:39
52,445,918
1
0
null
null
null
null
UTF-8
Java
false
false
340
java
package Parser; public class OutputStream implements Elements{ private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public String toString(){ return "Name:"+ getName(); } @Override public String getType() { return "OutputStream"; } }
8439927d7c0e18f99ca3ebe36226b04e1f31d92d
a24dea8651d6166fe0ca209c45879cd8c1d4e2dd
/LeetCode/All_Paths_From_Source_To_Target/All_Paths_From_Source_To_Target.java
5427a5e0d43bdf9fe1ea9973accd2b838397c211
[]
no_license
lakshmipathyarjun6/ProgrammingChallenges
b853b7f78fd4c5c969a8a41e8360c2f53f9663dc
dbe4e35e98b0a3e940c8e8dd61c52aaae5d62e15
refs/heads/master
2022-01-21T17:08:35.174002
2022-01-15T18:40:06
2022-01-15T18:40:06
61,674,320
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
class Solution { Set<List<Integer>> paths; public void dfs(List<Integer> currPath, int[][] graph, int current) { List<Integer> currPathNew = new ArrayList<Integer>(currPath); currPathNew.add(current); if(current == graph.length-1) { paths.add(currPathNew); } for(int i = 0; i < graph[current].length; i++) { dfs(currPathNew, graph, graph[current][i]); } } public List<List<Integer>> allPathsSourceTarget(int[][] graph) { paths = new HashSet<List<Integer>>(); dfs(new LinkedList<Integer>(), graph, 0); List<List<Integer>> allPaths = new LinkedList<List<Integer>>(paths); return allPaths; } }
58cc1702a3eaddcb749776ccdf2e4889c7c5f745
05ebb721fe64b06af0590a9fe84cd9191410ec79
/src/main/java/com/example/virus/vo/NewSummary.java
70473198c49c592556e5c6af1f10397eaf2aeec6
[]
no_license
GeoIntelSolution/virsus-info
c674386186a001c06c066184139d75d907a79557
8a24c5bd226e382a27abbb0b878b63a166038e9f
refs/heads/master
2020-12-19T12:48:13.552014
2020-01-27T03:06:45
2020-01-27T03:06:45
235,737,419
0
0
null
null
null
null
UTF-8
Java
false
false
3,164
java
package com.example.virus.vo; import java.util.List; public class NewSummary { private long createTime; private long modifyTime; private String tags; private int countryType; private String provinceId; private String provinceName; private String provinceShortName; private String cityName; private int confirmedCount; private int suspectedCount; private int curedCount; private int deadCount; private String comment; private int sort; private String operator; private java.util.List<CityItem> cities; public List<CityItem> getCities() { return cities; } public void setCities(List<CityItem> cities) { this.cities = cities; } public long getCreateTime() { return createTime; } public void setCreateTime(long createTime) { this.createTime = createTime; } public long getModifyTime() { return modifyTime; } public void setModifyTime(long modifyTime) { this.modifyTime = modifyTime; } public String getTags() { return tags; } public void setTags(String tags) { this.tags = tags; } public int getCountryType() { return countryType; } public void setCountryType(int countryType) { this.countryType = countryType; } public String getProvinceId() { return provinceId; } public void setProvinceId(String provinceId) { this.provinceId = provinceId; } public String getProvinceName() { return provinceName; } public void setProvinceName(String provinceName) { this.provinceName = provinceName; } public String getProvinceShortName() { return provinceShortName; } public void setProvinceShortName(String provinceShortName) { this.provinceShortName = provinceShortName; } public String getCityName() { return cityName; } public void setCityName(String cityName) { this.cityName = cityName; } public int getConfirmedCount() { return confirmedCount; } public void setConfirmedCount(int confirmedCount) { this.confirmedCount = confirmedCount; } public int getSuspectedCount() { return suspectedCount; } public void setSuspectedCount(int suspectedCount) { this.suspectedCount = suspectedCount; } public int getCuredCount() { return curedCount; } public void setCuredCount(int curedCount) { this.curedCount = curedCount; } public int getDeadCount() { return deadCount; } public void setDeadCount(int deadCount) { this.deadCount = deadCount; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public int getSort() { return sort; } public void setSort(int sort) { this.sort = sort; } public String getOperator() { return operator; } public void setOperator(String operator) { this.operator = operator; } }
b2a5222e96b5207be83b355059b64b5a4bbfe629
1336a1808af4575e1b3ab27f1e0c10a6ad4463d1
/Crypto/ConstantKey-ForgeryAttack-Lean/Malicious/app/src/main/java/edu/ksu/cs/malicious/MainActivity.java
12a646a0650bdacc37a4098863cb827b5b8a2dca
[ "BSD-3-Clause" ]
permissive
vaginessa/android-app-vulnerability-benchmarks
bda9f44fd4540d4a703531b72cd65230df6ab58e
6289f39d394afe83f5e591dcfb01e913f7307a90
refs/heads/master
2020-04-20T18:19:08.362162
2019-01-15T18:19:59
2019-01-22T22:25:09
169,016,953
2
0
null
null
null
null
UTF-8
Java
false
false
3,415
java
package edu.ksu.cs.malicious; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Base64; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.Toast; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; public class MainActivity extends AppCompatActivity { private static String TAG = "Malicious"; static final String PROVIDED_TOKEN_KEY = "generatedToken"; static final String INIT_VECTOR_KEY = "initVector"; static final byte[] SECRET_KEY = "0123456789!@#$%^".getBytes(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override protected void onResume() { super.onResume(); findViewById(R.id.button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EditText emailAddrText = (EditText) findViewById(R.id.emailText); String emailAddr = emailAddrText.getText().toString(); Intent intent = new Intent("edu.ksu.cs.benign.NEWPASS"); Cipher cipher; try { cipher = Cipher.getInstance("AES/GCM/NoPadding"); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { Log.d(TAG, "Exception while creating cipher instance", e); Toast.makeText(getApplicationContext(), "Cipher error", Toast.LENGTH_LONG).show(); return; } SecretKeySpec secretKeySpec = new SecretKeySpec(SECRET_KEY,"AES"); try { cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); } catch (InvalidKeyException e) { Log.d(TAG, "Exception while initializing cipher instance", e); Toast.makeText(getApplicationContext(), "Cipher error", Toast.LENGTH_LONG).show(); return; } try { String token = Base64.encodeToString(cipher.doFinal(emailAddr.getBytes()), Base64.DEFAULT); intent.putExtra(PROVIDED_TOKEN_KEY, token); Log.d(TAG, "Token = " + token); } catch (IllegalBlockSizeException | BadPaddingException e) { Log.d(TAG, "Exception while encrypting data second time", e); Toast.makeText(getApplicationContext(), "Token was not emailed. Try again :(", Toast.LENGTH_LONG).show(); return; } String initializationVector = Base64.encodeToString(cipher.getIV(), Base64.DEFAULT); intent.putExtra(INIT_VECTOR_KEY, initializationVector); Log.d(TAG, "IV = " + initializationVector); startActivity(intent); } }); } }
[ "joymitro.gmail.com" ]
joymitro.gmail.com
b2665dd1ea7d46d31b70ad7d5f70d1e6e73fba5a
c94f888541c0c430331110818ed7f3d6b27b788a
/blockchain/java/src/main/java/com/antgroup/antchain/openapi/blockchain/models/GetContractConfigChainRequest.java
c4c633fe286ff627c451f9173f846c1e1cd242c6
[ "MIT", "Apache-2.0" ]
permissive
alipay/antchain-openapi-prod-sdk
48534eb78878bd708a0c05f2fe280ba9c41d09ad
5269b1f55f1fc19cf0584dc3ceea821d3f8f8632
refs/heads/master
2023-09-03T07:12:04.166131
2023-09-01T08:56:15
2023-09-01T08:56:15
275,521,177
9
10
MIT
2021-03-25T02:35:20
2020-06-28T06:22:14
PHP
UTF-8
Java
false
false
1,076
java
// This file is auto-generated, don't edit it. Thanks. package com.antgroup.antchain.openapi.blockchain.models; import com.aliyun.tea.*; public class GetContractConfigChainRequest extends TeaModel { // OAuth模式下的授权token @NameInMap("auth_token") public String authToken; @NameInMap("product_instance_id") public String productInstanceId; public static GetContractConfigChainRequest build(java.util.Map<String, ?> map) throws Exception { GetContractConfigChainRequest self = new GetContractConfigChainRequest(); return TeaModel.build(map, self); } public GetContractConfigChainRequest setAuthToken(String authToken) { this.authToken = authToken; return this; } public String getAuthToken() { return this.authToken; } public GetContractConfigChainRequest setProductInstanceId(String productInstanceId) { this.productInstanceId = productInstanceId; return this; } public String getProductInstanceId() { return this.productInstanceId; } }
b69da3c6121ffad561813e1c7e87cf0fd967bba3
e1e5bd6b116e71a60040ec1e1642289217d527b0
/H5/L2jMaster_org/L2jMaster_org_2019_07_02/L2JMaster_Server/src/main/java/com/l2jserver/gameserver/network/clientpackets/AnswerCoupleAction.java
4bb0c9c63494f40f9954fab896b724b5d38b1e4c
[]
no_license
serk123/L2jOpenSource
6d6e1988a421763a9467bba0e4ac1fe3796b34b3
603e784e5f58f7fd07b01f6282218e8492f7090b
refs/heads/master
2023-03-18T01:51:23.867273
2020-04-23T10:44:41
2020-04-23T10:44:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,342
java
/* * Copyright (C) 2004-2019 L2J Server * * This file is part of L2J Server. * * L2J Server is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J Server is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.network.clientpackets; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ExRotation; import com.l2jserver.gameserver.network.serverpackets.SocialAction; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.util.Util; /** * @author JIV */ public class AnswerCoupleAction extends L2GameClientPacket { private static final String _C__D0_7A_ANSWERCOUPLEACTION = "[C] D0:7A AnswerCoupleAction"; private int _charObjId; private int _actionId; private int _answer; @Override protected void readImpl() { _actionId = readD(); _answer = readD(); _charObjId = readD(); } @Override protected void runImpl() { L2PcInstance activeChar = getActiveChar(); L2PcInstance target = L2World.getInstance().getPlayer(_charObjId); if ((activeChar == null) || (target == null)) { return; } if ((target.getMultiSocialTarget() != activeChar.getObjectId()) || (target.getMultiSociaAction() != _actionId)) { return; } if (_answer == 0) // cancel { target.sendPacket(SystemMessageId.COUPLE_ACTION_DENIED); } else if (_answer == 1) // approve { final int distance = (int) activeChar.calculateDistance(target, false, false); if ((distance > 125) || (distance < 15) || (activeChar.getObjectId() == target.getObjectId())) { sendPacket(SystemMessageId.TARGET_DO_NOT_MEET_LOC_REQUIREMENTS); target.sendPacket(SystemMessageId.TARGET_DO_NOT_MEET_LOC_REQUIREMENTS); return; } int heading = Util.calculateHeadingFrom(activeChar, target); activeChar.broadcastPacket(new ExRotation(activeChar.getObjectId(), heading)); activeChar.setHeading(heading); heading = Util.calculateHeadingFrom(target, activeChar); target.setHeading(heading); target.broadcastPacket(new ExRotation(target.getObjectId(), heading)); activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), _actionId)); target.broadcastPacket(new SocialAction(_charObjId, _actionId)); } else if (_answer == -1) // refused { SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_SET_TO_REFUSE_COUPLE_ACTIONS); sm.addPcName(activeChar); target.sendPacket(sm); } target.setMultiSocialAction(0, 0); } @Override public String getType() { return _C__D0_7A_ANSWERCOUPLEACTION; } }
3035e005f8243974ff002e9570d1e6d06e2eca82
4619ef64436f410273215c4db1773d6e7c2c3b64
/SimiCart/app/src/main/java/com/simicart/plugins/braintree/model/BrainTreeModel.java
b6708bcf71f9f6e315f02d53f3fafa3583a77a92
[]
no_license
Simicart/Android-studio-core
ba72add5d98b6fff1895d0fc1b02441276d2963d
44389099b7a2e2ca5c1eb1c14f6f8129713d880c
refs/heads/master
2021-06-08T16:21:49.831387
2016-09-21T13:35:06
2016-09-21T13:35:06
48,149,460
0
0
null
null
null
null
UTF-8
Java
false
false
1,112
java
package com.simicart.plugins.braintree.model; import com.simicart.core.base.model.SimiModel; import com.simicart.core.base.model.collection.SimiCollection; import org.json.JSONArray; import org.json.JSONException; public class BrainTreeModel extends SimiModel { protected String message; @Override protected void parseData() { try { if (mJSON.has("message")) { JSONArray messArr = mJSON.getJSONArray("message"); if (messArr.length() > 0) { message = messArr.getString(0); } } JSONArray js_data = this.mJSON.getJSONArray("data"); if (null == collection) { collection = new SimiCollection(); } } catch (JSONException e) { e.printStackTrace(); } } @Override protected void setUrlAction() { mUrlAction = "simibraintree/index/update_payment"; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
1d7fa4a5bd97f698e9ec26b1234a55879a5a7218
aa189fa4cac412b639cbc4b10f0c8d0db38adc19
/src/interaction/mappers/MentionUsersMapper.java
26730a4eea25b71674ac2e80d9495e5b3bb610fd
[]
no_license
wild-fire/interaction-graph-filter
231a45e9ad9901e8e88c42f72862bc55c3205216
9f4285f4d60e9f5fc8cdb7d420aad55456664879
refs/heads/master
2021-01-22T09:09:11.268326
2015-05-23T19:21:37
2015-05-23T19:21:37
32,278,773
2
0
null
null
null
null
UTF-8
Java
false
false
1,046
java
package interaction.mappers; import interaction.vos.Interaction; import java.io.IOException; import org.apache.hadoop.io.Text; import com.google.gson.JsonElement; import com.google.gson.JsonObject; public class MentionUsersMapper extends InteractionDateGroupedMapper { @Override protected void mapTweet(Object key, Text value, Context context) throws IOException, InterruptedException { JsonObject entities = this.tweet.get("entities").getAsJsonObject(); if(entities.get("user_mentions").getAsJsonArray().size() > 0) { String userId = this.tweet.get("user").getAsJsonObject().get("id_str") .getAsString(); for (JsonElement mentionedUser : entities.get("user_mentions") .getAsJsonArray()) { JsonObject mentionedUserObj = mentionedUser.getAsJsonObject(); if(!this.tweet.isRetweeting(mentionedUserObj.get("screen_name").getAsString())) { Interaction mention = new Interaction(userId, mentionedUserObj.get("id").toString()); this.contextWriteToGroups(context, mention); } } } } }
760d48a5d4378962563f8e0740acb30a7fd1c7b4
29d87d3c781b36d5ab5b114ddfe60f23cd81ceb0
/org/wargamer2010/signshop/operations/takeShopItems.java
fe51c02de9ea6ebeff65ed79b86a129a0bd55dd9
[]
no_license
MixxCraft/SignShop
4855b8f7b33154d4ed4a8f4392585f5d91833c97
241fe404d8d2d7ec064ee80a9a69039d2b9d542d
refs/heads/master
2021-01-21T08:44:35.583956
2014-03-29T22:33:01
2014-03-29T22:33:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,903
java
package org.wargamer2010.signshop.operations; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.InventoryHolder; import org.bukkit.block.Block; import org.wargamer2010.signshop.configuration.SignShopConfig; import org.wargamer2010.signshop.util.itemUtil; import java.util.List; import java.util.LinkedList; public class takeShopItems implements SignShopOperation { @Override public Boolean setupOperation(SignShopArguments ssArgs) { if(ssArgs.getContainables().isEmpty()) { ssArgs.getPlayer().get().sendMessage(SignShopConfig.getError("chest_missing", ssArgs.getMessageParts())); return false; } ItemStack[] isTotalItems = itemUtil.getAllItemStacksForContainables(ssArgs.getContainables().get()); if(!ssArgs.isOperationParameter("allowemptychest") && isTotalItems.length == 0) { ssArgs.getPlayer().get().sendMessage(SignShopConfig.getError("chest_empty", ssArgs.getMessageParts())); return false; } ssArgs.getItems().set(isTotalItems); ssArgs.setMessagePart("!items", itemUtil.itemStackToString(ssArgs.getItems().get())); return true; } @Override public Boolean checkRequirements(SignShopArguments ssArgs, Boolean activeCheck) { if(ssArgs.getItems().get() == null) { ssArgs.getPlayer().get().sendMessage(SignShopConfig.getError("no_items_defined_for_shop", ssArgs.getMessageParts())); return false; } Boolean bStockOK = itemUtil.stockOKForContainables(ssArgs.getContainables().get(), ssArgs.getItems().get(), true); ssArgs.setMessagePart("!items", itemUtil.itemStackToString(ssArgs.getItems().get())); if(!bStockOK) ssArgs.sendFailedRequirementsMessage("out_of_stock"); if(!bStockOK && activeCheck) itemUtil.updateStockStatus(ssArgs.getSign().get(), ChatColor.DARK_RED); else if(activeCheck) itemUtil.updateStockStatus(ssArgs.getSign().get(), ChatColor.DARK_BLUE); return bStockOK; } @Override public Boolean runOperation(SignShopArguments ssArgs) { InventoryHolder Holder = itemUtil.getFirstStockOKForContainables(ssArgs.getContainables().get(), ssArgs.getItems().get(), true); if(Holder == null) return false; Holder.getInventory().removeItem(ssArgs.getItems().get()); if(!itemUtil.stockOKForContainables(ssArgs.getContainables().get(), ssArgs.getItems().get(), true)) itemUtil.updateStockStatus(ssArgs.getSign().get(), ChatColor.DARK_RED); else itemUtil.updateStockStatus(ssArgs.getSign().get(), ChatColor.DARK_BLUE); ssArgs.setMessagePart("!items", itemUtil.itemStackToString(ssArgs.getItems().get())); return true; } }
2803b6b99f0f2dcb4406225d12322e1d13d2ea13
2aa81ae67c7d6e0c52ea3c55c6b2784416a3a5be
/src/test/java/PageObject/AjaxSubmitWithLoading.java
256499c1b15e1e9ae801e1356b1e0abf31bcec63
[]
no_license
Patryk728/Selenium
fa9d490fa83ee21309eef66168d1f93a1f95aba5
fdd93bf16e9928786b58aab29016d42b0b94e127
refs/heads/master
2020-04-25T19:56:28.203128
2019-02-28T12:16:04
2019-02-28T12:16:04
173,038,222
0
0
null
null
null
null
UTF-8
Java
false
false
1,833
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 PageObject; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebDriver; public class AjaxSubmitWithLoading extends BasePage { private final static String Url = appUrl + "ajax-form-submit-demo.html"; public AjaxSubmitWithLoading(RemoteWebDriver webDriver) { super(webDriver); } public static String getUrl() { return Url; } //elements for Ajax Form private WebElement nameBox; private WebElement commentBox; private WebElement submitButton; private WebElement resultMessage; //methods for Ajax Form public AjaxSubmitWithLoading nameBoxClick() { nameBox.click(); return this; } public AjaxSubmitWithLoading nameBoxInputText(String inputName) { nameBox.sendKeys(inputName); return this; } public AjaxSubmitWithLoading commentBoxClick() { commentBox.click(); return this; } public AjaxSubmitWithLoading commentBoxInputText(String inputComment) { commentBox.sendKeys(inputComment); return this; } public AjaxSubmitWithLoading submitButtonClick() { submitButton.click(); return this; } public WebElement getSubmitButton() { return submitButton; } public WebElement getResultMessage() { return resultMessage; } public AjaxSubmitWithLoading initializeElements(RemoteWebDriver webDriver) { nameBox = webDriver.findElement(By.xpath("//*[@id=\"title\"]")); commentBox = webDriver.findElement(By.xpath("//*[@id=\"description\"]")); submitButton = webDriver.findElement(By.xpath("//*[@id=\"btn-submit\"]")); resultMessage = webDriver.findElement(By.xpath("//*[@id=\"submit-control\"]")); return this; } }
6e6376b024a86cb37946b5a6060267ad4abc099b
83eb940fc766c8ff515727a3fe5c15a53ac3ddde
/app/src/main/java/moe/koibito/findiction/NaviListAdapter.java
4615d287039acb4520c417231393d8197c0aceff
[]
no_license
Astoration/FINDiction
4f0d77dcc46d962d2e0670f92549e6b18ad51340
6cbeb89fc0a57a36fa1ca6bd7dae7f41ca2426a6
refs/heads/master
2020-07-03T09:55:56.473584
2017-09-04T02:47:04
2017-09-04T02:47:04
67,225,496
0
0
null
null
null
null
UTF-8
Java
false
false
1,923
java
package moe.koibito.findiction; import android.content.Context; import android.database.DataSetObserver; import android.graphics.drawable.Drawable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.TextView; import java.util.ArrayList; import java.util.Arrays; /** * Created by Astoration on 2016. 9. 3.. */ public class NaviListAdapter extends BaseAdapter { private ArrayList<NaviMenuItem> MenuItemlist = new ArrayList<>(); public NaviListAdapter(NaviMenuItem[] items){ MenuItemlist.addAll(Arrays.asList(items)); } public void addMenuItem(Drawable drawable,String title){ NaviMenuItem item = new NaviMenuItem(drawable,title); MenuItemlist.add(item); } @Override public int getCount() { return MenuItemlist.size(); } @Override public Object getItem(int i) { return MenuItemlist.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View view, ViewGroup viewGroup) { final int pos = i; Context context = viewGroup.getContext(); if(view==null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.navidrawer_list_item,viewGroup,false); } ImageView icon = (ImageView) view.findViewById(R.id.list_icon); TextView title= (TextView) view.findViewById(R.id.list_title); NaviMenuItem item = MenuItemlist.get(pos); icon.setImageDrawable(item.getIconDrawable()); title.setText(item.getTitle()); return view; } @Override public boolean isEmpty() { return MenuItemlist.isEmpty(); } }
fb82059fa5b3fb3dbd5a02e0ac41aebb8d969633
8526a444075827abccab07b2948a3269f04fefe7
/app/src/main/java/nau/william/capstonechat/utils/Display.java
02db1b9c30ed48669288d07fd2c32387cdc41694
[]
no_license
WMNau/capstone-chat-app-android
2f735033f77816ecc168a111539435649346a820
b1ede4ca3b739659da9acea275d897dba79e2a6e
refs/heads/master
2020-05-14T08:58:55.673650
2019-05-15T01:15:09
2019-05-15T01:15:09
181,732,003
0
0
null
null
null
null
UTF-8
Java
false
false
1,059
java
package nau.william.capstonechat.utils; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.widget.TextView; import android.widget.Toast; public class Display { public static void toastMessage(Context context, String message) { Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } public static void popupMessage(Context context, String title, String message) { toastMessage(context, message); AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(title); TextView messageView = new TextView(context); messageView.setText(message); builder.setView(messageView); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); } }
[ "=" ]
=
51f6d53e88bb5c728d50eee24bb6e2ed95239be5
37f36fe4d46af514dda9b7585bdf535f614e5201
/src/java/controller/ReturnController.java
d0c36efcbaaea49aa316fc955effbd3fce97a72d
[]
no_license
longg20/JourneyToTheWest
871f77513f7be12e9cd0bd6cd6bb61bf80191d96
b80cee7134e0384fe4a7739af8fd10d753bdc4f8
refs/heads/master
2023-01-23T07:05:12.187629
2020-12-04T05:53:26
2020-12-04T05:53:26
318,417,568
0
0
null
null
null
null
UTF-8
Java
false
false
2,835
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 controller; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author Long */ public class ReturnController extends HttpServlet { private static final String ADMIN = "admin/admin.jsp"; private static final String ACTOR = "actor/actor.jsp"; private static final String INVALID = "error.jsp"; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String url = INVALID; try { HttpSession session = request.getSession(); String role = (String) session.getAttribute("ROLE"); if (role.equals("admin")) url = ADMIN; else if (role.equals("actor")) url = ACTOR; else { request.setAttribute("ERROR", "Invalid role"); } } catch (Exception e) { log("ERROR at ReturnController: " + e.getMessage()); } finally { request.getRequestDispatcher(url).forward(request, response); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
dca197a6cca1b23029cc5454578b65b811bd598a
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/baike/sources/android/support/v4/content/WakefulBroadcastReceiver.java
ae92ccb12b9fd1a9693f314852fe720cf2829282
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
1,846
java
package android.support.v4.content; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.util.Log; import android.util.SparseArray; @Deprecated public abstract class WakefulBroadcastReceiver extends BroadcastReceiver { private static final SparseArray<WakeLock> a = new SparseArray(); private static int b = 1; public static ComponentName startWakefulService(Context context, Intent intent) { synchronized (a) { int i = b; b++; if (b <= 0) { b = 1; } intent.putExtra("android.support.content.wakelockid", i); ComponentName startService = context.startService(intent); if (startService == null) { return null; } WakeLock newWakeLock = ((PowerManager) context.getSystemService("power")).newWakeLock(1, "wake:" + startService.flattenToShortString()); newWakeLock.setReferenceCounted(false); newWakeLock.acquire(60000); a.put(i, newWakeLock); return startService; } } public static boolean completeWakefulIntent(Intent intent) { int intExtra = intent.getIntExtra("android.support.content.wakelockid", 0); if (intExtra == 0) { return false; } synchronized (a) { WakeLock wakeLock = (WakeLock) a.get(intExtra); if (wakeLock != null) { wakeLock.release(); a.remove(intExtra); return true; } Log.w("WakefulBroadcastReceiv.", "No active wake lock id #" + intExtra); return true; } } }
43edeea10c404661e63f5dd736499634f9ade454
eef5f6729e3a7514d60da547378cc5ca93b994d1
/space_android/app/src/main/java/com/tenth/space/imservice/manager/IMContactManager.java
6cb42f2bdd091b6db7452dcf5c2954659d51c10f
[]
no_license
robot0x/10thspace
effab5646d36705eec9342b9589bfee19e4c65e9
8b4066bacf402382e7d423723f57eb409a7af0d6
refs/heads/master
2021-01-12T08:47:58.854002
2016-12-16T05:38:59
2016-12-16T05:38:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,176
java
package com.tenth.space.imservice.manager; import com.tenth.space.DB.DBInterface; import com.tenth.space.DB.entity.DepartmentEntity; import com.tenth.space.DB.entity.UserEntity; import com.tenth.space.imservice.event.UserInfoEvent; import com.tenth.space.protobuf.IMBaseDefine; import com.tenth.space.protobuf.IMBuddy; import com.tenth.space.protobuf.helper.ProtoBuf2JavaBean; import com.tenth.space.utils.IMUIHelper; import com.tenth.space.utils.Logger; import com.tenth.space.utils.pinyin.PinYin; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import de.greenrobot.event.EventBus; import static com.tenth.space.imservice.event.UserInfoEvent.Event.USER_INFO_OK; /** * 负责用户信息的请求 * 为回话页面以及联系人页面提供服务 * * 联系人信息管理 * 普通用户的version 有总版本 * 群组没有总version的概念, 每个群有version * 具体请参见 服务端具体的pd协议 */ public class IMContactManager extends IMManager { private Logger logger = Logger.getLogger(IMContactManager.class); // 单例 private static IMContactManager inst = new IMContactManager(); public static IMContactManager instance() { return inst; } private IMSocketManager imSocketManager = IMSocketManager.instance(); private DBInterface dbInterface = DBInterface.instance(); // 自身状态字段 private boolean userDataReady = false; private Map<Integer,UserEntity> userMap = new ConcurrentHashMap<>(); private Map<Integer,DepartmentEntity> departmentMap = new ConcurrentHashMap<>(); @Override public void doOnStart() { } /** * 登陆成功触发 * auto自动登陆 * */ public void onNormalLoginOk(){ onLocalLoginOk(); onLocalNetOk(); } /** * 加载本地DB的状态 * 不管是离线还是在线登陆,loadFromDb 要运行的 */ public void onLocalLoginOk(){ logger.i("contact#loadAllUserInfo"); List<DepartmentEntity> deptlist = dbInterface.loadAllDept(); logger.i("contact#loadAllDept dbsuccess"); List<UserEntity> userlist = dbInterface.loadAllUsers(); logger.i("contact#loadAllUserInfo dbsuccess"); for(UserEntity userInfo:userlist){ // todo DB的状态不包含拼音的,这个样每次都要加载啊 PinYin.getPinYin(userInfo.getMainName(), userInfo.getPinyinElement()); userMap.put(userInfo.getPeerId(),userInfo); } for(DepartmentEntity deptInfo:deptlist){ PinYin.getPinYin(deptInfo.getDepartName(), deptInfo.getPinyinElement()); departmentMap.put(deptInfo.getDepartId(),deptInfo); } triggerEvent(USER_INFO_OK); } /** * 网络链接成功,登陆之后请求 */ public void onLocalNetOk(){ // 部门信息 int deptUpdateTime = dbInterface.getDeptLastTime(); reqGetDepartment(deptUpdateTime); // 用户信息 int updateTime = dbInterface.getUserInfoLastTime(); logger.i("contact#loadAllUserInfo req-updateTime:%d",updateTime); reqGetAllUsers(updateTime); } @Override public void reset() { userDataReady = false; userMap.clear(); } /** * @param event */ public void triggerEvent(UserInfoEvent.Event event) { //先更新自身的状态 switch (event){ case USER_INFO_OK: userDataReady = true; break; } EventBus.getDefault().postSticky(event); } /**-----------------------事件驱动---end---------*/ private void reqGetAllUsers(int lastUpdateTime) { logger.i("contact#reqGetAllUsers"); int userId = IMLoginManager.instance().getLoginId(); IMBuddy.IMAllUserReq imAllUserReq = IMBuddy.IMAllUserReq.newBuilder() .setUserId(userId) .setLatestUpdateTime(0).build(); int sid = IMBaseDefine.ServiceID.SID_BUDDY_LIST_VALUE; int cid = IMBaseDefine.BuddyListCmdID.CID_BUDDY_LIST_ALL_USER_REQUEST_VALUE; imSocketManager.sendRequest(imAllUserReq,sid,cid); } /** * yingmu change id from string to int * @param imAllUserRsp * * 1.请求所有用户的信息,总的版本号version * 2.匹配总的版本号,返回可能存在变更的 * 3.选取存在变更的,请求用户详细信息 * 4.更新DB,保存globalVersion 以及用户的信息 */ public void onRepAllUsers(IMBuddy.IMAllUserRsp imAllUserRsp) { logger.i("contact#onRepAllUsers"); int userId = imAllUserRsp.getUserId(); int lastTime = imAllUserRsp.getLatestUpdateTime(); // lastTime 需要保存嘛? 不保存了 int count = imAllUserRsp.getUserListCount(); logger.i("contact#user cnt:%d", count); if(count <=0){ return; } int loginId = IMLoginManager.instance().getLoginId(); if(userId != loginId){ logger.e("[fatal error] userId not equels loginId ,cause by onRepAllUsers"); return ; } List<IMBaseDefine.UserInfo> changeList = imAllUserRsp.getUserListList(); ArrayList<UserEntity> needDb = new ArrayList<>(); for(IMBaseDefine.UserInfo userInfo:changeList){ UserEntity entity = ProtoBuf2JavaBean.getUserEntity(userInfo); userMap.put(entity.getPeerId(),entity); needDb.add(entity); } dbInterface.batchInsertOrUpdateUser(needDb); triggerEvent(UserInfoEvent.Event.USER_INFO_UPDATE); } public UserEntity findContact(int buddyId){ if(buddyId > 0 && userMap.containsKey(buddyId)){ return userMap.get(buddyId); }else // else if (buddyId==0){ // SessionEntity sessionEntity=new SessionEntity(); // sessionEntity.setPeerId(15); // sessionEntity.setPeerType(DBConstant.SESSION_TYPE_SINGLE); // sessionEntity.setSessionKey( sessionEntity.buildSessionKey()); // dbInterface.insertOrUpdateSession(sessionEntity); // long requstCode = DBInterface.instance().insertOrUpdateSession(new SessionEntity()); // if(requstCode !=-1){ // // } // } return null; } /** * 请求用户详细信息 * @param userIds */ public void reqGetDetaillUsers(ArrayList<Integer> userIds){ logger.i("contact#contact#reqGetDetaillUsers"); if(null == userIds || userIds.size() <=0){ logger.i("contact#contact#reqGetDetaillUsers return,cause by null or empty"); return; } int loginId = IMLoginManager.instance().getLoginId(); IMBuddy.IMUsersInfoReq imUsersInfoReq = IMBuddy.IMUsersInfoReq.newBuilder() .setUserId(loginId) .addAllUserIdList(userIds) .build(); int sid = IMBaseDefine.ServiceID.SID_BUDDY_LIST_VALUE; int cid = IMBaseDefine.BuddyListCmdID.CID_BUDDY_LIST_USER_INFO_REQUEST_VALUE; imSocketManager.sendRequest(imUsersInfoReq,sid,cid); } /** * 获取用户详细的信息 * @param imUsersInfoRsp */ public void onRepDetailUsers(IMBuddy.IMUsersInfoRsp imUsersInfoRsp){ int loginId = imUsersInfoRsp.getUserId(); boolean needEvent = false; List<IMBaseDefine.UserInfo> userInfoList = imUsersInfoRsp.getUserInfoListList(); ArrayList<UserEntity> dbNeed = new ArrayList<>(); for(IMBaseDefine.UserInfo userInfo:userInfoList) { UserEntity userEntity = ProtoBuf2JavaBean.getUserEntity(userInfo); int userId = userEntity.getPeerId(); if (userMap.containsKey(userId) && userMap.get(userId).equals(userEntity)) { //没有必要通知更新 } else { needEvent = true; userMap.put(userEntity.getPeerId(), userEntity); dbNeed.add(userEntity); if (userInfo.getUserId() == loginId) { IMLoginManager.instance().setLoginInfo(userEntity); } } } // 负责userMap dbInterface.batchInsertOrUpdateUser(dbNeed); // 判断有没有必要进行推送 if(needEvent){ triggerEvent(UserInfoEvent.Event.USER_INFO_UPDATE); } } public DepartmentEntity findDepartment(int deptId){ DepartmentEntity entity = departmentMap.get(deptId); return entity; } public List<DepartmentEntity> getDepartmentSortedList(){ // todo eric efficiency List<DepartmentEntity> departmentList = new ArrayList<>(departmentMap.values()); Collections.sort(departmentList, new Comparator<DepartmentEntity>(){ @Override public int compare(DepartmentEntity entity1, DepartmentEntity entity2) { if(entity1.getPinyinElement().pinyin==null) { PinYin.getPinYin(entity1.getDepartName(),entity1.getPinyinElement()); } if(entity2.getPinyinElement().pinyin==null) { PinYin.getPinYin(entity2.getDepartName(),entity2.getPinyinElement()); } return entity1.getPinyinElement().pinyin.compareToIgnoreCase(entity2.getPinyinElement().pinyin); } }); return departmentList; } public void addFriend(UserEntity userEntity){ userMap.put(userEntity.getPeerId(),userEntity); } public List<UserEntity> getContactSortedList() { // todo eric efficiency List<UserEntity> contactList = new ArrayList<>(userMap.values()); Collections.sort(contactList, new Comparator<UserEntity>(){ @Override public int compare(UserEntity entity1, UserEntity entity2) { PinYin.PinYinElement pinyinElement = entity2.getPinyinElement(); if (entity2.getPinyinElement().pinyin.startsWith("#")) { return -1; } else if (entity1.getPinyinElement().pinyin.startsWith("#")) { // todo eric guess: latter is > 0 return 1; } else { if(entity1.getPinyinElement().pinyin==null) { PinYin.getPinYin(entity1.getMainName(),entity1.getPinyinElement()); } if(entity2.getPinyinElement().pinyin==null) { PinYin.getPinYin(entity2.getMainName(),entity2.getPinyinElement()); } return entity1.getPinyinElement().pinyin.compareToIgnoreCase(entity2.getPinyinElement().pinyin); } } }); return contactList; } public List<UserEntity> queryAllUser(){ return new ArrayList<>(userMap.values()); } // 通讯录中的部门显示 需要根据优先级 public List<UserEntity> getDepartmentTabSortedList() { // todo eric efficiency List<UserEntity> contactList = new ArrayList<>(userMap.values()); Collections.sort(contactList, new Comparator<UserEntity>() { @Override public int compare(UserEntity entity1, UserEntity entity2) { DepartmentEntity dept1 = departmentMap.get(entity1.getDepartmentId()); DepartmentEntity dept2 = departmentMap.get(entity2.getDepartmentId()); if (entity1.getDepartmentId() == entity2.getDepartmentId()) { // start compare if (entity2.getPinyinElement().pinyin.startsWith("#")) { return -1; } else if (entity1.getPinyinElement().pinyin.startsWith("#")) { // todo eric guess: latter is > 0 return 1; } else { if(entity1.getPinyinElement().pinyin==null) { PinYin.getPinYin(entity1.getMainName(), entity1.getPinyinElement()); } if(entity2.getPinyinElement().pinyin==null) { PinYin.getPinYin(entity2.getMainName(),entity2.getPinyinElement()); } return entity1.getPinyinElement().pinyin.compareToIgnoreCase(entity2.getPinyinElement().pinyin); } // end compare } else { return dept1.getDepartName().compareToIgnoreCase(dept2.getDepartName()); } } }); return contactList; } // 确实要将对比的抽离出来 Collections public List<UserEntity> getSearchContactList(String key){ List<UserEntity> searchList = new ArrayList<>(); for(Map.Entry<Integer,UserEntity> entry:userMap.entrySet()){ UserEntity user = entry.getValue(); if (IMUIHelper.handleContactSearch(key, user)) { searchList.add(user); } } return searchList; } public List<DepartmentEntity> getSearchDepartList(String key) { List<DepartmentEntity> searchList = new ArrayList<>(); for(Map.Entry<Integer,DepartmentEntity> entry:departmentMap.entrySet()){ DepartmentEntity dept = entry.getValue(); if (IMUIHelper.handleDepartmentSearch(key, dept)) { searchList.add(dept); } } return searchList; } /**------------------------部门相关的协议 start------------------------------*/ // 更新的方式与userInfo一直,根据时间点 public void reqGetDepartment(int lastUpdateTime){ logger.i("contact#reqGetDepartment"); int userId = IMLoginManager.instance().getLoginId(); IMBuddy.IMDepartmentReq imDepartmentReq = IMBuddy.IMDepartmentReq.newBuilder() .setUserId(userId) .setLatestUpdateTime(lastUpdateTime).build(); int sid = IMBaseDefine.ServiceID.SID_BUDDY_LIST_VALUE; int cid = IMBaseDefine.BuddyListCmdID.CID_BUDDY_LIST_DEPARTMENT_REQUEST_VALUE; imSocketManager.sendRequest(imDepartmentReq,sid,cid); } public void onRepDepartment(IMBuddy.IMDepartmentRsp imDepartmentRsp){ logger.i("contact#onRepDepartment"); int userId = imDepartmentRsp.getUserId(); int lastTime = imDepartmentRsp.getLatestUpdateTime(); int count = imDepartmentRsp.getDeptListCount(); logger.i("contact#department cnt:%d", count); // 如果用户找不到depart 那么部门显示未知 if(count <=0){ return; } int loginId = IMLoginManager.instance().getLoginId(); if(userId != loginId){ logger.e("[fatal error] userId not equels loginId ,cause by onRepDepartment"); return ; } List<IMBaseDefine.DepartInfo> changeList = imDepartmentRsp.getDeptListList(); ArrayList<DepartmentEntity> needDb = new ArrayList<>(); for(IMBaseDefine.DepartInfo departInfo:changeList){ DepartmentEntity entity = ProtoBuf2JavaBean.getDepartEntity(departInfo); departmentMap.put(entity.getDepartId(),entity); needDb.add(entity); } // 部门信息更新 dbInterface.batchInsertOrUpdateDepart(needDb); triggerEvent(UserInfoEvent.Event.USER_INFO_UPDATE); } /**------------------------部门相关的协议 end------------------------------*/ /**-----------------------实体 get set 定义-----------------------------------*/ public Map<Integer, UserEntity> getUserMap() { return userMap; } public Map<Integer, DepartmentEntity> getDepartmentMap() { return departmentMap; } public boolean isUserDataReady() { return userDataReady; } }
6b3648548e37fb5f3480c28b1089b14f3f915e82
5fe0b2836fd22c3e7d1ce88b8628f226d3b727bb
/WinPointManagementSystem/src/main/java/com/winpoint/repository/PaymentModeRepository.java
69e9aca6c811cefbddc8facf922a7fdeef1d8692
[]
no_license
WinPointLC/WinPointDigitization-SpringBoot
50d848abae5b6895afe95cf25b9313ba2f4b24dd
61b57fe77b8f62f43030fab6cdca19b9945811d4
refs/heads/master
2023-03-09T05:57:46.962074
2021-03-02T06:36:31
2021-03-02T06:36:31
299,283,856
0
0
null
null
null
null
UTF-8
Java
false
false
224
java
package com.winpoint.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.winpoint.model.PaymentMode; public interface PaymentModeRepository extends JpaRepository<PaymentMode, Integer>{ }
d26aba93a06029e8f15bd564812c5e06dad32c8f
fe3e6688cb879db5136b95bdb89d3096f46724c5
/src/Cliente.java
92d208c95a9ff48ca436f906e17b23256c272383
[]
no_license
matheusf98/Java-Orientado_Objeto_Encapsulamento
ff84e540ae6a4c8403b09806db92f83bcc23b9b5
5357f4f5c832947194cfaa826333fb0e5c739402
refs/heads/master
2022-11-13T08:14:32.828346
2020-06-30T18:38:30
2020-06-30T18:38:30
276,180,823
1
0
null
null
null
null
UTF-8
Java
false
false
422
java
public class Cliente { private String Nome; private String Cpf; private String Profissao; public String getNome() { return Nome; } public void setNome(String nome) { Nome = nome; } public String getCpf() { return Cpf; } public void setCpf(String cpf) { Cpf = cpf; } public String getProfissao() { return Profissao; } public void setProfissao(String profissao) { Profissao = profissao; } }
[ "dev@perugluglu" ]
dev@perugluglu
d8b44289381c96a3d20b4d2cbab7a8b0138d1cc3
536239d5000786770fac4311819c360d18779a7e
/src/project/staff/attendance/Get_name.java
a87521d09e582c4b38d77b3672c7afa0f674b125
[]
no_license
rlaalghkwkd2/Project01
081222eda8374303241fb33480f0837ac095bb33
fbda5b57a670057c28379c9af2f6d6289efe004f
refs/heads/main
2023-02-02T02:50:12.010228
2020-12-24T04:11:43
2020-12-24T04:11:43
323,567,015
0
0
null
null
null
null
UTF-8
Java
false
false
1,214
java
package project.staff.attendance; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Properties; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import project.Payment.team.Hikariconfig; public class Get_name { public String name = null; HikariDataSource ds = null; public Get_name(int emp_id) { ds = new Hikariconfig().config(); try { Connection conn = ds.getConnection(); PreparedStatement pstmt = conn.prepareStatement("SELECT emp_name FROM employees3 WHERE emp_id = ?"); pstmt.setInt(1, emp_id); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { name = rs.getString("emp_name"); } rs.close(); pstmt.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } } public String name() { return name; } public static void main(String[] args) { System.out.println(new Get_name(2).name()); } }
[ "seunghwan@Park" ]
seunghwan@Park
627d5db55117408d2c5b400530dbf72ca31b97e1
ef275d147ddd32fdf137f2e57e7d09f04826754f
/h2code/src/main/org/h2/fulltext/FullTextLucene.java
4ea3a56756a75cf0010428360fbd0b3a8df343df
[]
no_license
ketki512/H2_database_extensions
61e26202422bd5ea86b684d171d5b97a74c19fd6
dcd56b74a5314013cbeafa2c4ef9ecb67a7f078d
refs/heads/master
2021-01-10T08:21:46.576757
2016-03-30T16:13:38
2016-03-30T16:13:38
55,077,685
0
0
null
null
null
null
UTF-8
Java
false
false
28,342
java
/* * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (http://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.fulltext; import java.io.IOException; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.DateTools; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.Searcher; import org.h2.api.Trigger; import org.h2.command.Parser; import org.h2.engine.Session; import org.h2.expression.ExpressionColumn; import org.h2.jdbc.JdbcConnection; import org.h2.store.fs.FileUtils; import org.h2.tools.SimpleResultSet; import org.h2.util.New; import org.h2.util.StatementBuilder; import org.h2.util.StringUtils; import org.h2.util.Utils; import java.io.File; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.Version; import org.apache.lucene.index.IndexWriter; /** * This class implements the full text search based on Apache Lucene. * Most methods can be called using SQL statements as well. */ public class FullTextLucene extends FullText { /** * Whether the text content should be stored in the Lucene index. */ protected static final boolean STORE_DOCUMENT_TEXT_IN_INDEX = Utils.getProperty("h2.storeDocumentTextInIndex", false); private static final HashMap<String, IndexAccess> INDEX_ACCESS = New.hashMap(); private static final String TRIGGER_PREFIX = "FTL_"; private static final String SCHEMA = "FTL"; private static final String LUCENE_FIELD_DATA = "_DATA"; private static final String LUCENE_FIELD_QUERY = "_QUERY"; private static final String LUCENE_FIELD_MODIFIED = "_modified"; private static final String LUCENE_FIELD_COLUMN_PREFIX = "_"; /** * The prefix for a in-memory path. This prefix is only used internally * within this class and not related to the database URL. */ private static final String IN_MEMORY_PREFIX = "mem:"; /** * Initializes full text search functionality for this database. This adds * the following Java functions to the database: * <ul> * <li>FTL_CREATE_INDEX(schemaNameString, tableNameString, * columnListString)</li> * <li>FTL_SEARCH(queryString, limitInt, offsetInt): result set</li> * <li>FTL_REINDEX()</li> * <li>FTL_DROP_ALL()</li> * </ul> * It also adds a schema FTL to the database where bookkeeping information * is stored. This function may be called from a Java application, or by * using the SQL statements: * * <pre> * CREATE ALIAS IF NOT EXISTS FTL_INIT FOR * &quot;org.h2.fulltext.FullTextLucene.init&quot;; * CALL FTL_INIT(); * </pre> * * @param conn the connection */ public static void init(Connection conn) throws SQLException { Statement stat = conn.createStatement(); stat.execute("CREATE SCHEMA IF NOT EXISTS " + SCHEMA); stat.execute("CREATE TABLE IF NOT EXISTS " + SCHEMA + ".INDEXES(SCHEMA VARCHAR, TABLE VARCHAR, " + "COLUMNS VARCHAR, PRIMARY KEY(SCHEMA, TABLE))"); stat.execute("CREATE ALIAS IF NOT EXISTS FTL_CREATE_INDEX FOR \"" + FullTextLucene.class.getName() + ".createIndex\""); stat.execute("CREATE ALIAS IF NOT EXISTS FTL_DROP_INDEX FOR \"" + FullTextLucene.class.getName() + ".dropIndex\""); stat.execute("CREATE ALIAS IF NOT EXISTS FTL_SEARCH FOR \"" + FullTextLucene.class.getName() + ".search\""); stat.execute("CREATE ALIAS IF NOT EXISTS FTL_SEARCH_DATA FOR \"" + FullTextLucene.class.getName() + ".searchData\""); stat.execute("CREATE ALIAS IF NOT EXISTS FTL_REINDEX FOR \"" + FullTextLucene.class.getName() + ".reindex\""); stat.execute("CREATE ALIAS IF NOT EXISTS FTL_DROP_ALL FOR \"" + FullTextLucene.class.getName() + ".dropAll\""); try { getIndexAccess(conn); } catch (SQLException e) { throw convertException(e); } } /** * Create a new full text index for a table and column list. Each table may * only have one index at any time. * * @param conn the connection * @param schema the schema name of the table (case sensitive) * @param table the table name (case sensitive) * @param columnList the column list (null for all columns) */ public static void createIndex(Connection conn, String schema, String table, String columnList) throws SQLException { init(conn); PreparedStatement prep = conn.prepareStatement("INSERT INTO " + SCHEMA + ".INDEXES(SCHEMA, TABLE, COLUMNS) VALUES(?, ?, ?)"); prep.setString(1, schema); prep.setString(2, table); prep.setString(3, columnList); prep.execute(); createTrigger(conn, schema, table); indexExistingRows(conn, schema, table); } /** * Drop an existing full text index for a table. This method returns * silently if no index for this table exists. * * @param conn the connection * @param schema the schema name of the table (case sensitive) * @param table the table name (case sensitive) */ public static void dropIndex(Connection conn, String schema, String table) throws SQLException { init(conn); PreparedStatement prep = conn.prepareStatement("DELETE FROM " + SCHEMA + ".INDEXES WHERE SCHEMA=? AND TABLE=?"); prep.setString(1, schema); prep.setString(2, table); int rowCount = prep.executeUpdate(); if (rowCount == 0) { return; } reindex(conn); } /** * Re-creates the full text index for this database. Calling this method is * usually not needed, as the index is kept up-to-date automatically. * * @param conn the connection */ public static void reindex(Connection conn) throws SQLException { init(conn); removeAllTriggers(conn, TRIGGER_PREFIX); removeIndexFiles(conn); Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("SELECT * FROM " + SCHEMA + ".INDEXES"); while (rs.next()) { String schema = rs.getString("SCHEMA"); String table = rs.getString("TABLE"); createTrigger(conn, schema, table); indexExistingRows(conn, schema, table); } } /** * Drops all full text indexes from the database. * * @param conn the connection */ public static void dropAll(Connection conn) throws SQLException { Statement stat = conn.createStatement(); stat.execute("DROP SCHEMA IF EXISTS " + SCHEMA); removeAllTriggers(conn, TRIGGER_PREFIX); removeIndexFiles(conn); } /** * Searches from the full text index for this database. * The returned result set has the following column: * <ul><li>QUERY (varchar): the query to use to get the data. * The query does not include 'SELECT * FROM '. Example: * PUBLIC.TEST WHERE ID = 1 * </li><li>SCORE (float) the relevance score as returned by Lucene. * </li></ul> * * @param conn the connection * @param text the search query * @param limit the maximum number of rows or 0 for no limit * @param offset the offset or 0 for no offset * @return the result set */ public static ResultSet search(Connection conn, String text, int limit, int offset) throws SQLException { return search(conn, text, limit, offset, false); } /** * Searches from the full text index for this database. The result contains * the primary key data as an array. The returned result set has the * following columns: * <ul> * <li>SCHEMA (varchar): the schema name. Example: PUBLIC</li> * <li>TABLE (varchar): the table name. Example: TEST</li> * <li>COLUMNS (array of varchar): comma separated list of quoted column * names. The column names are quoted if necessary. Example: (ID)</li> * <li>KEYS (array of values): comma separated list of values. * Example: (1)</li> * <li>SCORE (float) the relevance score as returned by Lucene.</li> * </ul> * * @param conn the connection * @param text the search query * @param limit the maximum number of rows or 0 for no limit * @param offset the offset or 0 for no offset * @return the result set */ public static ResultSet searchData(Connection conn, String text, int limit, int offset) throws SQLException { return search(conn, text, limit, offset, true); } /** * Convert an exception to a fulltext exception. * * @param e the original exception * @return the converted SQL exception */ protected static SQLException convertException(Exception e) { SQLException e2 = new SQLException( "Error while indexing document", "FULLTEXT"); e2.initCause(e); return e2; } /** * Create the trigger. * * @param conn the database connection * @param schema the schema name * @param table the table name */ protected static void createTrigger(Connection conn, String schema, String table) throws SQLException { createOrDropTrigger(conn, schema, table, true); } private static void createOrDropTrigger(Connection conn, String schema, String table, boolean create) throws SQLException { Statement stat = conn.createStatement(); String trigger = StringUtils.quoteIdentifier(schema) + "." + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table); stat.execute("DROP TRIGGER IF EXISTS " + trigger); if (create) { StringBuilder buff = new StringBuilder( "CREATE TRIGGER IF NOT EXISTS "); // the trigger is also called on rollback because transaction // rollback will not undo the changes in the Lucene index buff.append(trigger). append(" AFTER INSERT, UPDATE, DELETE, ROLLBACK ON "). append(StringUtils.quoteIdentifier(schema)). append('.'). append(StringUtils.quoteIdentifier(table)). append(" FOR EACH ROW CALL \""). append(FullTextLucene.FullTextTrigger.class.getName()). append('\"'); stat.execute(buff.toString()); } } /** * Get the index writer/searcher wrapper for the given connection. * * @param conn the connection * @return the index access wrapper */ protected static IndexAccess getIndexAccess(Connection conn) throws SQLException { String path = getIndexPath(conn); synchronized (INDEX_ACCESS) { IndexAccess access = INDEX_ACCESS.get(path); if (access == null) { try { Directory indexDir = path.startsWith(IN_MEMORY_PREFIX) ? new RAMDirectory() : FSDirectory.open(new File(path)); boolean recreate = !IndexReader.indexExists(indexDir); Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_30); IndexWriter writer = new IndexWriter(indexDir, analyzer, recreate, IndexWriter.MaxFieldLength.UNLIMITED); //see http://wiki.apache.org/lucene-java/NearRealtimeSearch IndexReader reader = writer.getReader(); access = new IndexAccess(); access.writer = writer; access.reader = reader; access.searcher = new IndexSearcher(reader); } catch (IOException e) { throw convertException(e); } INDEX_ACCESS.put(path, access); } return access; } } /** * Get the path of the Lucene index for this database. * * @param conn the database connection * @return the path */ protected static String getIndexPath(Connection conn) throws SQLException { Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("CALL DATABASE_PATH()"); rs.next(); String path = rs.getString(1); if (path == null) { return IN_MEMORY_PREFIX + conn.getCatalog(); } int index = path.lastIndexOf(':'); // position 1 means a windows drive letter is used, ignore that if (index > 1) { path = path.substring(index + 1); } rs.close(); return path; } /** * Add the existing data to the index. * * @param conn the database connection * @param schema the schema name * @param table the table name */ protected static void indexExistingRows(Connection conn, String schema, String table) throws SQLException { FullTextLucene.FullTextTrigger existing = new FullTextLucene.FullTextTrigger(); existing.init(conn, schema, null, table, false, Trigger.INSERT); String sql = "SELECT * FROM " + StringUtils.quoteIdentifier(schema) + "." + StringUtils.quoteIdentifier(table); ResultSet rs = conn.createStatement().executeQuery(sql); int columnCount = rs.getMetaData().getColumnCount(); while (rs.next()) { Object[] row = new Object[columnCount]; for (int i = 0; i < columnCount; i++) { row[i] = rs.getObject(i + 1); } existing.insert(row, false); } existing.commitIndex(); } private static void removeIndexFiles(Connection conn) throws SQLException { String path = getIndexPath(conn); IndexAccess access = INDEX_ACCESS.get(path); if (access != null) { removeIndexAccess(access, path); } if (!path.startsWith(IN_MEMORY_PREFIX)) { FileUtils.deleteRecursive(path, false); } } /** * Close the index writer and searcher and remove them from the index access * set. * * @param access the index writer/searcher wrapper * @param indexPath the index path */ protected static void removeIndexAccess(IndexAccess access, String indexPath) throws SQLException { synchronized (INDEX_ACCESS) { try { INDEX_ACCESS.remove(indexPath); access.searcher.close(); access.reader.close(); access.writer.close(); } catch (Exception e) { throw convertException(e); } } } /** * Do the search. * * @param conn the database connection * @param text the query * @param limit the limit * @param offset the offset * @param data whether the raw data should be returned * @return the result set */ protected static ResultSet search(Connection conn, String text, int limit, int offset, boolean data) throws SQLException { SimpleResultSet result = createResultSet(data); if (conn.getMetaData().getURL().startsWith("jdbc:columnlist:")) { // this is just to query the result set columns return result; } if (text == null || text.trim().length() == 0) { return result; } try { IndexAccess access = getIndexAccess(conn); // take a reference as the searcher may change Searcher searcher = access.searcher; // reuse the same analyzer; it's thread-safe; // also allows subclasses to control the analyzer used. Analyzer analyzer = access.writer.getAnalyzer(); QueryParser parser = new QueryParser(Version.LUCENE_30, LUCENE_FIELD_DATA, analyzer); Query query = parser.parse(text); // Lucene 3 insists on a hard limit and will not provide // a total hits value. Take at least 100 which is // an optimal limit for Lucene as any more // will trigger writing results to disk. int maxResults = (limit == 0 ? 100 : limit) + offset; TopDocs docs = searcher.search(query, maxResults); if (limit == 0) { limit = docs.totalHits; } for (int i = 0, len = docs.scoreDocs.length; i < limit && i + offset < docs.totalHits && i + offset < len; i++) { ScoreDoc sd = docs.scoreDocs[i + offset]; Document doc = searcher.doc(sd.doc); float score = sd.score; String q = doc.get(LUCENE_FIELD_QUERY); if (data) { int idx = q.indexOf(" WHERE "); JdbcConnection c = (JdbcConnection) conn; Session session = (Session) c.getSession(); Parser p = new Parser(session); String tab = q.substring(0, idx); ExpressionColumn expr = (ExpressionColumn) p.parseExpression(tab); String schemaName = expr.getOriginalTableAliasName(); String tableName = expr.getColumnName(); q = q.substring(idx + " WHERE ".length()); Object[][] columnData = parseKey(conn, q); result.addRow( schemaName, tableName, columnData[0], columnData[1], score); } else { result.addRow(q, score); } } } catch (Exception e) { throw convertException(e); } return result; } /** * Trigger updates the index when a inserting, updating, or deleting a row. */ public static class FullTextTrigger implements Trigger { protected String schema; protected String table; protected int[] keys; protected int[] indexColumns; protected String[] columns; protected int[] columnTypes; protected String indexPath; protected IndexAccess indexAccess; /** * INTERNAL */ @Override public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) throws SQLException { this.schema = schemaName; this.table = tableName; this.indexPath = getIndexPath(conn); this.indexAccess = getIndexAccess(conn); ArrayList<String> keyList = New.arrayList(); DatabaseMetaData meta = conn.getMetaData(); ResultSet rs = meta.getColumns(null, StringUtils.escapeMetaDataPattern(schemaName), StringUtils.escapeMetaDataPattern(tableName), null); ArrayList<String> columnList = New.arrayList(); while (rs.next()) { columnList.add(rs.getString("COLUMN_NAME")); } columnTypes = new int[columnList.size()]; columns = new String[columnList.size()]; columnList.toArray(columns); rs = meta.getColumns(null, StringUtils.escapeMetaDataPattern(schemaName), StringUtils.escapeMetaDataPattern(tableName), null); for (int i = 0; rs.next(); i++) { columnTypes[i] = rs.getInt("DATA_TYPE"); } if (keyList.size() == 0) { rs = meta.getPrimaryKeys(null, StringUtils.escapeMetaDataPattern(schemaName), tableName); while (rs.next()) { keyList.add(rs.getString("COLUMN_NAME")); } } if (keyList.size() == 0) { throw throwException("No primary key for table " + tableName); } ArrayList<String> indexList = New.arrayList(); PreparedStatement prep = conn.prepareStatement( "SELECT COLUMNS FROM " + SCHEMA + ".INDEXES WHERE SCHEMA=? AND TABLE=?"); prep.setString(1, schemaName); prep.setString(2, tableName); rs = prep.executeQuery(); if (rs.next()) { String cols = rs.getString(1); if (cols != null) { for (String s : StringUtils.arraySplit(cols, ',', true)) { indexList.add(s); } } } if (indexList.size() == 0) { indexList.addAll(columnList); } keys = new int[keyList.size()]; setColumns(keys, keyList, columnList); indexColumns = new int[indexList.size()]; setColumns(indexColumns, indexList, columnList); } /** * INTERNAL */ @Override public void fire(Connection conn, Object[] oldRow, Object[] newRow) throws SQLException { if (oldRow != null) { if (newRow != null) { // update if (hasChanged(oldRow, newRow, indexColumns)) { delete(oldRow, false); insert(newRow, true); } } else { // delete delete(oldRow, true); } } else if (newRow != null) { // insert insert(newRow, true); } } /** * INTERNAL */ @Override public void close() throws SQLException { if (indexAccess != null) { removeIndexAccess(indexAccess, indexPath); indexAccess = null; } } /** * INTERNAL */ @Override public void remove() { // ignore } /** * Commit all changes to the Lucene index. */ void commitIndex() throws SQLException { try { indexAccess.writer.commit(); // recreate Searcher with the IndexWriter's reader. indexAccess.searcher.close(); indexAccess.reader.close(); IndexReader reader = indexAccess.writer.getReader(); indexAccess.reader = reader; indexAccess.searcher = new IndexSearcher(reader); } catch (IOException e) { throw convertException(e); } } /** * Add a row to the index. * * @param row the row * @param commitIndex whether to commit the changes to the Lucene index */ protected void insert(Object[] row, boolean commitIndex) throws SQLException { String query = getQuery(row); Document doc = new Document(); doc.add(new Field(LUCENE_FIELD_QUERY, query, Field.Store.YES, Field.Index.NOT_ANALYZED)); long time = System.currentTimeMillis(); doc.add(new Field(LUCENE_FIELD_MODIFIED, DateTools.timeToString(time, DateTools.Resolution.SECOND), Field.Store.YES, Field.Index.NOT_ANALYZED)); StatementBuilder buff = new StatementBuilder(); for (int index : indexColumns) { String columnName = columns[index]; String data = asString(row[index], columnTypes[index]); // column names that start with _ // must be escaped to avoid conflicts // with internal field names (_DATA, _QUERY, _modified) if (columnName.startsWith(LUCENE_FIELD_COLUMN_PREFIX)) { columnName = LUCENE_FIELD_COLUMN_PREFIX + columnName; } doc.add(new Field(columnName, data, Field.Store.NO, Field.Index.ANALYZED)); buff.appendExceptFirst(" "); buff.append(data); } Field.Store storeText = STORE_DOCUMENT_TEXT_IN_INDEX ? Field.Store.YES : Field.Store.NO; doc.add(new Field(LUCENE_FIELD_DATA, buff.toString(), storeText, Field.Index.ANALYZED)); try { indexAccess.writer.addDocument(doc); if (commitIndex) { commitIndex(); } } catch (IOException e) { throw convertException(e); } } /** * Delete a row from the index. * * @param row the row * @param commitIndex whether to commit the changes to the Lucene index */ protected void delete(Object[] row, boolean commitIndex) throws SQLException { String query = getQuery(row); try { Term term = new Term(LUCENE_FIELD_QUERY, query); indexAccess.writer.deleteDocuments(term); if (commitIndex) { commitIndex(); } } catch (IOException e) { throw convertException(e); } } private String getQuery(Object[] row) throws SQLException { StatementBuilder buff = new StatementBuilder(); if (schema != null) { buff.append(StringUtils.quoteIdentifier(schema)).append('.'); } buff.append(StringUtils.quoteIdentifier(table)).append(" WHERE "); for (int columnIndex : keys) { buff.appendExceptFirst(" AND "); buff.append(StringUtils.quoteIdentifier(columns[columnIndex])); Object o = row[columnIndex]; if (o == null) { buff.append(" IS NULL"); } else { buff.append('=').append(FullText.quoteSQL(o, columnTypes[columnIndex])); } } return buff.toString(); } } /** * A wrapper for the Lucene writer and searcher. */ static class IndexAccess { /** * The index writer. */ IndexWriter writer; /** * The index reader. */ IndexReader reader; /** * The index searcher. */ Searcher searcher; } }
ec3ae5dcd92b8944845d3a14348efb97472e4c87
a4fc9dce11508df61099891be5d0d5b2d965d78e
/Pong.java
30f84d5fd679cebda1484c00ef278b776ce25d6d
[]
no_license
WInnah/Pong
53deefebd99aff6ab39d8b0183b986f8a4bdba85
393e0069892300ef20668be1d59e55170a63c28f
refs/heads/master
2021-01-13T08:58:30.663018
2016-10-26T10:27:36
2016-10-26T10:27:36
71,990,824
0
0
null
null
null
null
UTF-8
Java
false
false
4,419
java
/** * Created by Winnah Gwen Acal on 10/22/2016. */ import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.*; @SuppressWarnings("serial") public class Pong extends JPanel{ Ball ball = new Ball(this); Racquet racquet = new Racquet(this, 330, 60, 10); Racquet racket = new Racquet(this, 20, 60, 10); int speed = 1; int speeder = 1; //determines the of player 1 private int getScorePlayer1(){ return speed - 1; } //determines the score for player 2 private int getScorePlayer2(){ return speeder - 1; } public Pong(){ //these are key listener. Its role is to listen and to interpret the keys given by the user addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { racquet.keyPressed(e, 1); } @Override public void keyReleased(KeyEvent e) { racquet.keyReleased(e); } }); setFocusable(true); Sound.BACK.loop(); addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { racket.keyPressed(e, 2); } @Override public void keyReleased(KeyEvent e) { racket.keyReleased(e); } }); setFocusable(true); Sound.BACK.loop(); } //this calls all the move method of every sprite private void move(){ ball.move(); racquet.move(); racket.move(); } @Override public void paint(Graphics g){ super.paint(g); //for repainting so it wouldn't look like a connected circle Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.RED); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); //for smoother border ball.paint(g2d); racquet.paint(g2d); racket.paint(g2d); //this is for the score visible in the corner //Racket top g2d.setColor(Color.BLUE); g2d.setFont(new Font("Verdana", Font.BOLD, 30)); g2d.drawString(String.valueOf(getScorePlayer2()), 10, 50); //Racquet bottom g2d.setColor(Color.green); g2d.setFont(new Font("Verdana", Font.BOLD, 30)); g2d.drawString(String.valueOf(getScorePlayer1()), 250, 300); } //if the game is over this method is called and dialog appear to ask if the players wanted to continue the game public void gameOver(){ Sound.BACK.stop(); Sound.GAMEOVER.play(); JDialog.setDefaultLookAndFeelDecorated(true); if (speed > 3 || speeder > 3) { int response = JOptionPane.showConfirmDialog(null, "\tGAME OVER!\nPlayer 1 Score is: " + getScorePlayer1() + "\nPlayer 2 Score is: " + getScorePlayer2() + "\nDo you want to play again?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (response == JOptionPane.NO_OPTION) { System.exit(0); } else if (response == JOptionPane.YES_OPTION) { main(null); } else if (response == JOptionPane.CLOSED_OPTION) { System.exit(0); } } } public static void main(String[] args) { //this creates a new frame given the size. JFrame frame = new JFrame("Mini Tennis"); Pong game = new Pong(); frame.add(game); frame.setSize(300, 400); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //this is responsible for the one visible in the screen while (true){ game.move(); game.repaint(); //this part is responsible for the motion seen //without this part the movement of the ball will be so fast try { Thread.sleep(10); } catch (InterruptedException e) { } } } }
b712699c62d85021d9a6c2fb934f2e55816b7d0b
6e483845ddc79559ace7f3a69afa078d70520a99
/src/edu/fatec/grafo/Grafo.java
1523321b53d946e42c0fc32ad95c306108aa2d35
[]
no_license
brunonlima/GrafoManhattanV2.0
e0bba318b56f467a9aff470f22a0f33fd301de62
f0a3ccc2ebca6fd0e491e392b3aab3a0ecb3cbd7
refs/heads/master
2021-09-07T04:52:06.995998
2018-02-17T19:43:26
2018-02-17T19:43:26
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
3,812
java
package edu.fatec.grafo; import java.util.LinkedList; import java.util.Scanner; //Classe G=(V,E) não-orientado.Tempo esperado de execução é proporcional à O(|V|E|) public class Grafo { //Atributos private final int V;// Número de vértices,sendo uma constante. private int E;// Número de arestas private int adj[][];// Matriz de adjacências private LinkedList<Integer>[] adje;// Lista de adjacências // Construtor que inicializa o Grafo com V vértices public Grafo(int V) { if (V < 0) throw new IllegalArgumentException("Número de vértices não pode ser negativo"); this.V = V; this.E = 0; adj = new int[V][V]; adje = (LinkedList<Integer>[]) new LinkedList[V]; for (int v = 0; v < V; v++) { adje[v] = new LinkedList<Integer>(); } } /* Método que adiciona E(v-w) arestas ao Grafo.       * Tempo esperado de execução é proporcional a O(V + E). */ public void adiciona_aresta(int E) { if (E < 0) throw new IllegalArgumentException("Número de arestas não pode ser negativo"); int v=0,w=0,cont=0; int u=0; Scanner s = new Scanner(System.in); while(cont < E){ System.out.printf("\n%d ARESTA:",cont+1); do{ System.out.printf("\nForneça o valor da coordenada X: "); v=s.nextInt(); }while(v > this.V); do{ System.out.printf("Forneça o valor da coordenada Y: "); w=s.nextInt(); } while(w > this.V); do{ System.out.printf("\nForneça o valor de peso da aresta[%d,%d]: " , v , w); System.out.printf("\n*Sendo 1 para Aresta horizontal ou vertical\n"); System.out.printf("*Sendo 2(RAIZ de 2) para Aresta diagonal\n"); u=s.nextInt(); }while(u > 2); if (v != w && this.adj[v - 1][w - 1] == 0) { this.adj[v - 1][w - 1] = u; this.adj[w - 1][v - 1] = u; adicionaArestaLista(v-1, w-1); this.E++; } cont = cont + 1; } } public void mostrarGrafo(){ int v, w; System.out.printf("\n\n"); for (v = 0; v < this.V; v++){ System.out.printf( "%2d:", v+1); for (w = 0; w < this.V; w++) if (this.adj[v][w] > 0 ) System.out.printf( " %2d", w+1); System.out.printf( "\n"); } } /* Método que mostra matriz de adjacências.       * Tempo esperado de execução é proporcional a O(V x V). * Matriz simétrica. */ public void mostrarMatriz(){ int i , j; System.out.printf( "\n\n** MATRIZ DE ADJACÊNCIAS**\n"); for(i = 0; i < this.V ; i++){ System.out.printf(" %d" , i + 1); } System.out.printf("\n --------------------------------------------------"); System.out.printf("\n"); for(i = 0; i < this.V ; i++){ System.out.printf("%d|" , i + 1); for(j = 0; j < this.V ; j++) System.out.printf(" %d" , this.adj[i][j]); System.out.printf("\n"); } } private void adicionaArestaLista(int v, int w) { if (v < 0 || v >= V) throw new IndexOutOfBoundsException(); if (w < 0 || w >= V) throw new IndexOutOfBoundsException(); adje[v].add(w); adje[w].add(v); } public int V(){return V;} public int E(){return E;} public int[][] getAdj(){return adj;} public Iterable<Integer> adje(int v) { if (v < 0 || v >= V) throw new IndexOutOfBoundsException(); return adje[v]; } }
5ee0b614f5b8b8a2c0eeaa0f50aa1d1018d5847e
b77bf23ba60db5794445b8204317ed8b7388a2fd
/gg/sulfur/client/impl/utils/networking/PacketSleepThread.java
fbc5844a9c28763899bd0e44ffdc13c791848c5e
[]
no_license
SulfurClient/Sulfur
f41abb5335ae9617a629ced0cde4703ef7cc5f2c
e54efe14bb52d09752f9a38d7282f0d1cd81e469
refs/heads/main
2022-07-29T03:18:53.078298
2022-02-02T15:09:34
2022-02-02T15:09:34
426,418,356
2
0
null
null
null
null
UTF-8
Java
false
false
716
java
package gg.sulfur.client.impl.utils.networking; import net.minecraft.client.Minecraft; import net.minecraft.network.Packet; public class PacketSleepThread extends Thread { public PacketSleepThread(Packet packet, long delay) { super(() -> { sleep_ms(delay); if (Minecraft.getMinecraft().thePlayer != null) PacketUtil.sendPacketNoEvent(packet); }); } static void sleep_ms(long delay) { try { sleep(delay); } catch (InterruptedException e) { e.printStackTrace(); } } public static void delayPacket(Packet packet, long delay) { new PacketSleepThread(packet, delay).start(); } }
12e4f8bb995c2cc74284719ecb70d27c051b5858
471579962eb0abf949c73685353ef0098a8ad127
/HelloGradle/src/main/java/com/kaifantech/component/timer/agv/server/YufengAgvServerTimer.java
113d3cb3e9a7f5936fa385df2781bf12cd36b7c1
[]
no_license
huyulin11/gradle
a727c7e31b9a42aee6decd5d6a5f5ceac84180f3
3cdc3b8b02e9f48af93d1cc6087b61f67cf45a0e
refs/heads/master
2020-04-13T07:09:16.437325
2019-02-26T03:20:13
2019-02-26T03:20:13
163,042,029
0
0
null
null
null
null
UTF-8
Java
false
false
1,965
java
package com.kaifantech.component.timer.agv.server; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import com.kaifantech.component.dao.AGVConnectMsgDao; import com.kaifantech.component.service.agv.simulator.YufengAgvServerWorker; import com.kaifantech.component.service.comm.YufengAgvManager; import com.kaifantech.init.sys.SystemClient; import com.kaifantech.init.sys.params.SystemParameters; import com.kaifantech.util.seq.ThreadID; import com.kaifantech.util.thread.ThreadTool; import com.ytgrading.util.AppTool; @Component @Lazy(false) public class YufengAgvServerTimer { private static boolean isRunning = false; private static String timerType = "IOT模拟器"; private final Logger logger = Logger.getLogger(YufengAgvServerTimer.class); @Autowired private YufengAgvServerWorker agvServerWorker; @Autowired private AGVConnectMsgDao msgDao; public YufengAgvServerTimer() { logger.info(timerType + "开始启动!"); } @Scheduled(cron = "0/1 * * * * ?") public void resolute() { if (!SystemClient.CLIENT.equals(SystemClient.Client.YUFENG)) { return; } if (!SystemParameters.isConnectIotServer()) { return; } if (!isRunning) { Thread.currentThread().setName(timerType + (ThreadID.number++)); isRunning = true; agvSimulate(); } isRunning = false; } private void agvSimulate() { ThreadTool.run(() -> { agvServerWorker.startConnect(); }); } @Scheduled(initialDelay = 5000, fixedDelay = 1000) public void getMsgFromAgv() { if (!SystemClient.CLIENT.equals(SystemClient.Client.YUFENG)) { return; } String msg = agvServerWorker.getMap().get(1).getMsgReceived(); if (AppTool.isNull(msg)) { return; } YufengAgvManager.nextMsg = msg; msgDao.addAMsg(msg, "getMsgFromAgv", 1); } }
72581ad38ff150654528c3d82cd333d1f5f1cd95
e5c11eaa5b9842ac42ba25829d56dcb5635e017c
/src/com/code/pattern/chain/Director.java
31ca67a816f282a4d9c9f57d6aacc1b44bcb507c
[]
no_license
zhulongxi2015/PatternDesign
8147d567bf01b42fc7ce2a17a3a3d5f9a87ca793
14e2aa38932b70690d50ee5ce5ceb8c8eba449c6
refs/heads/master
2020-04-27T00:03:23.600533
2019-03-12T02:59:04
2019-03-12T02:59:04
173,922,599
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package com.code.pattern.chain; /** * 主任 */ public class Director extends Leader { public Director(String name){ super(name); } @Override public void handlerRequest(LeaveRequest leaveRequest) { if(leaveRequest.getLeaveDays()<3){ System.out.println("员工 "+leaveRequest.getEmpName()+" 请假 "+leaveRequest.getLeaveDays()+" 天"); System.out.println("主任 "+this.name+" 审批通过"); }else{ if(this.nextLeader!=null){ this.nextLeader.handlerRequest(leaveRequest); } } } }
0e611b645e1a979d5cf1979eb1f0839195269d62
b3d3b41f2023f1c969bc01dea85ef99bba0b8cdd
/src/main/java/com/amazonaws/services/cloudfront/AmazonCloudFrontClient.java
730d1867af227af354a3654585b8baf17d367be9
[ "JSON", "Apache-2.0" ]
permissive
carljparker/aws-sdk-for-java
67fe76c0fa8ff347dd3252cdca10b26be497c1f6
902235186eefaf131fadd18c47d85d9167cbe963
refs/heads/master
2021-01-15T21:02:29.480581
2011-10-21T00:18:29
2011-10-21T18:45:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
43,412
java
/* * Copyright 2010-2011 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.cloudfront; import org.w3c.dom.Node; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map.Entry; import com.amazonaws.*; import com.amazonaws.auth.*; import com.amazonaws.handlers.HandlerChainFactory; import com.amazonaws.handlers.RequestHandler; import com.amazonaws.http.StaxResponseHandler; import com.amazonaws.http.DefaultErrorResponseHandler; import com.amazonaws.http.ExecutionContext; import com.amazonaws.internal.StaticCredentialsProvider; import com.amazonaws.transform.Unmarshaller; import com.amazonaws.transform.StaxUnmarshallerContext; import com.amazonaws.transform.StandardErrorUnmarshaller; import com.amazonaws.services.cloudfront.model.*; import com.amazonaws.services.cloudfront.model.transform.*; /** * Client for accessing AmazonCloudFront. All service calls made * using this client are blocking, and will not return until the service call * completes. * <p> * */ public class AmazonCloudFrontClient extends AmazonWebServiceClient implements AmazonCloudFront { /** Provider for AWS credentials. */ private AWSCredentialsProvider awsCredentialsProvider; /** * List of exception unmarshallers for all AmazonCloudFront exceptions. */ protected final List<Unmarshaller<AmazonServiceException, Node>> exceptionUnmarshallers = new ArrayList<Unmarshaller<AmazonServiceException, Node>>(); /** AWS signer for authenticating requests. */ private CloudFrontSigner signer; /** * Constructs a new client to invoke service methods on * AmazonCloudFront using the specified AWS account credentials. * * <p> * All service calls made using this new client object are blocking, and will not * return until the service call completes. * * @param awsCredentials The AWS credentials (access key ID and secret key) to use * when authenticating with AWS services. */ public AmazonCloudFrontClient(AWSCredentials awsCredentials) { this(awsCredentials, new ClientConfiguration()); } /** * Constructs a new client to invoke service methods on * AmazonCloudFront using the specified AWS account credentials * and client configuration options. * * <p> * All service calls made using this new client object are blocking, and will not * return until the service call completes. * * @param awsCredentials The AWS credentials (access key ID and secret key) to use * when authenticating with AWS services. * @param clientConfiguration The client configuration options controlling how this * client connects to AmazonCloudFront * (ex: proxy settings, retry counts, etc.). */ public AmazonCloudFrontClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials); init(); } /** * Constructs a new client to invoke service methods on * AmazonCloudFront using the specified AWS account credentials provider. * * <p> * All service calls made using this new client object are blocking, and will not * return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials * to authenticate requests with AWS services. */ public AmazonCloudFrontClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, new ClientConfiguration()); } /** * Constructs a new client to invoke service methods on * AmazonCloudFront using the specified AWS account credentials * provider and client configuration options. * * <p> * All service calls made using this new client object are blocking, and will not * return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials * to authenticate requests with AWS services. * @param clientConfiguration The client configuration options controlling how this * client connects to AmazonCloudFront * (ex: proxy settings, retry counts, etc.). */ public AmazonCloudFrontClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = awsCredentialsProvider; init(); } private void init() { exceptionUnmarshallers.add(new TooManyDistributionsExceptionUnmarshaller()); exceptionUnmarshallers.add(new PreconditionFailedExceptionUnmarshaller()); exceptionUnmarshallers.add(new CNAMEAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new CloudFrontOriginAccessIdentityInUseExceptionUnmarshaller()); exceptionUnmarshallers.add(new TrustedSignerDoesNotExistExceptionUnmarshaller()); exceptionUnmarshallers.add(new DistributionNotDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new BatchTooLargeExceptionUnmarshaller()); exceptionUnmarshallers.add(new StreamingDistributionNotDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidArgumentExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyStreamingDistributionsExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyTrustedSignersExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidRequiredProtocolExceptionUnmarshaller()); exceptionUnmarshallers.add(new IllegalUpdateExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyCloudFrontOriginAccessIdentitiesExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchDistributionExceptionUnmarshaller()); exceptionUnmarshallers.add(new DistributionAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new CloudFrontOriginAccessIdentityAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyInvalidationsInProgressExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidDefaultRootObjectExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidIfMatchVersionExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidOriginExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchInvalidationExceptionUnmarshaller()); exceptionUnmarshallers.add(new StreamingDistributionAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new AccessDeniedExceptionUnmarshaller()); exceptionUnmarshallers.add(new MissingBodyExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyDistributionCNAMEsExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchCloudFrontOriginAccessIdentityExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidOriginAccessIdentityExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchStreamingDistributionExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyStreamingDistributionCNAMEsExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller()); setEndpoint("cloudfront.amazonaws.com/"); signer = new CloudFrontSigner(); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandlers.addAll(chainFactory.newRequestHandlerChain( "/com/amazonaws/services/cloudfront/request.handlers")); } /** * <p> * Get the information about a streaming distribution. * </p> * * @param getStreamingDistributionRequest Container for the necessary * parameters to execute the GetStreamingDistribution service method on * AmazonCloudFront. * * @return The response from the GetStreamingDistribution service method, * as returned by AmazonCloudFront. * * @throws NoSuchStreamingDistributionException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetStreamingDistributionResult getStreamingDistribution(GetStreamingDistributionRequest getStreamingDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<GetStreamingDistributionRequest> request = new GetStreamingDistributionRequestMarshaller().marshall(getStreamingDistributionRequest); return invoke(request, new GetStreamingDistributionResultStaxUnmarshaller()); } /** * <p> * List origin access identities. * </p> * * @param listCloudFrontOriginAccessIdentitiesRequest Container for the * necessary parameters to execute the * ListCloudFrontOriginAccessIdentities service method on * AmazonCloudFront. * * @return The response from the ListCloudFrontOriginAccessIdentities * service method, as returned by AmazonCloudFront. * * @throws InvalidArgumentException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public ListCloudFrontOriginAccessIdentitiesResult listCloudFrontOriginAccessIdentities(ListCloudFrontOriginAccessIdentitiesRequest listCloudFrontOriginAccessIdentitiesRequest) throws AmazonServiceException, AmazonClientException { Request<ListCloudFrontOriginAccessIdentitiesRequest> request = new ListCloudFrontOriginAccessIdentitiesRequestMarshaller().marshall(listCloudFrontOriginAccessIdentitiesRequest); return invoke(request, new ListCloudFrontOriginAccessIdentitiesResultStaxUnmarshaller()); } /** * <p> * Create a new distribution. * </p> * * @param createDistributionRequest Container for the necessary * parameters to execute the CreateDistribution service method on * AmazonCloudFront. * * @return The response from the CreateDistribution service method, as * returned by AmazonCloudFront. * * @throws InvalidDefaultRootObjectException * @throws MissingBodyException * @throws TooManyDistributionCNAMEsException * @throws TooManyDistributionsException * @throws CNAMEAlreadyExistsException * @throws InvalidArgumentException * @throws InvalidOriginAccessIdentityException * @throws TrustedSignerDoesNotExistException * @throws InvalidOriginException * @throws TooManyTrustedSignersException * @throws AccessDeniedException * @throws DistributionAlreadyExistsException * @throws InvalidRequiredProtocolException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public CreateDistributionResult createDistribution(CreateDistributionRequest createDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<CreateDistributionRequest> request = new CreateDistributionRequestMarshaller().marshall(createDistributionRequest); return invoke(request, new CreateDistributionResultStaxUnmarshaller()); } /** * <p> * Create a new origin access identity. * </p> * * @param createCloudFrontOriginAccessIdentityRequest Container for the * necessary parameters to execute the * CreateCloudFrontOriginAccessIdentity service method on * AmazonCloudFront. * * @return The response from the CreateCloudFrontOriginAccessIdentity * service method, as returned by AmazonCloudFront. * * @throws TooManyCloudFrontOriginAccessIdentitiesException * @throws MissingBodyException * @throws InvalidArgumentException * @throws CloudFrontOriginAccessIdentityAlreadyExistsException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public CreateCloudFrontOriginAccessIdentityResult createCloudFrontOriginAccessIdentity(CreateCloudFrontOriginAccessIdentityRequest createCloudFrontOriginAccessIdentityRequest) throws AmazonServiceException, AmazonClientException { Request<CreateCloudFrontOriginAccessIdentityRequest> request = new CreateCloudFrontOriginAccessIdentityRequestMarshaller().marshall(createCloudFrontOriginAccessIdentityRequest); return invoke(request, new CreateCloudFrontOriginAccessIdentityResultStaxUnmarshaller()); } /** * <p> * List invalidation batches. * </p> * * @param listInvalidationsRequest Container for the necessary parameters * to execute the ListInvalidations service method on AmazonCloudFront. * * @return The response from the ListInvalidations service method, as * returned by AmazonCloudFront. * * @throws NoSuchDistributionException * @throws InvalidArgumentException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public ListInvalidationsResult listInvalidations(ListInvalidationsRequest listInvalidationsRequest) throws AmazonServiceException, AmazonClientException { Request<ListInvalidationsRequest> request = new ListInvalidationsRequestMarshaller().marshall(listInvalidationsRequest); return invoke(request, new ListInvalidationsResultStaxUnmarshaller()); } /** * <p> * Get the information about a distribution. * </p> * * @param getDistributionRequest Container for the necessary parameters * to execute the GetDistribution service method on AmazonCloudFront. * * @return The response from the GetDistribution service method, as * returned by AmazonCloudFront. * * @throws NoSuchDistributionException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetDistributionResult getDistribution(GetDistributionRequest getDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<GetDistributionRequest> request = new GetDistributionRequestMarshaller().marshall(getDistributionRequest); return invoke(request, new GetDistributionResultStaxUnmarshaller()); } /** * <p> * List distributions. * </p> * * @param listDistributionsRequest Container for the necessary parameters * to execute the ListDistributions service method on AmazonCloudFront. * * @return The response from the ListDistributions service method, as * returned by AmazonCloudFront. * * @throws InvalidArgumentException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public ListDistributionsResult listDistributions(ListDistributionsRequest listDistributionsRequest) throws AmazonServiceException, AmazonClientException { Request<ListDistributionsRequest> request = new ListDistributionsRequestMarshaller().marshall(listDistributionsRequest); return invoke(request, new ListDistributionsResultStaxUnmarshaller()); } /** * <p> * Create a new streaming distribution. * </p> * * @param createStreamingDistributionRequest Container for the necessary * parameters to execute the CreateStreamingDistribution service method * on AmazonCloudFront. * * @return The response from the CreateStreamingDistribution service * method, as returned by AmazonCloudFront. * * @throws TooManyTrustedSignersException * @throws MissingBodyException * @throws TooManyStreamingDistributionCNAMEsException * @throws StreamingDistributionAlreadyExistsException * @throws CNAMEAlreadyExistsException * @throws AccessDeniedException * @throws TooManyStreamingDistributionsException * @throws InvalidArgumentException * @throws InvalidOriginAccessIdentityException * @throws TrustedSignerDoesNotExistException * @throws InvalidOriginException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public CreateStreamingDistributionResult createStreamingDistribution(CreateStreamingDistributionRequest createStreamingDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<CreateStreamingDistributionRequest> request = new CreateStreamingDistributionRequestMarshaller().marshall(createStreamingDistributionRequest); return invoke(request, new CreateStreamingDistributionResultStaxUnmarshaller()); } /** * <p> * Delete a streaming distribution. * </p> * * @param deleteStreamingDistributionRequest Container for the necessary * parameters to execute the DeleteStreamingDistribution service method * on AmazonCloudFront. * * @throws InvalidIfMatchVersionException * @throws NoSuchStreamingDistributionException * @throws StreamingDistributionNotDisabledException * @throws PreconditionFailedException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public void deleteStreamingDistribution(DeleteStreamingDistributionRequest deleteStreamingDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<DeleteStreamingDistributionRequest> request = new DeleteStreamingDistributionRequestMarshaller().marshall(deleteStreamingDistributionRequest); invoke(request, null); } /** * <p> * Delete an origin access identity. * </p> * * @param deleteCloudFrontOriginAccessIdentityRequest Container for the * necessary parameters to execute the * DeleteCloudFrontOriginAccessIdentity service method on * AmazonCloudFront. * * @throws InvalidIfMatchVersionException * @throws CloudFrontOriginAccessIdentityInUseException * @throws NoSuchCloudFrontOriginAccessIdentityException * @throws PreconditionFailedException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public void deleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest deleteCloudFrontOriginAccessIdentityRequest) throws AmazonServiceException, AmazonClientException { Request<DeleteCloudFrontOriginAccessIdentityRequest> request = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller().marshall(deleteCloudFrontOriginAccessIdentityRequest); invoke(request, null); } /** * <p> * Get the information about an invalidation. * </p> * * @param getInvalidationRequest Container for the necessary parameters * to execute the GetInvalidation service method on AmazonCloudFront. * * @return The response from the GetInvalidation service method, as * returned by AmazonCloudFront. * * @throws NoSuchInvalidationException * @throws NoSuchDistributionException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetInvalidationResult getInvalidation(GetInvalidationRequest getInvalidationRequest) throws AmazonServiceException, AmazonClientException { Request<GetInvalidationRequest> request = new GetInvalidationRequestMarshaller().marshall(getInvalidationRequest); return invoke(request, new GetInvalidationResultStaxUnmarshaller()); } /** * <p> * Delete a distribution. * </p> * * @param deleteDistributionRequest Container for the necessary * parameters to execute the DeleteDistribution service method on * AmazonCloudFront. * * @throws InvalidIfMatchVersionException * @throws NoSuchDistributionException * @throws DistributionNotDisabledException * @throws PreconditionFailedException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public void deleteDistribution(DeleteDistributionRequest deleteDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<DeleteDistributionRequest> request = new DeleteDistributionRequestMarshaller().marshall(deleteDistributionRequest); invoke(request, null); } /** * <p> * Update a distribution. * </p> * * @param updateDistributionRequest Container for the necessary * parameters to execute the UpdateDistribution service method on * AmazonCloudFront. * * @return The response from the UpdateDistribution service method, as * returned by AmazonCloudFront. * * @throws InvalidDefaultRootObjectException * @throws InvalidIfMatchVersionException * @throws IllegalUpdateException * @throws MissingBodyException * @throws TooManyDistributionCNAMEsException * @throws PreconditionFailedException * @throws CNAMEAlreadyExistsException * @throws InvalidArgumentException * @throws InvalidOriginAccessIdentityException * @throws TrustedSignerDoesNotExistException * @throws TooManyTrustedSignersException * @throws NoSuchDistributionException * @throws AccessDeniedException * @throws InvalidRequiredProtocolException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public UpdateDistributionResult updateDistribution(UpdateDistributionRequest updateDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<UpdateDistributionRequest> request = new UpdateDistributionRequestMarshaller().marshall(updateDistributionRequest); return invoke(request, new UpdateDistributionResultStaxUnmarshaller()); } /** * <p> * Get the configuration information about a distribution. * </p> * * @param getDistributionConfigRequest Container for the necessary * parameters to execute the GetDistributionConfig service method on * AmazonCloudFront. * * @return The response from the GetDistributionConfig service method, as * returned by AmazonCloudFront. * * @throws NoSuchDistributionException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetDistributionConfigResult getDistributionConfig(GetDistributionConfigRequest getDistributionConfigRequest) throws AmazonServiceException, AmazonClientException { Request<GetDistributionConfigRequest> request = new GetDistributionConfigRequestMarshaller().marshall(getDistributionConfigRequest); return invoke(request, new GetDistributionConfigResultStaxUnmarshaller()); } /** * <p> * Update an origin access identity. * </p> * * @param updateCloudFrontOriginAccessIdentityRequest Container for the * necessary parameters to execute the * UpdateCloudFrontOriginAccessIdentity service method on * AmazonCloudFront. * * @return The response from the UpdateCloudFrontOriginAccessIdentity * service method, as returned by AmazonCloudFront. * * @throws InvalidIfMatchVersionException * @throws IllegalUpdateException * @throws MissingBodyException * @throws NoSuchCloudFrontOriginAccessIdentityException * @throws PreconditionFailedException * @throws AccessDeniedException * @throws InvalidArgumentException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public UpdateCloudFrontOriginAccessIdentityResult updateCloudFrontOriginAccessIdentity(UpdateCloudFrontOriginAccessIdentityRequest updateCloudFrontOriginAccessIdentityRequest) throws AmazonServiceException, AmazonClientException { Request<UpdateCloudFrontOriginAccessIdentityRequest> request = new UpdateCloudFrontOriginAccessIdentityRequestMarshaller().marshall(updateCloudFrontOriginAccessIdentityRequest); return invoke(request, new UpdateCloudFrontOriginAccessIdentityResultStaxUnmarshaller()); } /** * <p> * Get the information about an origin access identity. * </p> * * @param getCloudFrontOriginAccessIdentityRequest Container for the * necessary parameters to execute the GetCloudFrontOriginAccessIdentity * service method on AmazonCloudFront. * * @return The response from the GetCloudFrontOriginAccessIdentity * service method, as returned by AmazonCloudFront. * * @throws NoSuchCloudFrontOriginAccessIdentityException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetCloudFrontOriginAccessIdentityResult getCloudFrontOriginAccessIdentity(GetCloudFrontOriginAccessIdentityRequest getCloudFrontOriginAccessIdentityRequest) throws AmazonServiceException, AmazonClientException { Request<GetCloudFrontOriginAccessIdentityRequest> request = new GetCloudFrontOriginAccessIdentityRequestMarshaller().marshall(getCloudFrontOriginAccessIdentityRequest); return invoke(request, new GetCloudFrontOriginAccessIdentityResultStaxUnmarshaller()); } /** * <p> * Create a new invalidation. * </p> * * @param createInvalidationRequest Container for the necessary * parameters to execute the CreateInvalidation service method on * AmazonCloudFront. * * @return The response from the CreateInvalidation service method, as * returned by AmazonCloudFront. * * @throws TooManyInvalidationsInProgressException * @throws MissingBodyException * @throws NoSuchDistributionException * @throws BatchTooLargeException * @throws AccessDeniedException * @throws InvalidArgumentException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public CreateInvalidationResult createInvalidation(CreateInvalidationRequest createInvalidationRequest) throws AmazonServiceException, AmazonClientException { Request<CreateInvalidationRequest> request = new CreateInvalidationRequestMarshaller().marshall(createInvalidationRequest); return invoke(request, new CreateInvalidationResultStaxUnmarshaller()); } /** * <p> * Get the configuration information about a streaming distribution. * </p> * * @param getStreamingDistributionConfigRequest Container for the * necessary parameters to execute the GetStreamingDistributionConfig * service method on AmazonCloudFront. * * @return The response from the GetStreamingDistributionConfig service * method, as returned by AmazonCloudFront. * * @throws NoSuchStreamingDistributionException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetStreamingDistributionConfigResult getStreamingDistributionConfig(GetStreamingDistributionConfigRequest getStreamingDistributionConfigRequest) throws AmazonServiceException, AmazonClientException { Request<GetStreamingDistributionConfigRequest> request = new GetStreamingDistributionConfigRequestMarshaller().marshall(getStreamingDistributionConfigRequest); return invoke(request, new GetStreamingDistributionConfigResultStaxUnmarshaller()); } /** * <p> * Update a streaming distribution. * </p> * * @param updateStreamingDistributionRequest Container for the necessary * parameters to execute the UpdateStreamingDistribution service method * on AmazonCloudFront. * * @return The response from the UpdateStreamingDistribution service * method, as returned by AmazonCloudFront. * * @throws TooManyTrustedSignersException * @throws InvalidIfMatchVersionException * @throws IllegalUpdateException * @throws MissingBodyException * @throws NoSuchStreamingDistributionException * @throws TooManyStreamingDistributionCNAMEsException * @throws PreconditionFailedException * @throws AccessDeniedException * @throws CNAMEAlreadyExistsException * @throws InvalidArgumentException * @throws InvalidOriginAccessIdentityException * @throws TrustedSignerDoesNotExistException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public UpdateStreamingDistributionResult updateStreamingDistribution(UpdateStreamingDistributionRequest updateStreamingDistributionRequest) throws AmazonServiceException, AmazonClientException { Request<UpdateStreamingDistributionRequest> request = new UpdateStreamingDistributionRequestMarshaller().marshall(updateStreamingDistributionRequest); return invoke(request, new UpdateStreamingDistributionResultStaxUnmarshaller()); } /** * <p> * List streaming distributions. * </p> * * @param listStreamingDistributionsRequest Container for the necessary * parameters to execute the ListStreamingDistributions service method on * AmazonCloudFront. * * @return The response from the ListStreamingDistributions service * method, as returned by AmazonCloudFront. * * @throws InvalidArgumentException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public ListStreamingDistributionsResult listStreamingDistributions(ListStreamingDistributionsRequest listStreamingDistributionsRequest) throws AmazonServiceException, AmazonClientException { Request<ListStreamingDistributionsRequest> request = new ListStreamingDistributionsRequestMarshaller().marshall(listStreamingDistributionsRequest); return invoke(request, new ListStreamingDistributionsResultStaxUnmarshaller()); } /** * <p> * Get the configuration information about an origin access identity. * </p> * * @param getCloudFrontOriginAccessIdentityConfigRequest Container for * the necessary parameters to execute the * GetCloudFrontOriginAccessIdentityConfig service method on * AmazonCloudFront. * * @return The response from the GetCloudFrontOriginAccessIdentityConfig * service method, as returned by AmazonCloudFront. * * @throws NoSuchCloudFrontOriginAccessIdentityException * @throws AccessDeniedException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCloudFront indicating * either a problem with the data in the request, or a server side issue. */ public GetCloudFrontOriginAccessIdentityConfigResult getCloudFrontOriginAccessIdentityConfig(GetCloudFrontOriginAccessIdentityConfigRequest getCloudFrontOriginAccessIdentityConfigRequest) throws AmazonServiceException, AmazonClientException { Request<GetCloudFrontOriginAccessIdentityConfigRequest> request = new GetCloudFrontOriginAccessIdentityConfigRequestMarshaller().marshall(getCloudFrontOriginAccessIdentityConfigRequest); return invoke(request, new GetCloudFrontOriginAccessIdentityConfigResultStaxUnmarshaller()); } /** * Returns additional metadata for a previously executed successful, request, typically used for * debugging issues where a service isn't acting as expected. This data isn't considered part * of the result data returned by an operation, so it's available through this separate, * diagnostic interface. * <p> * Response metadata is only cached for a limited period of time, so if you need to access * this extra diagnostic information for an executed request, you should use this method * to retrieve it as soon as possible after executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none * is available. */ public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } private <X, Y extends AmazonWebServiceRequest> X invoke(Request<Y> request, Unmarshaller<X, StaxUnmarshallerContext> unmarshaller) { request.setEndpoint(endpoint); for (Entry<String, String> entry : request.getOriginalRequest().copyPrivateRequestParameters().entrySet()) { request.addParameter(entry.getKey(), entry.getValue()); } AWSCredentials credentials = awsCredentialsProvider.getCredentials(); AmazonWebServiceRequest originalRequest = request.getOriginalRequest(); if (originalRequest != null && originalRequest.getRequestCredentials() != null) { credentials = originalRequest.getRequestCredentials(); } ExecutionContext executionContext = createExecutionContext(); executionContext.setSigner(signer); executionContext.setCredentials(credentials); StaxResponseHandler<X> responseHandler = new StaxResponseHandler<X>(unmarshaller); DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallers); return (X)client.execute(request, responseHandler, errorResponseHandler, executionContext); } }
bdb069bb9cfe510020d0f7b82968b8c900dc0c3a
89bfa64c1c728fa0b5ce77319d415ea52249026b
/chapter04/src/main/java/chapter04/StringTest03.java
df7a075f29835b51cc20766ed0452b8ffcaf28e5
[]
no_license
tnalfm12353/javastudy
1bcc358a76562aaa09d7aadb9692935d9beb61cf
cb15e1a0e5cc6ebc9c9b7d7cbf39c51a9aec1ace
refs/heads/master
2023-04-19T23:48:43.652861
2021-05-13T08:17:59
2021-05-13T08:17:59
361,947,031
0
0
null
null
null
null
UTF-8
Java
false
false
2,103
java
package chapter04; public class StringTest03 { public static void main(String[] args) { String s = "aBcABCabcAbc"; System.out.println(s.length()); System.out.println(s.charAt(2)); System.out.println(s.indexOf("abc")); System.out.println(s.indexOf("abc", 3)); System.out.println(s.indexOf("abc", 7)); // -1 System.out.println(s.substring(3)); System.out.println(s.substring(3,5)); String s2 = " ab cd "; String s3 = "efg,hijk,lmn,opqr,stu"; String s4 = s2.concat(s3); System.out.println(s4); System.out.println("----" + s2.trim() + "----"); System.out.println("====" + s2.replaceAll(" ", "") + "===="); // 정규표현식 regular expression String p = "1000"; if(p.matches("\\d+")) { // \d 숫자 int price = Integer.parseInt(p); System.out.println(price); }else { System.out.println("유효한 금액이 아닙니다."); } String tokens [] = s3.split(","); for(String token : tokens) { System.out.println(token); } System.out.println("==================================================="); String tokens2 [] = s3.split("#"); for(String token : tokens2) { System.out.println(token); } StringBuffer sb = new StringBuffer(""); sb.append("Hello "); sb.append("World "); sb.append("Java "); sb.append(1.8); String s5= sb.toString(); System.out.println(s5); //String s6 = "Hello " + "World " + "Java " + 1.8; String s6 = new StringBuffer("Hello ").append("World ").append("Java ").append(1.8).toString(); System.out.println(s6); // 주의 : 문자열 + 연산을 하지 말아야 할 때 --> String s6 = "Hello " + "World " + "Java " + 1.8; String warning =""; for(int i = 0 ; i < 100000 ; i++) { //warning = s7 + i; //warning = new StringBuffer(s7).append(i).toString(); } StringBuffer useThis = new StringBuffer(""); for(int i = 0 ; i < 100000 ; i++) { useThis.append(i); } String s7 = useThis.toString(); System.out.println(s7.length()); } }
[ "BIT@DESKTOP-0H6HNMT" ]
BIT@DESKTOP-0H6HNMT
5b97eeb901b11c66cc6bef389829417fc8c96ccd
20eff352e4a7996746027123a0d9180ec405ce24
/SSM001/src/main/java/com/crx/quanxian/service/serviceImpl/UserServiceImpl.java
8df5ed33ebed1e3d8c05e02bf38af0bc2f6e0bb3
[]
no_license
1984867875/ZhangweiHello
641a100c7009a542f563ad333605bc911a3dca11
340435bb52d52213a3a65809a41d559ce782c248
refs/heads/master
2023-02-07T12:16:22.501973
2021-01-04T08:30:59
2021-01-04T08:30:59
326,613,940
0
0
null
null
null
null
UTF-8
Java
false
false
1,309
java
package com.crx.quanxian.service.serviceImpl; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpRequest; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.SessionAttributes; import com.crx.quanxian.dao.UserMapper; import com.crx.quanxian.model.Message; import com.crx.quanxian.model.User; import com.crx.quanxian.service.UserService; @Service public class UserServiceImpl implements UserService { @Autowired private UserMapper mapper; @Override public Message login(HttpServletRequest request, User user) { HttpSession session = request.getSession(); User u = mapper.selectByUser(user); Message message = new Message(); if(u!=null) { message.setMess("success"); session.setAttribute("user", u); }else { message.setMess("fail"); } return message; } /** * 用户列表 查找所有 */ @Override public List<User> queryUserList() { // TODO Auto-generated method stub return mapper.queryUserList(); } /** * 更改用户信息 (删除) */ @Override public void updateUser(User user) { mapper.deleteByPrimaryKey(user.getUid()); } }
153bf45c830ff4b5a1fb2df6bdf5751266ebf0f9
7a37f671593075168849e5936fbcaef6c9aa8cc2
/contributions/jxpath/src/main/java/org/softlang/company/features/Cut.java
c12ad7fc980107f8e98dc74a2e50981fd8b49038
[]
no_license
DerDackel/101simplejava
59afce318775f14cd576384f573b47fa90a896c1
0b99227b09fcf9a7c95ee6f0b20b42bbd3935cc4
refs/heads/master
2021-01-18T18:22:32.313684
2014-05-20T13:54:36
2014-05-20T13:54:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package org.softlang.company.features; import java.util.LinkedList; import org.apache.commons.jxpath.JXPathContext; import org.softlang.company.model.Company; import org.softlang.company.model.Employee; /** * * @author Matthias Paul * */ public class Cut { /** * Cut using JXPath to modify salaries. Method demonstrate JXPath ability to * alter values. * * @param c * Company to cut salaries */ public static void cut(Company c) { JXPathContext con = JXPathContext.newContext(c); LinkedList<Employee> es = new LinkedList<Employee>(); es.addAll(con.selectNodes("//employees | //manager")); con = JXPathContext.newContext(es); for (int i = 1; i <= es.size(); i++) { con.setValue("@salary[" + i + "]", (Double) con.getValue("@salary[" + i + "]") / 2); } } }
c720eb87cf3eb49063ef38db27a45f6adcb21032
23574e36203a1ad85029c59079ec0f24666d41d7
/src/main/java/br/com/felippeneves/abstract_factory/car_service/services/CarEJBService.java
99860b713e5c35b6d1fecf81a111153a4bf74912
[]
no_license
felippeneves/creational-patterns
9a7246a7d85e27d132122f08641c44ef25185aa8
2e9c13f0ff1cfc21d74e105220e1a8f16206f6d1
refs/heads/master
2023-08-14T12:41:53.664128
2021-10-17T17:13:51
2021-10-17T17:13:51
417,646,544
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package br.com.felippeneves.abstract_factory.car_service.services; public class CarEJBService implements CarService { @Override public void save(String model) { System.out.println("Saving " + model + " car through EJB's interface"); } @Override public void update(String newModel) { System.out.println("Updating " + newModel + " car through EJB's interface"); } }
dbeeb524f77290cefb857f52dcbde3425295a514
cb47150733851506ab7987cabf4bb57d839dd724
/app/src/main/java/com/example/geeksproject/Notification/Client.java
bb3d57734a5737f96c4e63554388a9ae984a781a
[]
no_license
Saumil4122000/WhatsAppClone
f00a29f96905355f904d60908769bd11a8bc9421
cffcd3c54b990fd43144d7b9e8ced36066b8c109
refs/heads/master
2023-08-02T12:47:10.275083
2021-09-23T16:42:43
2021-09-23T16:42:43
343,429,809
2
0
null
null
null
null
UTF-8
Java
false
false
453
java
package com.example.geeksproject.Notification; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class Client { private static Retrofit retrofit=null; public static Retrofit getClient(String url){ if (retrofit==null){ retrofit=new Retrofit.Builder() .baseUrl(url).addConverterFactory(GsonConverterFactory.create()).build(); } return retrofit; } }
cb739334b3aea49d6d3240980574d20c38a1449f
a7e301415e5c4f775a597cbb2043427ede49a965
/src/main/java/students/viktors_cesnokovs/lesson_9/level_5/task_22/FraudRule2.java
b4492bdf9cf0ecf329ca6443b5aba1b4da2e1179
[]
no_license
topchilina/jg-java-1-online-autumn-november-monday-2020
bf1ed1d6e8fd1afc35fe3af341eba6b4cfe27dd3
f130707b07a95e0a130433686d27af66c5ab1505
refs/heads/master
2023-03-04T23:38:29.814830
2021-02-22T16:50:30
2021-02-22T16:50:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
279
java
package students.viktors_cesnokovs.lesson_9.level_5.task_22; class FraudRule2 extends FraudRule { public FraudRule2(String ruleName) { super(ruleName); } public boolean isFraud(Transaction t) { return t.getTrader().getCity().equalsIgnoreCase("Sidney"); } }
4ab71893c98fbb6993ff83a8175e1430466011f1
0e6d099cc6f4750c396619c5196c8ba5d7fdd062
/app/src/main/java/mx/edu/ittepic/tpdm_u3_practica1/ProductoAdapter.java
fe544207ea5ee7d340912ed12d24563fae09a3fa
[]
no_license
jorgearellano19/Empresa
d6c2315427ad4026415550457c8274d1d8b87fba
bb0e0e76d073becbab95235597f0d2b74f155e1a
refs/heads/master
2021-01-18T18:05:51.881112
2017-03-31T22:35:28
2017-03-31T22:35:28
86,843,637
0
0
null
null
null
null
UTF-8
Java
false
false
1,421
java
package mx.edu.ittepic.tpdm_u3_practica1; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import java.util.List; /** * Created by jorgearellano on 29/03/17. */ public class ProductoAdapter extends ArrayAdapter { private Context context; private List datos; public ProductoAdapter( Context context, List objects) { super(context,R.layout.listview_producto ,objects); this.context = context; this.datos = objects; } public View getView(int position, View convertView, ViewGroup parent){ LayoutInflater inflater = LayoutInflater.from(context); View item = inflater.inflate(R.layout.listview_producto,null); //Sacar todos los datos TextView tv1 = (TextView)item.findViewById(R.id.listview_item_producto_nombre); tv1.setText("Nombre del producto: "+((Producto)datos.get(position)).nombre); TextView tv2 = (TextView)item.findViewById(R.id.listview_item_producto_cantidad); tv2.setText("Cantidad en stock: "+((Producto)datos.get(position)).stack+""); TextView tv3 = (TextView)item.findViewById(R.id.listview_item_producto_precio); tv3.setText("Precio unitario del producto: $"+((Producto)datos.get(position)).precio+""); return item; } }
a42b4c15d6a76b77e49627258f119bf6bca0c55a
4723eb5cb5ddc0b9d5a12a9ae050a23b832e4a43
/app/src/main/java/com/nearman/focusin/TodoDatabaseAccessProvider.java
543d1e42baa2c962d28bcd418a122eeed5b34acb
[]
no_license
cnearman/focus-in
2fa3a2e1046a2343fea61500c6e559331a2ec214
b8e12c424f0fbe2e0d94624446df95cd8b87c2f3
refs/heads/master
2021-01-20T00:51:57.115882
2017-04-24T06:23:19
2017-04-24T06:23:19
89,204,721
0
0
null
null
null
null
UTF-8
Java
false
false
2,958
java
package com.nearman.focusin; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; /** * Created by Chris on 4/9/2017. */ public class TodoDatabaseAccessProvider implements TodoAccessHandler { DatabaseAccessInitializer mDbHelper; public TodoDatabaseAccessProvider(Context context) { mDbHelper= new DatabaseAccessInitializer(context); } public long createTodo(TodoModel todo){ SQLiteDatabase db = mDbHelper.getWritableDatabase(); ContentValues inputModel = mapTodoToDatabaseValues(todo); long result = db.insert(DatabaseContract.Todo.TABLE_NAME, null, inputModel); return result; } public void updateTodo(TodoModel todo) { SQLiteDatabase db = mDbHelper.getReadableDatabase(); ContentValues values = mapTodoToDatabaseValues(todo); String selection = DatabaseContract.Todo._ID + "= ?"; String idString = Integer.toString(todo.getId()); String[] selectionArgs = {idString}; db.update(DatabaseContract.Todo.TABLE_NAME, values, selection, selectionArgs); } public void deleteTodo(TodoModel todo) { SQLiteDatabase db = mDbHelper.getWritableDatabase(); String selection = DatabaseContract.Todo._ID + "= ?"; String idString = Integer.toString(todo.getId()); String[] selectionArgs = {idString}; db.delete(DatabaseContract.Todo.TABLE_NAME, selection, selectionArgs); } public TodoModel retrieveTodo(int todoId) throws Exception{ SQLiteDatabase db = mDbHelper.getWritableDatabase(); String[] columns = { DatabaseContract.Todo._ID, DatabaseContract.Todo.COLUMN_NAME_DESCRIPTION }; String selection = DatabaseContract.Todo._ID + "= ?"; String idString = Integer.toString(todoId); String[] selectionArgs = {idString}; Cursor cursor = db.query ( DatabaseContract.Todo.TABLE_NAME, columns, selection, selectionArgs, null, null, null ); if(cursor.getCount() > 1){ throw new Exception(); } cursor.moveToFirst(); TodoModel result = mapTodoFromCursor(cursor); return result; } private ContentValues mapTodoToDatabaseValues(TodoModel todo){ ContentValues values = new ContentValues(); values.put(DatabaseContract.Todo.COLUMN_NAME_DESCRIPTION, todo.getDescription()); return values; } private TodoModel mapTodoFromCursor(Cursor c){ TodoModel result = new TodoModel(); result.setId(c.getColumnIndexOrThrow(DatabaseContract.Todo._ID)); result.setDescription(c.getString(c.getColumnIndexOrThrow(DatabaseContract.Todo.COLUMN_NAME_DESCRIPTION))); return result; } }
f5c95a3ac1f5bf23e8d22017bb3d51f7dc4077bb
43871858d9f0a605d56aedc255f4e114bcbb14e2
/src/main/java/com/razrabotkin/systematics/DataModels/Formulas/Cosine.java
0e7065a53ce6d1d301f687ed17f8f8df5952af82
[]
no_license
volodya-stepanov/ProjectS
afb1b837fe699d192774bf6f2c7da646bdd11f22
cd37be046e06e8a1cf3fb7edcf19d8d9df1b76ed
refs/heads/master
2020-04-19T04:49:19.914929
2019-04-09T21:07:49
2019-04-09T21:07:49
167,954,498
0
0
null
null
null
null
UTF-8
Java
false
false
2,037
java
package com.razrabotkin.systematics.DataModels.Formulas; import sun.reflect.generics.reflectiveObjects.NotImplementedException; import javax.xml.bind.JAXBElement; import java.util.ArrayList; /** * Косинус */ public class Cosine extends ExpressionModel{ /** Аргумент */ private SignedAtomModel Argument; public Cosine(FormulaModel parent) { super(parent); } @Override public String toString() { return "cos(" + Argument.toString() + ")"; } @Override public ArrayList<JAXBElement> toOpenXML() { throw new NotImplementedException(); } @Override public boolean isNumber() { return false; } @Override public boolean isVariable() { return false; } @Override public boolean isResult() { // Если аргумет дальше вычислить уже нельзя, но при этом он является числом, значит, // значение функции ещё можно вычислить. // Во всех остальных случаях значение вычислить уже нельзя, значит, это результат. if (Argument.isResult()){ if (Argument.isNumber()){ return false; } else { return true; } } else { return false; } } @Override public FormulaModel copy(FormulaModel parent) { Cosine cosine = new Cosine(parent); cosine.setArgument((SignedAtomModel) Argument.copy(cosine)); return cosine; } @Override public boolean canSolve() { return Argument.isNumber(); } @Override public void solve() { throw new NotImplementedException(); } // Методы-мутаторы public SignedAtomModel getArgument() { return Argument; } public void setArgument(SignedAtomModel argument) { Argument = argument; } }
9422bed3112d4d9b37279b8ce7b41d0a1357958a
af03e8577c3d3dd8915aae19e0805317ffeb4d22
/quakoo-chat/src/main/java/com/quakoo/framework/ext/chat/service/nio/NioConnectService.java
9f126264008a36593c5330f3288ed3bc1653bcc2
[]
no_license
quakoo/quakoo-framework
299d07a175af95093c0f6ed89f67c323e07bd5c0
45a9ecb72022f95ca11512f62589ed6b9b6500ef
refs/heads/master
2023-01-07T06:36:23.729603
2021-06-19T10:50:34
2021-06-19T10:50:34
163,071,702
1
1
null
2022-12-29T01:50:15
2018-12-25T10:13:22
Java
UTF-8
Java
false
false
469
java
package com.quakoo.framework.ext.chat.service.nio; import com.quakoo.framework.ext.chat.model.param.nio.SessionRequest; import io.netty.channel.ChannelHandlerContext; public interface NioConnectService { public void handle(ChannelHandlerContext ctx, SessionRequest sessionRequest); // public void connect(ChannelHandlerContext ctx, ConnectRequest connectRequest); // public void sessionRequest(ChannelHandlerContext ctx, SessionRequest sessionRequest); }
041ea74545a3e85b051bf80eca17e54d047604ec
ff8172960401d3be52ff5a5a26e35499e5588951
/ControlClass.java
97e2422726f5c77840447165d2584f2481482128
[]
no_license
Iresha-Vishwakala/project-one
052cfc25664cdc2e9a3ce3df8fb3dfa08e6c488d
73c5b05aba7add196dbca8e39d405e1bd07ba56e
refs/heads/master
2020-03-22T08:17:37.942251
2018-07-06T10:54:52
2018-07-06T10:54:52
139,757,754
0
0
null
null
null
null
UTF-8
Java
false
false
628
java
public class ControlClass { public ControlClass() { // TODO Auto-generated constructor stub } //main method public static void main(String []args){ System.out.println("Starting point----"); //create a obj to Passenger car PassengerCar toyotaPassenger = new PassengerCar(); System.out.println("Toyota Passenger car"); toyotaPassenger.paint("blue"); toyotaPassenger.speed(80); RacingCar hondaRacing = new RacingCar(); System.out.println("Honda Racing car"); hondaRacing.paint("red"); hondaRacing.speed(120); } }
6d09a58539de70faf5f7311787c13b0e7964cc3d
dde804bed2655d40ce4cf4fb65701e652415b7d1
/ebaysdkcore/src/main/java/com/ebay/soap/eBLBaseComponents/CategoryFeatureType.java
b39bab6c752babe917c0a73c578796e7d71ebb30
[]
no_license
mamthal/getItemJava
ceccf4a8bab67bab5e9e8a37d60af095f847de44
d7a1bcc8c7a1f72728973c799973e86c435a6047
refs/heads/master
2016-09-05T23:39:46.495096
2014-04-21T18:19:21
2014-04-21T18:19:21
19,001,704
0
1
null
null
null
null
UTF-8
Java
false
false
111,265
java
package com.ebay.soap.eBLBaseComponents; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** * * Type defining the <b>Category</b> container that is returned in the <b>GetCategoryFeatures</b> response. A <b>Category</b> node is returned for each category that is relevant/applicable to the input criteria in the <b>GetCategoryFeatures</b> request. The <b>CategoryID</b> value identifies the eBay category. The rest of the <b>CategoryFeatureType</b> fields that are returned will be dependent on which <b>FeatureID</b> value(s) are specified in the <b>GetCategoryFeatures</b> request. * * * <p>Java class for CategoryFeatureType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CategoryFeatureType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="CategoryID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ListingDuration" type="{urn:ebay:apis:eBLBaseComponents}ListingDurationReferenceType" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="ShippingTermsRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="BestOfferEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="DutchBINEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="UserConsentRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="HomePageFeaturedEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ProPackEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="BasicUpgradePackEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ValuePackEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ProPackPlusEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="AdFormatEnabled" type="{urn:ebay:apis:eBLBaseComponents}AdFormatEnabledCodeType" minOccurs="0"/> * &lt;element name="BestOfferCounterEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="BestOfferAutoDeclineEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketSpecialitySubscription" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketRegularSubscription" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketPremiumSubscription" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketNonSubscription" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ExpressEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ExpressPicturesRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ExpressConditionRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="MinimumReservePrice" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/> * &lt;element name="SellerContactDetailsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="TransactionConfirmationRequestEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="StoreInventoryEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="SkypeMeTransactionalEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="SkypeMeNonTransactionalEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdPaymentMethodEnabled" type="{urn:ebay:apis:eBLBaseComponents}ClassifiedAdPaymentMethodEnabledCodeType" minOccurs="0"/> * &lt;element name="ClassifiedAdShippingMethodEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdBestOfferEnabled" type="{urn:ebay:apis:eBLBaseComponents}ClassifiedAdBestOfferEnabledCodeType" minOccurs="0"/> * &lt;element name="ClassifiedAdCounterOfferEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdAutoDeclineEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdContactByPhoneEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdContactByEmailEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="SafePaymentRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdPayPerLeadEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ItemSpecificsEnabled" type="{urn:ebay:apis:eBLBaseComponents}ItemSpecificsEnabledCodeType" minOccurs="0"/> * &lt;element name="PaisaPayFullEscrowEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="UPCIdentifierEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="EANIdentifierEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ISBNIdentifierEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="BrandMPNIdentifierEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdAutoAcceptEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="BestOfferAutoAcceptEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="CrossBorderTradeNorthAmericaEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="CrossBorderTradeGBEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="CrossBorderTradeAustraliaEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="PayPalBuyerProtectionEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="BuyerGuaranteeEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="CombinedFixedPriceTreatmentEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="GalleryFeaturedDurations" type="{urn:ebay:apis:eBLBaseComponents}ListingEnhancementDurationReferenceType" minOccurs="0"/> * &lt;element name="PayPalRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProAdFormatEnabled" type="{urn:ebay:apis:eBLBaseComponents}AdFormatEnabledCodeType" minOccurs="0"/> * &lt;element name="eBayMotorsProContactByPhoneEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProPhoneCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="eBayMotorsProContactByAddressEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProStreetCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="eBayMotorsProCompanyNameEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProContactByEmailEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProBestOfferEnabled" type="{urn:ebay:apis:eBLBaseComponents}ClassifiedAdBestOfferEnabledCodeType" minOccurs="0"/> * &lt;element name="eBayMotorsProAutoAcceptEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProAutoDeclineEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProPaymentMethodCheckOutEnabled" type="{urn:ebay:apis:eBLBaseComponents}ClassifiedAdPaymentMethodEnabledCodeType" minOccurs="0"/> * &lt;element name="eBayMotorsProShippingMethodEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProCounterOfferEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="eBayMotorsProSellerContactDetailsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketAdFormatEnabled" type="{urn:ebay:apis:eBLBaseComponents}AdFormatEnabledCodeType" minOccurs="0"/> * &lt;element name="LocalMarketContactByPhoneEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketPhoneCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="LocalMarketContactByAddressEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketStreetCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="LocalMarketCompanyNameEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketContactByEmailEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketBestOfferEnabled" type="{urn:ebay:apis:eBLBaseComponents}ClassifiedAdBestOfferEnabledCodeType" minOccurs="0"/> * &lt;element name="LocalMarketAutoAcceptEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketAutoDeclineEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketPaymentMethodCheckOutEnabled" type="{urn:ebay:apis:eBLBaseComponents}ClassifiedAdPaymentMethodEnabledCodeType" minOccurs="0"/> * &lt;element name="LocalMarketShippingMethodEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketCounterOfferEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="LocalMarketSellerContactDetailsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdPhoneCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="ClassifiedAdContactByAddressEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ClassifiedAdStreetCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="ClassifiedAdCompanyNameEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="SpecialitySubscription" type="{urn:ebay:apis:eBLBaseComponents}GeographicExposureCodeType" minOccurs="0"/> * &lt;element name="RegularSubscription" type="{urn:ebay:apis:eBLBaseComponents}GeographicExposureCodeType" minOccurs="0"/> * &lt;element name="PremiumSubscription" type="{urn:ebay:apis:eBLBaseComponents}GeographicExposureCodeType" minOccurs="0"/> * &lt;element name="NonSubscription" type="{urn:ebay:apis:eBLBaseComponents}GeographicExposureCodeType" minOccurs="0"/> * &lt;element name="INEscrowWorkflowTimeline" type="{urn:ebay:apis:eBLBaseComponents}INEscrowWorkflowTimelineCodeType" minOccurs="0"/> * &lt;element name="PayPalRequiredForStoreOwner" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ReviseQuantityAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="RevisePriceAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="StoreOwnerExtendedListingDurationsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="StoreOwnerExtendedListingDurations" type="{urn:ebay:apis:eBLBaseComponents}StoreOwnerExtendedListingDurationsType" minOccurs="0"/> * &lt;element name="ReturnPolicyEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="HandlingTimeEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="MaxFlatShippingCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/> * &lt;element name="Group1MaxFlatShippingCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/> * &lt;element name="Group2MaxFlatShippingCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/> * &lt;element name="Group3MaxFlatShippingCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/> * &lt;element name="PaymentMethod" type="{urn:ebay:apis:eBLBaseComponents}BuyerPaymentMethodCodeType" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="VariationsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="AttributeConversionEnabled" type="{urn:ebay:apis:eBLBaseComponents}AttributeConversionEnabledCodeType" minOccurs="0"/> * &lt;element name="FreeGalleryPlusEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="FreePicturePackEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ItemCompatibilityEnabled" type="{urn:ebay:apis:eBLBaseComponents}ItemCompatibilityEnabledCodeType" minOccurs="0"/> * &lt;element name="MinItemCompatibility" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="MaxItemCompatibility" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="ConditionEnabled" type="{urn:ebay:apis:eBLBaseComponents}ConditionEnabledCodeType" minOccurs="0"/> * &lt;element name="ConditionValues" type="{urn:ebay:apis:eBLBaseComponents}ConditionValuesType" minOccurs="0"/> * &lt;element name="ValueCategory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="ProductCreationEnabled" type="{urn:ebay:apis:eBLBaseComponents}ProductCreationEnabledCodeType" minOccurs="0"/> * &lt;element name="MaxGranularFitmentCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="CompatibleVehicleType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PaymentOptionsGroup" type="{urn:ebay:apis:eBLBaseComponents}PaymentOptionsGroupEnabledCodeType" minOccurs="0"/> * &lt;element name="ShippingProfileCategoryGroup" type="{urn:ebay:apis:eBLBaseComponents}ProfileCategoryGroupCodeType" minOccurs="0"/> * &lt;element name="PaymentProfileCategoryGroup" type="{urn:ebay:apis:eBLBaseComponents}ProfileCategoryGroupCodeType" minOccurs="0"/> * &lt;element name="ReturnPolicyProfileCategoryGroup" type="{urn:ebay:apis:eBLBaseComponents}ProfileCategoryGroupCodeType" minOccurs="0"/> * &lt;element name="VINSupported" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="VRMSupported" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="SellerProvidedTitleSupported" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="DepositSupported" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="GlobalShippingEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="AdditionalCompatibilityEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;any/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CategoryFeatureType", propOrder = { "categoryID", "listingDuration", "shippingTermsRequired", "bestOfferEnabled", "dutchBINEnabled", "userConsentRequired", "homePageFeaturedEnabled", "proPackEnabled", "basicUpgradePackEnabled", "valuePackEnabled", "proPackPlusEnabled", "adFormatEnabled", "bestOfferCounterEnabled", "bestOfferAutoDeclineEnabled", "localMarketSpecialitySubscription", "localMarketRegularSubscription", "localMarketPremiumSubscription", "localMarketNonSubscription", "expressEnabled", "expressPicturesRequired", "expressConditionRequired", "minimumReservePrice", "sellerContactDetailsEnabled", "transactionConfirmationRequestEnabled", "storeInventoryEnabled", "skypeMeTransactionalEnabled", "skypeMeNonTransactionalEnabled", "classifiedAdPaymentMethodEnabled", "classifiedAdShippingMethodEnabled", "classifiedAdBestOfferEnabled", "classifiedAdCounterOfferEnabled", "classifiedAdAutoDeclineEnabled", "classifiedAdContactByPhoneEnabled", "classifiedAdContactByEmailEnabled", "safePaymentRequired", "classifiedAdPayPerLeadEnabled", "itemSpecificsEnabled", "paisaPayFullEscrowEnabled", "upcIdentifierEnabled", "eanIdentifierEnabled", "isbnIdentifierEnabled", "brandMPNIdentifierEnabled", "classifiedAdAutoAcceptEnabled", "bestOfferAutoAcceptEnabled", "crossBorderTradeNorthAmericaEnabled", "crossBorderTradeGBEnabled", "crossBorderTradeAustraliaEnabled", "payPalBuyerProtectionEnabled", "buyerGuaranteeEnabled", "combinedFixedPriceTreatmentEnabled", "galleryFeaturedDurations", "payPalRequired", "eBayMotorsProAdFormatEnabled", "eBayMotorsProContactByPhoneEnabled", "eBayMotorsProPhoneCount", "eBayMotorsProContactByAddressEnabled", "eBayMotorsProStreetCount", "eBayMotorsProCompanyNameEnabled", "eBayMotorsProContactByEmailEnabled", "eBayMotorsProBestOfferEnabled", "eBayMotorsProAutoAcceptEnabled", "eBayMotorsProAutoDeclineEnabled", "eBayMotorsProPaymentMethodCheckOutEnabled", "eBayMotorsProShippingMethodEnabled", "eBayMotorsProCounterOfferEnabled", "eBayMotorsProSellerContactDetailsEnabled", "localMarketAdFormatEnabled", "localMarketContactByPhoneEnabled", "localMarketPhoneCount", "localMarketContactByAddressEnabled", "localMarketStreetCount", "localMarketCompanyNameEnabled", "localMarketContactByEmailEnabled", "localMarketBestOfferEnabled", "localMarketAutoAcceptEnabled", "localMarketAutoDeclineEnabled", "localMarketPaymentMethodCheckOutEnabled", "localMarketShippingMethodEnabled", "localMarketCounterOfferEnabled", "localMarketSellerContactDetailsEnabled", "classifiedAdPhoneCount", "classifiedAdContactByAddressEnabled", "classifiedAdStreetCount", "classifiedAdCompanyNameEnabled", "specialitySubscription", "regularSubscription", "premiumSubscription", "nonSubscription", "inEscrowWorkflowTimeline", "payPalRequiredForStoreOwner", "reviseQuantityAllowed", "revisePriceAllowed", "storeOwnerExtendedListingDurationsEnabled", "storeOwnerExtendedListingDurations", "returnPolicyEnabled", "handlingTimeEnabled", "maxFlatShippingCost", "group1MaxFlatShippingCost", "group2MaxFlatShippingCost", "group3MaxFlatShippingCost", "paymentMethod", "variationsEnabled", "attributeConversionEnabled", "freeGalleryPlusEnabled", "freePicturePackEnabled", "itemCompatibilityEnabled", "minItemCompatibility", "maxItemCompatibility", "conditionEnabled", "conditionValues", "valueCategory", "productCreationEnabled", "maxGranularFitmentCount", "compatibleVehicleType", "paymentOptionsGroup", "shippingProfileCategoryGroup", "paymentProfileCategoryGroup", "returnPolicyProfileCategoryGroup", "vinSupported", "vrmSupported", "sellerProvidedTitleSupported", "depositSupported", "globalShippingEnabled", "additionalCompatibilityEnabled", "any" }) public class CategoryFeatureType implements Serializable { private final static long serialVersionUID = 12343L; @XmlElement(name = "CategoryID") protected String categoryID; @XmlElement(name = "ListingDuration") protected List<ListingDurationReferenceType> listingDuration; @XmlElement(name = "ShippingTermsRequired") protected Boolean shippingTermsRequired; @XmlElement(name = "BestOfferEnabled") protected Boolean bestOfferEnabled; @XmlElement(name = "DutchBINEnabled") protected Boolean dutchBINEnabled; @XmlElement(name = "UserConsentRequired") protected Boolean userConsentRequired; @XmlElement(name = "HomePageFeaturedEnabled") protected Boolean homePageFeaturedEnabled; @XmlElement(name = "ProPackEnabled") protected Boolean proPackEnabled; @XmlElement(name = "BasicUpgradePackEnabled") protected Boolean basicUpgradePackEnabled; @XmlElement(name = "ValuePackEnabled") protected Boolean valuePackEnabled; @XmlElement(name = "ProPackPlusEnabled") protected Boolean proPackPlusEnabled; @XmlElement(name = "AdFormatEnabled") protected AdFormatEnabledCodeType adFormatEnabled; @XmlElement(name = "BestOfferCounterEnabled") protected Boolean bestOfferCounterEnabled; @XmlElement(name = "BestOfferAutoDeclineEnabled") protected Boolean bestOfferAutoDeclineEnabled; @XmlElement(name = "LocalMarketSpecialitySubscription") protected Boolean localMarketSpecialitySubscription; @XmlElement(name = "LocalMarketRegularSubscription") protected Boolean localMarketRegularSubscription; @XmlElement(name = "LocalMarketPremiumSubscription") protected Boolean localMarketPremiumSubscription; @XmlElement(name = "LocalMarketNonSubscription") protected Boolean localMarketNonSubscription; @XmlElement(name = "ExpressEnabled") protected Boolean expressEnabled; @XmlElement(name = "ExpressPicturesRequired") protected Boolean expressPicturesRequired; @XmlElement(name = "ExpressConditionRequired") protected Boolean expressConditionRequired; @XmlElement(name = "MinimumReservePrice") protected Double minimumReservePrice; @XmlElement(name = "SellerContactDetailsEnabled") protected Boolean sellerContactDetailsEnabled; @XmlElement(name = "TransactionConfirmationRequestEnabled") protected Boolean transactionConfirmationRequestEnabled; @XmlElement(name = "StoreInventoryEnabled") protected Boolean storeInventoryEnabled; @XmlElement(name = "SkypeMeTransactionalEnabled") protected Boolean skypeMeTransactionalEnabled; @XmlElement(name = "SkypeMeNonTransactionalEnabled") protected Boolean skypeMeNonTransactionalEnabled; @XmlElement(name = "ClassifiedAdPaymentMethodEnabled") protected ClassifiedAdPaymentMethodEnabledCodeType classifiedAdPaymentMethodEnabled; @XmlElement(name = "ClassifiedAdShippingMethodEnabled") protected Boolean classifiedAdShippingMethodEnabled; @XmlElement(name = "ClassifiedAdBestOfferEnabled") protected ClassifiedAdBestOfferEnabledCodeType classifiedAdBestOfferEnabled; @XmlElement(name = "ClassifiedAdCounterOfferEnabled") protected Boolean classifiedAdCounterOfferEnabled; @XmlElement(name = "ClassifiedAdAutoDeclineEnabled") protected Boolean classifiedAdAutoDeclineEnabled; @XmlElement(name = "ClassifiedAdContactByPhoneEnabled") protected Boolean classifiedAdContactByPhoneEnabled; @XmlElement(name = "ClassifiedAdContactByEmailEnabled") protected Boolean classifiedAdContactByEmailEnabled; @XmlElement(name = "SafePaymentRequired") protected Boolean safePaymentRequired; @XmlElement(name = "ClassifiedAdPayPerLeadEnabled") protected Boolean classifiedAdPayPerLeadEnabled; @XmlElement(name = "ItemSpecificsEnabled") protected ItemSpecificsEnabledCodeType itemSpecificsEnabled; @XmlElement(name = "PaisaPayFullEscrowEnabled") protected Boolean paisaPayFullEscrowEnabled; @XmlElement(name = "UPCIdentifierEnabled") protected Boolean upcIdentifierEnabled; @XmlElement(name = "EANIdentifierEnabled") protected Boolean eanIdentifierEnabled; @XmlElement(name = "ISBNIdentifierEnabled") protected Boolean isbnIdentifierEnabled; @XmlElement(name = "BrandMPNIdentifierEnabled") protected Boolean brandMPNIdentifierEnabled; @XmlElement(name = "ClassifiedAdAutoAcceptEnabled") protected Boolean classifiedAdAutoAcceptEnabled; @XmlElement(name = "BestOfferAutoAcceptEnabled") protected Boolean bestOfferAutoAcceptEnabled; @XmlElement(name = "CrossBorderTradeNorthAmericaEnabled") protected Boolean crossBorderTradeNorthAmericaEnabled; @XmlElement(name = "CrossBorderTradeGBEnabled") protected Boolean crossBorderTradeGBEnabled; @XmlElement(name = "CrossBorderTradeAustraliaEnabled") protected Boolean crossBorderTradeAustraliaEnabled; @XmlElement(name = "PayPalBuyerProtectionEnabled") protected Boolean payPalBuyerProtectionEnabled; @XmlElement(name = "BuyerGuaranteeEnabled") protected Boolean buyerGuaranteeEnabled; @XmlElement(name = "CombinedFixedPriceTreatmentEnabled") protected Boolean combinedFixedPriceTreatmentEnabled; @XmlElement(name = "GalleryFeaturedDurations") protected ListingEnhancementDurationReferenceType galleryFeaturedDurations; @XmlElement(name = "PayPalRequired") protected Boolean payPalRequired; protected AdFormatEnabledCodeType eBayMotorsProAdFormatEnabled; protected Boolean eBayMotorsProContactByPhoneEnabled; protected Integer eBayMotorsProPhoneCount; protected Boolean eBayMotorsProContactByAddressEnabled; protected Integer eBayMotorsProStreetCount; protected Boolean eBayMotorsProCompanyNameEnabled; protected Boolean eBayMotorsProContactByEmailEnabled; protected ClassifiedAdBestOfferEnabledCodeType eBayMotorsProBestOfferEnabled; protected Boolean eBayMotorsProAutoAcceptEnabled; protected Boolean eBayMotorsProAutoDeclineEnabled; protected ClassifiedAdPaymentMethodEnabledCodeType eBayMotorsProPaymentMethodCheckOutEnabled; protected Boolean eBayMotorsProShippingMethodEnabled; protected Boolean eBayMotorsProCounterOfferEnabled; protected Boolean eBayMotorsProSellerContactDetailsEnabled; @XmlElement(name = "LocalMarketAdFormatEnabled") protected AdFormatEnabledCodeType localMarketAdFormatEnabled; @XmlElement(name = "LocalMarketContactByPhoneEnabled") protected Boolean localMarketContactByPhoneEnabled; @XmlElement(name = "LocalMarketPhoneCount") protected Integer localMarketPhoneCount; @XmlElement(name = "LocalMarketContactByAddressEnabled") protected Boolean localMarketContactByAddressEnabled; @XmlElement(name = "LocalMarketStreetCount") protected Integer localMarketStreetCount; @XmlElement(name = "LocalMarketCompanyNameEnabled") protected Boolean localMarketCompanyNameEnabled; @XmlElement(name = "LocalMarketContactByEmailEnabled") protected Boolean localMarketContactByEmailEnabled; @XmlElement(name = "LocalMarketBestOfferEnabled") protected ClassifiedAdBestOfferEnabledCodeType localMarketBestOfferEnabled; @XmlElement(name = "LocalMarketAutoAcceptEnabled") protected Boolean localMarketAutoAcceptEnabled; @XmlElement(name = "LocalMarketAutoDeclineEnabled") protected Boolean localMarketAutoDeclineEnabled; @XmlElement(name = "LocalMarketPaymentMethodCheckOutEnabled") protected ClassifiedAdPaymentMethodEnabledCodeType localMarketPaymentMethodCheckOutEnabled; @XmlElement(name = "LocalMarketShippingMethodEnabled") protected Boolean localMarketShippingMethodEnabled; @XmlElement(name = "LocalMarketCounterOfferEnabled") protected Boolean localMarketCounterOfferEnabled; @XmlElement(name = "LocalMarketSellerContactDetailsEnabled") protected Boolean localMarketSellerContactDetailsEnabled; @XmlElement(name = "ClassifiedAdPhoneCount") protected Integer classifiedAdPhoneCount; @XmlElement(name = "ClassifiedAdContactByAddressEnabled") protected Boolean classifiedAdContactByAddressEnabled; @XmlElement(name = "ClassifiedAdStreetCount") protected Integer classifiedAdStreetCount; @XmlElement(name = "ClassifiedAdCompanyNameEnabled") protected Boolean classifiedAdCompanyNameEnabled; @XmlElement(name = "SpecialitySubscription") protected GeographicExposureCodeType specialitySubscription; @XmlElement(name = "RegularSubscription") protected GeographicExposureCodeType regularSubscription; @XmlElement(name = "PremiumSubscription") protected GeographicExposureCodeType premiumSubscription; @XmlElement(name = "NonSubscription") protected GeographicExposureCodeType nonSubscription; @XmlElement(name = "INEscrowWorkflowTimeline") protected INEscrowWorkflowTimelineCodeType inEscrowWorkflowTimeline; @XmlElement(name = "PayPalRequiredForStoreOwner") protected Boolean payPalRequiredForStoreOwner; @XmlElement(name = "ReviseQuantityAllowed") protected Boolean reviseQuantityAllowed; @XmlElement(name = "RevisePriceAllowed") protected Boolean revisePriceAllowed; @XmlElement(name = "StoreOwnerExtendedListingDurationsEnabled") protected Boolean storeOwnerExtendedListingDurationsEnabled; @XmlElement(name = "StoreOwnerExtendedListingDurations") protected StoreOwnerExtendedListingDurationsType storeOwnerExtendedListingDurations; @XmlElement(name = "ReturnPolicyEnabled") protected Boolean returnPolicyEnabled; @XmlElement(name = "HandlingTimeEnabled") protected Boolean handlingTimeEnabled; @XmlElement(name = "MaxFlatShippingCost") protected AmountType maxFlatShippingCost; @XmlElement(name = "Group1MaxFlatShippingCost") protected AmountType group1MaxFlatShippingCost; @XmlElement(name = "Group2MaxFlatShippingCost") protected AmountType group2MaxFlatShippingCost; @XmlElement(name = "Group3MaxFlatShippingCost") protected AmountType group3MaxFlatShippingCost; @XmlElement(name = "PaymentMethod") protected List<BuyerPaymentMethodCodeType> paymentMethod; @XmlElement(name = "VariationsEnabled") protected Boolean variationsEnabled; @XmlElement(name = "AttributeConversionEnabled") protected AttributeConversionEnabledCodeType attributeConversionEnabled; @XmlElement(name = "FreeGalleryPlusEnabled") protected Boolean freeGalleryPlusEnabled; @XmlElement(name = "FreePicturePackEnabled") protected Boolean freePicturePackEnabled; @XmlElement(name = "ItemCompatibilityEnabled") protected ItemCompatibilityEnabledCodeType itemCompatibilityEnabled; @XmlElement(name = "MinItemCompatibility") protected Integer minItemCompatibility; @XmlElement(name = "MaxItemCompatibility") protected Integer maxItemCompatibility; @XmlElement(name = "ConditionEnabled") protected ConditionEnabledCodeType conditionEnabled; @XmlElement(name = "ConditionValues") protected ConditionValuesType conditionValues; @XmlElement(name = "ValueCategory") protected Boolean valueCategory; @XmlElement(name = "ProductCreationEnabled") protected ProductCreationEnabledCodeType productCreationEnabled; @XmlElement(name = "MaxGranularFitmentCount") protected Integer maxGranularFitmentCount; @XmlElement(name = "CompatibleVehicleType") protected String compatibleVehicleType; @XmlElement(name = "PaymentOptionsGroup") protected PaymentOptionsGroupEnabledCodeType paymentOptionsGroup; @XmlElement(name = "ShippingProfileCategoryGroup") protected ProfileCategoryGroupCodeType shippingProfileCategoryGroup; @XmlElement(name = "PaymentProfileCategoryGroup") protected ProfileCategoryGroupCodeType paymentProfileCategoryGroup; @XmlElement(name = "ReturnPolicyProfileCategoryGroup") protected ProfileCategoryGroupCodeType returnPolicyProfileCategoryGroup; @XmlElement(name = "VINSupported") protected Boolean vinSupported; @XmlElement(name = "VRMSupported") protected Boolean vrmSupported; @XmlElement(name = "SellerProvidedTitleSupported") protected Boolean sellerProvidedTitleSupported; @XmlElement(name = "DepositSupported") protected Boolean depositSupported; @XmlElement(name = "GlobalShippingEnabled") protected Boolean globalShippingEnabled; @XmlElement(name = "AdditionalCompatibilityEnabled") protected Boolean additionalCompatibilityEnabled; @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the categoryID property. * * @return * possible object is * {@link String } * */ public String getCategoryID() { return categoryID; } /** * Sets the value of the categoryID property. * * @param value * allowed object is * {@link String } * */ public void setCategoryID(String value) { this.categoryID = value; } /** * * * @return * array of * {@link ListingDurationReferenceType } * */ public ListingDurationReferenceType[] getListingDuration() { if (this.listingDuration == null) { return new ListingDurationReferenceType[ 0 ] ; } return ((ListingDurationReferenceType[]) this.listingDuration.toArray(new ListingDurationReferenceType[this.listingDuration.size()] )); } /** * * * @return * one of * {@link ListingDurationReferenceType } * */ public ListingDurationReferenceType getListingDuration(int idx) { if (this.listingDuration == null) { throw new IndexOutOfBoundsException(); } return this.listingDuration.get(idx); } public int getListingDurationLength() { if (this.listingDuration == null) { return 0; } return this.listingDuration.size(); } /** * * * @param values * allowed objects are * {@link ListingDurationReferenceType } * */ public void setListingDuration(ListingDurationReferenceType[] values) { this._getListingDuration().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.listingDuration.add(values[i]); } } protected List<ListingDurationReferenceType> _getListingDuration() { if (listingDuration == null) { listingDuration = new ArrayList<ListingDurationReferenceType>(); } return listingDuration; } /** * * * @param value * allowed object is * {@link ListingDurationReferenceType } * */ public ListingDurationReferenceType setListingDuration(int idx, ListingDurationReferenceType value) { return this.listingDuration.set(idx, value); } /** * Gets the value of the shippingTermsRequired property. * * @return * possible object is * {@link Boolean } * */ public Boolean isShippingTermsRequired() { return shippingTermsRequired; } /** * Sets the value of the shippingTermsRequired property. * * @param value * allowed object is * {@link Boolean } * */ public void setShippingTermsRequired(Boolean value) { this.shippingTermsRequired = value; } /** * Gets the value of the bestOfferEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBestOfferEnabled() { return bestOfferEnabled; } /** * Sets the value of the bestOfferEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBestOfferEnabled(Boolean value) { this.bestOfferEnabled = value; } /** * Gets the value of the dutchBINEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isDutchBINEnabled() { return dutchBINEnabled; } /** * Sets the value of the dutchBINEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setDutchBINEnabled(Boolean value) { this.dutchBINEnabled = value; } /** * Gets the value of the userConsentRequired property. * * @return * possible object is * {@link Boolean } * */ public Boolean isUserConsentRequired() { return userConsentRequired; } /** * Sets the value of the userConsentRequired property. * * @param value * allowed object is * {@link Boolean } * */ public void setUserConsentRequired(Boolean value) { this.userConsentRequired = value; } /** * Gets the value of the homePageFeaturedEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isHomePageFeaturedEnabled() { return homePageFeaturedEnabled; } /** * Sets the value of the homePageFeaturedEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setHomePageFeaturedEnabled(Boolean value) { this.homePageFeaturedEnabled = value; } /** * Gets the value of the proPackEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isProPackEnabled() { return proPackEnabled; } /** * Sets the value of the proPackEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setProPackEnabled(Boolean value) { this.proPackEnabled = value; } /** * Gets the value of the basicUpgradePackEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBasicUpgradePackEnabled() { return basicUpgradePackEnabled; } /** * Sets the value of the basicUpgradePackEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBasicUpgradePackEnabled(Boolean value) { this.basicUpgradePackEnabled = value; } /** * Gets the value of the valuePackEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isValuePackEnabled() { return valuePackEnabled; } /** * Sets the value of the valuePackEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setValuePackEnabled(Boolean value) { this.valuePackEnabled = value; } /** * Gets the value of the proPackPlusEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isProPackPlusEnabled() { return proPackPlusEnabled; } /** * Sets the value of the proPackPlusEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setProPackPlusEnabled(Boolean value) { this.proPackPlusEnabled = value; } /** * Gets the value of the adFormatEnabled property. * * @return * possible object is * {@link AdFormatEnabledCodeType } * */ public AdFormatEnabledCodeType getAdFormatEnabled() { return adFormatEnabled; } /** * Sets the value of the adFormatEnabled property. * * @param value * allowed object is * {@link AdFormatEnabledCodeType } * */ public void setAdFormatEnabled(AdFormatEnabledCodeType value) { this.adFormatEnabled = value; } /** * Gets the value of the bestOfferCounterEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBestOfferCounterEnabled() { return bestOfferCounterEnabled; } /** * Sets the value of the bestOfferCounterEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBestOfferCounterEnabled(Boolean value) { this.bestOfferCounterEnabled = value; } /** * Gets the value of the bestOfferAutoDeclineEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBestOfferAutoDeclineEnabled() { return bestOfferAutoDeclineEnabled; } /** * Sets the value of the bestOfferAutoDeclineEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBestOfferAutoDeclineEnabled(Boolean value) { this.bestOfferAutoDeclineEnabled = value; } /** * Gets the value of the localMarketSpecialitySubscription property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketSpecialitySubscription() { return localMarketSpecialitySubscription; } /** * Sets the value of the localMarketSpecialitySubscription property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketSpecialitySubscription(Boolean value) { this.localMarketSpecialitySubscription = value; } /** * Gets the value of the localMarketRegularSubscription property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketRegularSubscription() { return localMarketRegularSubscription; } /** * Sets the value of the localMarketRegularSubscription property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketRegularSubscription(Boolean value) { this.localMarketRegularSubscription = value; } /** * Gets the value of the localMarketPremiumSubscription property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketPremiumSubscription() { return localMarketPremiumSubscription; } /** * Sets the value of the localMarketPremiumSubscription property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketPremiumSubscription(Boolean value) { this.localMarketPremiumSubscription = value; } /** * Gets the value of the localMarketNonSubscription property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketNonSubscription() { return localMarketNonSubscription; } /** * Sets the value of the localMarketNonSubscription property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketNonSubscription(Boolean value) { this.localMarketNonSubscription = value; } /** * Gets the value of the expressEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isExpressEnabled() { return expressEnabled; } /** * Sets the value of the expressEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setExpressEnabled(Boolean value) { this.expressEnabled = value; } /** * Gets the value of the expressPicturesRequired property. * * @return * possible object is * {@link Boolean } * */ public Boolean isExpressPicturesRequired() { return expressPicturesRequired; } /** * Sets the value of the expressPicturesRequired property. * * @param value * allowed object is * {@link Boolean } * */ public void setExpressPicturesRequired(Boolean value) { this.expressPicturesRequired = value; } /** * Gets the value of the expressConditionRequired property. * * @return * possible object is * {@link Boolean } * */ public Boolean isExpressConditionRequired() { return expressConditionRequired; } /** * Sets the value of the expressConditionRequired property. * * @param value * allowed object is * {@link Boolean } * */ public void setExpressConditionRequired(Boolean value) { this.expressConditionRequired = value; } /** * Gets the value of the minimumReservePrice property. * * @return * possible object is * {@link Double } * */ public Double getMinimumReservePrice() { return minimumReservePrice; } /** * Sets the value of the minimumReservePrice property. * * @param value * allowed object is * {@link Double } * */ public void setMinimumReservePrice(Double value) { this.minimumReservePrice = value; } /** * Gets the value of the sellerContactDetailsEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSellerContactDetailsEnabled() { return sellerContactDetailsEnabled; } /** * Sets the value of the sellerContactDetailsEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setSellerContactDetailsEnabled(Boolean value) { this.sellerContactDetailsEnabled = value; } /** * Gets the value of the transactionConfirmationRequestEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isTransactionConfirmationRequestEnabled() { return transactionConfirmationRequestEnabled; } /** * Sets the value of the transactionConfirmationRequestEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setTransactionConfirmationRequestEnabled(Boolean value) { this.transactionConfirmationRequestEnabled = value; } /** * Gets the value of the storeInventoryEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isStoreInventoryEnabled() { return storeInventoryEnabled; } /** * Sets the value of the storeInventoryEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setStoreInventoryEnabled(Boolean value) { this.storeInventoryEnabled = value; } /** * Gets the value of the skypeMeTransactionalEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSkypeMeTransactionalEnabled() { return skypeMeTransactionalEnabled; } /** * Sets the value of the skypeMeTransactionalEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setSkypeMeTransactionalEnabled(Boolean value) { this.skypeMeTransactionalEnabled = value; } /** * Gets the value of the skypeMeNonTransactionalEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSkypeMeNonTransactionalEnabled() { return skypeMeNonTransactionalEnabled; } /** * Sets the value of the skypeMeNonTransactionalEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setSkypeMeNonTransactionalEnabled(Boolean value) { this.skypeMeNonTransactionalEnabled = value; } /** * Gets the value of the classifiedAdPaymentMethodEnabled property. * * @return * possible object is * {@link ClassifiedAdPaymentMethodEnabledCodeType } * */ public ClassifiedAdPaymentMethodEnabledCodeType getClassifiedAdPaymentMethodEnabled() { return classifiedAdPaymentMethodEnabled; } /** * Sets the value of the classifiedAdPaymentMethodEnabled property. * * @param value * allowed object is * {@link ClassifiedAdPaymentMethodEnabledCodeType } * */ public void setClassifiedAdPaymentMethodEnabled(ClassifiedAdPaymentMethodEnabledCodeType value) { this.classifiedAdPaymentMethodEnabled = value; } /** * Gets the value of the classifiedAdShippingMethodEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdShippingMethodEnabled() { return classifiedAdShippingMethodEnabled; } /** * Sets the value of the classifiedAdShippingMethodEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdShippingMethodEnabled(Boolean value) { this.classifiedAdShippingMethodEnabled = value; } /** * Gets the value of the classifiedAdBestOfferEnabled property. * * @return * possible object is * {@link ClassifiedAdBestOfferEnabledCodeType } * */ public ClassifiedAdBestOfferEnabledCodeType getClassifiedAdBestOfferEnabled() { return classifiedAdBestOfferEnabled; } /** * Sets the value of the classifiedAdBestOfferEnabled property. * * @param value * allowed object is * {@link ClassifiedAdBestOfferEnabledCodeType } * */ public void setClassifiedAdBestOfferEnabled(ClassifiedAdBestOfferEnabledCodeType value) { this.classifiedAdBestOfferEnabled = value; } /** * Gets the value of the classifiedAdCounterOfferEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdCounterOfferEnabled() { return classifiedAdCounterOfferEnabled; } /** * Sets the value of the classifiedAdCounterOfferEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdCounterOfferEnabled(Boolean value) { this.classifiedAdCounterOfferEnabled = value; } /** * Gets the value of the classifiedAdAutoDeclineEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdAutoDeclineEnabled() { return classifiedAdAutoDeclineEnabled; } /** * Sets the value of the classifiedAdAutoDeclineEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdAutoDeclineEnabled(Boolean value) { this.classifiedAdAutoDeclineEnabled = value; } /** * Gets the value of the classifiedAdContactByPhoneEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdContactByPhoneEnabled() { return classifiedAdContactByPhoneEnabled; } /** * Sets the value of the classifiedAdContactByPhoneEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdContactByPhoneEnabled(Boolean value) { this.classifiedAdContactByPhoneEnabled = value; } /** * Gets the value of the classifiedAdContactByEmailEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdContactByEmailEnabled() { return classifiedAdContactByEmailEnabled; } /** * Sets the value of the classifiedAdContactByEmailEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdContactByEmailEnabled(Boolean value) { this.classifiedAdContactByEmailEnabled = value; } /** * Gets the value of the safePaymentRequired property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSafePaymentRequired() { return safePaymentRequired; } /** * Sets the value of the safePaymentRequired property. * * @param value * allowed object is * {@link Boolean } * */ public void setSafePaymentRequired(Boolean value) { this.safePaymentRequired = value; } /** * Gets the value of the classifiedAdPayPerLeadEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdPayPerLeadEnabled() { return classifiedAdPayPerLeadEnabled; } /** * Sets the value of the classifiedAdPayPerLeadEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdPayPerLeadEnabled(Boolean value) { this.classifiedAdPayPerLeadEnabled = value; } /** * Gets the value of the itemSpecificsEnabled property. * * @return * possible object is * {@link ItemSpecificsEnabledCodeType } * */ public ItemSpecificsEnabledCodeType getItemSpecificsEnabled() { return itemSpecificsEnabled; } /** * Sets the value of the itemSpecificsEnabled property. * * @param value * allowed object is * {@link ItemSpecificsEnabledCodeType } * */ public void setItemSpecificsEnabled(ItemSpecificsEnabledCodeType value) { this.itemSpecificsEnabled = value; } /** * Gets the value of the paisaPayFullEscrowEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isPaisaPayFullEscrowEnabled() { return paisaPayFullEscrowEnabled; } /** * Sets the value of the paisaPayFullEscrowEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setPaisaPayFullEscrowEnabled(Boolean value) { this.paisaPayFullEscrowEnabled = value; } /** * Gets the value of the upcIdentifierEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isUPCIdentifierEnabled() { return upcIdentifierEnabled; } /** * Sets the value of the upcIdentifierEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setUPCIdentifierEnabled(Boolean value) { this.upcIdentifierEnabled = value; } /** * Gets the value of the eanIdentifierEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEANIdentifierEnabled() { return eanIdentifierEnabled; } /** * Sets the value of the eanIdentifierEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEANIdentifierEnabled(Boolean value) { this.eanIdentifierEnabled = value; } /** * Gets the value of the isbnIdentifierEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isISBNIdentifierEnabled() { return isbnIdentifierEnabled; } /** * Sets the value of the isbnIdentifierEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setISBNIdentifierEnabled(Boolean value) { this.isbnIdentifierEnabled = value; } /** * Gets the value of the brandMPNIdentifierEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBrandMPNIdentifierEnabled() { return brandMPNIdentifierEnabled; } /** * Sets the value of the brandMPNIdentifierEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBrandMPNIdentifierEnabled(Boolean value) { this.brandMPNIdentifierEnabled = value; } /** * Gets the value of the classifiedAdAutoAcceptEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdAutoAcceptEnabled() { return classifiedAdAutoAcceptEnabled; } /** * Sets the value of the classifiedAdAutoAcceptEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdAutoAcceptEnabled(Boolean value) { this.classifiedAdAutoAcceptEnabled = value; } /** * Gets the value of the bestOfferAutoAcceptEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBestOfferAutoAcceptEnabled() { return bestOfferAutoAcceptEnabled; } /** * Sets the value of the bestOfferAutoAcceptEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBestOfferAutoAcceptEnabled(Boolean value) { this.bestOfferAutoAcceptEnabled = value; } /** * Gets the value of the crossBorderTradeNorthAmericaEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isCrossBorderTradeNorthAmericaEnabled() { return crossBorderTradeNorthAmericaEnabled; } /** * Sets the value of the crossBorderTradeNorthAmericaEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setCrossBorderTradeNorthAmericaEnabled(Boolean value) { this.crossBorderTradeNorthAmericaEnabled = value; } /** * Gets the value of the crossBorderTradeGBEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isCrossBorderTradeGBEnabled() { return crossBorderTradeGBEnabled; } /** * Sets the value of the crossBorderTradeGBEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setCrossBorderTradeGBEnabled(Boolean value) { this.crossBorderTradeGBEnabled = value; } /** * Gets the value of the crossBorderTradeAustraliaEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isCrossBorderTradeAustraliaEnabled() { return crossBorderTradeAustraliaEnabled; } /** * Sets the value of the crossBorderTradeAustraliaEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setCrossBorderTradeAustraliaEnabled(Boolean value) { this.crossBorderTradeAustraliaEnabled = value; } /** * Gets the value of the payPalBuyerProtectionEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isPayPalBuyerProtectionEnabled() { return payPalBuyerProtectionEnabled; } /** * Sets the value of the payPalBuyerProtectionEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setPayPalBuyerProtectionEnabled(Boolean value) { this.payPalBuyerProtectionEnabled = value; } /** * Gets the value of the buyerGuaranteeEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBuyerGuaranteeEnabled() { return buyerGuaranteeEnabled; } /** * Sets the value of the buyerGuaranteeEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setBuyerGuaranteeEnabled(Boolean value) { this.buyerGuaranteeEnabled = value; } /** * Gets the value of the combinedFixedPriceTreatmentEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isCombinedFixedPriceTreatmentEnabled() { return combinedFixedPriceTreatmentEnabled; } /** * Sets the value of the combinedFixedPriceTreatmentEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setCombinedFixedPriceTreatmentEnabled(Boolean value) { this.combinedFixedPriceTreatmentEnabled = value; } /** * Gets the value of the galleryFeaturedDurations property. * * @return * possible object is * {@link ListingEnhancementDurationReferenceType } * */ public ListingEnhancementDurationReferenceType getGalleryFeaturedDurations() { return galleryFeaturedDurations; } /** * Sets the value of the galleryFeaturedDurations property. * * @param value * allowed object is * {@link ListingEnhancementDurationReferenceType } * */ public void setGalleryFeaturedDurations(ListingEnhancementDurationReferenceType value) { this.galleryFeaturedDurations = value; } /** * Gets the value of the payPalRequired property. * * @return * possible object is * {@link Boolean } * */ public Boolean isPayPalRequired() { return payPalRequired; } /** * Sets the value of the payPalRequired property. * * @param value * allowed object is * {@link Boolean } * */ public void setPayPalRequired(Boolean value) { this.payPalRequired = value; } /** * Gets the value of the eBayMotorsProAdFormatEnabled property. * * @return * possible object is * {@link AdFormatEnabledCodeType } * */ public AdFormatEnabledCodeType getEBayMotorsProAdFormatEnabled() { return eBayMotorsProAdFormatEnabled; } /** * Sets the value of the eBayMotorsProAdFormatEnabled property. * * @param value * allowed object is * {@link AdFormatEnabledCodeType } * */ public void setEBayMotorsProAdFormatEnabled(AdFormatEnabledCodeType value) { this.eBayMotorsProAdFormatEnabled = value; } /** * Gets the value of the eBayMotorsProContactByPhoneEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProContactByPhoneEnabled() { return eBayMotorsProContactByPhoneEnabled; } /** * Sets the value of the eBayMotorsProContactByPhoneEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProContactByPhoneEnabled(Boolean value) { this.eBayMotorsProContactByPhoneEnabled = value; } /** * Gets the value of the eBayMotorsProPhoneCount property. * * @return * possible object is * {@link Integer } * */ public Integer getEBayMotorsProPhoneCount() { return eBayMotorsProPhoneCount; } /** * Sets the value of the eBayMotorsProPhoneCount property. * * @param value * allowed object is * {@link Integer } * */ public void setEBayMotorsProPhoneCount(Integer value) { this.eBayMotorsProPhoneCount = value; } /** * Gets the value of the eBayMotorsProContactByAddressEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProContactByAddressEnabled() { return eBayMotorsProContactByAddressEnabled; } /** * Sets the value of the eBayMotorsProContactByAddressEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProContactByAddressEnabled(Boolean value) { this.eBayMotorsProContactByAddressEnabled = value; } /** * Gets the value of the eBayMotorsProStreetCount property. * * @return * possible object is * {@link Integer } * */ public Integer getEBayMotorsProStreetCount() { return eBayMotorsProStreetCount; } /** * Sets the value of the eBayMotorsProStreetCount property. * * @param value * allowed object is * {@link Integer } * */ public void setEBayMotorsProStreetCount(Integer value) { this.eBayMotorsProStreetCount = value; } /** * Gets the value of the eBayMotorsProCompanyNameEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProCompanyNameEnabled() { return eBayMotorsProCompanyNameEnabled; } /** * Sets the value of the eBayMotorsProCompanyNameEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProCompanyNameEnabled(Boolean value) { this.eBayMotorsProCompanyNameEnabled = value; } /** * Gets the value of the eBayMotorsProContactByEmailEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProContactByEmailEnabled() { return eBayMotorsProContactByEmailEnabled; } /** * Sets the value of the eBayMotorsProContactByEmailEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProContactByEmailEnabled(Boolean value) { this.eBayMotorsProContactByEmailEnabled = value; } /** * Gets the value of the eBayMotorsProBestOfferEnabled property. * * @return * possible object is * {@link ClassifiedAdBestOfferEnabledCodeType } * */ public ClassifiedAdBestOfferEnabledCodeType getEBayMotorsProBestOfferEnabled() { return eBayMotorsProBestOfferEnabled; } /** * Sets the value of the eBayMotorsProBestOfferEnabled property. * * @param value * allowed object is * {@link ClassifiedAdBestOfferEnabledCodeType } * */ public void setEBayMotorsProBestOfferEnabled(ClassifiedAdBestOfferEnabledCodeType value) { this.eBayMotorsProBestOfferEnabled = value; } /** * Gets the value of the eBayMotorsProAutoAcceptEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProAutoAcceptEnabled() { return eBayMotorsProAutoAcceptEnabled; } /** * Sets the value of the eBayMotorsProAutoAcceptEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProAutoAcceptEnabled(Boolean value) { this.eBayMotorsProAutoAcceptEnabled = value; } /** * Gets the value of the eBayMotorsProAutoDeclineEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProAutoDeclineEnabled() { return eBayMotorsProAutoDeclineEnabled; } /** * Sets the value of the eBayMotorsProAutoDeclineEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProAutoDeclineEnabled(Boolean value) { this.eBayMotorsProAutoDeclineEnabled = value; } /** * Gets the value of the eBayMotorsProPaymentMethodCheckOutEnabled property. * * @return * possible object is * {@link ClassifiedAdPaymentMethodEnabledCodeType } * */ public ClassifiedAdPaymentMethodEnabledCodeType getEBayMotorsProPaymentMethodCheckOutEnabled() { return eBayMotorsProPaymentMethodCheckOutEnabled; } /** * Sets the value of the eBayMotorsProPaymentMethodCheckOutEnabled property. * * @param value * allowed object is * {@link ClassifiedAdPaymentMethodEnabledCodeType } * */ public void setEBayMotorsProPaymentMethodCheckOutEnabled(ClassifiedAdPaymentMethodEnabledCodeType value) { this.eBayMotorsProPaymentMethodCheckOutEnabled = value; } /** * Gets the value of the eBayMotorsProShippingMethodEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProShippingMethodEnabled() { return eBayMotorsProShippingMethodEnabled; } /** * Sets the value of the eBayMotorsProShippingMethodEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProShippingMethodEnabled(Boolean value) { this.eBayMotorsProShippingMethodEnabled = value; } /** * Gets the value of the eBayMotorsProCounterOfferEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProCounterOfferEnabled() { return eBayMotorsProCounterOfferEnabled; } /** * Sets the value of the eBayMotorsProCounterOfferEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProCounterOfferEnabled(Boolean value) { this.eBayMotorsProCounterOfferEnabled = value; } /** * Gets the value of the eBayMotorsProSellerContactDetailsEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isEBayMotorsProSellerContactDetailsEnabled() { return eBayMotorsProSellerContactDetailsEnabled; } /** * Sets the value of the eBayMotorsProSellerContactDetailsEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setEBayMotorsProSellerContactDetailsEnabled(Boolean value) { this.eBayMotorsProSellerContactDetailsEnabled = value; } /** * Gets the value of the localMarketAdFormatEnabled property. * * @return * possible object is * {@link AdFormatEnabledCodeType } * */ public AdFormatEnabledCodeType getLocalMarketAdFormatEnabled() { return localMarketAdFormatEnabled; } /** * Sets the value of the localMarketAdFormatEnabled property. * * @param value * allowed object is * {@link AdFormatEnabledCodeType } * */ public void setLocalMarketAdFormatEnabled(AdFormatEnabledCodeType value) { this.localMarketAdFormatEnabled = value; } /** * Gets the value of the localMarketContactByPhoneEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketContactByPhoneEnabled() { return localMarketContactByPhoneEnabled; } /** * Sets the value of the localMarketContactByPhoneEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketContactByPhoneEnabled(Boolean value) { this.localMarketContactByPhoneEnabled = value; } /** * Gets the value of the localMarketPhoneCount property. * * @return * possible object is * {@link Integer } * */ public Integer getLocalMarketPhoneCount() { return localMarketPhoneCount; } /** * Sets the value of the localMarketPhoneCount property. * * @param value * allowed object is * {@link Integer } * */ public void setLocalMarketPhoneCount(Integer value) { this.localMarketPhoneCount = value; } /** * Gets the value of the localMarketContactByAddressEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketContactByAddressEnabled() { return localMarketContactByAddressEnabled; } /** * Sets the value of the localMarketContactByAddressEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketContactByAddressEnabled(Boolean value) { this.localMarketContactByAddressEnabled = value; } /** * Gets the value of the localMarketStreetCount property. * * @return * possible object is * {@link Integer } * */ public Integer getLocalMarketStreetCount() { return localMarketStreetCount; } /** * Sets the value of the localMarketStreetCount property. * * @param value * allowed object is * {@link Integer } * */ public void setLocalMarketStreetCount(Integer value) { this.localMarketStreetCount = value; } /** * Gets the value of the localMarketCompanyNameEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketCompanyNameEnabled() { return localMarketCompanyNameEnabled; } /** * Sets the value of the localMarketCompanyNameEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketCompanyNameEnabled(Boolean value) { this.localMarketCompanyNameEnabled = value; } /** * Gets the value of the localMarketContactByEmailEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketContactByEmailEnabled() { return localMarketContactByEmailEnabled; } /** * Sets the value of the localMarketContactByEmailEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketContactByEmailEnabled(Boolean value) { this.localMarketContactByEmailEnabled = value; } /** * Gets the value of the localMarketBestOfferEnabled property. * * @return * possible object is * {@link ClassifiedAdBestOfferEnabledCodeType } * */ public ClassifiedAdBestOfferEnabledCodeType getLocalMarketBestOfferEnabled() { return localMarketBestOfferEnabled; } /** * Sets the value of the localMarketBestOfferEnabled property. * * @param value * allowed object is * {@link ClassifiedAdBestOfferEnabledCodeType } * */ public void setLocalMarketBestOfferEnabled(ClassifiedAdBestOfferEnabledCodeType value) { this.localMarketBestOfferEnabled = value; } /** * Gets the value of the localMarketAutoAcceptEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketAutoAcceptEnabled() { return localMarketAutoAcceptEnabled; } /** * Sets the value of the localMarketAutoAcceptEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketAutoAcceptEnabled(Boolean value) { this.localMarketAutoAcceptEnabled = value; } /** * Gets the value of the localMarketAutoDeclineEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketAutoDeclineEnabled() { return localMarketAutoDeclineEnabled; } /** * Sets the value of the localMarketAutoDeclineEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketAutoDeclineEnabled(Boolean value) { this.localMarketAutoDeclineEnabled = value; } /** * Gets the value of the localMarketPaymentMethodCheckOutEnabled property. * * @return * possible object is * {@link ClassifiedAdPaymentMethodEnabledCodeType } * */ public ClassifiedAdPaymentMethodEnabledCodeType getLocalMarketPaymentMethodCheckOutEnabled() { return localMarketPaymentMethodCheckOutEnabled; } /** * Sets the value of the localMarketPaymentMethodCheckOutEnabled property. * * @param value * allowed object is * {@link ClassifiedAdPaymentMethodEnabledCodeType } * */ public void setLocalMarketPaymentMethodCheckOutEnabled(ClassifiedAdPaymentMethodEnabledCodeType value) { this.localMarketPaymentMethodCheckOutEnabled = value; } /** * Gets the value of the localMarketShippingMethodEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketShippingMethodEnabled() { return localMarketShippingMethodEnabled; } /** * Sets the value of the localMarketShippingMethodEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketShippingMethodEnabled(Boolean value) { this.localMarketShippingMethodEnabled = value; } /** * Gets the value of the localMarketCounterOfferEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketCounterOfferEnabled() { return localMarketCounterOfferEnabled; } /** * Sets the value of the localMarketCounterOfferEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketCounterOfferEnabled(Boolean value) { this.localMarketCounterOfferEnabled = value; } /** * Gets the value of the localMarketSellerContactDetailsEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLocalMarketSellerContactDetailsEnabled() { return localMarketSellerContactDetailsEnabled; } /** * Sets the value of the localMarketSellerContactDetailsEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setLocalMarketSellerContactDetailsEnabled(Boolean value) { this.localMarketSellerContactDetailsEnabled = value; } /** * Gets the value of the classifiedAdPhoneCount property. * * @return * possible object is * {@link Integer } * */ public Integer getClassifiedAdPhoneCount() { return classifiedAdPhoneCount; } /** * Sets the value of the classifiedAdPhoneCount property. * * @param value * allowed object is * {@link Integer } * */ public void setClassifiedAdPhoneCount(Integer value) { this.classifiedAdPhoneCount = value; } /** * Gets the value of the classifiedAdContactByAddressEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdContactByAddressEnabled() { return classifiedAdContactByAddressEnabled; } /** * Sets the value of the classifiedAdContactByAddressEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdContactByAddressEnabled(Boolean value) { this.classifiedAdContactByAddressEnabled = value; } /** * Gets the value of the classifiedAdStreetCount property. * * @return * possible object is * {@link Integer } * */ public Integer getClassifiedAdStreetCount() { return classifiedAdStreetCount; } /** * Sets the value of the classifiedAdStreetCount property. * * @param value * allowed object is * {@link Integer } * */ public void setClassifiedAdStreetCount(Integer value) { this.classifiedAdStreetCount = value; } /** * Gets the value of the classifiedAdCompanyNameEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isClassifiedAdCompanyNameEnabled() { return classifiedAdCompanyNameEnabled; } /** * Sets the value of the classifiedAdCompanyNameEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setClassifiedAdCompanyNameEnabled(Boolean value) { this.classifiedAdCompanyNameEnabled = value; } /** * Gets the value of the specialitySubscription property. * * @return * possible object is * {@link GeographicExposureCodeType } * */ public GeographicExposureCodeType getSpecialitySubscription() { return specialitySubscription; } /** * Sets the value of the specialitySubscription property. * * @param value * allowed object is * {@link GeographicExposureCodeType } * */ public void setSpecialitySubscription(GeographicExposureCodeType value) { this.specialitySubscription = value; } /** * Gets the value of the regularSubscription property. * * @return * possible object is * {@link GeographicExposureCodeType } * */ public GeographicExposureCodeType getRegularSubscription() { return regularSubscription; } /** * Sets the value of the regularSubscription property. * * @param value * allowed object is * {@link GeographicExposureCodeType } * */ public void setRegularSubscription(GeographicExposureCodeType value) { this.regularSubscription = value; } /** * Gets the value of the premiumSubscription property. * * @return * possible object is * {@link GeographicExposureCodeType } * */ public GeographicExposureCodeType getPremiumSubscription() { return premiumSubscription; } /** * Sets the value of the premiumSubscription property. * * @param value * allowed object is * {@link GeographicExposureCodeType } * */ public void setPremiumSubscription(GeographicExposureCodeType value) { this.premiumSubscription = value; } /** * Gets the value of the nonSubscription property. * * @return * possible object is * {@link GeographicExposureCodeType } * */ public GeographicExposureCodeType getNonSubscription() { return nonSubscription; } /** * Sets the value of the nonSubscription property. * * @param value * allowed object is * {@link GeographicExposureCodeType } * */ public void setNonSubscription(GeographicExposureCodeType value) { this.nonSubscription = value; } /** * Gets the value of the inEscrowWorkflowTimeline property. * * @return * possible object is * {@link INEscrowWorkflowTimelineCodeType } * */ public INEscrowWorkflowTimelineCodeType getINEscrowWorkflowTimeline() { return inEscrowWorkflowTimeline; } /** * Sets the value of the inEscrowWorkflowTimeline property. * * @param value * allowed object is * {@link INEscrowWorkflowTimelineCodeType } * */ public void setINEscrowWorkflowTimeline(INEscrowWorkflowTimelineCodeType value) { this.inEscrowWorkflowTimeline = value; } /** * Gets the value of the payPalRequiredForStoreOwner property. * * @return * possible object is * {@link Boolean } * */ public Boolean isPayPalRequiredForStoreOwner() { return payPalRequiredForStoreOwner; } /** * Sets the value of the payPalRequiredForStoreOwner property. * * @param value * allowed object is * {@link Boolean } * */ public void setPayPalRequiredForStoreOwner(Boolean value) { this.payPalRequiredForStoreOwner = value; } /** * Gets the value of the reviseQuantityAllowed property. * * @return * possible object is * {@link Boolean } * */ public Boolean isReviseQuantityAllowed() { return reviseQuantityAllowed; } /** * Sets the value of the reviseQuantityAllowed property. * * @param value * allowed object is * {@link Boolean } * */ public void setReviseQuantityAllowed(Boolean value) { this.reviseQuantityAllowed = value; } /** * Gets the value of the revisePriceAllowed property. * * @return * possible object is * {@link Boolean } * */ public Boolean isRevisePriceAllowed() { return revisePriceAllowed; } /** * Sets the value of the revisePriceAllowed property. * * @param value * allowed object is * {@link Boolean } * */ public void setRevisePriceAllowed(Boolean value) { this.revisePriceAllowed = value; } /** * Gets the value of the storeOwnerExtendedListingDurationsEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isStoreOwnerExtendedListingDurationsEnabled() { return storeOwnerExtendedListingDurationsEnabled; } /** * Sets the value of the storeOwnerExtendedListingDurationsEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setStoreOwnerExtendedListingDurationsEnabled(Boolean value) { this.storeOwnerExtendedListingDurationsEnabled = value; } /** * Gets the value of the storeOwnerExtendedListingDurations property. * * @return * possible object is * {@link StoreOwnerExtendedListingDurationsType } * */ public StoreOwnerExtendedListingDurationsType getStoreOwnerExtendedListingDurations() { return storeOwnerExtendedListingDurations; } /** * Sets the value of the storeOwnerExtendedListingDurations property. * * @param value * allowed object is * {@link StoreOwnerExtendedListingDurationsType } * */ public void setStoreOwnerExtendedListingDurations(StoreOwnerExtendedListingDurationsType value) { this.storeOwnerExtendedListingDurations = value; } /** * Gets the value of the returnPolicyEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isReturnPolicyEnabled() { return returnPolicyEnabled; } /** * Sets the value of the returnPolicyEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setReturnPolicyEnabled(Boolean value) { this.returnPolicyEnabled = value; } /** * Gets the value of the handlingTimeEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isHandlingTimeEnabled() { return handlingTimeEnabled; } /** * Sets the value of the handlingTimeEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setHandlingTimeEnabled(Boolean value) { this.handlingTimeEnabled = value; } /** * Gets the value of the maxFlatShippingCost property. * * @return * possible object is * {@link AmountType } * */ public AmountType getMaxFlatShippingCost() { return maxFlatShippingCost; } /** * Sets the value of the maxFlatShippingCost property. * * @param value * allowed object is * {@link AmountType } * */ public void setMaxFlatShippingCost(AmountType value) { this.maxFlatShippingCost = value; } /** * Gets the value of the group1MaxFlatShippingCost property. * * @return * possible object is * {@link AmountType } * */ public AmountType getGroup1MaxFlatShippingCost() { return group1MaxFlatShippingCost; } /** * Sets the value of the group1MaxFlatShippingCost property. * * @param value * allowed object is * {@link AmountType } * */ public void setGroup1MaxFlatShippingCost(AmountType value) { this.group1MaxFlatShippingCost = value; } /** * Gets the value of the group2MaxFlatShippingCost property. * * @return * possible object is * {@link AmountType } * */ public AmountType getGroup2MaxFlatShippingCost() { return group2MaxFlatShippingCost; } /** * Sets the value of the group2MaxFlatShippingCost property. * * @param value * allowed object is * {@link AmountType } * */ public void setGroup2MaxFlatShippingCost(AmountType value) { this.group2MaxFlatShippingCost = value; } /** * Gets the value of the group3MaxFlatShippingCost property. * * @return * possible object is * {@link AmountType } * */ public AmountType getGroup3MaxFlatShippingCost() { return group3MaxFlatShippingCost; } /** * Sets the value of the group3MaxFlatShippingCost property. * * @param value * allowed object is * {@link AmountType } * */ public void setGroup3MaxFlatShippingCost(AmountType value) { this.group3MaxFlatShippingCost = value; } /** * * * @return * array of * {@link BuyerPaymentMethodCodeType } * */ public BuyerPaymentMethodCodeType[] getPaymentMethod() { if (this.paymentMethod == null) { return new BuyerPaymentMethodCodeType[ 0 ] ; } return ((BuyerPaymentMethodCodeType[]) this.paymentMethod.toArray(new BuyerPaymentMethodCodeType[this.paymentMethod.size()] )); } /** * * * @return * one of * {@link BuyerPaymentMethodCodeType } * */ public BuyerPaymentMethodCodeType getPaymentMethod(int idx) { if (this.paymentMethod == null) { throw new IndexOutOfBoundsException(); } return this.paymentMethod.get(idx); } public int getPaymentMethodLength() { if (this.paymentMethod == null) { return 0; } return this.paymentMethod.size(); } /** * * * @param values * allowed objects are * {@link BuyerPaymentMethodCodeType } * */ public void setPaymentMethod(BuyerPaymentMethodCodeType[] values) { this._getPaymentMethod().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.paymentMethod.add(values[i]); } } protected List<BuyerPaymentMethodCodeType> _getPaymentMethod() { if (paymentMethod == null) { paymentMethod = new ArrayList<BuyerPaymentMethodCodeType>(); } return paymentMethod; } /** * * * @param value * allowed object is * {@link BuyerPaymentMethodCodeType } * */ public BuyerPaymentMethodCodeType setPaymentMethod(int idx, BuyerPaymentMethodCodeType value) { return this.paymentMethod.set(idx, value); } /** * Gets the value of the variationsEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isVariationsEnabled() { return variationsEnabled; } /** * Sets the value of the variationsEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setVariationsEnabled(Boolean value) { this.variationsEnabled = value; } /** * Gets the value of the attributeConversionEnabled property. * * @return * possible object is * {@link AttributeConversionEnabledCodeType } * */ public AttributeConversionEnabledCodeType getAttributeConversionEnabled() { return attributeConversionEnabled; } /** * Sets the value of the attributeConversionEnabled property. * * @param value * allowed object is * {@link AttributeConversionEnabledCodeType } * */ public void setAttributeConversionEnabled(AttributeConversionEnabledCodeType value) { this.attributeConversionEnabled = value; } /** * Gets the value of the freeGalleryPlusEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isFreeGalleryPlusEnabled() { return freeGalleryPlusEnabled; } /** * Sets the value of the freeGalleryPlusEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setFreeGalleryPlusEnabled(Boolean value) { this.freeGalleryPlusEnabled = value; } /** * Gets the value of the freePicturePackEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isFreePicturePackEnabled() { return freePicturePackEnabled; } /** * Sets the value of the freePicturePackEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setFreePicturePackEnabled(Boolean value) { this.freePicturePackEnabled = value; } /** * Gets the value of the itemCompatibilityEnabled property. * * @return * possible object is * {@link ItemCompatibilityEnabledCodeType } * */ public ItemCompatibilityEnabledCodeType getItemCompatibilityEnabled() { return itemCompatibilityEnabled; } /** * Sets the value of the itemCompatibilityEnabled property. * * @param value * allowed object is * {@link ItemCompatibilityEnabledCodeType } * */ public void setItemCompatibilityEnabled(ItemCompatibilityEnabledCodeType value) { this.itemCompatibilityEnabled = value; } /** * Gets the value of the minItemCompatibility property. * * @return * possible object is * {@link Integer } * */ public Integer getMinItemCompatibility() { return minItemCompatibility; } /** * Sets the value of the minItemCompatibility property. * * @param value * allowed object is * {@link Integer } * */ public void setMinItemCompatibility(Integer value) { this.minItemCompatibility = value; } /** * Gets the value of the maxItemCompatibility property. * * @return * possible object is * {@link Integer } * */ public Integer getMaxItemCompatibility() { return maxItemCompatibility; } /** * Sets the value of the maxItemCompatibility property. * * @param value * allowed object is * {@link Integer } * */ public void setMaxItemCompatibility(Integer value) { this.maxItemCompatibility = value; } /** * Gets the value of the conditionEnabled property. * * @return * possible object is * {@link ConditionEnabledCodeType } * */ public ConditionEnabledCodeType getConditionEnabled() { return conditionEnabled; } /** * Sets the value of the conditionEnabled property. * * @param value * allowed object is * {@link ConditionEnabledCodeType } * */ public void setConditionEnabled(ConditionEnabledCodeType value) { this.conditionEnabled = value; } /** * Gets the value of the conditionValues property. * * @return * possible object is * {@link ConditionValuesType } * */ public ConditionValuesType getConditionValues() { return conditionValues; } /** * Sets the value of the conditionValues property. * * @param value * allowed object is * {@link ConditionValuesType } * */ public void setConditionValues(ConditionValuesType value) { this.conditionValues = value; } /** * Gets the value of the valueCategory property. * * @return * possible object is * {@link Boolean } * */ public Boolean isValueCategory() { return valueCategory; } /** * Sets the value of the valueCategory property. * * @param value * allowed object is * {@link Boolean } * */ public void setValueCategory(Boolean value) { this.valueCategory = value; } /** * Gets the value of the productCreationEnabled property. * * @return * possible object is * {@link ProductCreationEnabledCodeType } * */ public ProductCreationEnabledCodeType getProductCreationEnabled() { return productCreationEnabled; } /** * Sets the value of the productCreationEnabled property. * * @param value * allowed object is * {@link ProductCreationEnabledCodeType } * */ public void setProductCreationEnabled(ProductCreationEnabledCodeType value) { this.productCreationEnabled = value; } /** * Gets the value of the maxGranularFitmentCount property. * * @return * possible object is * {@link Integer } * */ public Integer getMaxGranularFitmentCount() { return maxGranularFitmentCount; } /** * Sets the value of the maxGranularFitmentCount property. * * @param value * allowed object is * {@link Integer } * */ public void setMaxGranularFitmentCount(Integer value) { this.maxGranularFitmentCount = value; } /** * Gets the value of the compatibleVehicleType property. * * @return * possible object is * {@link String } * */ public String getCompatibleVehicleType() { return compatibleVehicleType; } /** * Sets the value of the compatibleVehicleType property. * * @param value * allowed object is * {@link String } * */ public void setCompatibleVehicleType(String value) { this.compatibleVehicleType = value; } /** * Gets the value of the paymentOptionsGroup property. * * @return * possible object is * {@link PaymentOptionsGroupEnabledCodeType } * */ public PaymentOptionsGroupEnabledCodeType getPaymentOptionsGroup() { return paymentOptionsGroup; } /** * Sets the value of the paymentOptionsGroup property. * * @param value * allowed object is * {@link PaymentOptionsGroupEnabledCodeType } * */ public void setPaymentOptionsGroup(PaymentOptionsGroupEnabledCodeType value) { this.paymentOptionsGroup = value; } /** * Gets the value of the shippingProfileCategoryGroup property. * * @return * possible object is * {@link ProfileCategoryGroupCodeType } * */ public ProfileCategoryGroupCodeType getShippingProfileCategoryGroup() { return shippingProfileCategoryGroup; } /** * Sets the value of the shippingProfileCategoryGroup property. * * @param value * allowed object is * {@link ProfileCategoryGroupCodeType } * */ public void setShippingProfileCategoryGroup(ProfileCategoryGroupCodeType value) { this.shippingProfileCategoryGroup = value; } /** * Gets the value of the paymentProfileCategoryGroup property. * * @return * possible object is * {@link ProfileCategoryGroupCodeType } * */ public ProfileCategoryGroupCodeType getPaymentProfileCategoryGroup() { return paymentProfileCategoryGroup; } /** * Sets the value of the paymentProfileCategoryGroup property. * * @param value * allowed object is * {@link ProfileCategoryGroupCodeType } * */ public void setPaymentProfileCategoryGroup(ProfileCategoryGroupCodeType value) { this.paymentProfileCategoryGroup = value; } /** * Gets the value of the returnPolicyProfileCategoryGroup property. * * @return * possible object is * {@link ProfileCategoryGroupCodeType } * */ public ProfileCategoryGroupCodeType getReturnPolicyProfileCategoryGroup() { return returnPolicyProfileCategoryGroup; } /** * Sets the value of the returnPolicyProfileCategoryGroup property. * * @param value * allowed object is * {@link ProfileCategoryGroupCodeType } * */ public void setReturnPolicyProfileCategoryGroup(ProfileCategoryGroupCodeType value) { this.returnPolicyProfileCategoryGroup = value; } /** * Gets the value of the vinSupported property. * * @return * possible object is * {@link Boolean } * */ public Boolean isVINSupported() { return vinSupported; } /** * Sets the value of the vinSupported property. * * @param value * allowed object is * {@link Boolean } * */ public void setVINSupported(Boolean value) { this.vinSupported = value; } /** * Gets the value of the vrmSupported property. * * @return * possible object is * {@link Boolean } * */ public Boolean isVRMSupported() { return vrmSupported; } /** * Sets the value of the vrmSupported property. * * @param value * allowed object is * {@link Boolean } * */ public void setVRMSupported(Boolean value) { this.vrmSupported = value; } /** * Gets the value of the sellerProvidedTitleSupported property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSellerProvidedTitleSupported() { return sellerProvidedTitleSupported; } /** * Sets the value of the sellerProvidedTitleSupported property. * * @param value * allowed object is * {@link Boolean } * */ public void setSellerProvidedTitleSupported(Boolean value) { this.sellerProvidedTitleSupported = value; } /** * Gets the value of the depositSupported property. * * @return * possible object is * {@link Boolean } * */ public Boolean isDepositSupported() { return depositSupported; } /** * Sets the value of the depositSupported property. * * @param value * allowed object is * {@link Boolean } * */ public void setDepositSupported(Boolean value) { this.depositSupported = value; } /** * Gets the value of the globalShippingEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isGlobalShippingEnabled() { return globalShippingEnabled; } /** * Sets the value of the globalShippingEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setGlobalShippingEnabled(Boolean value) { this.globalShippingEnabled = value; } /** * Gets the value of the additionalCompatibilityEnabled property. * * @return * possible object is * {@link Boolean } * */ public Boolean isAdditionalCompatibilityEnabled() { return additionalCompatibilityEnabled; } /** * Sets the value of the additionalCompatibilityEnabled property. * * @param value * allowed object is * {@link Boolean } * */ public void setAdditionalCompatibilityEnabled(Boolean value) { this.additionalCompatibilityEnabled = value; } /** * * * @return * array of * {@link Element } * {@link Object } * */ public Object[] getAny() { if (this.any == null) { return new Object[ 0 ] ; } return ((Object[]) this.any.toArray(new Object[this.any.size()] )); } /** * * * @return * one of * {@link Element } * {@link Object } * */ public Object getAny(int idx) { if (this.any == null) { throw new IndexOutOfBoundsException(); } return this.any.get(idx); } public int getAnyLength() { if (this.any == null) { return 0; } return this.any.size(); } /** * * * @param values * allowed objects are * {@link Element } * {@link Object } * */ public void setAny(Object[] values) { this._getAny().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.any.add(values[i]); } } protected List<Object> _getAny() { if (any == null) { any = new ArrayList<Object>(); } return any; } /** * * * @param value * allowed object is * {@link Element } * {@link Object } * */ public Object setAny(int idx, Object value) { return this.any.set(idx, value); } }
[ "mamtha@mamtha-Dell.(none)" ]
mamtha@mamtha-Dell.(none)
026d4328bf33a9f24a91ecded71f4996906f00c4
fdb99db45d13b5078f03f814700f72e3a2fc9aa0
/app/src/main/java/com/teach/news10/adapter/TestAdapter.java
a782acfc7446c81128da9c24ed377f0107ec9efd
[]
no_license
andongn1-byte/kuangjia
fd5944018855c51622b27568d5afc0acc651b499
d82cc7c0e0d07d9d4c2de604a754e63c41c7d5d9
refs/heads/master
2022-12-08T13:39:12.182966
2020-08-31T07:24:03
2020-08-31T07:24:03
291,638,797
0
0
null
null
null
null
UTF-8
Java
false
false
2,189
java
package com.teach.news10.adapter; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.teach.news10.R; import com.teach.news10.bean.LevelAndRoundInfo; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; public class TestAdapter extends RecyclerView.Adapter<TestAdapter.ViewHolder> { List<LevelAndRoundInfo.ContentBeanX.RoundsBean.ContentBean.DataBean> mList; Context mContext; public TestAdapter(List<LevelAndRoundInfo.ContentBeanX.RoundsBean.ContentBean.DataBean> pList, Context pContext) { mList = pList; mContext = pContext; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.test_adapter_layout, parent, false)); } @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { if (mList == null) return; LevelAndRoundInfo.ContentBeanX.RoundsBean.ContentBean.DataBean dataBean = mList.get(position); Glide.with(mContext).load(dataBean.getTeam_A_logo()).into(holder.leftImage); Glide.with(mContext).load(dataBean.getTeam_B_logo()).into(holder.rightImage); holder.leftText.setText(dataBean.getTeam_A_name()); holder.rightText.setText(dataBean.getTeam_B_name()); } @Override public int getItemCount() { return mList != null ? mList.size() : 0; } public class ViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.left_image) ImageView leftImage; @BindView(R.id.left_text) TextView leftText; @BindView(R.id.right_image) ImageView rightImage; @BindView(R.id.right_text) TextView rightText; public ViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); } } }
e7c392e4e78aebfa1e6fe94c256b19760604ecca
e1529b1835f6135e76fd7ff4bc4045e9b2ef1460
/src/TestScript1.java
e73e852455fa33de9d7df62c3093387c3aa55ab1
[]
no_license
SmijaNair/to-be-loaded_git
5b412ec5b75bb07b4e0d4c109f76bbc78ee0348f
1817163f4a9b6b972f13f81c52f50455149a0bd6
refs/heads/master
2020-07-23T09:42:06.736454
2019-09-10T10:02:09
2019-09-10T10:02:09
207,516,840
0
0
null
null
null
null
UTF-8
Java
false
false
238
java
public class TestScript1 { public static void main(String[] args) { System.out.println("Test 1"); System.out.println("now added one more line"); System.out.println("third line"); System.out.println("from project architecture"); } }
ecb677d7703ca171e25250d02542b71216654312
1a9108b7b9cb2a83452788b9f0a4483700f8689b
/src/com/github/battleships/Area.java
794ac70d8f0592411622af7a488e494b1aff8068
[]
no_license
4KevR/Battleships
be0a5de6e56b9867b3f243dc3b30948f51684fd5
8a6bd67d5a2b4e62deb88308ab77c402b34156be
refs/heads/master
2022-11-19T20:41:15.766295
2020-07-18T12:36:46
2020-07-18T12:36:46
241,362,615
1
0
null
null
null
null
UTF-8
Java
false
false
2,644
java
package com.github.battleships; import java.util.Random; public class Area { private final char[][] area = new char[10][10]; public Area () { this.initArea(); } public void initArea () { for (int i = 0; i < this.area.length; i++) { for (int j = 0; j < this.area.length; j++) { this.area[i][j] = '~'; } } } public void placeShip (int [] coordinates){ this.area[coordinates[1]][coordinates[0]] = '#'; } public char giveField (int [] coordinates){ return this.area[coordinates[1]][coordinates[0]]; } public void setField (int [] coordinates, char character){ this.area[coordinates[1]][coordinates[0]] = character; } public int [] getFieldWithChar (char character) { int set = 0; int [] field = new int[2]; while (set == 0) { field[0] = new Random().nextInt(10); field[1] = new Random().nextInt(10); if (this.giveField(field) == character) { set = 1; } } return field; } public int nearbyFieldsContainCharacter (int [] coordinates, String characters) { int [][] fields = {{coordinates[0]+1, coordinates[1]}, {coordinates[0]-1, coordinates[1]}, {coordinates[0], coordinates[1]+1}, {coordinates[0], coordinates[1]-1}}; for (int counter = 0; counter < 4; counter++) { if (fields[counter][0] >= 0 && fields[counter][0] <= 9 && fields[counter][1] >= 0 && fields[counter][1] <= 9) { if (characters.indexOf(this.giveField(fields[counter])) != -1) { return counter+1; } } } return 0; } public void applyNumberPos (int [] coordinates, int number) { if (number == 1) { coordinates[0] = coordinates[0]+1; } else if (number == 2) { coordinates[0] = coordinates[0]-1; } else if (number == 3) { coordinates[1] = coordinates[1]+1; } else { coordinates[1] = coordinates[1]-1; } } public void showArea () { System.out.println(" 1 2 3 4 5 6 7 8 9 10"); for (int i=0;i<this.area.length;i++) { int asciiNumber = 65+i; char asciiChar = (char)asciiNumber; System.out.print(asciiChar); System.out.print(" "); for (int j=0;j<this.area.length;j++) { System.out.print(this.area[i][j]); System.out.print(" "); } System.out.println(); } } }
04ee22136d60052880b88f3ed54c9dd9b18d7868
b5e0efc45d5502177268483397a031475b672bd5
/s4e-backend/src/test/java/pl/cyfronet/s4e/controller/AuthControllerTest.java
2f7a459684df92ad9ab97732be1690fcd62785a6
[ "Apache-2.0" ]
permissive
cyfronet-fid/sat4envi
8f9a08a924362e751c2cf5f5a06f97ffd8988620
02908e9d457a4f1f4f6356760268142e178b4554
refs/heads/master
2022-08-21T11:25:50.424798
2022-07-06T12:48:02
2022-07-08T08:41:59
149,281,301
2
2
Apache-2.0
2022-07-08T08:42:00
2018-09-18T12:01:10
Java
UTF-8
Java
false
false
11,737
java
/* * Copyright 2020 ACC Cyfronet AGH * * 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 pl.cyfronet.s4e.controller; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.val; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.http.MediaType; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultMatcher; import pl.cyfronet.s4e.BasicTest; import pl.cyfronet.s4e.TestDbHelper; import pl.cyfronet.s4e.bean.AppUser; import pl.cyfronet.s4e.controller.request.LoginRequest; import pl.cyfronet.s4e.data.repository.AppUserRepository; import pl.cyfronet.s4e.security.SecurityConstants; import static org.hamcrest.Matchers.*; import static org.springframework.test.web.servlet.ResultMatcher.matchAll; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; import static pl.cyfronet.s4e.Constants.API_PREFIX_V1; @AutoConfigureMockMvc @BasicTest class AuthControllerTest { /// Constant in all our tokens. private static final String JWT_ALG_PREFIX = "eyJhbGciOiJSUzI1NiJ9"; private static final String TOKEN_COOKIE = SecurityConstants.COOKIE_NAME; private static final String TEST_HOST = "test-host:1234"; private static final String TEST_HOST_DOMAIN = "test-host"; @Autowired private AppUserRepository appUserRepository; @Autowired private PasswordEncoder passwordEncoder; @Autowired private ObjectMapper objectMapper; @Autowired private TestDbHelper testDbHelper; @Autowired private MockMvc mockMvc; @BeforeEach public void beforeEach() { testDbHelper.clean(); } @Test public void tokenShouldReturnJWS() throws Exception { val appUser = appUserRepository.save(appUser(true)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/token") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isOk()) .andExpect(jsonPath("email", is(equalTo("[email protected]")))) .andExpect(jsonPath("token", startsWith(JWT_ALG_PREFIX))); } @Test public void tokenShouldReturn403ForDisabledAccount() throws Exception { val appUser = appUserRepository.save(appUser(false)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/token") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isForbidden()); } @Test public void tokenShouldReturn401ForIncorrectCredentials() throws Exception { val appUser = appUserRepository.save(appUser(true)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("incorrectPassword") .build(); mockMvc.perform(post(API_PREFIX_V1+"/token") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isUnauthorized()); } @Test public void tokenShouldReturn401ForNonexistentAccount() throws Exception { val loginRequest = LoginRequest.builder() .email("[email protected]") .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/token") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isUnauthorized()); } @Test public void loginShouldSetCookie() throws Exception { val appUser = appUserRepository.save(appUser(true)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/login") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isOk()) .andExpect(content().string(is(emptyOrNullString()))) .andExpect(setsCookie(TEST_HOST_DOMAIN)); } @Test public void loginShouldSetCookieWithXForwardedHost() throws Exception { val appUser = appUserRepository.save(appUser(true)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/login") .header("Host", TEST_HOST) .header("X-Forwarded-Host", "original-host") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isOk()) .andExpect(content().string(is(emptyOrNullString()))) .andExpect(setsCookie("original-host")); } @Test public void loginShouldReturn403ForDisabledAccount() throws Exception { val appUser = appUserRepository.save(appUser(false)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/login") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isForbidden()); } @Test public void loginShouldReturn401ForIncorrectCredentials() throws Exception { val appUser = appUserRepository.save(appUser(true)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("incorrectPassword") .build(); mockMvc.perform(post(API_PREFIX_V1+"/login") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isUnauthorized()); } @Test public void loginShouldReturn401ForNonexistentAccount() throws Exception { val loginRequest = LoginRequest.builder() .email("[email protected]") .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/login") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isUnauthorized()); } @Test public void logoutShouldResetCookie() throws Exception { mockMvc.perform(post(API_PREFIX_V1+"/logout") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string(is(emptyOrNullString()))) .andExpect(unsetsCookie(TEST_HOST_DOMAIN)); } @Test public void logoutShouldResetCookieWithXForwardedHost() throws Exception { mockMvc.perform(post(API_PREFIX_V1+"/logout") .header("Host", TEST_HOST) .header("X-Forwarded-Host", "original-host") .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string(is(emptyOrNullString()))) .andExpect(unsetsCookie("original-host")); } @Nested @TestPropertySource(properties = { "jwt.cookie.domain=other-domain" }) class WithCookieDomainProperty { // For some reason, the set property isn't propagated to the mockMvc from an enclosing class, // but works when it's moved here. @Autowired private MockMvc mockMvc; @Test public void loginShouldSetCookie() throws Exception { val appUser = appUserRepository.save(appUser(true)); val loginRequest = LoginRequest.builder() .email(appUser.getEmail()) .password("password") .build(); mockMvc.perform(post(API_PREFIX_V1+"/login") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsBytes(loginRequest))) .andExpect(status().isOk()) .andExpect(content().string(is(emptyOrNullString()))) .andExpect(setsCookie("other-domain")); } @Test public void logoutShouldResetCookie() throws Exception { mockMvc.perform(post(API_PREFIX_V1+"/logout") .header("Host", TEST_HOST) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string(is(emptyOrNullString()))) .andExpect(unsetsCookie("other-domain")); } } private ResultMatcher setsCookie(String expectedDomain) { return matchAll( cookie().value(TOKEN_COOKIE, startsWith(JWT_ALG_PREFIX)), cookie().httpOnly(TOKEN_COOKIE, true), cookie().path(TOKEN_COOKIE, "/"), cookie().secure(TOKEN_COOKIE, true), cookie().maxAge(TOKEN_COOKIE, greaterThan(0)), cookie().domain(TOKEN_COOKIE, expectedDomain) ); } private ResultMatcher unsetsCookie(String expectedDomain) { return matchAll( cookie().value(TOKEN_COOKIE, is(emptyOrNullString())), cookie().httpOnly(TOKEN_COOKIE, true), cookie().path(TOKEN_COOKIE, "/"), cookie().secure(TOKEN_COOKIE, true), cookie().maxAge(TOKEN_COOKIE, 0), // resets cookie cookie().domain(TOKEN_COOKIE, expectedDomain) ); } private AppUser appUser(boolean enabled) { return AppUser.builder() .email("[email protected]") .name("Name") .surname("Surname") .password(passwordEncoder.encode("password")) .enabled(enabled) .build(); } }
d2cc567d507cfb317f73c28630b7859b3bbd7b0e
77d863a334936f38f0934dbadc843d7acd587cc1
/RO17/src/main/java/adt/bst/BSTImpl.java
b6e4fb0c7eb674dc7576768f02a640df3e6f8d37
[]
no_license
ja1felipe/LEDA
7d454e9cfa540648c2d0279e8bacdf2c0e18265f
f2d4859c9371c7cc3b38a132fcd32975b81a6271
refs/heads/master
2020-05-03T04:11:45.287088
2019-06-11T22:51:41
2019-06-11T22:51:41
178,415,032
0
0
null
null
null
null
UTF-8
Java
false
false
6,766
java
package adt.bst; import java.util.ArrayList; import adt.bt.BTNode; public class BSTImpl<T extends Comparable<T>> implements BST<T> { protected BSTNode<T> root; public BSTImpl() { root = new BSTNode<>(); } public BSTNode<T> getRoot() { return this.root; } @Override public boolean isEmpty() { return this.root.isEmpty(); } @Override public int height() { return height(this.root); } protected int height(BSTNode<T> node) { int height = -1; if (!node.isEmpty()) { int heightLeft = height((BSTNode<T>) node.getLeft()); int heightRight = height((BSTNode<T>) node.getRight()); height = 1 + Math.max(heightLeft, heightRight); } return height; } @Override public BSTNode<T> search(T element) { return search(root, element); } protected BSTNode<T> search(BTNode<T> node, T element) { if (node.isEmpty()) { return (BSTNode<T>) node; } else if (node.getData().equals(element)) { return (BSTNode<T>) node; } else { if (element.compareTo(node.getData()) <= 0) { return search(node.getLeft(), element); } else { return search(node.getRight(), element); } } } @Override public void insert(T element) { insert(element,root); } protected void insert(T element, BTNode<T> node) { if (node.isEmpty()) { node.setData(element); node.setLeft(new BSTNode<T>()); node.setRight(new BSTNode<T>()); node.getLeft().setParent((BTNode<T>) node); node.getRight().setParent((BTNode<T>) node); } else { if (element.compareTo(node.getData()) < 0) { insert(element,node.getLeft()); } else { insert(element, node.getRight()); } } } @Override public BSTNode<T> maximum() { return maximum(root); } private BSTNode<T> maximum(BTNode<T> node) { if (node.isEmpty()) { return null; } else if (node.getRight().isEmpty()) { return (BSTNode<T>) node; } else { return maximum(node.getRight()); } } @Override public BSTNode<T> minimum() { return minimum(root); } private BSTNode<T> minimum(BTNode<T> node) { if (node.isEmpty()) { return null; } else if (node.getLeft().isEmpty()) { return (BSTNode<T>) node; } else { return minimum(node.getLeft()); } } @Override public BSTNode<T> sucessor(T element) { return (BSTNode<T>) sucessor(root, element); } private BTNode<T> sucessor(BTNode<T> no, T element) { BTNode<T> result = null; BTNode<T> auxNode = search(element); if (auxNode.isEmpty()) { return null; } if (!auxNode.getRight().isEmpty()) { result = minimum(auxNode.getRight()); } else { result = auxNode.getParent(); while (result != null && auxNode.equals(result.getRight())) { auxNode = result; result = result.getParent(); } } return result; } @Override public BSTNode<T> predecessor(T element) { return (BSTNode<T>) predecessor(root, element); } private BTNode<T> predecessor(BTNode<T> no, T element) { BTNode<T> result = null; BTNode<T> auxNode = search(element); if (auxNode.isEmpty()) { return null; } if (!auxNode.getLeft().isEmpty()) { result = maximum(auxNode.getLeft()); } else { result = auxNode.getParent(); while (result != null && auxNode.equals(result.getLeft())) { auxNode = result; result = result.getParent(); } } return result; } @Override public void remove(T element) { BSTNode<T> no = search(element); if(!no.isEmpty()) remove(no); } private void remove(BSTNode<T> node) { if (node.getRight().isEmpty() && node.getLeft().isEmpty()) { node.setData(null); } else if (node.getRight().isEmpty() || node.getLeft().isEmpty()) { if (node.equals(root)) { if (!node.getRight().isEmpty()) { root = (BSTNode<T>) node.getRight(); } else { root = (BSTNode<T>) node.getLeft(); } root.setParent(new BSTNode<T>()); } else { if (node.equals(node.getParent().getLeft())) { if (!node.getRight().isEmpty()) { node.getParent().setLeft(node.getRight()); node.getRight().setParent(node.getParent()); } else { node.getParent().setLeft(node.getLeft()); node.getLeft().setParent(node.getParent()); } } else { if (!node.getRight().isEmpty()) { node.getParent().setRight(node.getRight()); node.getRight().setParent(node.getParent()); } else { node.getParent().setRight(node.getLeft()); node.getLeft().setParent(node.getParent()); } } } }else{ BSTNode<T>sucessor = sucessor(node.getData()); T elementoSucessor = sucessor.getData(); remove(sucessor); node.setData(elementoSucessor); } } @Override public T[] preOrder() { ArrayList<T> list = new ArrayList<T>(); preOrder(this.root, list); T[] array = (T[]) new Comparable[size()]; return list.toArray(array); } public void preOrder(BSTNode<T> no, ArrayList<T> array) { if (!no.isEmpty()) { array.add(no.getData()); preOrder((BSTNode<T>) no.getLeft(), array); preOrder((BSTNode<T>) no.getRight(), array); } } @Override public T[] order() { ArrayList<T> list = new ArrayList<T>(); order(this.root, list); T[] array = (T[]) new Comparable[size()]; return list.toArray(array); } private void order(BSTNode<T> no, ArrayList<T> array) { if (!no.isEmpty()) { order((BSTNode<T>) no.getLeft(), array); array.add(no.getData()); order((BSTNode<T>) no.getRight(), array); } } @Override public T[] postOrder() { ArrayList<T> list = new ArrayList<T>(); postOrder(this.root, list); T[] array = (T[]) new Comparable[size()]; return list.toArray(array); } private void postOrder(BSTNode<T> no, ArrayList<T> array) { if (!no.isEmpty()) { postOrder((BSTNode<T>) no.getLeft(), array); postOrder((BSTNode<T>) no.getRight(), array); array.add(no.getData()); } } /** * This method is already implemented using recursion. You must understand how it work and * use similar idea with the other methods. */ @Override public int size() { return size(root); } private int size(BSTNode<T> node){ int result = 0; //base case means doing nothing (return 0) if(!node.isEmpty()){ //indusctive case result = 1 + size((BSTNode<T>)node.getLeft()) + size((BSTNode<T>)node.getRight()); } return result; } public boolean isLeftChild(BSTNode<T> node) { return node.getParent() != null && !node.getParent().isEmpty() && !node.getParent().getLeft().isEmpty() && node.getParent().getLeft().getData().equals(node.getData()); } public boolean isBiggerThan(BSTNode<T> node, T element) { return !node.isEmpty() && element != null && node.getData().compareTo(element) > 0; } public boolean isSmallerThan(BSTNode<T> node, T element) { return !node.isEmpty() && element != null && node.getData().compareTo(element) < 0; } }
53541d2a95c1e510b9be4ed017fc36efe6146490
1fedcc071a503d91f571daf5ff99c4e270b350a4
/app/src/main/java/com/fangsf/gankio/di/component/VideoComponent.java
c5b81c6b0a780b40ddaabfe695e61b3103345e91
[ "Apache-2.0" ]
permissive
midFang/Gank.io
0c3252ae4e0528b86d28c2bb86ff4ef44896f115
82a788b05a4a8fd54033c5e91a75e44583cb7894
refs/heads/master
2022-02-27T20:38:42.749995
2019-10-20T09:55:43
2019-10-20T09:55:43
111,272,804
4
0
null
null
null
null
UTF-8
Java
false
false
512
java
package com.fangsf.gankio.di.component; import com.fangsf.gankio.di.FragmentScope; import com.fangsf.gankio.di.module.HttpModule; import com.fangsf.gankio.di.module.VideoModule; import com.fangsf.gankio.ui.fragment.hometab.VideoFragment; import dagger.Component; import dagger.Module; /** * Created by fangsf on 2018/3/11. * Useful: */ @FragmentScope @Component(modules = VideoModule.class, dependencies = AppComponent.class) public interface VideoComponent { void inject(VideoFragment fragment); }
01237b73fb82120001aa4b1ecf7553e9512f4bac
ac6eb25990d5e101ac7a6a20390a2372728807fa
/src/com/cm55/kanhira/OkuriganaTable.java
cb6a89c699c816fe65e97b8b980f668a2b9740de
[]
no_license
FlySkyBear/kanhira
b8b3509f06729229b8db47d3a2d87efdc41580b6
0bb8899cecb3d8b4a2056c3eced5d6eeec5af673
refs/heads/master
2020-05-03T01:55:54.947044
2019-03-29T07:39:43
2019-03-29T07:39:43
178,353,381
0
0
null
null
null
null
UTF-8
Java
false
false
2,519
java
package com.cm55.kanhira; import java.util.*; /** * あるひらがな文字が漢字の送り仮名として適当かどうかをチェックするためのテーブル。 * 例えば、「悪く」の「く」という送り仮名が適当かどうかは、「悪」という熟語の送り仮名イニシャルとして「k」が * あるかないかで決まる。 * @author admin */ public class OkuriganaTable { /** * チェック対象の文字が送り仮名として適当であるかを調べる。 * @param okurigana 送り仮名マーク * @param target チェック対称の文字 * @return true:適当、false:不適当 */ public static boolean check(char okurigana, char target) { // 送り仮名マークの対象とするひらがなリストを取得する。 char[]targetChars = map.get(okurigana); if (targetChars == null) return false; // チェック、対象ひらがなは昇順なのでバイナリサーチ return Arrays.binarySearch(targetChars, target) >= 0; } /** 送り仮名イニシャルと、それに対してゆるされるひらがな */ static final Object[] TABLE = { 'a', "ぁあぃいぅうぇえぉおっ", 'b', "っばびぶべぼ", 'c', "ちっ", 'd', "だぢっづでど", 'e', "ぁあぃいぅうぇえぉおっゎわゐゑ", 'f', "っふ", 'g', "がぎぐげごっ", 'h', "っはひふへほ", 'i', "ぁあぃいぅうぇえぉおっゎわゐゑ", 'j', "ざじずぜぞっ", 'k', "かきくけこっヵヶ", 'l', "らりるれろ", 'm', "まみむめも", 'n', "なにぬねのん", 'o', "ぁあぃいぅうぇえぉおっゎわゐゑ", 'p', "っぱぴぷぺぽ", 'r', "らりるれろ", 's', "さしすせそっ", 't', "たちっつてと", 'u', "ぁあぃいぅうぇえぉおっゎわゐゑ", 'w', "ぁあぃいぅうぇえぉおっゎわゐゑを", 'y', "ゃやゅゆょよ", 'z', "ざじずぜぞっ", }; /** 送り仮名イニシャル・許可ひらがなマップ。ひらがな配列は昇順に並ぶ */ private static final Map<Character, char[]> map = new HashMap<>(); static { for (int i = 0; i < TABLE.length; i += 2) { char initial = (Character)TABLE[i + 0]; String targets = (String)TABLE[i + 1]; char[]targetChars = targets.toCharArray(); Arrays.sort(targetChars); map.put(initial, targetChars); } } }
7ffcc2cc8680a68d66a58ba9922972bdd4535e6c
9f7e5da0e402587fd18ad7bbc100800396446c6d
/src/base/SuperNovice.java
62021d837df55049ce936553f86b0ff90f3d1796
[]
no_license
nasroon/Assignment-RO
39cd2e777c0fd46905399e169f2a236a97ee8f94
c1770248a4d3eaba57c313203b3a337f5e9118f1
refs/heads/master
2020-05-17T05:24:38.598839
2019-04-26T01:30:27
2019-04-26T01:30:27
183,534,762
0
0
null
null
null
null
UTF-8
Java
false
false
316
java
package base; public class SuperNovice extends Novice { public SuperNovice(String name, String gender) { super(name, gender); setJob("Super Novice",this.damagePoint+10); } public String getJob() { return job; } public int getDamage(){return damagePoint;} }
924de3b9a479d8cd86fcb8bbf842761338c8e59f
cf93912c617c5de392ac6b0583e47f4f23496a65
/app/src/main/java/mx/edu/ittepic/a46animacionframeanimations/MainActivity.java
fa62297bf8e4ddc63027051a9bc63901a361c83d
[]
no_license
SoftZenith/46AnimacionFrameAnimations
bba1de57012515a6e140aa33e12be4eb47f97d32
b19d0b6cbf3994520bc520349e356676fa656162
refs/heads/master
2020-03-17T04:37:43.211275
2018-05-13T23:36:36
2018-05-13T23:36:36
133,282,725
0
0
null
null
null
null
UTF-8
Java
false
false
1,197
java
package mx.edu.ittepic.a46animacionframeanimations; import android.graphics.drawable.AnimationDrawable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { private ImageView imageView; private AnimationDrawable horseAnimation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageView = (ImageView) findViewById(R.id.animation); if (imageView == null) throw new AssertionError(); imageView.setVisibility(View.INVISIBLE); imageView.setBackgroundResource(R.drawable.horseanimation); horseAnimation = (AnimationDrawable) imageView.getBackground(); horseAnimation.setOneShot(true); } public void onStartBtnClick(View v) { imageView.setVisibility(View.VISIBLE); if (horseAnimation.isRunning()) { horseAnimation.stop(); } horseAnimation.start(); } public void onStopBtnClick(View v) { horseAnimation.stop(); } }
57f2aee72195b164e004e663194ec03c609c0c56
9e35f63e0e24796726ac9ad6404f81597c06bcc4
/src/main/java/br/com/sigi/controller/PlanoFinanceiroManagedBean.java
d8f63bffffd1d843c303d75f37b5d0e69ff424ad
[]
no_license
ramon-diego/sigi
efebcf0046cf9aa8e8c9e5d2f31a0df9d6870a9c
b59b0e75a07681603c8bda7ba43ce41ecec1aa3d
refs/heads/master
2021-01-21T04:50:47.293101
2016-07-11T03:56:36
2016-07-11T03:56:36
51,704,159
0
0
null
null
null
null
UTF-8
Java
false
false
2,078
java
package br.com.sigi.controller; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.RequestScoped; import br.com.sigi.model.PlanoFinanceiro; import br.com.sigi.services.PlanoFinanceiroService; @RequestScoped @ManagedBean(name = "planoFinanceiroBean") public class PlanoFinanceiroManagedBean implements Serializable { private static final long serialVersionUID = -7244080784034046663L; private PlanoFinanceiro planoFinanceiro; private List<PlanoFinanceiro> planosReceita; private List<PlanoFinanceiro> planosDespesa; @ManagedProperty("#{planoFinanceiroService}") PlanoFinanceiroService planoFinanceiroService; @PostConstruct public void init() { planoFinanceiro = new PlanoFinanceiro(); planosDespesa = new ArrayList<>(); planosDespesa = new ArrayList<>(); carregarPlanos(); } public void setPlanoFinanceiroService(PlanoFinanceiroService planoFinanceiroService) { this.planoFinanceiroService = planoFinanceiroService; } public void setPlanoFinanceiro(PlanoFinanceiro planoFinanceiro) { this.planoFinanceiro = planoFinanceiro; } public PlanoFinanceiro getPlanoFinanceiro() { return planoFinanceiro; } public void setPlanosReceita(List<PlanoFinanceiro> planosReceita) { this.planosReceita = planosReceita; } public List<PlanoFinanceiro> getPlanosReceita() { return planosReceita; } public void setPlanosDespesa(List<PlanoFinanceiro> planosDespesa) { this.planosDespesa = planosDespesa; } public List<PlanoFinanceiro> getPlanosDespesa() { return planosDespesa; } public void salvar() { planoFinanceiroService.save(planoFinanceiro); carregarPlanos(); } public void delete(PlanoFinanceiro planoFinanceiro) { planoFinanceiroService.delete(planoFinanceiro); carregarPlanos(); } public void carregarPlanos() { planosDespesa = planoFinanceiroService.buscarPlanoDespesa(); planosReceita = planoFinanceiroService.buscarPlanoReceita(); } }
d1bf7840cb651d1fb0745100e6e8f41a0ce9e6cb
539ba246d56f0e624104b0b8a6691808bffd552c
/pac4/client/src/main/java/ss3/gui/StockPiezas.java
29014cca3fa845929e29466d3c778e08feec3f8e
[]
no_license
esaugm/TDP_Grup6
a09026cb2490b6b3724ef3a62984770aa9af2d58
5e09035a3f93b43f0b8288d9eef4f26bdf9988b3
refs/heads/master
2020-07-24T19:35:07.581920
2013-05-26T21:35:45
2013-05-26T21:35:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,400
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ss3.gui; import common.rmi.Client; import java.rmi.RemoteException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableModel; import ss1.dao.exception.ExceptionErrorDataBase; import ss1.entity.Taller; import ss1.entity.Usuari; import ss1.entity.UsuariConectat; import ss1.entity.exception.ExceptionNoReparacionesAsignadas; import ss1.gui.LoginDialog; import ss2.entity.Solicitud; import ss2.entity.StockPeca; import ss2.exception.AppException; import ss3.beans.Pedido; import ss3.beans.Pieza; import ss3.beans.Reparacion; import ss3.beans.Vehiculo; /** * * @author Fernando */ public class StockPiezas extends javax.swing.JPanel { LoginDialog loginDialog; public Client cliente; JTable jTable1; JScrollPane scrollPane; JTable jTable2; JScrollPane scrollPane2; JFrame topFrame; UsuariConectat uC; /** * Creates new form StockPiezas */ public StockPiezas(Client cli, UsuariConectat uC) throws ExceptionErrorDataBase, RemoteException { cliente = cli; initComponents(); jTable1 = crearTabla(); scrollPane = new JScrollPane(); scrollPane.setBounds(20, 130, 725, 100); add(scrollPane); scrollPane.setViewportView(jTable1); jTable2 = crearTabla2(); scrollPane2 = new JScrollPane(); scrollPane2.setBounds(20, 320, 665, 90); add(scrollPane2); scrollPane2.setViewportView(jTable2); topFrame = (JFrame) SwingUtilities.getWindowAncestor(this); rellenaTabla(cliente.consultaStockPiezas(uC.getTaller())); } public void rellenaTabla(ArrayList<StockPeca> stoPeca) throws ExceptionErrorDataBase { jButton3.setEnabled(false); try { DefaultTableModel tableModel = (DefaultTableModel) jTable1.getModel(); int rowCount = tableModel.getRowCount(); Iterator itRep = stoPeca.iterator(); int i=0; Pieza p1; StockPeca sp1; while (itRep.hasNext()){ sp1 = (StockPeca) itRep.next(); p1 = cliente.ConsultaCodigo(sp1.getCodipeca()); if(i==rowCount-1) tableModel.addRow(new Object[]{}); tableModel.setValueAt(p1.getCodiPieza(),i, 0); tableModel.setValueAt(p1.getMarca(),i,1); tableModel.setValueAt(p1.getModelo(),i,2); tableModel.setValueAt(sp1.getStockminim(),i,3); tableModel.setValueAt(sp1.getStock(),i,4); tableModel.setValueAt(p1.getPvd(),i,5); tableModel.setValueAt(p1.getDescripcion(),i,6); i++; } for (int rowIdx=i;rowIdx<rowCount ;rowIdx++){ tableModel.setValueAt("",rowIdx,0); tableModel.setValueAt("",rowIdx,1); tableModel.setValueAt("",rowIdx,2); tableModel.setValueAt("",rowIdx,3); tableModel.setValueAt("",rowIdx,4); tableModel.setValueAt("",rowIdx,5); tableModel.setValueAt("",rowIdx,6); } jTable1 = createTabla(tableModel); scrollPane.setViewportView(jTable1); DefaultTableModel tableModel2 = (DefaultTableModel) jTable2.getModel(); int rowCount2 = tableModel2.getRowCount(); int j=0; for (int rowIdy=j;rowIdy<rowCount2 ;rowIdy++){ tableModel2.setValueAt("",rowIdy,0); tableModel2.setValueAt("",rowIdy,1); tableModel2.setValueAt("",rowIdy,2); tableModel2.setValueAt("",rowIdy,3); tableModel2.setValueAt("",rowIdy,4); tableModel2.setValueAt("",rowIdy,5); tableModel2.setValueAt("",rowIdy,6); } jTable2 = createTabla2(tableModel2); scrollPane2.setViewportView(jTable2); } catch (RemoteException e1) { e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } private JTable crearTabla() { DefaultTableModel tableModel = (new DefaultTableModel( new Object[][] { {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, }, new String[] {"Codigo","Marca","Modelo", "Stock Min.","Stock","Precio","Descripción"} ){ Class[] columnTypes = new Class[] { Integer.class, String.class, String.class, Integer.class, Integer.class, Integer.class, String.class }; public Class getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } }); return createTabla(tableModel); } private JTable createTabla(DefaultTableModel tableModel) { JTable table = new JTable(); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setCellSelectionEnabled(false); table.setColumnSelectionAllowed(false); table.setModel(tableModel); table.setRowSelectionAllowed(true); table.getColumnModel().getColumn(0).setResizable(false); table.getColumnModel().getColumn(0).setPreferredWidth(75); table.getColumnModel().getColumn(0).setMinWidth(75); table.getColumnModel().getColumn(0).setMaxWidth(75); table.getColumnModel().getColumn(1).setResizable(false); table.getColumnModel().getColumn(1).setPreferredWidth(100); table.getColumnModel().getColumn(1).setMinWidth(100); table.getColumnModel().getColumn(1).setMaxWidth(100); table.getColumnModel().getColumn(2).setPreferredWidth(80); table.getColumnModel().getColumn(2).setMinWidth(80); table.getColumnModel().getColumn(2).setMaxWidth(80); table.getColumnModel().getColumn(3).setPreferredWidth(80); table.getColumnModel().getColumn(3).setMinWidth(80); table.getColumnModel().getColumn(3).setMaxWidth(80); table.getColumnModel().getColumn(4).setPreferredWidth(80); table.getColumnModel().getColumn(4).setMinWidth(80); table.getColumnModel().getColumn(4).setMaxWidth(80); table.getColumnModel().getColumn(5).setPreferredWidth(80); table.getColumnModel().getColumn(5).setMinWidth(80); table.getColumnModel().getColumn(5).setMaxWidth(80); table.getColumnModel().getColumn(6).setPreferredWidth(230); table.getColumnModel().getColumn(6).setMinWidth(230); table.getColumnModel().getColumn(6).setMaxWidth(230); table.setBounds(20, 130, 725, 100); return table; } private JTable crearTabla2() { DefaultTableModel tableModel = (new DefaultTableModel( new Object[][] { {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, }, new String[] {"Codigo","Marca","Modelo", "Unidades","Precio","PRecio Total","Descripción"} ){ Class[] columnTypes = new Class[] { Integer.class, String.class, String.class, Integer.class, Integer.class, Integer.class, String.class }; public Class getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } }); return createTabla(tableModel); } private JTable createTabla2(DefaultTableModel tableModel) { JTable table = new JTable(); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setCellSelectionEnabled(false); table.setColumnSelectionAllowed(false); table.setModel(tableModel); table.setRowSelectionAllowed(true); table.getColumnModel().getColumn(0).setResizable(false); table.getColumnModel().getColumn(0).setPreferredWidth(75); table.getColumnModel().getColumn(0).setMinWidth(75); table.getColumnModel().getColumn(0).setMaxWidth(75); table.getColumnModel().getColumn(1).setResizable(false); table.getColumnModel().getColumn(1).setPreferredWidth(100); table.getColumnModel().getColumn(1).setMinWidth(100); table.getColumnModel().getColumn(1).setMaxWidth(100); table.getColumnModel().getColumn(2).setPreferredWidth(80); table.getColumnModel().getColumn(2).setMinWidth(80); table.getColumnModel().getColumn(2).setMaxWidth(80); table.getColumnModel().getColumn(3).setPreferredWidth(80); table.getColumnModel().getColumn(3).setMinWidth(80); table.getColumnModel().getColumn(3).setMaxWidth(80); table.getColumnModel().getColumn(4).setPreferredWidth(80); table.getColumnModel().getColumn(4).setMinWidth(80); table.getColumnModel().getColumn(4).setMaxWidth(80); table.getColumnModel().getColumn(5).setPreferredWidth(80); table.getColumnModel().getColumn(5).setMinWidth(80); table.getColumnModel().getColumn(5).setMaxWidth(80); table.getColumnModel().getColumn(6).setPreferredWidth(155); table.getColumnModel().getColumn(6).setMinWidth(155); table.getColumnModel().getColumn(6).setMaxWidth(155); table.setBounds(20, 320, 665, 90); return table; } /** * 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() { jLabel1 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jLabel11 = new javax.swing.JLabel(); setLayout(null); jLabel1.setFont(new java.awt.Font("Lucida Grande", 1, 36)); // NOI18N jLabel1.setText("Stock Piezas"); add(jLabel1); jLabel1.setBounds(273, 11, 219, 51); jButton2.setText("Realizar Pedido"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); add(jButton2); jButton2.setBounds(10, 460, 150, 23); jButton3.setText("Eliminar"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); add(jButton3); jButton3.setBounds(180, 460, 80, 23); jButton6.setText("Salir"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); add(jButton6); jButton6.setBounds(687, 458, 60, 23); jButton5.setText("Añadir"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); add(jButton5); jButton5.setBounds(660, 240, 83, 23); jLabel11.setFont(new java.awt.Font("Lucida Grande", 1, 24)); // NOI18N jLabel11.setText("Piezas añadidas para realizar el pedido"); add(jLabel11); jLabel11.setBounds(170, 280, 446, 32); }// </editor-fold>//GEN-END:initComponents private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: DefaultTableModel modelo = (DefaultTableModel) jTable2.getModel(); Object[] datos = {(Integer)jTable1.getValueAt(jTable1.getSelectedRow(), 0),jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString(),jTable1.getValueAt(jTable1.getSelectedRow(), 2).toString(),1,(Float)jTable1.getValueAt(jTable1.getSelectedRow(), 5),(Float)jTable1.getValueAt(jTable1.getSelectedRow(), 5),jTable1.getValueAt(jTable1.getSelectedRow(), 6)}; // Cantidad de columnas de la tabla modelo.addRow(datos); modelo.moveRow(jTable2.getRowCount()-1, jTable2.getRowCount()-1, 0); jButton3.setEnabled(true); }//GEN-LAST:event_jButton5ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed // TODO add your handling code here: setVisible(false); }//GEN-LAST:event_jButton6ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed // TODO add your handling code here: // TODO add your handling code here: if(!jTable2.getValueAt(jTable2.getSelectedRow(), 0).toString().isEmpty()){ DefaultTableModel model = (DefaultTableModel)jTable2.getModel(); model.removeRow(jTable2.getSelectedRow()); jTable2.getSelectionModel().setSelectionInterval(0,0); }else{ Avisos av = new Avisos("Esta fila está vacía. No hay nada que eliminar."); av.setVisible(true); av.setModal(true); } }//GEN-LAST:event_jButton3ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: /*jTable2.getSelectionModel().setSelectionInterval(0, 0); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = new Date(); try { Taller tall = cliente.findTallerById(uC.getTaller()); Pieza p2 = cliente.ConsultaCodigo(Integer.parseInt(jTable2.getValueAt(0, 0).toString())); StockPeca sp2 = cliente.consultaStockPiezabyCodigoPieza(Integer.parseInt(p2.getCodiPieza().toString()), uC.getTaller()); //Pedido ped = new Pedido(true,dateFormat.format(date),p2.getCodiPieza(),tall.getCapTaller(),p2.getIdProveedor(),); } catch (ExceptionErrorDataBase ex) { ex.printStackTrace(); } catch (RemoteException ex) { ex.printStackTrace(); }*/ Avisos av = new Avisos("Función no implementada. Disculpe las molestias."); av.setVisible(true); av.setModal(true); }//GEN-LAST:event_jButton2ActionPerformed private void jTable2ActionPerformed(java.awt.event.ActionEvent evt){ } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel11; // End of variables declaration//GEN-END:variables }
a5a537ec7d431e7419be56f3498121502230a61f
6970cd9e1c123276f8f297caaac3374ef779a72e
/pocchroma/pocchromastorefront/web/addonsrc/notificationaddon/de/hybris/platform/notificationaddon/controllers/pages/NotificationPreferencePageController.java
e3f68aadbdc7ddb0bf2e2c78e757c53fee67f003
[]
no_license
Prashanth-techouts/tatacroma-poc
22badc975ebb84ebd270e88932eafdbb4ffe14ec
21992e275ba96f65b129b4485e76a7e4baa2e727
refs/heads/master
2023-06-19T13:32:32.848697
2021-07-21T08:28:09
2021-07-21T08:28:09
388,042,775
0
0
null
null
null
null
UTF-8
Java
false
false
4,747
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("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 SAP. */ package de.hybris.platform.notificationaddon.controllers.pages; import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn; import de.hybris.platform.acceleratorstorefrontcommons.breadcrumb.ResourceBreadcrumbBuilder; import de.hybris.platform.acceleratorstorefrontcommons.controllers.ThirdPartyConstants; import de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController; import de.hybris.platform.acceleratorstorefrontcommons.controllers.util.GlobalMessages; import de.hybris.platform.cms2.exceptions.CMSItemNotFoundException; import de.hybris.platform.notificationaddon.forms.NotificationChannelForm; import de.hybris.platform.notificationfacades.data.NotificationPreferenceData; import de.hybris.platform.notificationfacades.facades.NotificationPreferenceFacade; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.mvc.support.RedirectAttributes; /** * Controller for displaying and updating notification preference */ @Controller @Scope("tenant") @RequestMapping("/my-account/notification-preference") public class NotificationPreferencePageController extends AbstractPageController { private static final String REDIRECT_TO_GET_PREFERENCE_PAGE = REDIRECT_PREFIX + "/my-account/notification-preference"; private static final String NOTIFICATION_PREFERENCE_CMS_PAGE = "notification-preference"; private static final String BREADCRUMBS_ATTR = "breadcrumbs"; private static final String NOTIFICATION_PREFERENCE_FORM = "notificationPreferenceForm"; @Resource(name = "accountBreadcrumbBuilder") private ResourceBreadcrumbBuilder accountBreadcrumbBuilder; @Resource(name = "notificationPreferenceFacade") private NotificationPreferenceFacade notificationPreferenceFacade; final String[] DISALLOWED_FIELDS = new String[]{}; @InitBinder public void initBinder(final WebDataBinder binder) { binder.setDisallowedFields(DISALLOWED_FIELDS); } @RequestMapping(method = RequestMethod.GET) @RequireHardLogIn public String getNotificationPreferences(final Model model) throws CMSItemNotFoundException { final List<NotificationPreferenceData> notificationPreferenceList = notificationPreferenceFacade .getValidNotificationPreferences(); final NotificationChannelForm form = new NotificationChannelForm(); form.setChannels(notificationPreferenceList.stream() .sorted((a, b) -> a.getChannel().getCode().compareTo(b.getChannel().getCode())).collect(Collectors.toList())); model.addAttribute(NOTIFICATION_PREFERENCE_FORM, form); storeCmsPageInModel(model, getContentPageForLabelOrId(NOTIFICATION_PREFERENCE_CMS_PAGE)); setUpMetaDataForContentPage(model, getContentPageForLabelOrId(NOTIFICATION_PREFERENCE_CMS_PAGE)); model.addAttribute(BREADCRUMBS_ATTR, accountBreadcrumbBuilder.getBreadcrumbs("text.account.profile.notificationPreferenceSetting")); model.addAttribute(ThirdPartyConstants.SeoRobots.META_ROBOTS, ThirdPartyConstants.SeoRobots.NOINDEX_NOFOLLOW); return getViewForPage(model); } @RequestMapping(method = RequestMethod.POST) @RequireHardLogIn public String updateNotificationPreference(final NotificationChannelForm notificationPreferenceForm, final BindingResult bindingResult, final Model model, final RedirectAttributes redirectModel) throws CMSItemNotFoundException { notificationPreferenceFacade.updateNotificationPreference(notificationPreferenceForm.getChannels()); model.addAttribute(BREADCRUMBS_ATTR, accountBreadcrumbBuilder.getBreadcrumbs("text.account.profile.notificationPreferenceSetting")); model.addAttribute(ThirdPartyConstants.SeoRobots.META_ROBOTS, ThirdPartyConstants.SeoRobots.NOINDEX_NOFOLLOW); GlobalMessages.addFlashMessage(redirectModel, GlobalMessages.CONF_MESSAGES_HOLDER, "notification.preference.confirmation.message.title"); return REDIRECT_TO_GET_PREFERENCE_PAGE; } }
feaba2012a7ed234a6ce5d23359a6930361084db
d5fe47a125fe59dea63aef684d3b66a69e32d065
/ly-order/ly-order-interface/src/main/java/com/leyou/order/pojo/OrderStatus.java
8aecba6cbc1fb98a76250c3dc1f6b11043a4f85f
[]
no_license
delicatebaby99/leyou
62e79aaf1061ea2c573dcca061549148236b4a4a
d0670f6ef4be767c2a0fc9ee14a3f72033f8d519
refs/heads/master
2023-01-18T17:19:08.542078
2020-11-23T08:16:04
2020-11-23T08:16:04
314,478,208
1
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package com.leyou.order.pojo; import lombok.Data; import javax.persistence.Id; import javax.persistence.Table; import java.util.Date; /** * date:2020-10-22 * author:zhangxiaoshuai */ @Data @Table(name = "tb_order_status") public class OrderStatus { /** * 初始阶段:1、未付款、未发货;初始化所有数据 * 付款阶段:2、已付款、未发货;更改付款时间 * 发货阶段:3、已发货,未确认;更改发货时间、物流名称、物流单号 * 成功阶段:4、已确认,未评价;更改交易结束时间 * 关闭阶段:5、关闭; 更改更新时间,交易关闭时间。 * 评价阶段:6、已评价 */ @Id private Long orderId; private Integer status; /** * 创建时间 */ private Date createTime; /** * 付款时间 */ private Date paymentTime; /** * 发货时间 */ private Date consignTime; /** * 交易结束时间 */ private Date endTime; /** * 交易关闭时间 */ private Date closeTime; /** * 评价时间 */ private Date commentTime; }
4cf0cde64defb1a088450f5d09dc90e132a7ddb4
529a045dce4d15abc0a559f5256b91704eb5abdc
/workspace/src/lotto/LottoPro.java
7241e67898d86488bc9704da1a1bbe5ca4bf4dfc
[]
no_license
commin0813/platform
5b21bf17bc542278247d5a36b08d790768665163
4227b15ead3f3ee43b2142ff7f493bf6b7ecab31
refs/heads/master
2020-05-21T08:41:53.393376
2017-05-30T01:33:25
2017-05-30T01:33:25
64,712,190
0
0
null
null
null
null
UTF-8
Java
false
false
2,254
java
package lotto; public class LottoPro { // developed by commin// // Lotto Program // // ver 1.0.0 // // 2016.11.21 // // 전역 변수 private boolean duplicate = false; private boolean can_bonus; private int[] numbers; public LottoPro() { System.out.println("(System)보너스추첨은 불가합니다."); can_bonus = false; } public LottoPro(boolean can_bonus) { System.out.println("(System)보너스추첨도 가능합니다."); this.can_bonus = can_bonus; } public void printNumber(){ if(numbers==null||numbers[0]==0){ System.out.println("(System)Empty Value"); return; } for(int i=0;i<numbers.length;i++){ if(i==6){ System.out.println("(BONUS)>>>"+numbers[i]); }else{ System.out.println(">>>"+numbers[i]); } } } public int[] start_recommandation() { if (can_bonus) { numbers = new int[7]; } else { numbers = new int[6]; } int [] imsi=getNormalNumber(); for (int i = 0; i < numbers.length; i++) { if (i == 6) { numbers[i] =getBounusNumber(numbers); } else { numbers[i] = imsi[i]; } } return numbers; } private int getBounusNumber(int[] normal_number) { int bonus = 0; int imsi = 0; while (true) { imsi = (int) (Math.random() * 45 + 1); for (int j = 0; j < normal_number.length; j++) { if (normal_number[j] == imsi) { duplicate = true; } } if (duplicate) { duplicate = false; continue; } else { break; } } bonus = imsi; System.out.println("(System)Success Create Bonus Number"); return bonus; } private int[] getNormalNumber() { int[] normal_number = new int[6]; int imsi = 0; for (int i = 0; i < normal_number.length; i++) { imsi = (int) (Math.random() * 45 + 1);// random 함수는 0.0~ 0.999...까지 랜덤으로 난수를 생성하는 함수입니다. for (int j = 0; j < i; j++) { if (normal_number[j] == imsi) { duplicate = true; } } if (!duplicate) { normal_number[i] = imsi; } else { duplicate = false; i--; } } System.out.println("(System)Success Create Normal Number"); return normal_number; } }
65e24f3eaa36233b4a1b909a1cf0ac8221d14f6c
5d860ba1d0ddad29b06ac4244a269a73394c8cb3
/src/main/java/com/khlin/leetcode/ProductOfArrayExceptSelf.java
01fe82b5fdd7d81a97e609bb00193dee0a307ce6
[]
no_license
kikilink/MyLeetCodePractice
547729c75f0e65cd2296bccca0e1081e5d353ee1
dd5e5817045892aff829a341fbb493ece30eb441
refs/heads/master
2020-04-01T06:07:51.448471
2018-11-25T07:38:35
2018-11-25T07:38:35
152,934,463
0
0
null
null
null
null
UTF-8
Java
false
false
1,589
java
package com.khlin.leetcode; import java.util.Arrays; /** * 给定长度为 n 的整数数组 nums,其中 n > 1,返回输出数组 output ,其中 output[i] 等于 nums 中除 nums[i] * 之外其余各元素的乘积。 * * 示例: * * 输入: [1,2,3,4] 输出: [24,12,8,6] 说明: 请不要使用除法,且在 O(n) 时间复杂度内完成此题。 * * 进阶: 你可以在常数空间复杂度内完成这个题目吗?( 出于对空间复杂度分析的目的,输出数组不被视为额外空间。) */ public class ProductOfArrayExceptSelf { public static class Solution { public int[] productExceptSelf(int[] nums) { if (nums.length == 0) { return new int[0]; } int[] result = new int[nums.length]; int lastCursor = 1; // 先从左往右遍历,构造一个数组,每个索引位置i的值,是从0到(i-1)位置的乘积 // 例如[1, 2, 3, 4],则构造出[1, 1, 2, 6] result[0] = 1; for (int i = 1; i <= nums.length - 1; i++) { result[i] = nums[i - 1] * lastCursor; lastCursor = result[i]; } // 从右往左遍历,每个索引的值等于当前位置的值(即所有左边的乘积)乘以右边所有位置的值 int right = 1; for (int i = nums.length - 2; i >= 0; i--) { result[i] = result[i] * (right * nums[i + 1]); right = right * nums[i + 1]; } return result; } } public static void main(String[] args) { System.out.println(Arrays.toString( new Solution().productExceptSelf(new int[] { 2, 3, 4, 5, 6 }))); } }
4b6c6f5ddbd848b07826b461f9b6af8c12e81c9e
a8dedf48a44006b0dfe44725ce56545759a23c99
/src/main/java/com/bambini/ProductStoreApp.java
20413443e9aacb5e1a68d0ec684abb6466f8bc35
[]
no_license
pepo42/products-store
b03edf414c1ad811e42cf1bedc78bd59e64ade06
e947f65d89cee80108e1ba7806d416116c342a4b
refs/heads/master
2020-03-28T13:48:19.461959
2018-09-16T17:40:51
2018-09-16T17:40:51
148,430,416
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package com.bambini; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ProductStoreApp { // Creates everything for free (servlets, containers...) // Standalone application public static void main(String[] args) { SpringApplication.run(ProductStoreApp.class, args); } }
7a3fd1234fe749c792e6db8cec85e1576e40f03e
fc2daa3b96a8987aa46d328f518bfa329be8a6c0
/xqls/src/main/java/com/xqls/dal/service/RolePermissionDetailMapper.java
26494220643ff6188804a100ba4a9307c23eb995
[]
no_license
ufoet0715/Skeye
d8a35eedd8ebb12525cb72d876b24165f31935bf
58069bf871bdb4f37b2c47755f55058fba338241
refs/heads/master
2021-01-21T11:01:06.831483
2017-03-04T09:56:40
2017-03-04T09:56:40
83,518,007
0
0
null
null
null
null
UTF-8
Java
false
false
243
java
package com.xqls.dal.service; import java.util.List; import java.util.Map; import com.xqls.dal.model.RolePermissionDetail; public interface RolePermissionDetailMapper { List<RolePermissionDetail> getListByMap(Map<String,Object> map); }
7a3ab3b2582357fdb151a9edae4254536c065263
bb31abd2a7f8b0f58a117d68bb9595f18d0ab620
/MyJavaWorkShop10/src/com/test2/Sample02.java
0353515470d68da7ce2422fa3382e3ca04b87339
[]
no_license
doyongsung/Java
d17fda36e9c3b45d25cdfd43ac13db2d9be3f418
22efff99b4d40d056767662c7d47eed158a02248
refs/heads/master
2023-05-07T15:05:57.230557
2021-05-21T10:47:58
2021-05-21T10:47:58
366,378,987
0
0
null
null
null
null
UHC
Java
false
false
600
java
package com.test2; import java.io.IOException; public class Sample02 { void method1() throws IOException{//throws Exception{ //throw(s) Exception ex)에러를 다음으로 넘김 오류가연속으로 나올때 // try { // int a = 10/0; throw new IOException(); //throw // }catch(Exception ex) { // } // } // void method2() throws IOException { // method1(); // } // void method3() { // method2(); // } // // public static void main(String[] args) { // Sample02 obj = new Sample02(); // try { // obj.method3(); // }catch(Exception ex) { // System.out.println("Exit"); // } } }
fac68fd87a321b3e495a118141e30d7c5fe51a0b
8a6453cd49949798c11f57462d3f64a1fa2fc441
/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/UpdateServiceActionResult.java
dc0c47192edfa986da8d37ef279ea01509f2f517
[ "Apache-2.0" ]
permissive
tedyu/aws-sdk-java
138837a2be45ecb73c14c0d1b5b021e7470520e1
c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8
refs/heads/master
2020-04-14T14:17:28.985045
2019-01-02T21:46:53
2019-01-02T21:46:53
163,892,339
0
0
Apache-2.0
2019-01-02T21:38:39
2019-01-02T21:38:39
null
UTF-8
Java
false
false
4,172
java
/* * Copyright 2013-2018 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.servicecatalog.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateServiceAction" target="_top">AWS * API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateServiceActionResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * Detailed information about the self-service action. * </p> */ private ServiceActionDetail serviceActionDetail; /** * <p> * Detailed information about the self-service action. * </p> * * @param serviceActionDetail * Detailed information about the self-service action. */ public void setServiceActionDetail(ServiceActionDetail serviceActionDetail) { this.serviceActionDetail = serviceActionDetail; } /** * <p> * Detailed information about the self-service action. * </p> * * @return Detailed information about the self-service action. */ public ServiceActionDetail getServiceActionDetail() { return this.serviceActionDetail; } /** * <p> * Detailed information about the self-service action. * </p> * * @param serviceActionDetail * Detailed information about the self-service action. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceActionResult withServiceActionDetail(ServiceActionDetail serviceActionDetail) { setServiceActionDetail(serviceActionDetail); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getServiceActionDetail() != null) sb.append("ServiceActionDetail: ").append(getServiceActionDetail()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateServiceActionResult == false) return false; UpdateServiceActionResult other = (UpdateServiceActionResult) obj; if (other.getServiceActionDetail() == null ^ this.getServiceActionDetail() == null) return false; if (other.getServiceActionDetail() != null && other.getServiceActionDetail().equals(this.getServiceActionDetail()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getServiceActionDetail() == null) ? 0 : getServiceActionDetail().hashCode()); return hashCode; } @Override public UpdateServiceActionResult clone() { try { return (UpdateServiceActionResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
a3a4cceb5979db46529633cd2b45575e47042d6d
9042e1627059aadac870f9d142e89e18031eb61c
/fettuccine/graphics/RenderData.java
5b9cec2b0705d9fcf5bdc7438314c14e3d363436
[ "Apache-2.0" ]
permissive
TheMonsterFromTheDeep/Fellowship
0d5870065dd9d8860fd702afb59593df169d2e3d
377f5af59d0bae262254140d444b75e4f7956dfa
refs/heads/master
2016-08-12T11:29:28.438918
2016-04-18T22:42:04
2016-04-18T22:42:04
47,946,963
0
0
null
null
null
null
UTF-8
Java
false
false
1,545
java
package fettuccine.graphics; /** * Stores data about a screen being rendered. A RenderData class holds methods * to recalculate offsets and other values used for rendering a scaled canvas of * a fixed ratio inside a larger screen.<br /><br /> * * A RenderData can be passed directly to a Renderer when rendering. * @author TheMonsterFromTheDeep */ public class RenderData { public int canvasWidth, canvasHeight; public int renderWidth, renderHeight; public int renderX, renderY; public double scaleX, scaleY; public RenderData(int dw, int dh) { renderWidth = canvasWidth = dw; renderHeight = canvasHeight = dh; renderX = 0; renderY = 0; scaleX = scaleY = 1; } public void recalculate(int windowWidth, int windowHeight) { double YXRatio = (double)canvasHeight / canvasWidth; double XYRatio = (double)canvasWidth / canvasHeight; if(windowWidth < (windowHeight * XYRatio)) { renderWidth = windowWidth; renderHeight = (int)(windowWidth * YXRatio); renderX = 0; renderY = (int)Math.floor((windowHeight - renderHeight) / 2); } else { renderWidth = (int)(windowHeight * XYRatio); renderHeight = windowHeight; renderX = (int)Math.floor((windowWidth - renderWidth) / 2); renderY = 0; } scaleX = (double)renderWidth / canvasWidth; scaleY = (double)renderHeight / canvasHeight; } }