blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
9b7b3cfda03340536266795b5098103bd5ef11fa
90d6a984fdf14236ab7a0b5bdf795c6e99fdd7e0
/FileTypeData/Prog_Data_train/java/BlogService.java
9a0768c4cf2415e7b349ff48a9791728a7061835
[]
no_license
KqSMea8/gueslang
f0833a7821da0d3b22bc3135e4c73107c4ae0127
1de76d469113127706a014eec57c8b2e2f198816
refs/heads/master
2020-04-19T09:59:18.367082
2019-01-28T19:37:40
2019-01-28T19:37:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
package com.springtutorial.MyBlogger.services; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.springtutorial.MyBlogger.domain.Blog; import com.springtutorial.MyBlogger.repository.BlogRepository; @Service public class BlogService { private final BlogRepository blogRepository; @Autowired public BlogService(BlogRepository blogRepository) { this.blogRepository = blogRepository; } public Blog createBlog(Blog blog) { Blog saved = blogRepository.save(blog); return saved; } }
[ "umarrauf117@gmail.com" ]
umarrauf117@gmail.com
67d2ba681e211354749d1c4c6f5f79826ae1d030
94da3e938b081032a50d8045658e41b03a7f0449
/src/main/java/com/poc/hdiv/service/common/AbstractService.java
b2c4ed14365894c031fc668ff08e3960d6ef29ec
[]
no_license
ajaysoni98292/hdiv-spring4-hibernate4
1f98ee5d4aa6dbfd4b1b1d64bec0ff0bd6bb46fe
25ea64bff8ece0be827aa92ae02fa9e1041e11d1
refs/heads/master
2021-01-22T02:41:02.745398
2015-08-23T12:11:49
2015-08-23T12:11:49
41,246,897
0
0
null
null
null
null
UTF-8
Java
false
false
1,288
java
package com.poc.hdiv.service.common; import com.poc.hdiv.persistence.dao.common.IOperations; import org.springframework.transaction.annotation.Transactional; import java.io.Serializable; import java.util.List; /** * * @author ajay */ @Transactional public abstract class AbstractService<T extends Serializable> implements IOperations<T> { @Override public T findOne(final long id) { return getDao().findOne(id); } @Override public T findOne(final String id) { return getDao().findOne(id); } @Override public List<T> findAll() { return getDao().findAll(); } @Override public void create(final T entity) { getDao().create(entity); } @Override public T update(final T entity) { return getDao().update(entity); } @Override public void delete(final T entity) { getDao().delete(entity); } @Override public void deleteById(final long entityId) { getDao().deleteById(entityId); } @Override public void deleteById(final String entityId) { getDao().deleteById(entityId); } @Override public long findRecordsCount() { return getDao().findRecordsCount(); } protected abstract IOperations<T> getDao(); }
[ "developer.ajaysoni@gmail.com" ]
developer.ajaysoni@gmail.com
6af6eb7cfb690375bb9173b8bf54f9c4c9423415
d9b80faf79965f351fb4c7dc683998de5f8c259e
/104/assignment3/src/Deck.java
fa57b411f1411d257275fe3312dc666b3e285098
[]
no_license
muhammedaydogan/School-Projects
3389ceddf22bb9eeba301c0c693d2a5767bd0fba
8414cc1ddf0e0ce58a786830dd1435648e17c5f0
refs/heads/master
2020-05-27T00:50:11.708489
2019-05-24T14:24:47
2019-05-24T14:24:47
188,429,569
1
0
null
null
null
null
UTF-8
Java
false
false
2,043
java
import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; public class Deck { private ArrayList<String> commChestCards = new ArrayList<String>(); private ArrayList<String> chanceCards = new ArrayList<String>(); private int currentCommChestCardPosition; private int currentChanceCardPosition; public Deck(String cardFile) { this.currentChanceCardPosition = 0; this.currentCommChestCardPosition = 0; this.setDeck(cardFile); } private void setDeck(String cardFile) { JSONParser parser = new JSONParser(); try { Object obj = parser.parse(new FileReader(cardFile)); JSONObject jsonObj = (JSONObject) obj; JSONArray cardArr = (JSONArray) jsonObj.get("chanceList"); int i = -1; while (++i < cardArr.size()) { JSONObject card = (JSONObject) cardArr.get(i); String item = (String) card.get("item"); this.chanceCards.add(item); } cardArr = (JSONArray) jsonObj.get("communityChestList"); i = -1; while (++i < cardArr.size()) { JSONObject card = (JSONObject) cardArr.get(i); String item = (String) card.get("item"); this.commChestCards.add(item); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } } public String getCommChestCard() { if(this.currentCommChestCardPosition == this.commChestCards.size()) { this.currentCommChestCardPosition = 0; } return this.commChestCards.get(this.currentCommChestCardPosition++); } public String getChanceCard() { if(this.currentChanceCardPosition == this.chanceCards.size()) { this.currentChanceCardPosition = 0; } return this.chanceCards.get(this.currentChanceCardPosition++); } }
[ "noreply@github.com" ]
noreply@github.com
0e0ef6e24ff861a8343e3cc7333ed12773142274
45d175ed304991bd22db8c8531d0ed7b0ff459aa
/app/src/main/java/com/solo/security/common/BaseActivity.java
043c8cbab41357d8854ac424e35c026cd1f56a7d
[]
no_license
bbsyaya/SoloSeccurity
fe645b8f1431fbc266a4a275272cc0db83eb3f4e
6cdaeeb15bad3c41c01395b717cbdc92fd616b0b
refs/heads/master
2021-01-13T08:05:16.828075
2016-11-21T03:37:41
2016-11-21T03:37:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.solo.security.common; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import butterknife.ButterKnife; /** * Created by haipingguo on 16-11-18. */ public abstract class BaseActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getContentViewID() != 0) { setContentView(getContentViewID()); } ButterKnife.bind(this); initToolBar(); initFragment(); initViewsAndData(); } protected abstract int getContentViewID(); protected abstract void initFragment(); protected abstract void initToolBar(); protected abstract void initViewsAndData(); }
[ "ghp@newborn-town.com" ]
ghp@newborn-town.com
e0ded2998dd00419065153d67deaf2b208e9042c
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/78/832.java
c92f56c67cb9d01befcb1a0fcfbcb2da9f44b24b
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
package <missing>; public class GlobalMembers { public static int Main() { int z; int q; int s; int l; int[] rank = new int[51]; int i; String word = new String(new char[51]); for (i = 0;i <= 50;i++) { rank[i] = 0; } for (z = 10;z <= 50;z = z + 10) { for (q = 10;q <= 50;q = q + 10) { for (s = 10;s <= 50;s = s + 10) { for (l = 10;l <= 50;l = l + 10) { if (((z + q) == (s + l)) && ((z + l) > (s + q)) && ((z + s) < q) && z != q && z != s && z != l && q != s && q != l && s != l) { word = tangible.StringFunctions.changeCharacter(word, z, 'z'); word = tangible.StringFunctions.changeCharacter(word, q, 'q'); word = tangible.StringFunctions.changeCharacter(word, s, 's'); word = tangible.StringFunctions.changeCharacter(word, l, 'l'); rank[z] = z; rank[q] = q; rank[s] = s; rank[l] = l; for (i = 50;i >= 0;i--) { if (rank[i] != 0) { System.out.print(word.charAt(i)); System.out.print(" "); System.out.print(rank[i]); System.out.print("\n"); } } } } } } } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
945b7c51e715a3c6e28b5c60c46d4c94788b2d57
85986e4d862e6fd257eb1c3db6f6b9c82bc6c4d5
/prjClienteSIC/src/main/java/ec/com/smx/sic/cliente/servicio/procesamientoventas/IProcesamientoVentasRecuperacionesServicio.java
f3e114e3c93690b855e658ea72e587a315a2f865
[]
no_license
SebasBenalcazarS/RepoAngularJS
1d60d0dec454fe4f1b1a8c434b656d55166f066f
5c3e1d5bb4a624e30cba0d518ff0b0cda14aa92c
refs/heads/master
2016-08-03T23:21:26.639859
2015-08-19T16:05:00
2015-08-19T16:05:00
40,517,374
1
0
null
null
null
null
UTF-8
Java
false
false
574
java
package ec.com.smx.sic.cliente.servicio.procesamientoventas; import java.io.Serializable; import java.util.Date; import java.util.Set; import ec.com.smx.sic.cliente.exception.SICException; /** * @author Luis Yacchirema * */ public interface IProcesamientoVentasRecuperacionesServicio extends Serializable { void ejecutarRecuperacionesProcesamientoVentas(Integer codigoCompania, Set<Date> fechasProcesamiento) throws SICException; void ejecutarRecuperacionesDiariasProcesamientoVentas(Integer codigoCompania, Set<Date> fechasProcesamiento) throws SICException; }
[ "nbenalcazar@kruger.com.ec" ]
nbenalcazar@kruger.com.ec
0a73650193240d1cf1650cd7cc38d6a47ec1f9f7
01dfb27f1288a9ed62f83be0e0aeedf121b4623a
/Compras/src/java/com/t2tierp/compras/servidor/CompraTipoRequisicaoDetalheAction.java
752972e9c24b24db87a1cdd7956e393efb8009e5
[ "MIT" ]
permissive
FabinhuSilva/T2Ti-ERP-2.0-Java-OpenSwing
deb486a13c264268d82e5ea50d84d2270b75772a
9531c3b6eaeaf44fa1e31b11baa630dcae67c18e
refs/heads/master
2022-11-16T00:03:53.426837
2020-07-08T00:36:48
2020-07-08T00:36:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,602
java
/* * The MIT License * * Copyright: Copyright (C) 2014 T2Ti.COM * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * The author may be contacted at: t2ti.com@gmail.com * * @author Claudio de Barros (T2Ti.com) * @version 2.0 */ package com.t2tierp.compras.servidor; import com.t2tierp.padrao.java.Constantes; import com.t2tierp.padrao.servidor.HibernateUtil; import com.t2tierp.compras.java.CompraTipoRequisicaoVO; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; import org.openswing.swing.message.receive.java.ErrorResponse; import org.openswing.swing.message.receive.java.Response; import org.openswing.swing.message.receive.java.VOResponse; import org.openswing.swing.server.Action; import org.openswing.swing.server.UserSessionParameters; public class CompraTipoRequisicaoDetalheAction implements Action { public CompraTipoRequisicaoDetalheAction() { } public String getRequestName() { return "compraTipoRequisicaoDetalheAction"; } public Response executeCommand(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) { Object[] pars = (Object[]) inputPar; Integer acao = (Integer) pars[0]; switch (acao) { case Constantes.LOAD: { return load(inputPar, userSessionPars, request, response, userSession, context); } case Constantes.INSERT: { return insert(inputPar, userSessionPars, request, response, userSession, context); } case Constantes.UPDATE: { return update(inputPar, userSessionPars, request, response, userSession, context); } case Constantes.DELETE: { return delete(inputPar, userSessionPars, request, response, userSession, context); } } return null; } private Response load(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) { Session session = null; Object[] pars = (Object[]) inputPar; String pk = (String) pars[1]; try { session = HibernateUtil.getSessionFactory().openSession(); Criteria criteria = session.createCriteria(CompraTipoRequisicaoVO.class); criteria.add(Restrictions.eq("id", Integer.valueOf(pk))); CompraTipoRequisicaoVO compraTipoRequisicao = (CompraTipoRequisicaoVO) criteria.uniqueResult(); return new VOResponse(compraTipoRequisicao); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } finally { try { session.close(); } catch (Exception ex1) { } } } public Response insert(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) { Session session = null; try { Object[] pars = (Object[]) inputPar; CompraTipoRequisicaoVO compraTipoRequisicao = (CompraTipoRequisicaoVO) pars[1]; session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); session.save(compraTipoRequisicao); session.getTransaction().commit(); return new VOResponse(compraTipoRequisicao); } catch (Exception ex) { ex.printStackTrace(); if (session != null) { session.getTransaction().rollback(); } return new ErrorResponse(ex.getMessage()); } finally { try { if (session != null) { session.close(); } } catch (Exception ex1) { ex1.printStackTrace(); } } } public Response update(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) { Session session = null; try { Object[] pars = (Object[]) inputPar; CompraTipoRequisicaoVO compraTipoRequisicao = (CompraTipoRequisicaoVO) pars[2]; session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); session.update(compraTipoRequisicao); session.getTransaction().commit(); return new VOResponse(compraTipoRequisicao); } catch (Exception ex) { ex.printStackTrace(); if (session != null) { session.getTransaction().rollback(); } return new ErrorResponse(ex.getMessage()); } finally { try { if (session != null) { session.close(); } } catch (Exception ex1) { ex1.printStackTrace(); } } } public Response delete(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) { return null; } }
[ "claudiobsi@gmail.com" ]
claudiobsi@gmail.com
f5a8df15a9938f4e9be8d199f4690a37d9800478
ecb60dd67939a917640a71c44a114ac521d1e11a
/sandbox/src/main/java/ru/stqa/pft/sandbox/MyFirstProgram.java
2f8d5a01a58a63f12d844e6194a6213f2fd5ef0a
[]
no_license
ppovarov/java_pft
7e989fa712529a00b69380a0567e3b5241bc7b18
8874d067edb67eaa6b52539dd9e5ec99e856a16f
refs/heads/master
2021-05-06T17:20:54.762984
2018-02-02T12:59:29
2018-02-02T12:59:29
111,809,687
0
0
null
null
null
null
UTF-8
Java
false
false
1,599
java
package ru.stqa.pft.sandbox; public class MyFirstProgram { // 3.1 Сделать запускаемый класс, то есть содержащий функцию public static void main(String[] args) {...} public static void main(String[] args) { Point p1 = new Point(1,1.5); Point p2 = new Point(-1,-4); //3.2 убедиться, что функция вычисления расстояния между точками действительно работает. Результат вычисления выводить на экран и контролировать визуально. System.out.println("Distance between P1(" + p1.x + ", " + p1.y + ") and P2(" + p2.x + ", " + p2.y + ") = " + distance(p1, p2)); // 4.2 добавить в созданный в предыдущем пункте запускаемый класс примеры использования метода вместо ранее созданной функции. System.out.println("Distance between P1" + p1.printXY()+ " and P2" + p2.printXY() + " = " + p1.distance(p2)); } // 2. Создать функцию public static double distance(Point p1, Point p2) // которая вычисляет расстояние между двумя точками. Для вычисления квадратного корня можно использовать функцию Math.sqrt public static double distance(Point p1, Point p2){ double dx = p1.x - p2.x; double dy = p1.y - p2.y; return Math.sqrt(dx * dx + dy * dy); } }
[ "33931731+ppovarov@users.noreply.github.com" ]
33931731+ppovarov@users.noreply.github.com
ef8a91a5be252efa0cfd4f4bc71a82d9603a8072
bf102bb1e38555a3f43492c33fe231deb78e2384
/api/src/main/java/org/openmrs/module/pharm/db/hibernate/HibernateAtcCodeChemicalCompoundDAO.java
555455132c1e830cee54a1895c770acf102852a7
[]
no_license
yjin/openmrs-module-pharm
040bb1e3f459c22a2bfb59e44aad4f0a9ab0164c
b5d72a7b0a37e851ddde94ac4dc8c40bd55ad985
refs/heads/master
2021-01-17T13:24:03.009858
2012-06-23T16:39:13
2012-06-23T16:39:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
package org.openmrs.module.pharm.db.hibernate; import java.util.List; import org.hibernate.Criteria; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; import org.openmrs.Patient; import org.openmrs.module.pharm.AtcCodeChemicalCompound; import org.openmrs.module.pharm.AtcCodeChemicalCompoundService; import org.openmrs.module.pharm.db.AtcCodeChemicalCompoundDAO; public class HibernateAtcCodeChemicalCompoundDAO implements AtcCodeChemicalCompoundDAO { private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public AtcCodeChemicalCompound getAtcCodeChemicalCompound(Integer id) { return (AtcCodeChemicalCompound) sessionFactory.getCurrentSession().get(AtcCodeChemicalCompound.class, id); } public AtcCodeChemicalCompound saveAtcCodeChemicalCompound(AtcCodeChemicalCompound atcccc) { sessionFactory.getCurrentSession().saveOrUpdate(atcccc); return atcccc; } }
[ "39ab1dbb984021b5b60c89011fd4123bb520de51@server" ]
39ab1dbb984021b5b60c89011fd4123bb520de51@server
c75049c51d34718fb3fd0d425e760ea43ec776ea
770d16e89274f5734c1ab95b101cd79395d57287
/src/main/java/com/TestGit.java
53376373da4556dcb72dd8b4783f08695685e36c
[]
no_license
mkInGithub/his
3b619f2269319a8dfefd5d5e5d686ebf1561a539
9be1e4437d9e9ae7e4afffdc12f834b63239bf17
refs/heads/master
2022-12-24T08:27:02.354973
2019-10-08T08:01:38
2019-10-08T08:01:38
213,556,275
0
0
null
2019-10-08T07:06:40
2019-10-08T05:31:38
null
UTF-8
Java
false
false
45
java
package com; public class TestGit { }
[ "228062032@qq.com" ]
228062032@qq.com
52d137c0a9576c63409d148e18a8a5b90e5d744e
796aa010ebf73333d2f730eaca3592091c9083b9
/OAuth2Lab-DB-resource/src/main/java/tk/mybatis/mapper/MyMapper.java
a119aa9a190b389a9a0ab82296f3a131d3d455d5
[]
no_license
JackCuiGuoqiang/OAuth2Lab
93bf445d2ce3f11f1cb131aaacf49eb3796cb0d8
1a7ee0d3b708b3f4da8ce4ab7055ad9ed77c5956
refs/heads/master
2020-06-16T22:20:39.948640
2019-07-16T14:01:36
2019-07-16T14:01:36
195,719,781
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package tk.mybatis.mapper; import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.MySqlMapper; /** * 自己的 Mapper * 特别注意,该接口不能被扫描到,否则会出错 * <p>Title: MyMapper</p> * <p>Description: </p> * * @author Lusifer * @version 1.0.0 * @date 2018/5/29 0:57 */ public interface MyMapper<T> extends Mapper<T>, MySqlMapper<T> { }
[ "cuiguoq@bsoft.com.cn" ]
cuiguoq@bsoft.com.cn
148c9014a964766e320e5984fc7058ec5428041c
e65bb841298870897467d1abee5a286d9c8c6da3
/analysis/src/main/java/br/com/marteleto/project/analysis/model/type/LabelType.java
fdb76a16071ae13ec4ca16dfef459df61ae1fc21
[]
no_license
amarteleto/project
2772a2ca5114a462c8c24f3d608467147783386d
ef2124c276721351de3abed94b6992d5a6dd5443
refs/heads/master
2020-04-01T01:04:12.397785
2018-10-16T01:42:57
2018-10-16T01:42:57
152,725,042
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package br.com.marteleto.project.analysis.model.type; public enum LabelType { TRUNK("trunk"), BRANCH("branches"), TAG("tags"), ; private String description; LabelType(String description){ this.description = description; } public String getDescription(){ return this.description; } public static LabelType getType(String tipo){ if (tipo != null) { if (BRANCH.description.equalsIgnoreCase(tipo)) { return LabelType.BRANCH; } else if (TAG.description.equalsIgnoreCase(tipo)) { return LabelType.TAG; } else if (TRUNK.description.equalsIgnoreCase(tipo)) { return LabelType.TRUNK; } } return null; } }
[ "amarteleto@outlook.com" ]
amarteleto@outlook.com
935b961a505eee4db86f40e4776a0ebddb00c16e
0c7d18072018a00c1eb483625c9c536336746007
/Homework 6 (Due 1024)/src/Business/Product.java
b865045d1616c5fa6727b6643bf373d221317217
[]
no_license
aliang1994/INFO5100-ApplicationEngineering
2ea391572fe57a019adef5b063891adb4abdc4ba
163490634550883e1d1afe046a635df6a49e1bbb
refs/heads/master
2021-09-08T09:25:47.065304
2018-03-09T03:48:26
2018-03-09T03:48:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package Business; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Wenqing */ public class Product { private String name; private int id; private static int productCount=0; private int availability; public Product(){ productCount ++; id = productCount; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getAvailability() { return availability; } public void setAvailability(int availability) { this.availability = availability; } public String toString(){ return name; } }
[ "liang.wenq@husky.neu.edu" ]
liang.wenq@husky.neu.edu
14b420bb1ef07c7756d6966a73bd2d27ce8b5c45
be50ab08685c0d03b55121c3b8f0ed25bee53578
/base-weixin/base-weixin-admin/src/main/java/com/aiforest/cloud/weixin/admin/service/WxTemplateMsgService.java
94d46e8f55e93bd913d1ab881e4bf967af501cf2
[]
no_license
panxiaochao/agent_backend
467a6b43306693eb1413f9066216b9b63877b65d
6fb79575f44242e86290080303bb652528ad9973
refs/heads/master
2023-05-25T12:50:57.148064
2020-10-12T22:59:23
2020-10-12T22:59:23
645,122,822
1
0
null
null
null
null
UTF-8
Java
false
false
981
java
/** * Copyright (C) 2018-2019 * All rights reserved, Designed By www.aiforest.com * 注意: * 本软件为www.aiforest.com开发研制,未经购买不得使用 * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) * 一经发现盗用、分享等行为,将追究法律责任,后果自负 */ package com.aiforest.cloud.weixin.admin.service; import com.baomidou.mybatisplus.extension.service.IService; import com.aiforest.cloud.weixin.common.dto.WxTemplateMsgSendDTO; import com.aiforest.cloud.weixin.common.entity.WxTemplateMsg; import com.aiforest.cloud.weixin.common.entity.WxUser; /** * 微信模板/订阅消息 * * @author JL * @date 2020-04-16 17:30:03 */ public interface WxTemplateMsgService extends IService<WxTemplateMsg> { /** * 发送微信订阅消息 * @param wxTemplateMsgSendDTO * @param wxUser */ void sendWxTemplateMsg(WxTemplateMsgSendDTO wxTemplateMsgSendDTO, WxUser wxUser); }
[ "way1001@yeah.net" ]
way1001@yeah.net
48920f2ad707eef64e925f23c1a87025a34cde09
a4f6b1e7205563dec75bf3415d4ffa005a35917b
/sample/src/main/java/cn/jianke/sample/module/jkchat/util/JsonUtil.java
1920e876311e96d03930f691de7268a2f66e7630
[ "Apache-2.0" ]
permissive
cbdgit/HttpRequest
c645b7a698a1787367907027baf55c392fe3a5a1
0941cd6c5caaa4ef7e4b01d203010189c6c71eca
refs/heads/master
2021-01-01T19:03:02.752503
2017-06-05T06:12:32
2017-06-05T06:12:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,194
java
package cn.jianke.sample.module.jkchat.util; import com.google.gson.Gson; import java.lang.reflect.Type; /** * @className: JsonUtil * @classDescription: json util * @author: leibing * @createTime: 2017/5/15 */ public class JsonUtil { /** * 对象转换成json字符串 * @author leibing * @createTime 2017/5/15 * @lastModify 2017/5/15 * @param obj * @return */ public static String toJson(Object obj) { Gson gson = new Gson(); return gson.toJson(obj); } /** * json字符串转成对象 * @author leibing * @createTime 2017/5/15 * @lastModify 2017/5/15 * @param str * @param type * @return */ public static <T> T fromJson(String str, Type type) { Gson gson = new Gson(); return gson.fromJson(str, type); } /** * json字符串转成对象 * @author leibing * @createTime 2017/5/15 * @lastModify 2017/5/15 * @param str * @param type * @return */ public static <T> T fromJson(String str, Class<T> type) { Gson gson = new Gson(); return gson.fromJson(str, type); } }
[ "leibing1989@126.com" ]
leibing1989@126.com
4098ae3964ecb9be68476731ae6de21be6b30f7a
49c02cb517c0e1a7b45b1f5aed7c745b00e3794b
/src/main/java/com/jagrosh/jmusicbot/commands/SetstatusCmd.java
ed72d00e65f6382517d0ebf38360187f5020b8a4
[ "Apache-2.0" ]
permissive
TheArmando/MusicBot
c1dad627c053dbb9062c218efd30e3fd073079a4
dddf4c8e3816e972c00f36932f92bd8f59a320dd
refs/heads/master
2021-01-20T12:20:35.056255
2017-08-18T19:43:20
2017-08-18T19:43:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,886
java
/* * Copyright 2017 John Grosh <john.a.grosh@gmail.com>. * * 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.jagrosh.jmusicbot.commands; import com.jagrosh.jdautilities.commandclient.Command; import com.jagrosh.jdautilities.commandclient.CommandEvent; import com.jagrosh.jmusicbot.Bot; import net.dv8tion.jda.core.OnlineStatus; /** * * @author John Grosh <john.a.grosh@gmail.com> */ public class SetstatusCmd extends Command { public SetstatusCmd(Bot bot) { this.name = "setstatus"; this.help = "sets the status the bot displays"; this.arguments = "[game]"; this.ownerCommand = true; this.category = bot.OWNER; } @Override protected void execute(CommandEvent event) { try { OnlineStatus status = OnlineStatus.fromKey(event.getArgs()); if(status==OnlineStatus.UNKNOWN) { event.replyError("Please include one of the following statuses: `ONLINE`, `IDLE`, `DND`, `INVISIBLE`"); } else { event.getJDA().getPresence().setStatus(status); event.replySuccess("Set the status to `"+status.getKey().toUpperCase()+"`"); } } catch(Exception e) { event.reply(event.getClient().getError()+" The status could not be set!"); } } }
[ "john.a.grosh@gmail.com" ]
john.a.grosh@gmail.com
ab3dde3aeb27bca1da1dc809336840a2e14cec08
285136003d2d831610b38b2e943c813a372aaff4
/example/src/main/java/com/example/demo/DemoApplication.java
5e020fd7d62c0959ecf331432eac278a96eb167f
[ "Apache-2.0" ]
permissive
Cicadaes/springboot-security
ad320833866e80eadac90dce8f866929fb9edf5e
a9edfd1f1b4e9d356bdca97adaf32018121cf12b
refs/heads/master
2020-08-02T12:13:08.012130
2019-01-31T11:57:35
2019-01-31T11:57:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
package com.example.demo; import com.springboot.security.SpringsecurityAuthApplication; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { Class [] classes = new Class[2]; classes[0]= SpringsecurityAuthApplication .class; classes[1]= DemoApplication.class; SpringApplication.run(classes,args); } }
[ "1170881778@qq.com" ]
1170881778@qq.com
17d9ee048107f847c4585c3b7f068ba08b63b578
2df516f629efad218d95b090cfc7c5e6008e9c22
/hk2/examples/security-lockdown/runner/src/test/java/org/glassfish/securitylockdown/test/SecurityLockdownTest.java
55325e63d54ca3f9b93bca1f7d32d57b87c7eca8
[]
no_license
theyelllowdart/hk2
4f0e7f27aa9ede30bfbcc630cf56ccc2913f469c
4ee41bfbfe02c1cc72d9338ce30c2a6013522f8b
refs/heads/master
2021-01-10T18:34:57.129494
2013-06-30T16:14:35
2013-06-30T16:14:35
11,035,590
0
1
null
null
null
null
UTF-8
Java
false
false
5,298
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package org.glassfish.securitylockdown.test; import junit.framework.Assert; import org.glassfish.hk2.api.MultiException; import org.junit.Test; import org.jvnet.hk2.testing.junit.HK2Runner; import com.alice.application.AliceApp; import com.mallory.application.MalloryApp; /** * * @author jwells * */ public class SecurityLockdownTest extends HK2Runner { /** * Tests that we can do a lookup of AliceApp */ @Test public void testAliceApp() { AliceApp aa = testLocator.getService(AliceApp.class); Assert.assertNotNull(aa); } /** * Tests that we can do a lookup of AliceApp */ @Test public void testMalloryApp() { MalloryApp ma = testLocator.getService(MalloryApp.class); Assert.assertNotNull(ma); } /** * Tests that we can have Alice perform an operation on Mallory's behalf */ @Test public void testMalloryCanLegallyHaveAliceDoAnOperation() { MalloryApp ma = testLocator.getService(MalloryApp.class); Assert.assertNotNull(ma); ma.doAnApprovedOperation(); } /** * Tests that we can have Alice perform an operation on Mallory's behalf */ @Test public void testMalloryCannotGetTheAuditServiceHimself() { MalloryApp ma = testLocator.getService(MalloryApp.class); Assert.assertNotNull(ma); try { ma.tryToGetTheAuditServiceMyself(); Assert.fail("Mallory should not be able to get the audit service himself"); } catch (NullPointerException npe) { // Good, should have failed for him! } } /** * Tests that Mallory cannot advertise a service */ @Test public void testMalloryCannotAdvertiseAService() { MalloryApp ma = testLocator.getService(MalloryApp.class); Assert.assertNotNull(ma); try { ma.tryToAdvertiseAService(); Assert.fail("Mallory should not be able to advertise a service himself"); } catch (MultiException multi) { // Good, should have failed for him! } } /** * Tests that Mallory cannot advertise a service */ @Test public void testMalloryCannotUnAdvertiseAService() { MalloryApp ma = testLocator.getService(MalloryApp.class); Assert.assertNotNull(ma); try { ma.tryToUnAdvertiseAService(); Assert.fail("Mallory should not be able to unadvertise a service"); } catch (MultiException multi) { // Good, should have failed for him! } } /** * Tests that Mallory cannot have a service that injects something it cannot */ @Test public void testMalloryCannotInjectAnUnAuthorizedThing() { MalloryApp ma = testLocator.getService(MalloryApp.class); Assert.assertNotNull(ma); try { ma.tryToInstantiateAServiceWithABadInjectionPoint(); Assert.fail("Mallory should not be able to inject a service it has no rights to"); } catch (MultiException multi) { Assert.assertTrue(multi.getMessage().contains("There was no object available for injection at Injectee")); } } }
[ "jwells@java.net" ]
jwells@java.net
b2789ab2d5ddad34d6a14824b8a65ea6ebf01cf6
20a9dfed6cae7e5dfe5c12e9c08c19c6fa13dcba
/src/orm/Picking.java
ef32f91017a9da2228c5fc92f2cc83eda0ffe2e7
[]
no_license
LiCasey/amc
b3c6f17dde2056cd6b43940534844dd9511e1b7d
4e3f74d05ac0be53e828178909c89c33d1bf7d35
refs/heads/master
2021-01-19T12:23:46.720421
2017-02-18T13:49:07
2017-02-18T13:49:07
82,308,712
0
1
null
2017-02-18T01:37:52
2017-02-17T15:10:13
Java
UTF-8
Java
false
false
1,634
java
package orm; import java.sql.Timestamp; import java.util.HashSet; import java.util.Set; /** * Picking entity. @author MyEclipse Persistence Tools */ public class Picking implements java.io.Serializable { // Fields private Integer pickingId; private User user; private Order order; private Timestamp pickingTime; private String pickingState; private Set pickingdetails = new HashSet(0); // Constructors /** default constructor */ public Picking() { } /** full constructor */ public Picking(User user, Order order, Timestamp pickingTime, String pickingState, Set pickingdetails) { this.user = user; this.order = order; this.pickingTime = pickingTime; this.pickingState = pickingState; this.pickingdetails = pickingdetails; } // Property accessors public Integer getPickingId() { return this.pickingId; } public void setPickingId(Integer pickingId) { this.pickingId = pickingId; } public User getUser() { return this.user; } public void setUser(User user) { this.user = user; } public Order getOrder() { return this.order; } public void setOrder(Order order) { this.order = order; } public Timestamp getPickingTime() { return this.pickingTime; } public void setPickingTime(Timestamp pickingTime) { this.pickingTime = pickingTime; } public String getPickingState() { return this.pickingState; } public void setPickingState(String pickingState) { this.pickingState = pickingState; } public Set getPickingdetails() { return this.pickingdetails; } public void setPickingdetails(Set pickingdetails) { this.pickingdetails = pickingdetails; } }
[ "Casey" ]
Casey
4ef15e5b1502390076511c8a8443811772113aa6
1cada5d1a271ac4026732eec70aa50b9d9352c37
/lib.ble/src/main/java/com/suhen/android/libble/central/sdk/BLEScanRecord.java
a32e1733099899f30ba289292d435b10d7fb80d8
[ "Apache-2.0" ]
permissive
leewoody/Android-BLE-Peripheral-Central-ANCS
e49355042b54d7982d12d0a93854782245e30fde
b82aed783666bac4dc3955e63221f00663da69cf
refs/heads/master
2022-02-27T21:23:33.858232
2019-09-25T09:20:33
2019-09-25T09:20:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,988
java
package com.suhen.android.libble.central.sdk; import android.util.Log; import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** * Created by suhen * 17-6-2. * Email: 1239604859@qq.com */ public class BLEScanRecord { private static final String TAG = "BLEScanRecord"; /* * BLE Scan record type IDs */ static final int EBLE_FLAGS = 0x01;//«Flags» Bluetooth Core Specification: static final int EBLE_16BitUUIDInc = 0x02;//«Incomplete List of 16-bit Service Class UUIDs» // Bluetooth Core Specification: static final int EBLE_16BitUUIDCom = 0x03;//«Complete List of 16-bit Service Class UUIDs» // Bluetooth Core Specification: static final int EBLE_32BitUUIDInc = 0x04;//«Incomplete List of 32-bit Service Class UUIDs» // Bluetooth Core Specification: static final int EBLE_32BitUUIDCom = 0x05;//«Complete List of 32-bit Service Class UUIDs» // Bluetooth Core Specification: static final int EBLE_128BitUUIDInc = 0x06;//«Incomplete List of 128-bit Service Class // UUIDs» Bluetooth Core Specification: static final int EBLE_128BitUUIDCom = 0x07;//«Complete List of 128-bit Service Class UUIDs» // Bluetooth Core Specification: static final int EBLE_SHORTNAME = 0x08;//«Shortened Local Name» Bluetooth Core Specification: static final int EBLE_LOCALNAME = 0x09;//«Complete Local Name» Bluetooth Core Specification: static final int EBLE_TXPOWERLEVEL = 0x0A;//«Tx Power Level» Bluetooth Core Specification: static final int EBLE_DEVICECLASS = 0x0D;//«Class of Device» Bluetooth Core Specification: static final int EBLE_SIMPLEPAIRHASH = 0x0E;//«Simple Pairing Hash C» Bluetooth Core // Specification:​«Simple Pairing Hash C-192» ​Core Specification Supplement, Part A, // section 1.6 static final int EBLE_SIMPLEPAIRRAND = 0x0F;//«Simple Pairing Randomizer R» Bluetooth Core // Specification:​«Simple Pairing Randomizer R-192» ​Core Specification Supplement, Part A, // section 1.6 static final int EBLE_DEVICEID = 0x10;//«Device ID» Device ID Profile v1.3 or later,«Security // Manager TK Value» Bluetooth Core Specification: static final int EBLE_SECURITYMANAGER = 0x11;//«Security Manager Out of Band Flags» Bluetooth // Core Specification: static final int EBLE_SLAVEINTERVALRA = 0x12;//«Slave Connection Interval Range» Bluetooth // Core Specification: static final int EBLE_16BitSSUUID = 0x14;//«List of 16-bit Service Solicitation UUIDs» // Bluetooth Core Specification: static final int EBLE_128BitSSUUID = 0x15;//«List of 128-bit Service Solicitation UUIDs» // Bluetooth Core Specification: static final int EBLE_SERVICEDATA = 0x16;//«Service Data» Bluetooth Core // Specification:​«Service Data - 16-bit UUID» ​Core Specification Supplement, Part A, // section 1.11 static final int EBLE_PTADDRESS = 0x17;//«Public Target Address» Bluetooth Core // Specification: static final int EBLE_RTADDRESS = 0x18;//«Random Target Address» Bluetooth Core // Specification: static final int EBLE_APPEARANCE = 0x19;//«Appearance» Bluetooth Core Specification: static final int EBLE_DEVADDRESS = 0x1B;//«​LE Bluetooth Device Address» ​Core Specification // Supplement, Part A, section 1.16 static final int EBLE_LEROLE = 0x1C;//«​LE Role» ​Core Specification Supplement, Part A, // section 1.17 static final int EBLE_PAIRINGHASH = 0x1D;//«​Simple Pairing Hash C-256» ​Core Specification // Supplement, Part A, section 1.6 static final int EBLE_PAIRINGRAND = 0x1E;//«​Simple Pairing Randomizer R-256» ​Core // Specification Supplement, Part A, section 1.6 static final int EBLE_32BitSSUUID = 0x1F;//​«List of 32-bit Service Solicitation UUIDs» ​Core // Specification Supplement, Part A, section 1.10 static final int EBLE_32BitSERDATA = 0x20;//​«Service Data - 32-bit UUID» ​Core // Specification Supplement, Part A, section 1.11 static final int EBLE_128BitSERDATA = 0x21;//​«Service Data - 128-bit UUID» ​Core // Specification Supplement, Part A, section 1.11 static final int EBLE_SECCONCONF = 0x22;//​«​LE Secure Connections Confirmation Value» // ​Core Specification Supplement Part A, Section 1.6 static final int EBLE_SECCONRAND = 0x23;//​​«​LE Secure Connections Random Value» ​Core // Specification Supplement Part A, Section 1.6​ static final int EBLE_3DINFDATA = 0x3D;//​​«3D Information Data» ​3D Synchronization Profile, // v1.0 or later static final int EBLE_MANDATA = 0xFF;//«Manufacturer Specific Data» Bluetooth Core // Specification: /* * BLE Scan record parsing */ static public Map<Integer, String> parseRecord(byte[] scanRecord) { Map<Integer, String> ret = new HashMap<>(); int index = 0; while (index < scanRecord.length) { int length = scanRecord[index++]; //Zero value indicates that we are done with the record now if (length == 0) { break; } int type = scanRecord[index]; //if the type is zero, then we are pass the significant section of the data, // and we are thud done if (type == 0) { break; } byte[] data = Arrays.copyOfRange(scanRecord, index + 1, index + length); if (data.length > 0) { StringBuilder hex = new StringBuilder(data.length * 2); // the data appears to be there backwards for (int bb = data.length - 1; bb >= 0; bb--) { hex.append(String.format("%02X", data[bb])); } ret.put(type, hex.toString()); Log.d(TAG, "parseRecord put one:\n" + type + " = " + hex.toString()); } index += length; } return ret; } }
[ "1239604859@qq.com" ]
1239604859@qq.com
6ff99b5e1bf1b8e746015445f2cb5133c1888c65
3a6535feb37d194ca17e36f7b165000168e53ed5
/spring-revisit-annotations/src/org/rajesh/boda/PingPongCoach.java
8d6440c5922192f5ab18599b9be0dc7bff632684
[]
no_license
rajeshboda/spring
f8600b00e4ffce302c44e7d6d5fc3cafc6777e2d
b05d52fd94a029b895a9eb77712812bfb509cf38
refs/heads/master
2020-04-20T18:55:35.929406
2019-05-14T09:42:12
2019-05-14T09:42:12
169,035,244
0
0
null
null
null
null
UTF-8
Java
false
false
636
java
package org.rajesh.boda; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component public class PingPongCoach implements Coach { @Autowired @Qualifier("fileFortuneService") private FortuneService fortuneService; public PingPongCoach() { System.out.println(">> PingPongCoach: inside default constructor"); } @Override public String getDailyWorkOut() { return "Practice your pingpong drop shot"; } @Override public String getDailyFortune() { return fortuneService.getFortune(); } }
[ "rajesh.boda@sap.com" ]
rajesh.boda@sap.com
a7716fd50662f569049164ad9b47b5e873f3ecfa
c1c509c5e32cf91d98f3bfc3ec903ba7059a397e
/MusicYao/MusicYao-web/src/test/java/com/yao/music/po/test/TestTable.java
16b87fc03b177994a93c671035574f9186cbc3e4
[]
no_license
yaoshining/MusicYao
5f92b7a7a64b00ac01dc5d663d8c712dec798e6d
7746b7a4071f26d1529f0dc40c4db32ccba6c34b
refs/heads/master
2020-06-08T11:02:14.474048
2014-04-17T11:26:09
2014-04-17T11:26:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.yao.music.po.test; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; /** * * @author 世宁 */ @Entity @Table public class TestTable implements Serializable{ @Id private int id; private String name; private String password; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "世宁@yao-thinkpad" ]
世宁@yao-thinkpad
73d11cd9e5005bfa66e51c3f076cd43704259df1
f6e5f4852b75dee46ea7937de105d6805c067a54
/injured-web-manager/target/classes/com/injured/project/system/role/service/IRoleService.java
03dceaa129b0dbf05a43b772185b5d8aa9eff86b
[ "MIT" ]
permissive
XuanYuanWuDi/springboot-demo
e0ac138a35d6d1ff7f72a2bba896efb2732d1aa5
4eb08f87fce9fcc34612bb06b9049d741eda0a00
refs/heads/master
2022-12-25T23:57:01.628568
2019-11-29T10:04:58
2019-11-29T10:04:58
224,823,311
0
0
null
2022-12-10T05:42:55
2019-11-29T09:39:51
Java
UTF-8
Java
false
false
5,194
java
package com.injured.project.system.role.service; import java.util.List; import java.util.Set; import com.injured.project.system.role.domain.Role; import com.injured.project.system.role.domain.RoleMenu; import com.injured.project.system.role.domain.SysUserAgnecyPrice; import com.injured.project.system.role.domain.SysUserAgencyPriceVo; import com.injured.project.system.role.domain.UserMenuVo; import com.injured.project.system.user.domain.UserRole; /** * 角色业务层 * * @author lzx */ public interface IRoleService { /** * 根据条件分页查询角色数据 * * @param role 角色信息 * @return 角色数据集合信息 */ public List<Role> selectRoleList(Role role); /** * 根据用户ID查询角色 * * @param userId 用户ID * @return 权限列表 */ public Set<String> selectRoleKeys(Long userId); /** * 根据用户ID查询角色 * * @param userId 用户ID * @return 角色列表 */ public List<Role> selectRolesByUserId(Long userId); /** * 查询所有角色 * * @return 角色列表 */ public List<Role> selectRoleAll(); /** * 通过角色ID查询角色 * * @param roleId 角色ID * @return 角色对象信息 */ public Role selectRoleById(Long roleId); /** * 通过角色ID删除角色 * * @param roleId 角色ID * @return 结果 */ public boolean deleteRoleById(Long roleId); /** * 批量删除角色用户信息 * * @param ids 需要删除的数据ID * @return 结果 * @throws Exception 异常 */ public int deleteRoleByIds(String ids) throws Exception; /** * 新增保存角色信息 * * @param role 角色信息 * @return 结果 */ public int insertRole(Role role); /** * 修改保存角色信息 * * @param role 角色信息 * @return 结果 */ public int updateRole(Role role); /** * 修改数据权限信息 * * @param role 角色信息 * @return 结果 */ public int authDataScope(Role role); /** * 校验角色名称是否唯一 * * @param role 角色信息 * @return 结果 */ public String checkRoleNameUnique(Role role); /** * 校验角色权限是否唯一 * * @param role 角色信息 * @return 结果 */ public String checkRoleKeyUnique(Role role); /** * 通过角色ID查询角色使用数量 * * @param roleId 角色ID * @return 结果 */ public int countUserRoleByRoleId(Long roleId); /** * 角色状态修改 * * @param role 角色信息 * @return 结果 */ public int changeStatus(Role role); /** * 取消授权用户角色 * * @param userRole 用户和角色关联信息 * @return 结果 */ public int deleteAuthUser(UserRole userRole); /** * 批量取消授权用户角色 * * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ public int deleteAuthUsers(Long roleId, String userIds); /** * 批量选择授权用户角色 * * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ public int insertAuthUsers(Long roleId, String userIds); /** * 根据用户id 查询权限信息 * * @param userId 用户id * @return 角色数据集合信息 */ public List<RoleMenu> selectPermissionsByUserId(Long userId); /** * 修改用户权限信息,添加修改日志 * @param roleMenuVo * @return */ public int updateRoleMenu(UserMenuVo roleMenuVo); /** * 根据userId查询roleId * @param userId * @return */ public Long selectRoleId(Long userId); /** * 根据用户id 查询用户 权限信息 * @param userId * @return */ public List<SysUserAgnecyPrice> selectByUserId(Long userId); /** * 根据角色id查询菜单列表 * @param roleId * @return */ public List<RoleMenu> selectMenuByRoleId(Long roleId); /** * 根据用户id和菜单id 查询金额权限 * @param userId * @param menuId * @return */ public List<SysUserAgnecyPrice> selectByUserIdAndMenuId(Long userId,Long menuId); /** * 查询该用户机构权限树 * @param roleMenuList * @param agencyPriceList * @param userId * @return */ public List<SysUserAgencyPriceVo> selectUserPrice(List<RoleMenu> roleMenuList,List<SysUserAgnecyPrice> agencyPriceList,Long userId); /** * 导入用户 保存权限信息 * @param userMenuVo * @return */ public int updateRoleMenuTest(UserMenuVo userMenuVo); }
[ "15330053776@163.com" ]
15330053776@163.com
6038c42b3dab5d7c2f08c541b18ee1e836c5c67e
bb23d874e1ee8de07660096e8aafdbcfe7a7294e
/src/main/java/lesson1/Wall.java
ff20d24778046c0323f624a13e8de40b4dd0c20b
[]
no_license
deld67/GeekJava2
02e0fbc1227522a25f4d9e12d9dc0492e1044876
dff066422d0796f6731fe7a069d247d61914c558
refs/heads/master
2021-01-13T19:11:40.940803
2020-03-12T15:14:16
2020-03-12T15:14:16
242,467,501
0
0
null
2020-10-13T19:50:07
2020-02-23T06:20:03
Java
UTF-8
Java
false
false
859
java
package lesson1; import java.util.Random; public class Wall extends Equipment { private int distance; static final String MYNAME = "стена"; static final int MAX_WALL_HEIGHT = 5; public Wall() { super(MYNAME); this.distance = new Random().nextInt(MAX_WALL_HEIGHT); //getHeight(); while (this.distance == 0 ) this.distance = new Random().nextInt(MAX_WALL_HEIGHT); } public String toString() { return " Снаряд \'"+getName()+"\' высотой "+this.distance; } @Override public boolean doRuning(Jump person) throws InterruptedException { System.out.println(" высота "+this.distance+" рекорд спортсмена "+person.getMaxJump()); if (person.getMaxJump() >= this.distance){ person.jumpUp(); } return false; } }
[ "deld67@gmail.com" ]
deld67@gmail.com
1b6f3ac7c0fe1d912c576528cfb1feb0f072103b
c38c7f14681780890fc1244752c2a5cc5e08b1d0
/src/main/java/com/lyn/code/util/JsonResult.java
431417c8257bc31f90aa9bdbf4e20fe0a8e2c9d4
[]
no_license
lihuiyang99/DataVisualization
86ecce4662d7167c2cd1e598aeb6979a6f12a976
5d98b7001e31c26f18c9a95ecbf0799c371ef9ef
refs/heads/master
2021-05-14T04:38:30.062150
2017-04-01T06:46:35
2017-04-01T06:46:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
723
java
package com.lyn.code.util; /** * format api return result * * @author Liu Yuning * */ public class JsonResult { private String code; private String msg; private Object obj; public JsonResult(APIStatusCode apiStatusCode, Object obj) { this.setCode(apiStatusCode); this.setMsg(apiStatusCode); this.setObj(obj); } public String getCode() { return code; } public void setCode(APIStatusCode apiStatusCode) { this.code = apiStatusCode.apiResultCode(); } public String getMsg() { return msg; } public void setMsg(APIStatusCode apiStatusCode) { this.msg = apiStatusCode.apiResultMsg(); } public Object getObj() { return obj; } public void setObj(Object obj) { this.obj = obj; } }
[ "yuning.liu@sap.com" ]
yuning.liu@sap.com
36e00dfc67b80c6b847117ec3b9dad6853c13a70
f3e119d6dbe75c3942c13c1c0bd005e1804d09f8
/app/src/main/java/com/example/marius/shoppingapp/activities/CompletedListActivity.java
f6afcd49e8e6d47955a1b93b9380dc187421c827
[]
no_license
MariusDK/shoppingrepo
0ea33d88e330a152077f30774eebd6391cd52e8a
f2a34252601037f16c2118ac7e2e455279edd35f
refs/heads/branch8
2020-03-27T05:08:39.477213
2018-10-30T09:00:12
2018-10-30T09:00:12
145,996,905
0
0
null
2018-10-30T09:00:04
2018-08-24T13:45:43
Java
UTF-8
Java
false
false
4,810
java
package com.example.marius.shoppingapp.activities; import android.content.Intent; import android.support.constraint.ConstraintLayout; import android.support.design.widget.TextInputEditText; import android.support.design.widget.TextInputLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.CardView; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; import com.example.marius.shoppingapp.R; import com.example.marius.shoppingapp.classes.Item; import com.example.marius.shoppingapp.classes.ShoppingList; import com.example.marius.shoppingapp.providers.ItemListProvider; import com.example.marius.shoppingapp.providers.ItemProvider; import com.example.marius.shoppingapp.providers.UserProvider; import java.util.ArrayList; public class CompletedListActivity extends AppCompatActivity implements ItemListProvider.getShoppingListListener,ItemProvider.getItemsListener{ UserProvider userProvider; ItemListProvider itemListProvider; ItemProvider provider; private LinearLayout linearView; private Toolbar toolbar; private String id_list; private TextView locatieTextView; private TextView descriereTextView; private TextView textView; private String ShoppingListTitle; private ArrayList<Item> items; private TextInputEditText numeInput; private TextInputEditText cantitateInput; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_completed_list); toolbar = (Toolbar) findViewById(R.id.toolbar_compListBar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); this.setSupportActionBar(toolbar); Intent intent = getIntent(); id_list = intent.getStringExtra("listKey"); linearView = findViewById(R.id.list_items_comp_id); locatieTextView = findViewById(R.id.id_location_comp); descriereTextView = findViewById(R.id.id_description_comp); textView = findViewById(R.id.titlu_comp_id); userProvider = new UserProvider(); itemListProvider = new ItemListProvider(this); itemListProvider.getShoppingListById(id_list); provider = new ItemProvider(this); provider.getItems(id_list); provider.getItemArrayList(); numeInput = findViewById(R.id.item_name_details_id); cantitateInput = findViewById(R.id.item_quantity_details_id); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Intent intent = new Intent(this,ShoppingListActivity.class); startActivity(intent); finish(); return true; default: return super.onOptionsItemSelected(item); } } @Override public void finishGetShoppingList(ShoppingList shoppingList) { ShoppingListTitle = shoppingList.getNume(); //toolbar.setTitle(ShoppingListTitle); //getSupportActionBar().setTitle(ShoppingListTitle); //this.setSupportActionBar(toolbar); textView.setText(shoppingList.getNume()); locatieTextView.setText(shoppingList.getLocation()); descriereTextView.setText(shoppingList.getDescription()); } public void setDataTOCardView(Item i) { CardView cardView = (CardView) linearView.getChildAt(items.indexOf(i)); ConstraintLayout constraintLayout = (ConstraintLayout) cardView.getChildAt(0); TextInputLayout TextItemName = (TextInputLayout) constraintLayout.getChildAt(0); TextInputLayout TextItemQuantity = (TextInputLayout) constraintLayout.getChildAt(1); FrameLayout frameLayout = (FrameLayout) TextItemName.getChildAt(0); EditText editTextName = (EditText) frameLayout.getChildAt(0); editTextName.setText(i.getName().toString()); FrameLayout frameLayout2 = (FrameLayout) TextItemQuantity.getChildAt(0); EditText editTextQuantity = (EditText) frameLayout2.getChildAt(0); editTextQuantity.setText(""+i.getQuantity()); } @Override public void getItemListener(ArrayList<Item> items) { this.items = items; for (Item item1:items) { View v = LayoutInflater.from(CompletedListActivity.this).inflate(R.layout.item_list_comp,null); linearView.addView(v); setDataTOCardView(item1); } this.items.clear(); } }
[ "mariusdk7@gmail.com" ]
mariusdk7@gmail.com
c8e154816f249d913394bcd37d668250ab4ceaa8
7b0521dfb4ec76ee1632b614f32ee532f4626ea2
/src/main/java/alcoholmod/Mathioks/SixPaths/RenderGiantPanda.java
489cf0c64fdbcd8c132c14d0cc36a896cc3055c4
[]
no_license
M9wo/NarutoUnderworld
6c5be180ab3a00b4664fd74f6305e7a1b50fe9fc
948065d8d43b0020443c0020775991b91f01dd50
refs/heads/master
2023-06-29T09:27:24.629868
2021-07-27T03:18:08
2021-07-27T03:18:08
389,832,397
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
package alcoholmod.Mathioks.SixPaths; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class RenderGiantPanda extends RenderLiving { private static final ResourceLocation mobTextures = new ResourceLocation("tm:textures/entity/GiantPanda.png"); public RenderGiantPanda(ModelBase par1ModelBase, float par2) { super(par1ModelBase, par2); } protected ResourceLocation getEntityTexture(EntityGiantPanda Entity) { return mobTextures; } protected ResourceLocation getEntityTexture(Entity entity) { return getEntityTexture((EntityGiantPanda)entity); } protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { GL11.glScalef(2.0F, 2.0F, 2.0F); } }
[ "mrkrank2023@gmail.com" ]
mrkrank2023@gmail.com
42197dcf58893de81302d09962e30a4fc6dffb43
e210ce1a7d8f213f77ba6bc783a6140401947e79
/data-structure/src/main/java/com/example/data/chapter1/demo1/SqlListUseCase1.java
e60b0d6759a411f8bd9cf40123adc46f737f8c59
[]
no_license
ReExia/java-demos
2439e3184288f724dc42a39e4509028532c4234e
85252aa4bb1e71d357edeba6dc3c631077bcf214
refs/heads/master
2020-03-26T05:31:59.474894
2018-08-30T05:05:15
2018-08-30T05:05:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,277
java
package com.example.data.chapter1.demo1; import java.util.Scanner; /** * 顺序表应用 */ public class SqlListUseCase1 { public static void main(String[] args) throws Exception { SqlList sqlList = new SqlList(26); for (int i = 0; i < 26; i++){ sqlList.insert(i, (char) ('a' + i)); } while (true){ System.out.println("请输入需要查询的元素位序号:"); int input = new Scanner(System.in).nextInt(); if (input == 0){ System.out.println("第" + input + "个元素的直接前驱不存在"); System.out.println("第" + input + "个元素的直接后继为 : " + sqlList.get(input + 1)); } if (input > 0 && input < 25){ System.out.println("第" + input + "个元素的直接前驱为 : " + sqlList.get(input - 1)); System.out.println("第" + input + "个元素的直接后继为 : " + sqlList.get(input + 1)); } if (input >= 25){ System.out.println("第" + input + "个元素的直接后继不存在"); System.out.println("第" + input + "个元素的直接前驱为 : " + sqlList.get(input - 1)); } } } }
[ "liu1023434681@qq.com" ]
liu1023434681@qq.com
a09bb9940df2456d01b025879e4f4a68cd1ed91a
b71b879318671bb79a86dcad60374c0ff5561e1f
/PMR_Parking/PMR_Parking/PMR_Parking.Android/obj/Debug/110/android/src/crc64d32ffa835eadac0e/DelegateCancelableCallback.java
45e7d998d42bc3af62a435dfada4fd4e6741d04c
[]
no_license
CarlosFdezJim/PMR-Parking
11a1d90bc3a8d0686364a41eb3acdfef02a7605d
3dc4c0c4bac13e860b2a2a4dea6b725d4312b951
refs/heads/master
2023-05-10T04:00:28.936070
2021-06-17T05:47:21
2021-06-17T05:47:21
376,351,945
1
0
null
null
null
null
UTF-8
Java
false
false
1,490
java
package crc64d32ffa835eadac0e; public class DelegateCancelableCallback extends java.lang.Object implements mono.android.IGCUserPeer, com.google.android.gms.maps.GoogleMap.CancelableCallback { /** @hide */ public static final String __md_methods; static { __md_methods = "n_onCancel:()V:GetOnCancelHandler:Android.Gms.Maps.GoogleMap/ICancelableCallbackInvoker, Xamarin.GooglePlayServices.Maps\n" + "n_onFinish:()V:GetOnFinishHandler:Android.Gms.Maps.GoogleMap/ICancelableCallbackInvoker, Xamarin.GooglePlayServices.Maps\n" + ""; mono.android.Runtime.register ("Xamarin.Forms.GoogleMaps.Android.Logics.DelegateCancelableCallback, Xamarin.Forms.GoogleMaps.Android", DelegateCancelableCallback.class, __md_methods); } public DelegateCancelableCallback () { super (); if (getClass () == DelegateCancelableCallback.class) mono.android.TypeManager.Activate ("Xamarin.Forms.GoogleMaps.Android.Logics.DelegateCancelableCallback, Xamarin.Forms.GoogleMaps.Android", "", this, new java.lang.Object[] { }); } public void onCancel () { n_onCancel (); } private native void n_onCancel (); public void onFinish () { n_onFinish (); } private native void n_onFinish (); private java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
[ "carlosfdezjim@gmail.com" ]
carlosfdezjim@gmail.com
280d8d061af1b331112295e40ba2f63dd9266b8c
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/vlog/ui/video/EditorVideoCompositionPluginLayout.java
669cdea84318a9fa8bc4c7587306bb8f85f44763
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
46,217
java
package com.tencent.mm.plugin.vlog.ui.video; import android.animation.Animator.AnimatorListener; import android.app.Activity; import android.content.Context; import android.graphics.BitmapFactory; import android.graphics.BitmapFactory.Options; import android.graphics.Point; import android.os.Bundle; import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.ViewPropertyAnimator; import android.widget.TextView; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.autogen.mmdata.rpt.oo; import com.tencent.mm.autogen.mmdata.rpt.oz; import com.tencent.mm.modelcontrol.VideoTransPara; import com.tencent.mm.plugin.recordvideo.activity.a.a; import com.tencent.mm.plugin.recordvideo.b.e; import com.tencent.mm.plugin.recordvideo.jumper.CaptureDataManager; import com.tencent.mm.plugin.recordvideo.jumper.RecordConfigProvider; import com.tencent.mm.plugin.recordvideo.model.audio.AudioCacheInfo; import com.tencent.mm.plugin.recordvideo.plugin.parent.BaseEditVideoPluginLayout; import com.tencent.mm.plugin.recordvideo.plugin.parent.a.c; import com.tencent.mm.plugin.recordvideo.plugin.u; import com.tencent.mm.plugin.recordvideo.ui.editor.EditorAudioView; import com.tencent.mm.plugin.recordvideo.ui.editor.item.EditorItemContainer; import com.tencent.mm.plugin.recordvideo.ui.editor.item.q; import com.tencent.mm.plugin.vlog.model.ac; import com.tencent.mm.protocal.protobuf.djw; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.Util; import com.tencent.mm.ui.aw; import com.tencent.mm.ui.bf; import com.tencent.mm.vfs.y; import com.tencent.mm.videocomposition.play.VideoCompositionPlayView; import com.tencent.threadpool.i; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import kotlin.Metadata; import kotlin.ResultKt; import kotlin.a.p; import kotlin.ah; import kotlin.g.a.m; import kotlinx.coroutines.aq; import kotlinx.coroutines.bg; import kotlinx.coroutines.bu; import kotlinx.coroutines.cb; import kotlinx.coroutines.l; @Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/vlog/ui/video/EditorVideoCompositionPluginLayout;", "Lcom/tencent/mm/plugin/recordvideo/plugin/parent/BaseEditVideoPluginLayout;", "Lcom/tencent/mm/plugin/recordvideo/plugin/parent/IRecordStatus;", "context", "Landroid/content/Context;", "attrs", "Landroid/util/AttributeSet;", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "mediaModel", "Lcom/tencent/mm/plugin/vlog/ui/video/MediaModel;", "previewNewPlugin", "Lcom/tencent/mm/plugin/vlog/ui/video/EditVideoPreviewPlugin;", "reMuxNewPlugin", "Lcom/tencent/mm/plugin/vlog/ui/video/RemuxNewPlugin;", "createReportString", "", "city", "poiName", "getPlayerView", "Landroid/view/View;", "loadCurrentPage", "", "info", "Lcom/tencent/mm/media/widget/camerarecordview/data/MediaCaptureInfo;", "onBackPress", "", "prepareImageSizeReport", "prepareStoryBehaviorReport", "prepareStoryFailBehaviorReport", "setupMediaData", "Lkotlinx/coroutines/Job;", "setupNormalVideoPlugins", "statusChange", "status", "Lcom/tencent/mm/plugin/recordvideo/plugin/parent/IRecordStatus$RecordStatus;", "param", "Landroid/os/Bundle;", "Companion", "plugin-vlog_release"}, k=1, mv={1, 5, 1}, xi=48) public class EditorVideoCompositionPluginLayout extends BaseEditVideoPluginLayout implements com.tencent.mm.plugin.recordvideo.plugin.parent.a { public static final EditorVideoCompositionPluginLayout.a UrH; private d UrE; private c UrI; private final e UrJ; static { AppMethodBeat.i(282042); UrH = new EditorVideoCompositionPluginLayout.a((byte)0); AppMethodBeat.o(282042); } public EditorVideoCompositionPluginLayout(Context paramContext, AttributeSet paramAttributeSet) { super(paramContext, paramAttributeSet); AppMethodBeat.i(281977); this.UrE = new d(); com.tencent.mm.plugin.vlog.model.local.a.a(com.tencent.mm.plugin.vlog.model.local.a.UbD); this.UrJ = new e(paramContext, (com.tencent.mm.plugin.recordvideo.plugin.parent.a)this); getPluginList().add(this.UrJ); AppMethodBeat.o(281977); } private static final void a(EditorVideoCompositionPluginLayout paramEditorVideoCompositionPluginLayout) { Object localObject2 = null; AppMethodBeat.i(282011); kotlin.g.b.s.u(paramEditorVideoCompositionPluginLayout, "this$0"); Object localObject1 = paramEditorVideoCompositionPluginLayout.getCaptureInfo(); if (localObject1 == null) { localObject1 = null; y.deleteFile((String)localObject1); paramEditorVideoCompositionPluginLayout = paramEditorVideoCompositionPluginLayout.getCaptureInfo(); if (paramEditorVideoCompositionPluginLayout != null) { break label59; } } label59: for (paramEditorVideoCompositionPluginLayout = localObject2;; paramEditorVideoCompositionPluginLayout = paramEditorVideoCompositionPluginLayout.nJU) { y.deleteFile(paramEditorVideoCompositionPluginLayout); AppMethodBeat.o(282011); return; localObject1 = ((com.tencent.mm.media.widget.camerarecordview.b.b)localObject1).nJX; break; } } private final void gIY() { AppMethodBeat.i(281991); Object localObject1 = ((Iterable)getItemContainerPlugin().getEditorDataList()).iterator(); int j = 0; int i = 0; while (((Iterator)localObject1).hasNext()) { Object localObject2 = (com.tencent.mm.plugin.recordvideo.ui.editor.item.a)((Iterator)localObject1).next(); Object localObject3 = ((com.tencent.mm.plugin.recordvideo.ui.editor.item.a)localObject2).NXP; switch (b.avl[localObject3.ordinal()]) { default: break; case 1: i += 1; break; case 2: j += 1; break; case 3: localObject2 = (djw)((com.tencent.mm.plugin.recordvideo.ui.editor.item.a)localObject2).gKs(); localObject3 = com.tencent.mm.plugin.recordvideo.f.c.NRf; localObject3 = com.tencent.mm.plugin.recordvideo.f.c.gJf(); String str1 = ((djw)localObject2).NYS; kotlin.g.b.s.s(str1, "poiData.cityName"); String str2 = ((djw)localObject2).poiName; kotlin.g.b.s.s(str2, "poiData.poiName"); StringBuilder localStringBuilder = new StringBuilder(); if (!TextUtils.isEmpty((CharSequence)str1)) { localStringBuilder.append(kotlin.n.n.m(str1, ",", " ", true)); } if (!TextUtils.isEmpty((CharSequence)str2)) { if (((CharSequence)localStringBuilder).length() <= 0) { break label328; } } for (int k = 1;; k = 0) { if (k != 0) { localStringBuilder.append("|"); } localStringBuilder.append(kotlin.n.n.m(str2, ",", " ", true)); str1 = localStringBuilder.toString(); kotlin.g.b.s.s(str1, "reportPositionString.toString()"); ((oo)localObject3).wo(str1); localObject3 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().wp(String.valueOf(((djw)localObject2).latitude)); localObject3 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().wq(String.valueOf(((djw)localObject2).longitude)); break; } case 4: localObject2 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjJ = 1L; break; case 5: label328: localObject2 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjK = 1L; } } localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjx = i; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjy = j; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.gJf(); if (getMoreMenuPlugin().NJY) {} for (long l = 1L;; l = 0L) { ((oo)localObject1).jjG = l; AppMethodBeat.o(281991); return; } } private final void gIZ() { AppMethodBeat.i(282003); StringBuilder localStringBuilder = new StringBuilder(); Object localObject = getCaptureInfo(); if (localObject != null) { localObject = ((com.tencent.mm.media.widget.camerarecordview.b.b)localObject).nKc; if (localObject != null) { localObject = ((Iterable)localObject).iterator(); while (((Iterator)localObject).hasNext()) { String str = (String)((Iterator)localObject).next(); BitmapFactory.Options localOptions = new BitmapFactory.Options(); localOptions.inJustDecodeBounds = true; BitmapFactory.decodeFile(str, localOptions); i = localOptions.outWidth; int j = localOptions.outHeight; localStringBuilder.append(j + ':' + i + "||"); } } } int i = localStringBuilder.lastIndexOf("||"); if (i >= 0) { localObject = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().wr(localStringBuilder.substring(0, i).toString()); } AppMethodBeat.o(282003); } public final void a(com.tencent.mm.media.widget.camerarecordview.b.b paramb) { Object localObject2 = null; AppMethodBeat.i(282072); Log.i("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("loadCurrentPage info ", paramb)); super.a(paramb); Object localObject3 = this.UrI; Object localObject1 = localObject3; if (localObject3 == null) { kotlin.g.b.s.bIx("previewNewPlugin"); localObject1 = null; } localObject3 = this.UrE; kotlin.g.b.s.u(localObject3, "mediaModel"); ((c)localObject1).UrE = ((d)localObject3); kotlinx.coroutines.j.a((aq)bu.ajwo, (kotlin.d.f)bg.kCh(), null, (m)new c(this, null), 2); long l; if (paramb != null) { localObject1 = com.tencent.mm.plugin.recordvideo.util.d.Obm; com.tencent.mm.plugin.recordvideo.util.d.ahc(0); if (paramb.buf()) { localObject1 = com.tencent.mm.plugin.recordvideo.util.d.Obm; com.tencent.mm.plugin.recordvideo.util.d.ahc(com.tencent.mm.plugin.recordvideo.util.d.gLe() + 1); } if (paramb.bue()) { localObject1 = com.tencent.mm.plugin.recordvideo.util.d.Obm; com.tencent.mm.plugin.recordvideo.util.d.ahc(com.tencent.mm.plugin.recordvideo.util.d.gLe() + 1); } l = Util.currentTicks(); localObject1 = getBgPlugin(); localObject3 = getCaptureInfo(); kotlin.g.b.s.checkNotNull(localObject3); ((com.tencent.mm.plugin.recordvideo.plugin.s)localObject1).a((com.tencent.mm.media.widget.camerarecordview.b.b)localObject3, getConfigProvider()); localObject3 = this.UrJ; localObject1 = getConfigProvider(); kotlin.g.b.s.checkNotNull(localObject1); kotlin.g.b.s.u(paramb, "info"); kotlin.g.b.s.u(localObject1, "configProvider"); ((e)localObject3).NLs = paramb; ((e)localObject3).oaV = ((RecordConfigProvider)localObject1); localObject1 = ((e)localObject3).oaV; if (localObject1 != null) { break label776; } localObject1 = localObject2; ((e)localObject3).KVn = ((VideoTransPara)localObject1); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_IS_CAPUTRE_BOOLEAN", Boolean.valueOf(paramb.nJW)); if (paramb.nJW) { localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_CAPUTRE_VIDEO_PATH_STRING", paramb.bug()); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_CAPUTRE_THUMB_PATH_STRING", paramb.buh()); } Log.d("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("reMuxNewPlugin ", Long.valueOf(Util.ticksToNow(l)))); localObject1 = getCropVideoPlugin(); localObject2 = getCaptureInfo(); kotlin.g.b.s.checkNotNull(localObject2); localObject3 = getConfigProvider(); kotlin.g.b.s.checkNotNull(localObject3); ((com.tencent.mm.plugin.recordvideo.plugin.cropvideo.a)localObject1).c((com.tencent.mm.media.widget.camerarecordview.b.b)localObject2, (RecordConfigProvider)localObject3); Log.d("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("cropVideoPlugin ", Long.valueOf(Util.ticksToNow(l)))); if (paramb.nKf != null) { localObject1 = paramb.nKf; kotlin.g.b.s.checkNotNull(localObject1); localObject2 = AudioCacheInfo.NIB; localObject1 = ((Bundle)localObject1).getParcelableArrayList(AudioCacheInfo.gHN()); localObject2 = paramb.nKf; kotlin.g.b.s.checkNotNull(localObject2); localObject3 = AudioCacheInfo.NIB; i = ((Bundle)localObject2).getInt(AudioCacheInfo.gHM(), 0); if ((localObject1 != null) && (!((ArrayList)localObject1).isEmpty())) { getAddMusicPlugin().d(i, (ArrayList)localObject1); } } localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_MEDIA_TYPE_INT", Integer.valueOf(2)); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_ORIGIN_MEDIA_DURATION_MS_LONG", Integer.valueOf(paramb.endTime)); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_ENTER_EDIT_PAGE_TIME_MS_LONG", Long.valueOf(System.currentTimeMillis())); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_EDIT_PUBLISHID_INT", Long.valueOf(System.currentTimeMillis())); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjv = System.currentTimeMillis(); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.gJf(); localObject2 = (Collection)paramb.nKc; if ((localObject2 != null) && (!((Collection)localObject2).isEmpty())) { break label786; } i = 1; label584: if (i != 0) { break label791; } l = 1L; label590: ((oo)localObject1).jjH = l; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjI = paramb.nKc.size(); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.gJg(); localObject2 = (Collection)paramb.nKc; if ((localObject2 != null) && (!((Collection)localObject2).isEmpty())) { break label798; } i = 1; label651: if (i != 0) { break label803; } l = 1L; label657: ((oz)localObject1).jjH = l; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJg().jjI = paramb.nKc.size(); if (!paramb.nJW) { break label810; } localObject1 = com.tencent.mm.plugin.recordvideo.f.g.NRB; com.tencent.mm.plugin.recordvideo.f.g.aTj(paramb.nJU); localObject1 = com.tencent.mm.plugin.recordvideo.f.g.NRB; com.tencent.mm.plugin.recordvideo.f.g.aTk(paramb.nJX); label713: paramb = com.tencent.mm.plugin.recordvideo.f.g.NRB; com.tencent.mm.plugin.recordvideo.f.g.setConfigProvider(getConfigProvider()); paramb = getCaptureInfo(); kotlin.g.b.s.checkNotNull(paramb); if (!paramb.nJW) { paramb = getConfigProvider(); if (paramb != null) { break label825; } } } label776: label786: label791: label798: label803: label810: label825: for (int i = 0;; i = paramb.scene) { if (i > 0) { paramb = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_MEDIA_SOURCE_INT", Integer.valueOf(0)); } AppMethodBeat.o(282072); return; localObject1 = ((RecordConfigProvider)localObject1).oXZ; break; i = 0; break label584; l = 2L; break label590; i = 0; break label651; l = 2L; break label657; localObject1 = com.tencent.mm.plugin.recordvideo.f.g.NRB; com.tencent.mm.plugin.recordvideo.f.g.aTl(paramb.nJU); break label713; } } public final void a(a.c paramc, Bundle paramBundle) { AppMethodBeat.i(282102); kotlin.g.b.s.u(paramc, "status"); boolean bool; label178: int j; label195: int k; label207: int m; switch (b.$EnumSwitchMapping$0[paramc.ordinal()]) { default: super.a(paramc, paramBundle); case 1: do { AppMethodBeat.o(282102); return; } while (paramBundle == null); bool = paramBundle.getBoolean("PARAM_EDIT_ORIGIN_VOICE_MUTE_BOOLEAN"); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } paramc = paramc.UrD; if (paramc != null) { paramc.NX(bool); } AppMethodBeat.o(282102); return; case 2: getVideoControlContainerPlugin().setVisibility(4); if (paramBundle != null) { bool = paramBundle.getBoolean("EDIT_CROP_VIDEO_SHOW_WESEE_SWITCH_BOOLEAN", false); paramc = this.UrI; if (paramc != null) { break label693; } kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; paramc.NKN = true; paramBundle = paramc.gIE(); if (paramBundle != null) { break label696; } j = 0; paramBundle = paramc.gIE(); if (paramBundle != null) { break label705; } k = 0; m = com.tencent.mm.cd.a.fromDPToPix(paramc.context, 20) + com.tencent.mm.cd.a.fromDPToPix(paramc.context, 95) + com.tencent.mm.cd.a.fromDPToPix(paramc.context, 12); if (!bf.bg(paramc.context)) { break label2156; } m += bf.bk(paramc.context); } break; } label343: label354: label2156: for (;;) { int i = 0; if (bool) { i = com.tencent.mm.cd.a.fromDPToPix(paramc.context, 56) + 0; if (aw.bx(paramc.context)) { Log.d("MicroMsg.EditVideoPreviewPlugin", "hasCutOut is true,videoViewTopMargin: " + i + ", cutout height is " + aw.bw(paramc.context)); i += aw.bw(paramc.context); } } else { paramBundle = paramc.gIE(); if (paramBundle != null) { break label726; } paramBundle = null; if (paramBundle != null) { break label737; } n = m + 0; label364: if (n >= com.tencent.mm.plugin.mmsight.d.iQ(paramc.context).y) { break label2143; } } for (int n = (int)((j - com.tencent.mm.cd.a.fromDPToPix(paramc.context, 32) * 2) / (j / k));; n = k - m - i) { int i1 = (int)(j / k * n); float f1 = i1 / j; float f2 = n / k; float f3 = -(Math.abs(m - i) / 2.0F); Log.i("MicroMsg.EditVideoPreviewPlugin", "scaleX: " + f1 + ", scaleY: " + f2 + ", translationY: " + f3); Log.i("MicroMsg.EditVideoPreviewPlugin", "isShowWeseeBtn: " + bool + ", videoViewWidth: " + j + ", videoViewHeight: " + k + ", videoViewBottomMargin:" + m + ", videoViewTopMargin:" + i + ", videoViewScaleHeight: " + n + ", videoViewScaleWidth: " + i1); paramBundle = paramc.gIE(); if (paramBundle != null) { paramBundle = paramBundle.animate(); if (paramBundle != null) { paramBundle = paramBundle.scaleX(f1); if (paramBundle != null) { paramBundle = paramBundle.scaleY(f2); if (paramBundle != null) { paramBundle = paramBundle.translationY(f3); if (paramBundle != null) { paramBundle = paramBundle.setDuration(300L); if (paramBundle != null) { paramBundle.setListener((Animator.AnimatorListener)new c.b(paramc)); } } } } } } getItemContainerPlugin().gIs(); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_ENTER_CROP_PAGE_TIME_MS_LONG", Long.valueOf(System.currentTimeMillis())); AppMethodBeat.o(282102); return; break label178; j = paramBundle.getWidth(); break label195; k = paramBundle.getHeight(); break label207; Log.d("MicroMsg.EditVideoPreviewPlugin", "hasCutOut is false"); break label343; paramBundle = Integer.valueOf(paramBundle.getBottom()); break label354; n = paramBundle.intValue(); break label364; if (paramBundle == null) { break; } i = paramBundle.getInt("EDIT_CROP_VIDEO_LENGTH_START_TIME_INT"); j = paramBundle.getInt("EDIT_CROP_VIDEO_LENGTH_END_TIME_INT"); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } Log.i("MicroMsg.EditVideoPreviewPlugin", "setPlayRange >> start: " + i + ", end: " + j); paramc.startTime = i; paramc.endTime = j; paramc = paramc.UrD; if (paramc != null) { paramc.bs(i, j); } paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } if (paramc.UrD != null) { paramBundle = paramc.UrD; kotlin.g.b.s.checkNotNull(paramBundle); if (!paramBundle.isPlaying()) { paramBundle = paramc.UrD; kotlin.g.b.s.checkNotNull(paramBundle); paramBundle.resume(); } paramc = paramc.UrD; kotlin.g.b.s.checkNotNull(paramc); paramc.seekTo(i); } AppMethodBeat.o(282102); return; paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } paramc.hSS(); AppMethodBeat.o(282102); return; paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } paramc.onResume(); AppMethodBeat.o(282102); return; AppMethodBeat.o(282102); return; paramc = getCaptureInfo(); if (paramc == null) { break; } paramBundle = getConfigProvider(); if (paramBundle == null) { i = 10000; } while (paramc.endTime - paramc.startTime > i + 250) { paramc = com.tencent.mm.plugin.recordvideo.f.g.NRB; com.tencent.mm.plugin.recordvideo.f.g.aQ(2, 3L); paramc = getContext(); if (paramc == null) { paramc = new NullPointerException("null cannot be cast to non-null type android.app.Activity"); AppMethodBeat.o(282102); throw paramc; i = paramBundle.NHZ; } else { ((Activity)paramc).setResult(3000); paramc = getContext(); if (paramc == null) { paramc = new NullPointerException("null cannot be cast to non-null type android.app.Activity"); AppMethodBeat.o(282102); throw paramc; } ((Activity)paramc).finish(); AppMethodBeat.o(282102); return; } } getVideoControlContainerPlugin().setVisibility(0); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } paramc.AX(false); getItemContainerPlugin().gIt(); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_EXIT_CROP_PAGE_TIME_MS_LONG", Long.valueOf(System.currentTimeMillis())); AppMethodBeat.o(282102); return; getVideoControlContainerPlugin().setVisibility(0); getAddMusicPlugin().gIV(); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } paramc.AX(true); getItemContainerPlugin().gIt(); Object localObject1 = new StringBuilder("crop finish >> startTime: "); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } localObject1 = ((StringBuilder)localObject1).append(paramc.startTime).append(" >> endTime: "); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } Log.i("MicroMsg.EditorVideoCompositionPluginLayout", paramc.endTime); localObject1 = this.UrE; paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } long l = paramc.startTime; paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } ((d)localObject1).bB(l, paramc.endTime); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_EXIT_CROP_PAGE_TIME_MS_LONG", Long.valueOf(System.currentTimeMillis())); AppMethodBeat.o(282102); return; paramc = this.UrE; if ((paramc.maxWidth == 0) || (paramc.maxHeight == 0)) { Log.e(paramc.TAG, "isNormalSizeValid maxWidth: " + paramc.maxWidth + ", maxHeight: " + paramc.maxHeight); } for (i = 0; i == 0; i = 1) { Log.e("MicroMsg.EditorVideoCompositionPluginLayout", "size is not valid,return this click"); AppMethodBeat.o(282102); return; } localObject1 = getBgPlugin().gID(); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } paramc.hSS(); getItemContainerPlugin().onPause(); getAddMusicPlugin().onPause(); i = 0; if (getMoreMenuPlugin().NJY) { i = 1; } CaptureDataManager.NHH.rnY.putInt("key_extra_feature_flag", i); if (getMoreMenuPlugin().dbk == 2) { CaptureDataManager.NHH.rnY.putString("key_group_list", getMoreMenuPlugin().gIy()); bool = getAddMusicPlugin().Gso.getMuteOrigin(); Object localObject2 = getAddMusicPlugin().Gss; ArrayList localArrayList1 = com.tencent.mm.plugin.recordvideo.plugin.j.a(getItemContainerPlugin()); ArrayList localArrayList2 = getItemContainerPlugin().getEditorDataList(); float[] arrayOfFloat = getItemContainerPlugin().gIq(); paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } i = paramc.startTime; paramBundle = this.UrI; paramc = paramBundle; if (paramBundle == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramc = null; } j = paramc.endTime; paramc = new ArrayList(); getItemContainerPlugin(); paramc = new com.tencent.mm.plugin.recordvideo.c.g(bool, (AudioCacheInfo)localObject2, localArrayList1, localArrayList2, arrayOfFloat, i, j, paramc, (String)localObject1, com.tencent.mm.plugin.recordvideo.plugin.j.gIr()); Log.i("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("edit config: ", paramc)); paramBundle = com.tencent.mm.plugin.recordvideo.f.g.NRB; j = getItemContainerPlugin().gIu(); k = getItemContainerPlugin().gIv(); if (getAddMusicPlugin().Gss != null) { break label2116; } i = 0; com.tencent.mm.plugin.recordvideo.f.g.M(new int[] { j, k, i }); paramBundle = this.UrJ; localObject1 = this.UrE; kotlin.g.b.s.u(paramc, "editConfig"); kotlin.g.b.s.u(localObject1, "mediaModel"); localObject2 = paramBundle.NLw; if (localObject2 != null) { ((cb)localObject2).a(null); } paramBundle.NLw = kotlinx.coroutines.j.a(paramBundle.scope, null, null, (m)new e.i(paramBundle, paramc, (d)localObject1, null), 3); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_ADD_EMOJI_COUNT_INT", Integer.valueOf(getItemContainerPlugin().gIu())); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_ADD_TEXT_COUNT_INT", Integer.valueOf(getItemContainerPlugin().gIv())); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; if (getAddMusicPlugin().Gss != null) { break label2122; } i = 0; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_SELECT_MUSIC_INT", Integer.valueOf(i)); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; if (!getAddMusicPlugin().Gso.getMuteOrigin()) { break label2128; } i = 0; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_SELECT_ORIGIN_INT", Integer.valueOf(i)); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_AFTER_EDIT_INT", Integer.valueOf(1)); gIY(); gIZ(); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.agH(13); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJf().jjw = System.currentTimeMillis(); paramc = com.tencent.mm.plugin.recordvideo.f.c.NRf; paramc = getConfigProvider(); if (paramc != null) { break label2134; } } for (i = 0;; i = paramc.scene) { com.tencent.mm.plugin.recordvideo.f.c.agI(i); paramc = com.tencent.mm.plugin.recordvideo.model.audio.c.NJe; paramc = com.tencent.mm.plugin.recordvideo.model.audio.c.gIh(); if (paramc != null) { paramc.gId(); } AppMethodBeat.o(282102); return; if (getMoreMenuPlugin().dbk != 3) { break; } CaptureDataManager.NHH.rnY.putString("key_black_list", getMoreMenuPlugin().gIy()); break; i = 1; break label1801; i = 1; break label1953; i = 1; break label1984; } } } } public View getPlayerView() { AppMethodBeat.i(282056); Object localObject1 = getContext(); kotlin.g.b.s.s(localObject1, "context"); VideoCompositionPlayView localVideoCompositionPlayView = new VideoCompositionPlayView((Context)localObject1); Log.i("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("videoPlayView :", localVideoCompositionPlayView)); setPreviewPlugin(new u(null, (com.tencent.mm.plugin.recordvideo.plugin.parent.a)this, null)); localObject1 = (com.tencent.mm.plugin.recordvideo.plugin.parent.a)this; Object localObject2 = (TextView)findViewById(b.e.video_debug_info); Object localObject3 = getContext(); kotlin.g.b.s.s(localObject3, "context"); this.UrI = new c(localVideoCompositionPlayView, (com.tencent.mm.plugin.recordvideo.plugin.parent.a)localObject1, (TextView)localObject2, (Context)localObject3); localObject3 = getPluginList(); localObject2 = this.UrI; localObject1 = localObject2; if (localObject2 == null) { kotlin.g.b.s.bIx("previewNewPlugin"); localObject1 = null; } ((ArrayList)localObject3).add(localObject1); localObject1 = (View)localVideoCompositionPlayView; AppMethodBeat.o(282056); return localObject1; } public final boolean onBackPress() { long l = 1L; int k = 0; AppMethodBeat.i(282113); Object localObject1; int j; int i; Object localObject2; if (!super.onBackPress()) { Log.i("MicroMsg.EditorVideoCompositionPluginLayout", "onBackPress"); localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.I("KEY_AFTER_EDIT_INT", Integer.valueOf(0)); localObject1 = ((Iterable)getItemContainerPlugin().NJQ.getAllItemViews()).iterator(); j = 0; i = 0; while (((Iterator)localObject1).hasNext()) { localObject2 = (com.tencent.mm.plugin.recordvideo.ui.editor.item.h)((Iterator)localObject1).next(); if ((localObject2 instanceof com.tencent.mm.plugin.recordvideo.ui.editor.item.f)) { i += 1; } else if ((localObject2 instanceof com.tencent.mm.plugin.recordvideo.ui.editor.item.s)) { j += 1; } else if ((localObject2 instanceof q)) { localObject2 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJg().jkY = 1L; } else if ((!(localObject2 instanceof com.tencent.mm.plugin.recordvideo.ui.editor.item.n)) && ((localObject2 instanceof com.tencent.mm.plugin.recordvideo.ui.editor.item.t))) { localObject2 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJg().jjK = 1L; } } localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.gJg(); if (!getMoreMenuPlugin().NJY) { break label355; } } for (;;) { ((oz)localObject1).jjG = l; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJg().jjx = i; localObject1 = com.tencent.mm.plugin.recordvideo.f.c.NRf; com.tencent.mm.plugin.recordvideo.f.c.gJg().jjy = j; localObject1 = getCaptureInfo(); i = k; if (localObject1 != null) { i = k; if (((com.tencent.mm.media.widget.camerarecordview.b.b)localObject1).nJW == true) { i = 1; } } if (i != 0) { com.tencent.threadpool.h.ahAA.bm(new EditorVideoCompositionPluginLayout..ExternalSyntheticLambda0(this)); } localObject2 = this.UrI; localObject1 = localObject2; if (localObject2 == null) { kotlin.g.b.s.bIx("previewNewPlugin"); localObject1 = null; } localObject2 = ((c)localObject1).peV; if (localObject2 != null) { ((com.tencent.mm.compatible.util.b)localObject2).aPS(); } localObject1 = ((c)localObject1).UrD; if (localObject1 != null) { ((VideoCompositionPlayView)localObject1).stop(); } localObject1 = getNavigator(); if (localObject1 != null) { a.a.a((com.tencent.mm.plugin.recordvideo.activity.a)localObject1); } AppMethodBeat.o(282113); return true; label355: l = 0L; } } @Metadata(d1={""}, d2={"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k=3, mv={1, 5, 1}, xi=48) static final class c extends kotlin.d.b.a.k implements m<aq, kotlin.d.d<? super ah>, Object> { long Yx; int label; c(EditorVideoCompositionPluginLayout paramEditorVideoCompositionPluginLayout, kotlin.d.d<? super c> paramd) { super(paramd); } public final kotlin.d.d<ah> create(Object paramObject, kotlin.d.d<?> paramd) { AppMethodBeat.i(281961); paramObject = (kotlin.d.d)new c(this.UrK, paramd); AppMethodBeat.o(281961); return paramObject; } public final Object invokeSuspend(Object paramObject) { AppMethodBeat.i(281955); kotlin.d.a.a locala = kotlin.d.a.a.aiwj; long l; switch (this.label) { default: paramObject = new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); AppMethodBeat.o(281955); throw paramObject; case 0: ResultKt.throwOnFailure(paramObject); l = System.currentTimeMillis(); Log.i("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("setupMediaData start:", kotlin.d.b.a.b.BF(l))); paramObject = EditorVideoCompositionPluginLayout.b(this.UrK); kotlin.g.b.s.checkNotNull(paramObject); Object localObject1 = p.listOf(paramObject.bug()); Object localObject2 = p.listOf(Integer.valueOf(2)); final Integer[] arrayOfInteger = new Integer[1]; int i = 0; if (i <= 0) { paramObject = EditorVideoCompositionPluginLayout.b(this.UrK); if ((paramObject != null) && (paramObject.nJW == true)) { i = 1; if (i == 0) { break label163; } } for (i = 1;; i = 0) { arrayOfInteger[0] = Integer.valueOf(i); i = 1; break; i = 0; break label139; } } paramObject = (kotlin.d.f)bg.kCi(); localObject1 = (m)new kotlin.d.b.a.k(this.UrK, (List)localObject1) { int label; public final kotlin.d.d<ah> create(Object paramAnonymousObject, kotlin.d.d<?> paramAnonymousd) { AppMethodBeat.i(282006); paramAnonymousObject = (kotlin.d.d)new 1(this.UrK, this.Ugz, this.UgA, arrayOfInteger, paramAnonymousd); AppMethodBeat.o(282006); return paramAnonymousObject; } public final Object invokeSuspend(Object paramAnonymousObject) { AppMethodBeat.i(281995); kotlin.d.a.a locala = kotlin.d.a.a.aiwj; switch (this.label) { default: paramAnonymousObject = new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); AppMethodBeat.o(281995); throw paramAnonymousObject; case 0: ResultKt.throwOnFailure(paramAnonymousObject); paramAnonymousObject = EditorVideoCompositionPluginLayout.c(this.UrK); Object localObject = this.Ugz; List localList1 = this.UgA; List localList2 = kotlin.a.k.ae(arrayOfInteger); kotlin.d.d locald = (kotlin.d.d)this; this.label = 1; localObject = l.a((kotlin.d.f)bg.kCi(), (m)new d.c(paramAnonymousObject, (List)localObject, localList1, localList2, null), locald); paramAnonymousObject = localObject; if (localObject == locala) { AppMethodBeat.o(281995); return locala; } break; case 1: ResultKt.throwOnFailure(paramAnonymousObject); } AppMethodBeat.o(281995); return paramAnonymousObject; } }; localObject2 = (kotlin.d.d)this; this.Yx = l; this.label = 1; if (l.a(paramObject, (m)localObject1, (kotlin.d.d)localObject2) == locala) { AppMethodBeat.o(281955); return locala; } break; case 1: label139: label163: l = this.Yx; ResultKt.throwOnFailure(paramObject); } for (;;) { EditorVideoCompositionPluginLayout.d(this.UrK); Log.i("MicroMsg.EditorVideoCompositionPluginLayout", kotlin.g.b.s.X("setupMediaData end cost:", kotlin.d.b.a.b.BF(System.currentTimeMillis() - l))); paramObject = ah.aiuX; AppMethodBeat.o(281955); return paramObject; } } } @Metadata(d1={""}, d2={"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k=3, mv={1, 5, 1}, xi=48) static final class d extends kotlin.d.b.a.k implements m<aq, kotlin.d.d<? super ah>, Object> { int label; d(EditorVideoCompositionPluginLayout paramEditorVideoCompositionPluginLayout, kotlin.d.d<? super d> paramd) { super(paramd); } public final kotlin.d.d<ah> create(Object paramObject, kotlin.d.d<?> paramd) { AppMethodBeat.i(281960); paramObject = (kotlin.d.d)new d(this.UrK, paramd); AppMethodBeat.o(281960); return paramObject; } public final Object invokeSuspend(Object paramObject) { AppMethodBeat.i(281954); kotlin.d.a.a locala = kotlin.d.a.a.aiwj; switch (this.label) { default: paramObject = new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); AppMethodBeat.o(281954); throw paramObject; case 0: ResultKt.throwOnFailure(paramObject); paramObject = EditorVideoCompositionPluginLayout.c(this.UrK); paramObject.TZS.clear(); paramObject.TZS.addAll((Collection)paramObject.TZF); paramObject.TYA = new ac((List)paramObject.TZS); paramObject.TYA.wz(paramObject.Tzj); Object localObject1 = paramObject.TYA; Object localObject2 = com.tencent.mm.plugin.vlog.model.local.a.UbD; ((ac)localObject1).a(com.tencent.mm.plugin.vlog.model.local.a.hRu()); paramObject.TYA.mu(paramObject.maxWidth, paramObject.maxHeight); paramObject = (kotlin.d.f)bg.kCh(); localObject1 = (m)new kotlin.d.b.a.k(this.UrK, null) { int label; public final kotlin.d.d<ah> create(Object paramAnonymousObject, kotlin.d.d<?> paramAnonymousd) { AppMethodBeat.i(281895); paramAnonymousObject = (kotlin.d.d)new 1(this.UrK, paramAnonymousd); AppMethodBeat.o(281895); return paramAnonymousObject; } public final Object invokeSuspend(Object paramAnonymousObject) { AppMethodBeat.i(281891); Object localObject = kotlin.d.a.a.aiwj; switch (this.label) { default: paramAnonymousObject = new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); AppMethodBeat.o(281891); throw paramAnonymousObject; } ResultKt.throwOnFailure(paramAnonymousObject); localObject = EditorVideoCompositionPluginLayout.e(this.UrK); paramAnonymousObject = localObject; if (localObject == null) { kotlin.g.b.s.bIx("previewNewPlugin"); paramAnonymousObject = null; } localObject = EditorVideoCompositionPluginLayout.b(this.UrK); kotlin.g.b.s.checkNotNull(localObject); paramAnonymousObject.d((com.tencent.mm.media.widget.camerarecordview.b.b)localObject, EditorVideoCompositionPluginLayout.f(this.UrK)); paramAnonymousObject = ah.aiuX; AppMethodBeat.o(281891); return paramAnonymousObject; } }; localObject2 = (kotlin.d.d)this; this.label = 1; if (l.a(paramObject, (m)localObject1, (kotlin.d.d)localObject2) == locala) { AppMethodBeat.o(281954); return locala; } break; case 1: ResultKt.throwOnFailure(paramObject); } paramObject = ah.aiuX; AppMethodBeat.o(281954); return paramObject; } } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes9.jar * Qualified Name: com.tencent.mm.plugin.vlog.ui.video.EditorVideoCompositionPluginLayout * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
91c889f8470ce65923efafa952cd20fcce979495
754c5e79aa63ca0a8ed4c9e98ba967c52bcb4afb
/src/main/java/cz/blahami2/dbviewer/exceptions/ApiError.java
c8149c1843afdc56d8b7e1a99b784394f2dea422
[]
no_license
blahami2/db-viewer
c9c6ac7cf7e22a353cd02f834dd1d3c33b09e3ff
97913c520f6d553571dacd32336f4b549e7d1beb
refs/heads/develop
2020-03-21T05:47:24.181032
2018-07-16T20:27:50
2018-07-16T20:27:50
138,180,335
0
1
null
2018-07-17T05:39:26
2018-06-21T14:21:50
Java
UTF-8
Java
false
false
183
java
package cz.blahami2.dbviewer.exceptions; import lombok.Value; import java.util.List; @Value public class ApiError { private String message; private List<String> details; }
[ "blahami2@gmail.com" ]
blahami2@gmail.com
330ce76f82b50062bc60ef78d5e704a897e958d5
37fd992bfefd39cef703d1c8befbd15d4944cdfd
/AutomobileApplication/src/TestAutomobile.java
6d4a9b86ee8196f5caac7cdc9cfa73bc88944f15
[]
no_license
rahulahire7/B2019JM
8466f18fd8b33d61da2437d0b27731924a68481f
916c26dfeb6e7d2c1fc98b97b16b29a401df84dc
refs/heads/master
2020-06-30T03:24:49.724581
2019-10-16T14:53:53
2019-10-16T14:53:53
200,707,939
1
3
null
null
null
null
UTF-8
Java
false
false
1,230
java
public class TestAutomobile { public static void main(String[] args) { Automobile a=null; a=new Maruti(); display(a,"Maruti"); a=new Toyota(); display(a,"Toyota"); a=new Bmw(); display(a,"Bmw"); a=new HeroHonda(); display(a, "HeroHonda"); /*System.out.println("Maruti Model :"+a.getModel()); System.out.println("Maruti Color :"+a.getColor()); System.out.println("Maruti Price :"+a.getPrice()); a=new Toyota(); System.out.println("Toyota Model :"+a.getModel()); System.out.println("Toyota Color :"+a.getColor()); System.out.println("Toyota Price :"+a.getPrice()); a=new Bmw(); System.out.println("BMW Model :"+a.getModel()); System.out.println("BMW Color :"+a.getColor()); System.out.println("BMW Price :"+a.getPrice()); */ } public static void display(Automobile a,String str){ System.out.println("---------------------------------------"); //System.out.println(a); System.out.println(str+" Model :"+a.getModel()); System.out.println(str+" Color :"+a.getColor()); System.out.println(str+" Price :"+a.getPrice()); if(a instanceof Bike) { Bike b=(Bike)a; System.out.println(str+" CC :"+b.getCC()); } } }
[ "rahul.ahire@gmail.com" ]
rahul.ahire@gmail.com
8ce8f487bdb0dd44ca061a17f3b7a536c6a04832
6d9453d21f3609ffcdcf65275864fe68ff76fe5c
/src/com/larp/usermanagementservlets/AddNewUser.java
76c47e2d656c2766184dd2721a64c68090e4070b
[]
no_license
caheer/LarpManageApp
a34945bb9dea86ad91c158135968a52bed856ee4
deb498cafe68e58792bd41b9bbfcf8c26037f472
refs/heads/master
2020-04-03T15:53:38.269109
2018-10-30T12:35:27
2018-10-30T12:35:27
155,382,134
1
0
null
null
null
null
UTF-8
Java
false
false
3,074
java
package com.larp.usermanagementservlets; import java.io.IOException; import java.util.List; import javax.ejb.EJB; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.larp.ejbs.UserService; import com.larp.models.Gender; import com.larp.models.AppUser; import com.larp.models.UserStatus; import com.larp.security.PasswordHashing; /** * Servlet implementation class AddUser */ @WebServlet("/AddNewUser") public class AddNewUser extends HttpServlet { private static final long serialVersionUID = 1L; @EJB UserService us; /** * @see HttpServlet#HttpServlet() */ public AddNewUser() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub RequestDispatcher view = request.getRequestDispatcher("ManageUsersNewUserAdminPanel"); view.forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub PasswordHashing hash_p = new PasswordHashing(); String login = request.getParameter("login"); String emailaddr = request.getParameter("email"); List<AppUser> auList = (List<AppUser>) us.getUsers(); for (AppUser appuser : auList) { if (login.equals(appuser.getLogin())) { String message = "USER LOGIN ALREADY EXISTS, PLEASE PICK DIFFERENT LOGIN"; request.setAttribute("message", message); request.getRequestDispatcher("ManageUsersNewUserAdminPanel").forward(request, response); return; } } for (AppUser appuser : auList) { if (emailaddr.equals(appuser.getEmail())) { String message = "EMAIL ALREADY EXISTS, PLEASE USE DIFFERENT EMAIL"; request.setAttribute("message", message); request.getRequestDispatcher("ManageUsersNewUserAdminPanel").forward(request, response); return; } } String password = hash_p.hash_password(request.getParameter("password")); String fName = request.getParameter("first_name"); String lName = request.getParameter("last_name"); String nickname = request.getParameter("nickname"); String gender = request.getParameter("gender"); String userstatus = request.getParameter("userstatus"); AppUser au = new AppUser(); au.setLogin(login); au.setPassword(password); au.setFirstName(fName); au.setLastName(lName); au.setNickname(nickname); au.setEmail(emailaddr); au.setGender(Gender.valueOf(gender)); au.setUserstatus(UserStatus.valueOf(userstatus)); us.addUser(au); response.sendRedirect("ManageUsersListAdminPanel"); } }
[ "tomasz.madejczyk@ericsson.com" ]
tomasz.madejczyk@ericsson.com
25c2b1bfde8b6cd631369a239be4ef9cd7b56b8d
bbbfdd01d3154510e90b90ad08ae3935d7e368e9
/src/Baekjoon/BOJ_2580_스도쿠.java
7599d2ed2651a84696528d593c5b8e36529a3af5
[]
no_license
yujeong0/AlgoProb
9570d61e3223c86929262fb021ab5f8c07b02952
9141d31e6451dd8cbeaa65de9988950c3a5a87c9
refs/heads/master
2023-08-01T02:53:33.007870
2021-09-06T13:19:47
2021-09-06T13:19:47
288,496,314
0
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package Baekjoon; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class BOJ_2580_스도쿠 { static int[][] grid = new int[9][9]; static List<int[]> list = new ArrayList<>(); public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); for (int i = 0; i < 9; i++) { StringTokenizer st = new StringTokenizer(br.readLine()); for (int j = 0; j < 9; j++) { grid[i][j] = Integer.parseInt(st.nextToken()); if(grid[i][j] == 0) { list.add(new int[] {i, j}); } } } if(list.size() > 0) solve(0); } // main static void solve(int idx) { if(idx == list.size()) { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { System.out.print(grid[i][j] + " "); } System.out.println(); } System.exit(0); } int i = list.get(idx)[0], j = list.get(idx)[1]; for (int num = 1; num <= 9; num++) { if(!isSuccess(i, j, num)) continue; grid[i][j] = num; solve(idx+1); grid[i][j] = 0; } } // solve static boolean isSuccess(int r, int c, int num) { // 가로 세로 for (int i = 0; i < 9; i++) { if(grid[i][c] == num || grid[r][i] == num) return false; } // 사각형 r = (r/3) * 3; c = (c/3) * 3; for (int i = r; i < r+3; i++) { for (int j = c; j < c+3; j++) { if(grid[i][j] == num) return false; } } return true; } }
[ "kos9811@naver.com" ]
kos9811@naver.com
70f2dcbcd6640fc701439cd2e0969f94d52309ac
73781bd51d22445e36f0be8d902b209fd28e0f00
/ISP/src/Good/SendEmail.java
fe8fe1ca0ba79b7ff11c581b31227a3156f308e3
[]
no_license
aaajain/SOLID
36d678740b4479ead2437416ef7cc7c974b50336
d095845768d6e63dac36dfc3222a94b8fd4231a7
refs/heads/main
2023-02-25T08:53:50.259962
2021-02-02T17:47:43
2021-02-02T17:47:43
335,372,735
0
0
null
null
null
null
UTF-8
Java
false
false
150
java
package Good; public class SendEmail implements Notification { @Override public void notifyUser(String message) { //send mail } }
[ "noreply@github.com" ]
noreply@github.com
8ba1adb9a85bd715bbf3120447726505432a88ea
4d546c705c5e78a709b5e04e6a0193caac377266
/google-cloud-container/src/main/java/com/google/cloud/container/v1/stub/GrpcClusterManagerStub.java
3b0d5cad527063c5fee083b16a075f08df582a41
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ajinsh/google-cloud-java
87701a7e099c2e9ea64b91a580f349102b43075a
306e82a4d006216eaa69ff1bc163238a75828f95
refs/heads/master
2021-09-03T21:33:25.163252
2018-01-11T22:55:53
2018-01-11T22:55:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
42,138
java
/* * Copyright 2017, Google LLC 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.container.v1.stub; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.container.v1.ClusterManagerSettings; import com.google.container.v1.CancelOperationRequest; import com.google.container.v1.Cluster; import com.google.container.v1.CompleteIPRotationRequest; import com.google.container.v1.CreateClusterRequest; import com.google.container.v1.CreateNodePoolRequest; import com.google.container.v1.DeleteClusterRequest; import com.google.container.v1.DeleteNodePoolRequest; import com.google.container.v1.GetClusterRequest; import com.google.container.v1.GetNodePoolRequest; import com.google.container.v1.GetOperationRequest; import com.google.container.v1.GetServerConfigRequest; import com.google.container.v1.ListClustersRequest; import com.google.container.v1.ListClustersResponse; import com.google.container.v1.ListNodePoolsRequest; import com.google.container.v1.ListNodePoolsResponse; import com.google.container.v1.ListOperationsRequest; import com.google.container.v1.ListOperationsResponse; import com.google.container.v1.NodePool; import com.google.container.v1.Operation; import com.google.container.v1.RollbackNodePoolUpgradeRequest; import com.google.container.v1.ServerConfig; import com.google.container.v1.SetAddonsConfigRequest; import com.google.container.v1.SetLabelsRequest; import com.google.container.v1.SetLegacyAbacRequest; import com.google.container.v1.SetLocationsRequest; import com.google.container.v1.SetLoggingServiceRequest; import com.google.container.v1.SetMaintenancePolicyRequest; import com.google.container.v1.SetMasterAuthRequest; import com.google.container.v1.SetMonitoringServiceRequest; import com.google.container.v1.SetNetworkPolicyRequest; import com.google.container.v1.SetNodePoolAutoscalingRequest; import com.google.container.v1.SetNodePoolManagementRequest; import com.google.container.v1.SetNodePoolSizeRequest; import com.google.container.v1.StartIPRotationRequest; import com.google.container.v1.UpdateClusterRequest; import com.google.container.v1.UpdateMasterRequest; import com.google.container.v1.UpdateNodePoolRequest; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS /** * gRPC stub implementation for Google Container Engine API. * * <p>This class is for advanced usage and reflects the underlying API directly. */ @Generated("by GAPIC v0.0.5") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcClusterManagerStub extends ClusterManagerStub { private static final MethodDescriptor<ListClustersRequest, ListClustersResponse> listClustersMethodDescriptor = MethodDescriptor.<ListClustersRequest, ListClustersResponse>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/ListClusters") .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) .build(); private static final MethodDescriptor<GetClusterRequest, Cluster> getClusterMethodDescriptor = MethodDescriptor.<GetClusterRequest, Cluster>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/GetCluster") .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) .build(); private static final MethodDescriptor<CreateClusterRequest, Operation> createClusterMethodDescriptor = MethodDescriptor.<CreateClusterRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/CreateCluster") .setRequestMarshaller( ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<UpdateClusterRequest, Operation> updateClusterMethodDescriptor = MethodDescriptor.<UpdateClusterRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/UpdateCluster") .setRequestMarshaller( ProtoUtils.marshaller(UpdateClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<UpdateNodePoolRequest, Operation> updateNodePoolMethodDescriptor = MethodDescriptor.<UpdateNodePoolRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/UpdateNodePool") .setRequestMarshaller( ProtoUtils.marshaller(UpdateNodePoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetNodePoolAutoscalingRequest, Operation> setNodePoolAutoscalingMethodDescriptor = MethodDescriptor.<SetNodePoolAutoscalingRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetNodePoolAutoscaling") .setRequestMarshaller( ProtoUtils.marshaller(SetNodePoolAutoscalingRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetLoggingServiceRequest, Operation> setLoggingServiceMethodDescriptor = MethodDescriptor.<SetLoggingServiceRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetLoggingService") .setRequestMarshaller( ProtoUtils.marshaller(SetLoggingServiceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetMonitoringServiceRequest, Operation> setMonitoringServiceMethodDescriptor = MethodDescriptor.<SetMonitoringServiceRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetMonitoringService") .setRequestMarshaller( ProtoUtils.marshaller(SetMonitoringServiceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetAddonsConfigRequest, Operation> setAddonsConfigMethodDescriptor = MethodDescriptor.<SetAddonsConfigRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetAddonsConfig") .setRequestMarshaller( ProtoUtils.marshaller(SetAddonsConfigRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetLocationsRequest, Operation> setLocationsMethodDescriptor = MethodDescriptor.<SetLocationsRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetLocations") .setRequestMarshaller(ProtoUtils.marshaller(SetLocationsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<UpdateMasterRequest, Operation> updateMasterMethodDescriptor = MethodDescriptor.<UpdateMasterRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/UpdateMaster") .setRequestMarshaller(ProtoUtils.marshaller(UpdateMasterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetMasterAuthRequest, Operation> setMasterAuthMethodDescriptor = MethodDescriptor.<SetMasterAuthRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetMasterAuth") .setRequestMarshaller( ProtoUtils.marshaller(SetMasterAuthRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<DeleteClusterRequest, Operation> deleteClusterMethodDescriptor = MethodDescriptor.<DeleteClusterRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/DeleteCluster") .setRequestMarshaller( ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<ListOperationsRequest, ListOperationsResponse> listOperationsMethodDescriptor = MethodDescriptor.<ListOperationsRequest, ListOperationsResponse>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/ListOperations") .setRequestMarshaller( ProtoUtils.marshaller(ListOperationsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListOperationsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor<GetOperationRequest, Operation> getOperationMethodDescriptor = MethodDescriptor.<GetOperationRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/GetOperation") .setRequestMarshaller(ProtoUtils.marshaller(GetOperationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<CancelOperationRequest, Empty> cancelOperationMethodDescriptor = MethodDescriptor.<CancelOperationRequest, Empty>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/CancelOperation") .setRequestMarshaller( ProtoUtils.marshaller(CancelOperationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); private static final MethodDescriptor<GetServerConfigRequest, ServerConfig> getServerConfigMethodDescriptor = MethodDescriptor.<GetServerConfigRequest, ServerConfig>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/GetServerConfig") .setRequestMarshaller( ProtoUtils.marshaller(GetServerConfigRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ServerConfig.getDefaultInstance())) .build(); private static final MethodDescriptor<ListNodePoolsRequest, ListNodePoolsResponse> listNodePoolsMethodDescriptor = MethodDescriptor.<ListNodePoolsRequest, ListNodePoolsResponse>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/ListNodePools") .setRequestMarshaller( ProtoUtils.marshaller(ListNodePoolsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListNodePoolsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor<GetNodePoolRequest, NodePool> getNodePoolMethodDescriptor = MethodDescriptor.<GetNodePoolRequest, NodePool>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/GetNodePool") .setRequestMarshaller(ProtoUtils.marshaller(GetNodePoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(NodePool.getDefaultInstance())) .build(); private static final MethodDescriptor<CreateNodePoolRequest, Operation> createNodePoolMethodDescriptor = MethodDescriptor.<CreateNodePoolRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/CreateNodePool") .setRequestMarshaller( ProtoUtils.marshaller(CreateNodePoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<DeleteNodePoolRequest, Operation> deleteNodePoolMethodDescriptor = MethodDescriptor.<DeleteNodePoolRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/DeleteNodePool") .setRequestMarshaller( ProtoUtils.marshaller(DeleteNodePoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<RollbackNodePoolUpgradeRequest, Operation> rollbackNodePoolUpgradeMethodDescriptor = MethodDescriptor.<RollbackNodePoolUpgradeRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/RollbackNodePoolUpgrade") .setRequestMarshaller( ProtoUtils.marshaller(RollbackNodePoolUpgradeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetNodePoolManagementRequest, Operation> setNodePoolManagementMethodDescriptor = MethodDescriptor.<SetNodePoolManagementRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetNodePoolManagement") .setRequestMarshaller( ProtoUtils.marshaller(SetNodePoolManagementRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetLabelsRequest, Operation> setLabelsMethodDescriptor = MethodDescriptor.<SetLabelsRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetLabels") .setRequestMarshaller(ProtoUtils.marshaller(SetLabelsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetLegacyAbacRequest, Operation> setLegacyAbacMethodDescriptor = MethodDescriptor.<SetLegacyAbacRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetLegacyAbac") .setRequestMarshaller( ProtoUtils.marshaller(SetLegacyAbacRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<StartIPRotationRequest, Operation> startIPRotationMethodDescriptor = MethodDescriptor.<StartIPRotationRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/StartIPRotation") .setRequestMarshaller( ProtoUtils.marshaller(StartIPRotationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<CompleteIPRotationRequest, Operation> completeIPRotationMethodDescriptor = MethodDescriptor.<CompleteIPRotationRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/CompleteIPRotation") .setRequestMarshaller( ProtoUtils.marshaller(CompleteIPRotationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetNodePoolSizeRequest, Operation> setNodePoolSizeMethodDescriptor = MethodDescriptor.<SetNodePoolSizeRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetNodePoolSize") .setRequestMarshaller( ProtoUtils.marshaller(SetNodePoolSizeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetNetworkPolicyRequest, Operation> setNetworkPolicyMethodDescriptor = MethodDescriptor.<SetNetworkPolicyRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetNetworkPolicy") .setRequestMarshaller( ProtoUtils.marshaller(SetNetworkPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor<SetMaintenancePolicyRequest, Operation> setMaintenancePolicyMethodDescriptor = MethodDescriptor.<SetMaintenancePolicyRequest, Operation>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.container.v1.ClusterManager/SetMaintenancePolicy") .setRequestMarshaller( ProtoUtils.marshaller(SetMaintenancePolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private final BackgroundResource backgroundResources; private final UnaryCallable<ListClustersRequest, ListClustersResponse> listClustersCallable; private final UnaryCallable<GetClusterRequest, Cluster> getClusterCallable; private final UnaryCallable<CreateClusterRequest, Operation> createClusterCallable; private final UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallable; private final UnaryCallable<UpdateNodePoolRequest, Operation> updateNodePoolCallable; private final UnaryCallable<SetNodePoolAutoscalingRequest, Operation> setNodePoolAutoscalingCallable; private final UnaryCallable<SetLoggingServiceRequest, Operation> setLoggingServiceCallable; private final UnaryCallable<SetMonitoringServiceRequest, Operation> setMonitoringServiceCallable; private final UnaryCallable<SetAddonsConfigRequest, Operation> setAddonsConfigCallable; private final UnaryCallable<SetLocationsRequest, Operation> setLocationsCallable; private final UnaryCallable<UpdateMasterRequest, Operation> updateMasterCallable; private final UnaryCallable<SetMasterAuthRequest, Operation> setMasterAuthCallable; private final UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallable; private final UnaryCallable<ListOperationsRequest, ListOperationsResponse> listOperationsCallable; private final UnaryCallable<GetOperationRequest, Operation> getOperationCallable; private final UnaryCallable<CancelOperationRequest, Empty> cancelOperationCallable; private final UnaryCallable<GetServerConfigRequest, ServerConfig> getServerConfigCallable; private final UnaryCallable<ListNodePoolsRequest, ListNodePoolsResponse> listNodePoolsCallable; private final UnaryCallable<GetNodePoolRequest, NodePool> getNodePoolCallable; private final UnaryCallable<CreateNodePoolRequest, Operation> createNodePoolCallable; private final UnaryCallable<DeleteNodePoolRequest, Operation> deleteNodePoolCallable; private final UnaryCallable<RollbackNodePoolUpgradeRequest, Operation> rollbackNodePoolUpgradeCallable; private final UnaryCallable<SetNodePoolManagementRequest, Operation> setNodePoolManagementCallable; private final UnaryCallable<SetLabelsRequest, Operation> setLabelsCallable; private final UnaryCallable<SetLegacyAbacRequest, Operation> setLegacyAbacCallable; private final UnaryCallable<StartIPRotationRequest, Operation> startIPRotationCallable; private final UnaryCallable<CompleteIPRotationRequest, Operation> completeIPRotationCallable; private final UnaryCallable<SetNodePoolSizeRequest, Operation> setNodePoolSizeCallable; private final UnaryCallable<SetNetworkPolicyRequest, Operation> setNetworkPolicyCallable; private final UnaryCallable<SetMaintenancePolicyRequest, Operation> setMaintenancePolicyCallable; public static final GrpcClusterManagerStub create(ClusterManagerSettings settings) throws IOException { return new GrpcClusterManagerStub(settings, ClientContext.create(settings)); } public static final GrpcClusterManagerStub create(ClientContext clientContext) throws IOException { return new GrpcClusterManagerStub(ClusterManagerSettings.newBuilder().build(), clientContext); } /** * Constructs an instance of GrpcClusterManagerStub, using the given settings. This is protected * so that it is easy to make a subclass, but otherwise, the static factory methods should be * preferred. */ protected GrpcClusterManagerStub(ClusterManagerSettings settings, ClientContext clientContext) throws IOException { GrpcCallSettings<ListClustersRequest, ListClustersResponse> listClustersTransportSettings = GrpcCallSettings.<ListClustersRequest, ListClustersResponse>newBuilder() .setMethodDescriptor(listClustersMethodDescriptor) .build(); GrpcCallSettings<GetClusterRequest, Cluster> getClusterTransportSettings = GrpcCallSettings.<GetClusterRequest, Cluster>newBuilder() .setMethodDescriptor(getClusterMethodDescriptor) .build(); GrpcCallSettings<CreateClusterRequest, Operation> createClusterTransportSettings = GrpcCallSettings.<CreateClusterRequest, Operation>newBuilder() .setMethodDescriptor(createClusterMethodDescriptor) .build(); GrpcCallSettings<UpdateClusterRequest, Operation> updateClusterTransportSettings = GrpcCallSettings.<UpdateClusterRequest, Operation>newBuilder() .setMethodDescriptor(updateClusterMethodDescriptor) .build(); GrpcCallSettings<UpdateNodePoolRequest, Operation> updateNodePoolTransportSettings = GrpcCallSettings.<UpdateNodePoolRequest, Operation>newBuilder() .setMethodDescriptor(updateNodePoolMethodDescriptor) .build(); GrpcCallSettings<SetNodePoolAutoscalingRequest, Operation> setNodePoolAutoscalingTransportSettings = GrpcCallSettings.<SetNodePoolAutoscalingRequest, Operation>newBuilder() .setMethodDescriptor(setNodePoolAutoscalingMethodDescriptor) .build(); GrpcCallSettings<SetLoggingServiceRequest, Operation> setLoggingServiceTransportSettings = GrpcCallSettings.<SetLoggingServiceRequest, Operation>newBuilder() .setMethodDescriptor(setLoggingServiceMethodDescriptor) .build(); GrpcCallSettings<SetMonitoringServiceRequest, Operation> setMonitoringServiceTransportSettings = GrpcCallSettings.<SetMonitoringServiceRequest, Operation>newBuilder() .setMethodDescriptor(setMonitoringServiceMethodDescriptor) .build(); GrpcCallSettings<SetAddonsConfigRequest, Operation> setAddonsConfigTransportSettings = GrpcCallSettings.<SetAddonsConfigRequest, Operation>newBuilder() .setMethodDescriptor(setAddonsConfigMethodDescriptor) .build(); GrpcCallSettings<SetLocationsRequest, Operation> setLocationsTransportSettings = GrpcCallSettings.<SetLocationsRequest, Operation>newBuilder() .setMethodDescriptor(setLocationsMethodDescriptor) .build(); GrpcCallSettings<UpdateMasterRequest, Operation> updateMasterTransportSettings = GrpcCallSettings.<UpdateMasterRequest, Operation>newBuilder() .setMethodDescriptor(updateMasterMethodDescriptor) .build(); GrpcCallSettings<SetMasterAuthRequest, Operation> setMasterAuthTransportSettings = GrpcCallSettings.<SetMasterAuthRequest, Operation>newBuilder() .setMethodDescriptor(setMasterAuthMethodDescriptor) .build(); GrpcCallSettings<DeleteClusterRequest, Operation> deleteClusterTransportSettings = GrpcCallSettings.<DeleteClusterRequest, Operation>newBuilder() .setMethodDescriptor(deleteClusterMethodDescriptor) .build(); GrpcCallSettings<ListOperationsRequest, ListOperationsResponse> listOperationsTransportSettings = GrpcCallSettings.<ListOperationsRequest, ListOperationsResponse>newBuilder() .setMethodDescriptor(listOperationsMethodDescriptor) .build(); GrpcCallSettings<GetOperationRequest, Operation> getOperationTransportSettings = GrpcCallSettings.<GetOperationRequest, Operation>newBuilder() .setMethodDescriptor(getOperationMethodDescriptor) .build(); GrpcCallSettings<CancelOperationRequest, Empty> cancelOperationTransportSettings = GrpcCallSettings.<CancelOperationRequest, Empty>newBuilder() .setMethodDescriptor(cancelOperationMethodDescriptor) .build(); GrpcCallSettings<GetServerConfigRequest, ServerConfig> getServerConfigTransportSettings = GrpcCallSettings.<GetServerConfigRequest, ServerConfig>newBuilder() .setMethodDescriptor(getServerConfigMethodDescriptor) .build(); GrpcCallSettings<ListNodePoolsRequest, ListNodePoolsResponse> listNodePoolsTransportSettings = GrpcCallSettings.<ListNodePoolsRequest, ListNodePoolsResponse>newBuilder() .setMethodDescriptor(listNodePoolsMethodDescriptor) .build(); GrpcCallSettings<GetNodePoolRequest, NodePool> getNodePoolTransportSettings = GrpcCallSettings.<GetNodePoolRequest, NodePool>newBuilder() .setMethodDescriptor(getNodePoolMethodDescriptor) .build(); GrpcCallSettings<CreateNodePoolRequest, Operation> createNodePoolTransportSettings = GrpcCallSettings.<CreateNodePoolRequest, Operation>newBuilder() .setMethodDescriptor(createNodePoolMethodDescriptor) .build(); GrpcCallSettings<DeleteNodePoolRequest, Operation> deleteNodePoolTransportSettings = GrpcCallSettings.<DeleteNodePoolRequest, Operation>newBuilder() .setMethodDescriptor(deleteNodePoolMethodDescriptor) .build(); GrpcCallSettings<RollbackNodePoolUpgradeRequest, Operation> rollbackNodePoolUpgradeTransportSettings = GrpcCallSettings.<RollbackNodePoolUpgradeRequest, Operation>newBuilder() .setMethodDescriptor(rollbackNodePoolUpgradeMethodDescriptor) .build(); GrpcCallSettings<SetNodePoolManagementRequest, Operation> setNodePoolManagementTransportSettings = GrpcCallSettings.<SetNodePoolManagementRequest, Operation>newBuilder() .setMethodDescriptor(setNodePoolManagementMethodDescriptor) .build(); GrpcCallSettings<SetLabelsRequest, Operation> setLabelsTransportSettings = GrpcCallSettings.<SetLabelsRequest, Operation>newBuilder() .setMethodDescriptor(setLabelsMethodDescriptor) .build(); GrpcCallSettings<SetLegacyAbacRequest, Operation> setLegacyAbacTransportSettings = GrpcCallSettings.<SetLegacyAbacRequest, Operation>newBuilder() .setMethodDescriptor(setLegacyAbacMethodDescriptor) .build(); GrpcCallSettings<StartIPRotationRequest, Operation> startIPRotationTransportSettings = GrpcCallSettings.<StartIPRotationRequest, Operation>newBuilder() .setMethodDescriptor(startIPRotationMethodDescriptor) .build(); GrpcCallSettings<CompleteIPRotationRequest, Operation> completeIPRotationTransportSettings = GrpcCallSettings.<CompleteIPRotationRequest, Operation>newBuilder() .setMethodDescriptor(completeIPRotationMethodDescriptor) .build(); GrpcCallSettings<SetNodePoolSizeRequest, Operation> setNodePoolSizeTransportSettings = GrpcCallSettings.<SetNodePoolSizeRequest, Operation>newBuilder() .setMethodDescriptor(setNodePoolSizeMethodDescriptor) .build(); GrpcCallSettings<SetNetworkPolicyRequest, Operation> setNetworkPolicyTransportSettings = GrpcCallSettings.<SetNetworkPolicyRequest, Operation>newBuilder() .setMethodDescriptor(setNetworkPolicyMethodDescriptor) .build(); GrpcCallSettings<SetMaintenancePolicyRequest, Operation> setMaintenancePolicyTransportSettings = GrpcCallSettings.<SetMaintenancePolicyRequest, Operation>newBuilder() .setMethodDescriptor(setMaintenancePolicyMethodDescriptor) .build(); this.listClustersCallable = GrpcCallableFactory.createUnaryCallable( listClustersTransportSettings, settings.listClustersSettings(), clientContext); this.getClusterCallable = GrpcCallableFactory.createUnaryCallable( getClusterTransportSettings, settings.getClusterSettings(), clientContext); this.createClusterCallable = GrpcCallableFactory.createUnaryCallable( createClusterTransportSettings, settings.createClusterSettings(), clientContext); this.updateClusterCallable = GrpcCallableFactory.createUnaryCallable( updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); this.updateNodePoolCallable = GrpcCallableFactory.createUnaryCallable( updateNodePoolTransportSettings, settings.updateNodePoolSettings(), clientContext); this.setNodePoolAutoscalingCallable = GrpcCallableFactory.createUnaryCallable( setNodePoolAutoscalingTransportSettings, settings.setNodePoolAutoscalingSettings(), clientContext); this.setLoggingServiceCallable = GrpcCallableFactory.createUnaryCallable( setLoggingServiceTransportSettings, settings.setLoggingServiceSettings(), clientContext); this.setMonitoringServiceCallable = GrpcCallableFactory.createUnaryCallable( setMonitoringServiceTransportSettings, settings.setMonitoringServiceSettings(), clientContext); this.setAddonsConfigCallable = GrpcCallableFactory.createUnaryCallable( setAddonsConfigTransportSettings, settings.setAddonsConfigSettings(), clientContext); this.setLocationsCallable = GrpcCallableFactory.createUnaryCallable( setLocationsTransportSettings, settings.setLocationsSettings(), clientContext); this.updateMasterCallable = GrpcCallableFactory.createUnaryCallable( updateMasterTransportSettings, settings.updateMasterSettings(), clientContext); this.setMasterAuthCallable = GrpcCallableFactory.createUnaryCallable( setMasterAuthTransportSettings, settings.setMasterAuthSettings(), clientContext); this.deleteClusterCallable = GrpcCallableFactory.createUnaryCallable( deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); this.listOperationsCallable = GrpcCallableFactory.createUnaryCallable( listOperationsTransportSettings, settings.listOperationsSettings(), clientContext); this.getOperationCallable = GrpcCallableFactory.createUnaryCallable( getOperationTransportSettings, settings.getOperationSettings(), clientContext); this.cancelOperationCallable = GrpcCallableFactory.createUnaryCallable( cancelOperationTransportSettings, settings.cancelOperationSettings(), clientContext); this.getServerConfigCallable = GrpcCallableFactory.createUnaryCallable( getServerConfigTransportSettings, settings.getServerConfigSettings(), clientContext); this.listNodePoolsCallable = GrpcCallableFactory.createUnaryCallable( listNodePoolsTransportSettings, settings.listNodePoolsSettings(), clientContext); this.getNodePoolCallable = GrpcCallableFactory.createUnaryCallable( getNodePoolTransportSettings, settings.getNodePoolSettings(), clientContext); this.createNodePoolCallable = GrpcCallableFactory.createUnaryCallable( createNodePoolTransportSettings, settings.createNodePoolSettings(), clientContext); this.deleteNodePoolCallable = GrpcCallableFactory.createUnaryCallable( deleteNodePoolTransportSettings, settings.deleteNodePoolSettings(), clientContext); this.rollbackNodePoolUpgradeCallable = GrpcCallableFactory.createUnaryCallable( rollbackNodePoolUpgradeTransportSettings, settings.rollbackNodePoolUpgradeSettings(), clientContext); this.setNodePoolManagementCallable = GrpcCallableFactory.createUnaryCallable( setNodePoolManagementTransportSettings, settings.setNodePoolManagementSettings(), clientContext); this.setLabelsCallable = GrpcCallableFactory.createUnaryCallable( setLabelsTransportSettings, settings.setLabelsSettings(), clientContext); this.setLegacyAbacCallable = GrpcCallableFactory.createUnaryCallable( setLegacyAbacTransportSettings, settings.setLegacyAbacSettings(), clientContext); this.startIPRotationCallable = GrpcCallableFactory.createUnaryCallable( startIPRotationTransportSettings, settings.startIPRotationSettings(), clientContext); this.completeIPRotationCallable = GrpcCallableFactory.createUnaryCallable( completeIPRotationTransportSettings, settings.completeIPRotationSettings(), clientContext); this.setNodePoolSizeCallable = GrpcCallableFactory.createUnaryCallable( setNodePoolSizeTransportSettings, settings.setNodePoolSizeSettings(), clientContext); this.setNetworkPolicyCallable = GrpcCallableFactory.createUnaryCallable( setNetworkPolicyTransportSettings, settings.setNetworkPolicySettings(), clientContext); this.setMaintenancePolicyCallable = GrpcCallableFactory.createUnaryCallable( setMaintenancePolicyTransportSettings, settings.setMaintenancePolicySettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } public UnaryCallable<ListClustersRequest, ListClustersResponse> listClustersCallable() { return listClustersCallable; } public UnaryCallable<GetClusterRequest, Cluster> getClusterCallable() { return getClusterCallable; } public UnaryCallable<CreateClusterRequest, Operation> createClusterCallable() { return createClusterCallable; } public UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallable() { return updateClusterCallable; } public UnaryCallable<UpdateNodePoolRequest, Operation> updateNodePoolCallable() { return updateNodePoolCallable; } public UnaryCallable<SetNodePoolAutoscalingRequest, Operation> setNodePoolAutoscalingCallable() { return setNodePoolAutoscalingCallable; } public UnaryCallable<SetLoggingServiceRequest, Operation> setLoggingServiceCallable() { return setLoggingServiceCallable; } public UnaryCallable<SetMonitoringServiceRequest, Operation> setMonitoringServiceCallable() { return setMonitoringServiceCallable; } public UnaryCallable<SetAddonsConfigRequest, Operation> setAddonsConfigCallable() { return setAddonsConfigCallable; } public UnaryCallable<SetLocationsRequest, Operation> setLocationsCallable() { return setLocationsCallable; } public UnaryCallable<UpdateMasterRequest, Operation> updateMasterCallable() { return updateMasterCallable; } public UnaryCallable<SetMasterAuthRequest, Operation> setMasterAuthCallable() { return setMasterAuthCallable; } public UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallable() { return deleteClusterCallable; } public UnaryCallable<ListOperationsRequest, ListOperationsResponse> listOperationsCallable() { return listOperationsCallable; } public UnaryCallable<GetOperationRequest, Operation> getOperationCallable() { return getOperationCallable; } public UnaryCallable<CancelOperationRequest, Empty> cancelOperationCallable() { return cancelOperationCallable; } public UnaryCallable<GetServerConfigRequest, ServerConfig> getServerConfigCallable() { return getServerConfigCallable; } public UnaryCallable<ListNodePoolsRequest, ListNodePoolsResponse> listNodePoolsCallable() { return listNodePoolsCallable; } public UnaryCallable<GetNodePoolRequest, NodePool> getNodePoolCallable() { return getNodePoolCallable; } public UnaryCallable<CreateNodePoolRequest, Operation> createNodePoolCallable() { return createNodePoolCallable; } public UnaryCallable<DeleteNodePoolRequest, Operation> deleteNodePoolCallable() { return deleteNodePoolCallable; } public UnaryCallable<RollbackNodePoolUpgradeRequest, Operation> rollbackNodePoolUpgradeCallable() { return rollbackNodePoolUpgradeCallable; } public UnaryCallable<SetNodePoolManagementRequest, Operation> setNodePoolManagementCallable() { return setNodePoolManagementCallable; } public UnaryCallable<SetLabelsRequest, Operation> setLabelsCallable() { return setLabelsCallable; } public UnaryCallable<SetLegacyAbacRequest, Operation> setLegacyAbacCallable() { return setLegacyAbacCallable; } public UnaryCallable<StartIPRotationRequest, Operation> startIPRotationCallable() { return startIPRotationCallable; } public UnaryCallable<CompleteIPRotationRequest, Operation> completeIPRotationCallable() { return completeIPRotationCallable; } public UnaryCallable<SetNodePoolSizeRequest, Operation> setNodePoolSizeCallable() { return setNodePoolSizeCallable; } public UnaryCallable<SetNetworkPolicyRequest, Operation> setNetworkPolicyCallable() { return setNetworkPolicyCallable; } public UnaryCallable<SetMaintenancePolicyRequest, Operation> setMaintenancePolicyCallable() { return setMaintenancePolicyCallable; } @Override public final void close() throws Exception { shutdown(); } @Override public void shutdown() { backgroundResources.shutdown(); } @Override public boolean isShutdown() { return backgroundResources.isShutdown(); } @Override public boolean isTerminated() { return backgroundResources.isTerminated(); } @Override public void shutdownNow() { backgroundResources.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } }
[ "noreply@github.com" ]
noreply@github.com
5a4cfc575ecb8d5e899438b6811415006e70f82f
288151cf821acf7fe9430c2b6aeb19e074a791d4
/mfoyou-agent-server/mfoyou-agent-taobao/src/main/java/com/alipay/api/domain/RefundUnfreezeResult.java
5ec318c05bf1c456a4faeeea0856b91c9ee80146
[]
no_license
jiningeast/distribution
60022e45d3a401252a9c970de14a599a548a1a99
c35bfc5923eaecf2256ce142955ecedcb3c64ae5
refs/heads/master
2020-06-24T11:27:51.899760
2019-06-06T12:52:59
2019-06-06T12:52:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,731
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 退款解冻信息 * * @author auto create * @since 1.0, 2016-11-21 12:06:39 */ public class RefundUnfreezeResult extends AlipayObject { private static final long serialVersionUID = 8217886174529442397L; /** * 冻结单号 */ @ApiField("freeze_no") private String freezeNo; /** * 解冻结果码 */ @ApiField("result_code") private String resultCode; /** * 解冻状态。S成功,F失败。 */ @ApiField("status") private String status; /** * 解冻金额 */ @ApiField("unfreeze_amount") private String unfreezeAmount; /** * 解冻单号 */ @ApiField("unfreeze_no") private String unfreezeNo; /** * 解冻时间 */ @ApiField("unfreeze_time") private String unfreezeTime; public String getFreezeNo() { return this.freezeNo; } public void setFreezeNo(String freezeNo) { this.freezeNo = freezeNo; } public String getResultCode() { return this.resultCode; } public void setResultCode(String resultCode) { this.resultCode = resultCode; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } public String getUnfreezeAmount() { return this.unfreezeAmount; } public void setUnfreezeAmount(String unfreezeAmount) { this.unfreezeAmount = unfreezeAmount; } public String getUnfreezeNo() { return this.unfreezeNo; } public void setUnfreezeNo(String unfreezeNo) { this.unfreezeNo = unfreezeNo; } public String getUnfreezeTime() { return this.unfreezeTime; } public void setUnfreezeTime(String unfreezeTime) { this.unfreezeTime = unfreezeTime; } }
[ "15732677882@163.com" ]
15732677882@163.com
a3dac76d2eb51cc97a880d2a0ad092e7f549298f
c8194e291d8c206f6e0160af94ef3fe33e4f8a51
/java-rmi/src/main/java/RemoteHelloWordImpl.java
938643be698c3b8f19d6b1d9c46ad5ee39ef3308
[]
no_license
gpqhl0071/gpcode
2515013f8954185c484cfeb327a7d64fa40f48bc
f232a9dda1809634c76d8b7e6f7f20438cb40a30
refs/heads/master
2021-06-10T09:04:55.246389
2019-12-24T08:22:02
2019-12-24T08:22:02
145,093,098
2
0
null
2019-03-07T09:19:32
2018-08-17T08:22:26
Java
UTF-8
Java
false
false
181
java
import java.rmi.RemoteException; public class RemoteHelloWordImpl implements RemoteHelloWorld { public String sayHello() throws RemoteException { return "hello world"; } }
[ "penggao@pengdeMacBook-Pro.local" ]
penggao@pengdeMacBook-Pro.local
09d9f6e965d9ae3e63e580374d7ce03de9592be1
7c53a8fcc349a3ab2d683757fc3063b40b8b7903
/chess/chess-logic/src/main/java/logic/RookMoveValidator.java
bbb08d8336e15a0be870ced53963a16de3b91cac
[]
no_license
WilkWojciechM/Chess
e35c15c1a7eae05eb31057988aa8b02776a397f5
63ffd653a87884d9882c1941b0b3ff1b0b896148
refs/heads/master
2022-12-26T08:46:10.324207
2019-10-14T14:57:22
2019-10-14T14:57:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package logic; import domain.ChessBoard; import domain.Move; public class RookMoveValidator implements MoveValidator{ FriendlyFireValidator friendlyFireValidator = new FriendlyFireValidator(); OrthogonalValidator orthogonalValidator = new OrthogonalValidator(); DiagonalMoveValidator diagonalMoveValidator = new DiagonalMoveValidator(); ClearPathValidator clearPathValidator = new ClearPathValidator(); @Override public boolean isValid(Move move, ChessBoard chessBoard){ return clearPathValidator.isValid(move, chessBoard)&& orthogonalValidator.isValid(move, chessBoard)&& friendlyFireValidator.isValid(move, chessBoard)&& !diagonalMoveValidator.isValid(move, chessBoard); } }
[ "noreply@github.com" ]
noreply@github.com
243e869d634422b0c059850d36edb9100e482807
0c3044613de112e4d8b7f254be3f17ea4fa4f0b3
/src/AddressBook.java
c74ec9ed52eb5d844bbd5f5e3f6011127539cdc4
[]
no_license
Softworks4UISP/Softworks4UISP
c2e703c0a2d4d8795ef6612755c547bf4614fa95
25e9fba10c20b36d9c44643ab069584b1bd4763d
refs/heads/master
2021-01-01T03:44:38.714043
2016-05-20T18:45:07
2016-05-20T18:45:07
58,955,028
1
3
null
null
null
null
UTF-8
Java
false
false
4,925
java
/** * Ms.Dyke * Nicole Kozlova * April 21,2016 * * This is the driver class. It creates JLabels and JTextFields where user caqn input data. * It adds them all to the JFrame. * * @author Nicole Kozlova * @version 1 04.21.16 **/ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.filechooser.*; import javax.swing.JOptionPane; /** This program will sumbit, update, scroll through records, save records, open records. It * adds a new record to an array list. Sumbit update alters the text in the textfields and creates new * records. Next and Back allows us to go through the records created * * <p> * <b>Instance variables: </b> * <p> * <b>PersonRecord</b> creates an object of the class * <p> * <b>persons</b> creates an array list of the class PersonRecord * <p> * <b>label</b> creates an instance array of JLable * <p> * <b>labelName</b> creates an instance array of a String * <p> * <b>buttonName</b> creates an instance array of a String * <p> * <b>textInTheField</b> creates an instance array of a String * <p> * <b>textField</b> creates an instance array of JTextField * <p> * <b>button</b> creates an instance array of a JButton * <p> **/ public class AddressBook extends JPanel implements ActionListener { // PersonRecord p; JLabel [] label = new JLabel [5]; String [] labelName = new String [5]; String [] buttonName = new String [5]; String [] textInTheField = new String[2]; JTextField [] textField = new JTextField[6]; JButton [] button = new JButton[5]; //File fileName; /** * This is the constructer of Address book **/ public AddressBook () { } /** This creates the textFields, the labels and the buttons onto the screen. * I use an absolute layout to design where each goes. The for loops are used to create * multiple textField, labels, buttons. It simplifies the code. I assign each button and label array * with text. * * <p> * <b>Local variables: </b> * <p> * <b>PersonRecord</b> creates an objext of the class * <p> **/ public void createDisplay(Container pane) { pane.setLayout(null); removeAll(); Insets insets = this.getInsets(); labelName [0] = ("First Name: "); labelName [1] = ("Last Name: "); labelName [2] = ("Phone Number: "); labelName [3] = ("Email: "); buttonName [0] = ("<<BACK<<"); buttonName [1] = (">>NEXT>>"); buttonName [2] = ("SUBMIT"); buttonName [3] = ("DELETE"); buttonName [4] = ("UPDATE"); textInTheField [1]=( "Record of"); textInTheField [0]=("File Name: "); // creates 4 labels for (int x = 0; x <4; x++) { label [x]= new JLabel (labelName[x]); Dimension size = label [x].getPreferredSize(); label [x].setBounds(15 + insets.left, 30*x + insets.top+50,size.width, size.height+5); pane.add (label[x]); } //text field for (int x = 2; x <6; x++) { textField [x] = new JTextField (15); Dimension size = textField[x].getPreferredSize(); textField [x].setBounds(200 + insets.left, 30* (x - 2) + insets.top+50,size.width+80, size.height+5); textField[x].setEnabled(false); pane.add (textField[x]); } //file Name and record number for (int x = 0; x <2; x++) { textField [x]= new JTextField (textInTheField[x]); Dimension size =textField [x].getPreferredSize(); textField [x].setBounds(200 + insets.left, 295*x+ insets.top+15,size.width + 10, size.height+5); textField[x].setEnabled(false); pane.add (textField[x]); } // add, delete, update buttons for (int b = 2; b <5; b++) { button [b] = new JButton (buttonName[b]); Dimension size = button [b].getPreferredSize(); button [b].setBounds(200 + insets.left, 40*b + insets.top+100,size.width, size.height+5); pane.add (button[b]); } // back and next button for (int b = 0; b <2; b++) { button [b] = new JButton (buttonName[b]); Dimension size = button [b].getPreferredSize(); button [b].setBounds(370*b+ insets.left +10,insets.top+295,size.width, size.height); pane.add (button[b]); } for (int b = 0; b < 5; b++) { button[b].addActionListener (this); } revalidate(); repaint(); textField [0].requestFocusInWindow(); } public void actionPerformed (ActionEvent ae) { if (ae.getActionCommand ().equals (button[2])) { } else if (ae.getActionCommand ().equals (button[3])) { } else if (ae.getActionCommand ().equals (button[0])) { } else if (ae.getActionCommand ().equals (button[1])) { } else { } } }
[ "Nicole.Kozlova@student.tdsb.on.ca" ]
Nicole.Kozlova@student.tdsb.on.ca
2fd7fe7d37145c164c030094586197cb5165c83d
94e44ffafffe795e999460c15e682950e4610142
/part2/week12-week12_46.FilmReference/src/reference/Main.java
41886adfe733aeff08ddd8875297888b97a85d62
[]
no_license
ruelneuman/object-oriented-programming-with-java
55ff1178521eacc56388541176667d9a4b586391
a90bdcdca0f16783e04f47d26ed88058479e8477
refs/heads/master
2023-06-26T19:03:01.683542
2021-08-01T23:09:04
2021-08-01T23:09:04
391,758,932
0
0
null
null
null
null
UTF-8
Java
false
false
1,915
java
package reference; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import reference.comparator.FilmComparator; import reference.comparator.PersonComparator; import reference.domain.Film; import reference.domain.Person; import reference.domain.Rating; public class Main { public static void main(String[] args) { RatingRegister ratings = new RatingRegister(); Film goneWithTheWind = new Film("Gone with the Wind"); Film theBridgesOfMadisonCounty = new Film("The Bridges of Madison County"); Film eraserhead = new Film("Eraserhead"); Film bluesBrothers = new Film("Blues Brothers"); Person matti = new Person("Matti"); Person pekka = new Person("Pekka"); Person mikke = new Person("Mikael"); Person thomas = new Person("Thomas"); Person arto = new Person("Arto"); ratings.addRating(matti, goneWithTheWind, Rating.BAD); ratings.addRating(matti, theBridgesOfMadisonCounty, Rating.GOOD); ratings.addRating(matti, eraserhead, Rating.FINE); ratings.addRating(pekka, goneWithTheWind, Rating.FINE); ratings.addRating(pekka, eraserhead, Rating.BAD); ratings.addRating(pekka, bluesBrothers, Rating.MEDIOCRE); ratings.addRating(mikke, eraserhead, Rating.BAD); ratings.addRating(thomas, bluesBrothers, Rating.GOOD); ratings.addRating(thomas, theBridgesOfMadisonCounty, Rating.GOOD); Reference ref = new Reference(ratings); System.out.println(thomas + " recommendation: " + ref.recommendFilm(thomas)); System.out.println(mikke + " recommendation: " + ref.recommendFilm(mikke)); System.out.println(matti + " recommendation: " + ref.recommendFilm(matti)); System.out.println(arto + " recommendation: " + ref.recommendFilm(arto)); } }
[ "ruelneuman@gmail.com" ]
ruelneuman@gmail.com
f52df1ef698021ad3e51d221fb3d263a4e0a959d
efb29b91d835066ccc59f2d9324022d419ce2d5a
/simulation/controller/ParameterField.java
34a980ce5399f88aa47e40c6d1f75143ef86106c
[]
no_license
bartvtende/Starty
797b348de94bb609bb5fed6baa07a2736ef72920
fc90791ff0aa7d1632bd0189b5d41fdc8d1774b3
refs/heads/master
2020-05-20T19:26:58.320486
2015-12-17T14:48:45
2015-12-17T14:48:45
36,784,794
1
0
null
null
null
null
UTF-8
Java
false
false
209
java
package controller; import javax.swing.JTextField; public class ParameterField extends JTextField { public ParameterField(int defaultNumber){ this.setText(new Integer(defaultNumber).toString()); } }
[ "j-c-s-s@hotmail.com" ]
j-c-s-s@hotmail.com
f3ada9f5062e9a5094b08a340d548dde34f6bce4
74c820bb924798a25e6b9f2a77c92610098c68ce
/src/test/java/login/login.java
856f8b0601fa65490448557131ce1a6e760f0a88
[]
no_license
tulasrirupa/casestudy
20895c742f5b1ff72dc2db7c24caf294924d0dce
ba2669f8a8ed2954db859f0bd5eefe58c8d41c6f
refs/heads/master
2021-01-14T16:02:57.810732
2020-02-24T07:23:50
2020-02-24T07:23:50
242,671,848
0
0
null
null
null
null
UTF-8
Java
false
false
1,090
java
package login; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import io.cucumber.java.en.Given; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; public class login { WebDriver driver; @Given("I want to write a step with") public void i_want_to_write_a_step_with() { driver=chrome.getDriver("Chrome"); driver.get("https://10.232.237.143:443/TestMeApp/fetchcat.htm"); driver.findElement(By.id("details-button")).click(); driver.findElement(By.id("proceed-link")).click(); driver.findElement(By.xpath("//*[@href='login.htm']")).click(); } @Given("i enter {string} and {string}") public void i_enter_and(String string, String string2) { driver.findElement(By.name("userName")).sendKeys(string); driver.findElement(By.name("password")).sendKeys(string2); driver.findElement(By.xpath("//input[@name='Login']")).click(); } @When("I check for the in step") public void i_check_for_the_in_step() { } @Then("I verify the in step") public void i_verify_the_in_step() { } }
[ "p.b.lakshminarayanan@accenture.com" ]
p.b.lakshminarayanan@accenture.com
a17691d69c3e2be685e7ab5c7ad624af710c11b2
ec9875e263808fa7f39896f548beb58c5645f518
/app/src/main/java/com/example/lab3pp/OutputActivity.java
c300df302b95c761b03f1cc4168dee2d1c606149
[]
no_license
Konstantin-Minachkin/lab3PP
d6be5fac88196ce1e67b631f94990714f216de39
f48233c829cfc3c92bd6f416b874a7e756a63a8d
refs/heads/master
2020-05-21T17:20:32.520634
2019-05-11T10:50:20
2019-05-11T10:50:20
185,241,037
0
0
null
2019-05-06T17:43:37
2019-05-06T17:23:13
Java
UTF-8
Java
false
false
2,695
java
package com.example.lab3pp; import android.content.Context; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.ArrayList; public class OutputActivity extends AppCompatActivity { RecyclerView list; ArrayList<String> outputID = new ArrayList<String>(); ArrayList<String> outputFIO = new ArrayList<String>(); ArrayList<String> outputDATE = new ArrayList<String>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.output_activity); outputID = getIntent().getStringArrayListExtra("id"); //почему иногда тут 4 а иногда 5 outputFIO = getIntent().getStringArrayListExtra("fio"); //почему иногда тут 4 а иногда 5 outputDATE = getIntent().getStringArrayListExtra("date"); //почему иногда тут 4 а иногда 5 list = (RecyclerView) findViewById(R.id.outList); list.setAdapter(new CustomAdapter(this, outputID.size())); } private class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private LayoutInflater inflater; Context context; private int number; CustomAdapter(Context context, int number) { this.number = number; this.context = context; this.inflater = LayoutInflater.from(context); } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { final View view = inflater.inflate(R.layout.list_item, parent, false); return new ViewHolder(view); } @Override public void onBindViewHolder(final ViewHolder holder, final int position) { holder.id.setText(outputID.get(position)); holder.name.setText(outputFIO.get(position)); holder.date.setText(outputDATE.get(position)); } @Override public int getItemCount() { return number; } public class ViewHolder extends RecyclerView.ViewHolder { View view; final TextView id, name, date; ViewHolder(final View view) { super(view); this.view = view; id = (TextView) view.findViewById(R.id.id); name = (TextView) view.findViewById(R.id.name); date = (TextView) view.findViewById(R.id.date); } } } }
[ "kos-min@mail.ru" ]
kos-min@mail.ru
f87406ef440ad004a715042a6a7b9bc9b7750413
f4e3565d879b429c2dc086ec81c7acd1bb3b4ceb
/book/src/com/gl/action/ManagerAction.java
c081026b07a6978536c1ac8751d22fa166a91422
[]
no_license
Iamdevelope/temp
dcf8bc6ca31ad73e3b7d4ff2304a228eb1571c62
8772e16267ef59a2d244f068a7409ccbc9117187
refs/heads/master
2020-04-29T03:14:10.605294
2019-04-12T10:57:51
2019-04-12T10:57:51
175,801,364
0
0
null
null
null
null
UTF-8
Java
false
false
4,916
java
package com.gl.action; import java.io.IOException; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.ServletActionContext; import com.gl.model.Manager; import com.gl.service.ManagerService; import com.gl.utils.TimeHelper; import com.gl.utils.UUIDUtils; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; public class ManagerAction extends ActionSupport implements ModelDriven<Manager> { /** * */ private static final long serialVersionUID = 1L; private Manager manager=new Manager(); @Override public Manager getModel() { //System.out.println("获取到了管理员实例"); return manager; } private String pwd; private String newpwd; public void setPwd(String pwd) { this.pwd=pwd; } public void setNewpwd(String newpwd) { this.newpwd=newpwd; } private ManagerService managerService; public void setManagerService(ManagerService managerService) { this.managerService=managerService; } public String execute() { return "manager"; } /* * 管理员登录 * */ public String managerIndex() { return "manager"; } /* * 管理员登录页面 * */ public String managerPage(){ return "managerPage"; } /* * 管理员新增页面 * */ public String addPage() { return "addPage"; } public String login() { Manager existAdmin=managerService.login(manager); if(existAdmin==null) { //System.out.println("登录失败"); this.addActionError("登录失败:用户名或密码错误!"); return LOGIN; } else if(existAdmin.getIsdelete()==1) { //System.out.println("当前管理员类型:"+existAdmin.getPower()); this.addActionError("登录失败:该用户已经被注销,不能再使用,如有疑问,请联系管理员!"); return LOGIN; } else if(existAdmin.getLogin_state()==1) { this.addActionError("登录失败:该用户已经登录!"); return LOGIN; } else { //System.out.println("当前时间:"+TimeHelper.getCurrentTime()); //当用户登录成功时,记录用户的此次登录的时间以及将登录次数自增 Integer count = existAdmin.getLogin_count(); if(count==null) { existAdmin.setLogin_count(1); }else { existAdmin.setLogin_count(count+1); } existAdmin.setLast_login_time(TimeHelper.getCurrentTime()); //existAdmin.setLogin_state(1); managerService.update(existAdmin); ServletActionContext.getRequest().getSession().setAttribute("existAdmin", existAdmin); //System.out.println("登录成功"); return "loginSuccess"; } } public String regist() { String code=UUIDUtils.getUUID(); manager.setCode(code); manager.setCreate_time(TimeHelper.getCurrentTime()); managerService.save(manager); return "msg"; } public String info() { manager = (Manager)ServletActionContext.getRequest().getSession().getAttribute("existAdmin"); if(manager==null) { this.addActionError("登录过期,请重新登录!"); } //System.out.println("院长的ID:"+manager.getMid()); return "infoPage"; } public String updatePassword() throws IOException { manager = (Manager)ServletActionContext.getRequest().getSession().getAttribute("existAdmin"); //System.out.println("当前账号的密码:"+manager.getPassword()+"********需要验证的密码:"+pwd); HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("text/html;charset=UTF-8"); if(!pwd.equals(manager.getPassword())) { //System.out.println("密码与数据库中密码不一致,更改密码失败"); response.getWriter().println("密码错误"); return NONE; } //System.out.println("设置的新密码为:"+newpwd); manager.setPassword(newpwd); managerService.update(manager); response.getWriter().println("修改成功:当前登录账号即将失效,请使用新密码重新登录。"); return NONE; } public String updatePasswordPage() { return "updatePassword"; } public String editPage() { manager=(Manager)ServletActionContext.getRequest().getSession().getAttribute("existAdmin"); return "editPage"; } public String edit() { Manager temp=(Manager)ServletActionContext.getRequest().getSession().getAttribute("existAdmin"); manager.setPassword(temp.getPassword()); manager.setCode(temp.getCode()); manager.setType(temp.getType()); //System.out.println("***********"+manager.getPassword()); managerService.update(manager); return "infoPage"; } public String update() { managerService.update(manager); return "updateSuccess"; } /* * 退出 * */ public void quit() { Manager m = (Manager)ServletActionContext.getRequest().getSession().getAttribute("existAdmin"); //m.setLogin_state(0); managerService.update(m); ServletActionContext.getRequest().getSession().removeAttribute("existAdmin"); //销毁session ServletActionContext.getRequest().getSession().invalidate(); } }
[ "986461143@qq.com" ]
986461143@qq.com
4d8b35388e1097e887befba90c3cbc0d9783d5ad
b683bf6e0693c5119ed744db422be7a753f17d90
/tfsIntegration/src/org/jetbrains/tfsIntegration/core/tfs/UpdateWorkspaceInfo.java
3fb1f761a87cfbe2ec80f1ae4da038f421c640cf
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
WALLOUD/vso-intellij
cff7f03a936ce7bdffc4004ec36c708d3c7da630
bb3606599853da8a3a2a3f8277095d0edfe641e2
refs/heads/master
2020-03-26T12:10:12.350040
2018-08-15T16:52:30
2018-08-15T16:52:30
144,878,970
1
0
MIT
2018-08-15T16:52:31
2018-08-15T16:48:43
Java
UTF-8
Java
false
false
1,031
java
/* * Copyright 2000-2008 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jetbrains.tfsIntegration.core.tfs; import org.jetbrains.tfsIntegration.core.tfs.version.VersionSpecBase; public class UpdateWorkspaceInfo { private VersionSpecBase myVersion; public UpdateWorkspaceInfo(VersionSpecBase version) { myVersion = version; } public VersionSpecBase getVersion() { return myVersion; } public void setVersion(VersionSpecBase version) { myVersion = version; } }
[ "kirill.safonov@swiftteams.com" ]
kirill.safonov@swiftteams.com
062169f7c213cf7ad1b4c94680497b1192f0bed8
4df795257ffddb6393f372edec725cf83f98f591
/src/main/java/com/fsse/ecommerce/service/impl/ProductServiceImpl.java
d8a70ffc33992c6ccbddacca86b682a488b1d689
[]
no_license
rickywong0221/E-commerce-Backend
1fc4ca84bdeae0836a2a1e6ace23ff1e4f7ae915
0619a7a8ee6a4e2d7432f13ad1a21ff0d6e33fcb
refs/heads/main
2023-08-19T14:14:45.589748
2021-10-25T02:32:13
2021-10-25T02:32:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,415
java
package com.fsse.ecommerce.service.impl; import com.fsse.ecommerce.domain.Product; import com.fsse.ecommerce.domain.entity.ProductEntity; import com.fsse.ecommerce.repository.ProductRepository; import com.fsse.ecommerce.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.Optional; @Service public class ProductServiceImpl implements ProductService { @Autowired private ProductRepository productRepository; @Override public List<Product> getAllProducts() { Iterable<ProductEntity> allProducts = productRepository.findAll(); List<Product> products = new ArrayList<>(); for (ProductEntity item : allProducts) { products.add(new Product(item)); } return products; } @Override public Product getProductByPid(Long pid) { Optional<ProductEntity> entityOpt = productRepository.findById(pid); if (entityOpt.isPresent()) { return new Product(entityOpt.get()); } return null; } @Override public ProductEntity getProductEntityByPid(Long pid) { Optional<ProductEntity> entityOpt = productRepository.findById(pid); if (entityOpt.isPresent()) { return entityOpt.get(); } return null; } }
[ "lcwwk0725@gmail.com" ]
lcwwk0725@gmail.com
dec20e7297099a826d68c34f75108fa2faba4844
6875158f461ffd0b1d602d4659d5dd8d2370b870
/richfaces-a4j/src/main/java/org/richfaces/json/JSONObject.java
4ab91ee8c1a61c42320997701d65be23c4eb5a67
[]
no_license
eis-group-opensource/richfaces-4.x
e8455aeb0053e78d19a225cd5d42ae80173b4c8b
5cb28ebfede146b149a4e53bce4b0ca3ffa3d457
refs/heads/master
2023-09-02T23:40:17.925915
2021-11-18T17:44:36
2021-11-18T17:44:36
429,522,883
0
0
null
null
null
null
UTF-8
Java
false
false
41,470
java
/* Copyright © 2016 EIS Group and/or one of its affiliates. All rights reserved. Unpublished work under U.S. copyright laws. CONFIDENTIAL AND TRADE SECRET INFORMATION. No portion of this work may be copied, distributed, modified, or incorporated into any other media without EIS Group prior written consent.*/ package org.richfaces.json; /* Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software shall be used for Good, not Evil. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import java.io.IOException; import java.io.ObjectStreamException; import java.io.Serializable; import java.io.Writer; import java.lang.reflect.Field; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * A JSONObject is an unordered collection of name/value pairs. Its external form is a string wrapped in curly braces with * colons between the names and values, and commas between the values and names. The internal form is an object having * <code>get</code> and <code>opt</code> methods for accessing the values by name, and <code>put</code> methods for adding or * replacing values by name. The values can be any of these types: <code>Boolean</code>, <code>JSONArray</code>, * <code>JSONObject</code>, <code>Number</code>, <code>String</code>, or the <code>JSONObject.NULL</code> object. A JSONObject * constructor can be used to convert an external form JSON text into an internal form whose values can be retrieved with the * <code>get</code> and <code>opt</code> methods, or to convert values into a JSON text using the <code>put</code> and * <code>toString</code> methods. A <code>get</code> method returns a value if one can be found, and throws an exception if one * cannot be found. An <code>opt</code> method returns a default value instead of throwing an exception, and so is useful for * obtaining optional values. * <p/> * The generic <code>get()</code> and <code>opt()</code> methods return an object, which you can cast or query for type. There * are also typed <code>get</code> and <code>opt</code> methods that do type checking and type coersion for you. * <p/> * The <code>put</code> methods adds values to an object. For example, * * <pre> * myString = new JSONObject().put(&quot;JSON&quot;, &quot;Hello, World!&quot;).toString(); * </pre> * * produces the string <code>{"JSON": "Hello, World"}</code>. * <p/> * The texts produced by the <code>toString</code> methods strictly conform to the JSON sysntax rules. The constructors are more * forgiving in the texts they will accept: * <ul> * <li>An extra <code>,</code>&nbsp;<small>(comma)</small> may appear just before the closing brace.</li> * <li>Strings may be quoted with <code>'</code>&nbsp;<small>(single quote)</small>.</li> * <li>Strings do not need to be quoted at all if they do not begin with a quote or single quote, and if they do not contain * leading or trailing spaces, and if they do not contain any of these characters: <code>{ } [ ] / \ : , = ; #</code> and if * they do not look like numbers and if they are not the reserved words <code>true</code>, <code>false</code>, or * <code>null</code>.</li> * <li>Keys can be followed by <code>=</code> or <code>=></code> as well as by <code>:</code>.</li> * <li>Values can be followed by <code>;</code> <small>(semicolon)</small> as well as by <code>,</code> <small>(comma)</small>.</li> * <li>Numbers may have the <code>0-</code> <small>(octal)</small> or <code>0x-</code> <small>(hex)</small> prefix.</li> * <li>Comments written in the slashshlash, slashstar, and hash conventions will be ignored.</li> * </ul> * * @author JSON.org * @version 2 */ public class JSONObject implements Serializable { /** * It is sometimes more convenient and less ambiguous to have a <code>NULL</code> object than to use Java's * <code>null</code> value. <code>JSONObject.NULL.equals(null)</code> returns <code>true</code>. * <code>JSONObject.NULL.toString()</code> returns <code>"null"</code>. */ public static final Object NULL = new Null(); /** * */ private static final long serialVersionUID = -3779657348977645510L; /** * The hash map where the JSONObject's properties are kept. */ private Map myHashMap; /** * Construct an empty JSONObject. */ public JSONObject() { this.myHashMap = new HashMap(); } /** * Construct a JSONObject from a JSONTokener. * * @param x A JSONTokener object containing the source string. * @throws JSONException If there is a syntax error in the source string. */ public JSONObject(JSONTokener x) throws JSONException { this(); char c; String key; if (x.nextClean() != '{') { throw x.syntaxError("A JSONObject text must begin with '{'"); } for (;;) { c = x.nextClean(); switch (c) { case 0: throw x.syntaxError("A JSONObject text must end with '}'"); case '}': return; default: x.back(); key = x.nextValue().toString(); } /* * The key is followed by ':'. We will also tolerate '=' or '=>'. */ c = x.nextClean(); if (c == '=') { if (x.next() != '>') { x.back(); } } else if (c != ':') { throw x.syntaxError("Expected a ':' after a key"); } put(key, x.nextValue()); /* * Pairs are separated by ','. We will also tolerate ';'. */ switch (x.nextClean()) { case ';': case ',': if (x.nextClean() == '}') { return; } x.back(); break; case '}': return; default: throw x.syntaxError("Expected a ',' or '}'"); } } } /** * Construct a JSONObject from a Map. * * @param map A map object that can be used to initialize the contents of the JSONObject. */ public JSONObject(Map map) { this.myHashMap = (map == null) ? new HashMap() : new HashMap(map); } /** * Construct a JSONObject from a string. This is the most commonly used JSONObject constructor. * * @param string A string beginning with <code>{</code>&nbsp;<small>(left brace)</small> and ending with <code>}</code> * &nbsp;<small>(right brace)</small>. * @throws JSONException If there is a syntax error in the source string. */ public JSONObject(String string) throws JSONException { this(new JSONTokener(string)); } /** * Construct a JSONObject from a subset of another JSONObject. An array of strings is used to identify the keys that should * be copied. Missing keys are ignored. * * @param jo A JSONObject. * @param sa An array of strings. * @throws JSONException If a value is a non-finite number. */ public JSONObject(JSONObject jo, String[] sa) throws JSONException { this(); for (int i = 0; i < sa.length; i += 1) { putOpt(sa[i], jo.opt(sa[i])); } } /** * Construct a JSONObject from an Object, using reflection to find the public members. The resulting JSONObject's keys will * be the strings from the names array, and the values will be the field values associated with those keys in the object. If * a key is not found or not visible, then it will not be copied into the new JSONObject. * * @param object An object that has fields that should be used to make a JSONObject. * @param names An array of strings, the names of the fields to be used from the object. */ public JSONObject(Object object, String[] names) { this(); Class c = object.getClass(); for (int i = 0; i < names.length; i += 1) { try { String name = names[i]; Field field = c.getField(name); Object value = field.get(object); this.put(name, value); } catch (Exception e) { /* forget about it */ } } } /** * Accumulate values under a key. It is similar to the put method except that if there is already an object stored under the * key then a JSONArray is stored under the key to hold all of the accumulated values. If there is already a JSONArray, then * the new value is appended to it. In contrast, the put method replaces the previous value. * * @param key A key string. * @param value An object to be accumulated under the key. * @return this. * @throws JSONException If the value is an invalid number or if the key is null. */ public JSONObject accumulate(String key, Object value) throws JSONException { testValidity(value); Object o = opt(key); if (o == null) { put(key, (value instanceof JSONArray) ? new JSONArray().put(value) : value); } else if (o instanceof JSONArray) { ((JSONArray) o).put(value); } else { put(key, new JSONArray().put(o).put(value)); } return this; } /** * Append values to the array under a key. If the key does not exist in the JSONObject, then the key is put in the * JSONObject with its value being a JSONArray containing the value parameter. If the key was already associated with a * JSONArray, then the value parameter is appended to it. * * @param key A key string. * @param value An object to be accumulated under the key. * @return this. * @throws JSONException If the key is null or if the current value associated with the key is not a JSONArray. */ public JSONObject append(String key, Object value) throws JSONException { testValidity(value); Object o = opt(key); if (o == null) { put(key, new JSONArray().put(value)); } else if (o instanceof JSONArray) { put(key, ((JSONArray) o).put(value)); } else { throw new JSONException("JSONObject[" + key + "] is not a JSONArray."); } return this; } /** * Produce a string from a double. The string "null" will be returned if the number is not finite. * * @param d A double. * @return A String. */ public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String s = Double.toString(d); if ((s.indexOf('.') > 0) && (s.indexOf('e') < 0) && (s.indexOf('E') < 0)) { while (s.endsWith("0")) { s = s.substring(0, s.length() - 1); } if (s.endsWith(".")) { s = s.substring(0, s.length() - 1); } } return s; } /** * Get the value object associated with a key. * * @param key A key string. * @return The object associated with the key. * @throws JSONException if the key is not found. */ public Object get(String key) throws JSONException { Object o = opt(key); if (o == null) { throw new JSONException("JSONObject[" + quote(key) + "] not found."); } return o; } /** * Get the boolean value associated with a key. * * @param key A key string. * @return The truth. * @throws JSONException if the value is not a Boolean or the String "true" or "false". */ public boolean getBoolean(String key) throws JSONException { Object o = get(key); if (o.equals(Boolean.FALSE) || ((o instanceof String) && ((String) o).equalsIgnoreCase("false"))) { return false; } else if (o.equals(Boolean.TRUE) || ((o instanceof String) && ((String) o).equalsIgnoreCase("true"))) { return true; } throw new JSONException("JSONObject[" + quote(key) + "] is not a Boolean."); } /** * Get the double value associated with a key. * * @param key A key string. * @return The numeric value. * @throws JSONException if the key is not found or if the value is not a Number object and cannot be converted to a number. */ public double getDouble(String key) throws JSONException { Object o = get(key); try { return (o instanceof Number) ? ((Number) o).doubleValue() : Double.valueOf((String) o).doubleValue(); } catch (Exception e) { throw new JSONException("JSONObject[" + quote(key) + "] is not a number."); } } /** * Get the int value associated with a key. If the number value is too large for an int, it will be clipped. * * @param key A key string. * @return The integer value. * @throws JSONException if the key is not found or if the value cannot be converted to an integer. */ public int getInt(String key) throws JSONException { Object o = get(key); return (o instanceof Number) ? ((Number) o).intValue() : (int) getDouble(key); } /** * Get the JSONArray value associated with a key. * * @param key A key string. * @return A JSONArray which is the value. * @throws JSONException if the key is not found or if the value is not a JSONArray. */ public JSONArray getJSONArray(String key) throws JSONException { Object o = get(key); if (o instanceof JSONArray) { return (JSONArray) o; } throw new JSONException("JSONObject[" + quote(key) + "] is not a JSONArray."); } /** * Get the JSONObject value associated with a key. * * @param key A key string. * @return A JSONObject which is the value. * @throws JSONException if the key is not found or if the value is not a JSONObject. */ public JSONObject getJSONObject(String key) throws JSONException { Object o = get(key); if (o instanceof JSONObject) { return (JSONObject) o; } throw new JSONException("JSONObject[" + quote(key) + "] is not a JSONObject."); } /** * Get the long value associated with a key. If the number value is too long for a long, it will be clipped. * * @param key A key string. * @return The long value. * @throws JSONException if the key is not found or if the value cannot be converted to a long. */ public long getLong(String key) throws JSONException { Object o = get(key); return (o instanceof Number) ? ((Number) o).longValue() : (long) getDouble(key); } /** * Get the string associated with a key. * * @param key A key string. * @return A string which is the value. * @throws JSONException if the key is not found. */ public String getString(String key) throws JSONException { return get(key).toString(); } /** * Determine if the JSONObject contains a specific key. * * @param key A key string. * @return true if the key exists in the JSONObject. */ public boolean has(String key) { return this.myHashMap.containsKey(key); } /** * Determine if the value associated with the key is null or if there is no value. * * @param key A key string. * @return true if there is no value associated with the key or if the value is the JSONObject.NULL object. */ public boolean isNull(String key) { return JSONObject.NULL.equals(opt(key)); } /** * Get an enumeration of the keys of the JSONObject. * * @return An iterator of the keys. */ public Iterator keys() { return this.myHashMap.keySet().iterator(); } /** * Get the number of keys stored in the JSONObject. * * @return The number of keys in the JSONObject. */ public int length() { return this.myHashMap.size(); } /** * Produce a JSONArray containing the names of the elements of this JSONObject. * * @return A JSONArray containing the key strings, or null if the JSONObject is empty. */ public JSONArray names() { JSONArray ja = new JSONArray(); Iterator keys = keys(); while (keys.hasNext()) { ja.put(keys.next()); } return (ja.length() == 0) ? null : ja; } /** * Produce a string from a Number. * * @param n A Number * @return A String. * @throws JSONException If n is a non-finite number. */ public static String numberToString(Number n) throws JSONException { if (n == null) { throw new JSONException("Null pointer"); } testValidity(n); // Shave off trailing zeros and decimal point, if possible. String s = n.toString(); if ((s.indexOf('.') > 0) && (s.indexOf('e') < 0) && (s.indexOf('E') < 0)) { while (s.endsWith("0")) { s = s.substring(0, s.length() - 1); } if (s.endsWith(".")) { s = s.substring(0, s.length() - 1); } } return s; } /** * Get an optional value associated with a key. * * @param key A key string. * @return An object which is the value, or null if there is no value. */ public Object opt(String key) { return (key == null) ? null : this.myHashMap.get(key); } /** * Get an optional boolean associated with a key. It returns false if there is no such key, or if the value is not * Boolean.TRUE or the String "true". * * @param key A key string. * @return The truth. */ public boolean optBoolean(String key) { return optBoolean(key, false); } /** * Get an optional boolean associated with a key. It returns the defaultValue if there is no such key, or if it is not a * Boolean or the String "true" or "false" (case insensitive). * * @param key A key string. * @param defaultValue The default. * @return The truth. */ public boolean optBoolean(String key, boolean defaultValue) { try { return getBoolean(key); } catch (Exception e) { return defaultValue; } } /** * Put a key/value pair in the JSONObject, where the value will be a JSONArray which is produced from a Collection. * * @param key A key string. * @param value A Collection value. * @return this. * @throws JSONException */ public JSONObject put(String key, Collection value) throws JSONException { put(key, new JSONArray(value)); return this; } /** * Get an optional double associated with a key, or NaN if there is no such key or if its value is not a number. If the * value is a string, an attempt will be made to evaluate it as a number. * * @param key A string which is the key. * @return An object which is the value. */ public double optDouble(String key) { return optDouble(key, Double.NaN); } /** * Get an optional double associated with a key, or the defaultValue if there is no such key or if its value is not a * number. If the value is a string, an attempt will be made to evaluate it as a number. * * @param key A key string. * @param defaultValue The default. * @return An object which is the value. */ public double optDouble(String key, double defaultValue) { try { Object o = opt(key); return (o instanceof Number) ? ((Number) o).doubleValue() : new Double((String) o).doubleValue(); } catch (Exception e) { return defaultValue; } } /** * Get an optional int value associated with a key, or zero if there is no such key or if the value is not a number. If the * value is a string, an attempt will be made to evaluate it as a number. * * @param key A key string. * @return An object which is the value. */ public int optInt(String key) { return optInt(key, 0); } /** * Get an optional int value associated with a key, or the default if there is no such key or if the value is not a number. * If the value is a string, an attempt will be made to evaluate it as a number. * * @param key A key string. * @param defaultValue The default. * @return An object which is the value. */ public int optInt(String key, int defaultValue) { try { return getInt(key); } catch (Exception e) { return defaultValue; } } /** * Get an optional JSONArray associated with a key. It returns null if there is no such key, or if its value is not a * JSONArray. * * @param key A key string. * @return A JSONArray which is the value. */ public JSONArray optJSONArray(String key) { Object o = opt(key); return (o instanceof JSONArray) ? (JSONArray) o : null; } /** * Get an optional JSONObject associated with a key. It returns null if there is no such key, or if its value is not a * JSONObject. * * @param key A key string. * @return A JSONObject which is the value. */ public JSONObject optJSONObject(String key) { Object o = opt(key); return (o instanceof JSONObject) ? (JSONObject) o : null; } /** * Get an optional long value associated with a key, or zero if there is no such key or if the value is not a number. If the * value is a string, an attempt will be made to evaluate it as a number. * * @param key A key string. * @return An object which is the value. */ public long optLong(String key) { return optLong(key, 0); } /** * Get an optional long value associated with a key, or the default if there is no such key or if the value is not a number. * If the value is a string, an attempt will be made to evaluate it as a number. * * @param key A key string. * @param defaultValue The default. * @return An object which is the value. */ public long optLong(String key, long defaultValue) { try { return getLong(key); } catch (Exception e) { return defaultValue; } } /** * Get an optional string associated with a key. It returns an empty string if there is no such key. If the value is not a * string and is not null, then it is coverted to a string. * * @param key A key string. * @return A string which is the value. */ public String optString(String key) { return optString(key, ""); } /** * Get an optional string associated with a key. It returns the defaultValue if there is no such key. * * @param key A key string. * @param defaultValue The default. * @return A string which is the value. */ public String optString(String key, String defaultValue) { Object o = opt(key); return (o != null) ? o.toString() : defaultValue; } /** * Put a key/boolean pair in the JSONObject. * * @param key A key string. * @param value A boolean which is the value. * @return this. * @throws JSONException If the key is null. */ public JSONObject put(String key, boolean value) throws JSONException { put(key, value ? Boolean.TRUE : Boolean.FALSE); return this; } /** * Put a key/double pair in the JSONObject. * * @param key A key string. * @param value A double which is the value. * @return this. * @throws JSONException If the key is null or if the number is invalid. */ public JSONObject put(String key, double value) throws JSONException { put(key, new Double(value)); return this; } /** * Put a key/int pair in the JSONObject. * * @param key A key string. * @param value An int which is the value. * @return this. * @throws JSONException If the key is null. */ public JSONObject put(String key, int value) throws JSONException { put(key, new Integer(value)); return this; } /** * Put a key/long pair in the JSONObject. * * @param key A key string. * @param value A long which is the value. * @return this. * @throws JSONException If the key is null. */ public JSONObject put(String key, long value) throws JSONException { put(key, new Long(value)); return this; } /** * Put a key/value pair in the JSONObject, where the value will be a JSONObject which is produced from a Map. * * @param key A key string. * @param value A Map value. * @return this. * @throws JSONException */ public JSONObject put(String key, Map value) throws JSONException { put(key, new JSONObject(value)); return this; } /** * Put a key/value pair in the JSONObject. If the value is null, then the key will be removed from the JSONObject if it is * present. * * @param key A key string. * @param value An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, * JSONObject, Long, String, or the JSONObject.NULL object. * @return this. * @throws JSONException If the value is non-finite number or if the key is null. */ public JSONObject put(String key, Object value) throws JSONException { if (key == null) { throw new JSONException("Null key."); } if (value != null) { testValidity(value); this.myHashMap.put(key, value); } else { remove(key); } return this; } /** * Put a key/value pair in the JSONObject, but only if the key and the value are both non-null. * * @param key A key string. * @param value An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, * JSONObject, Long, String, or the JSONObject.NULL object. * @return this. * @throws JSONException If the value is a non-finite number. */ public JSONObject putOpt(String key, Object value) throws JSONException { if ((key != null) && (value != null)) { put(key, value); } return this; } /** * Produce a string in double quotes with backslash sequences in all the right places. A backslash will be inserted within * </, allowing JSON text to be delivered in HTML. In JSON text, a string cannot contain a control character or an unescaped * quote or backslash. * * @param string A String * @return A String correctly formatted for insertion in a JSON text. */ public static String quote(String string) { if ((string == null) || (string.length() == 0)) { return "\"\""; } char b; char c = 0; int i; int len = string.length(); StringBuffer sb = new StringBuffer(len + 4); String t; sb.append('"'); for (i = 0; i < len; i += 1) { b = c; c = string.charAt(i); switch (c) { case '\\': case '"': sb.append('\\'); sb.append(c); break; case '/': if (b == '<') { sb.append('\\'); } sb.append(c); break; case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; default: if (c < ' ') { t = "000" + Integer.toHexString(c); sb.append("\\u" + t.substring(t.length() - 4)); } else { sb.append(c); } } } sb.append('"'); return sb.toString(); } /** * Remove a name and its value, if present. * * @param key The name to be removed. * @return The value that was associated with the name, or null if there was no value. */ public Object remove(String key) { return this.myHashMap.remove(key); } /** * Throw an exception if the object is an NaN or infinite number. * * @param o The object to test. * @throws JSONException If o is a non-finite number. */ static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double) o).isInfinite() || ((Double) o).isNaN()) { throw new JSONException("JSON does not allow non-finite numbers"); } } else if (o instanceof Float) { if (((Float) o).isInfinite() || ((Float) o).isNaN()) { throw new JSONException("JSON does not allow non-finite numbers."); } } } } /** * Produce a JSONArray containing the values of the members of this JSONObject. * * @param names A JSONArray containing a list of key strings. This determines the sequence of the values in the result. * @return A JSONArray of values. * @throws JSONException If any of the values are non-finite numbers. */ public JSONArray toJSONArray(JSONArray names) throws JSONException { if ((names == null) || (names.length() == 0)) { return null; } JSONArray ja = new JSONArray(); for (int i = 0; i < names.length(); i += 1) { ja.put(this.opt(names.getString(i))); } return ja; } /** * Make a JSON text of this JSONObject. For compactness, no whitespace is added. If this would not result in a syntactically * correct JSON text, then null will be returned instead. * <p/> * Warning: This method assumes that the data structure is acyclical. * * @return a printable, displayable, portable, transmittable representation of the object, beginning with <code>{</code> * &nbsp;<small>(left brace)</small> and ending with <code>}</code>&nbsp;<small>(right brace)</small>. */ public String toString() { try { Iterator keys = keys(); StringBuffer sb = new StringBuffer("{"); while (keys.hasNext()) { if (sb.length() > 1) { sb.append(','); } Object o = keys.next(); sb.append(quote(o.toString())); sb.append(':'); sb.append(valueToString(this.myHashMap.get(o))); } sb.append('}'); return sb.toString(); } catch (Exception e) { return null; } } /** * Make a prettyprinted JSON text of this JSONObject. * <p/> * Warning: This method assumes that the data structure is acyclical. * * @param indentFactor The number of spaces to add to each level of indentation. * @return a printable, displayable, portable, transmittable representation of the object, beginning with <code>{</code> * &nbsp;<small>(left brace)</small> and ending with <code>}</code>&nbsp;<small>(right brace)</small>. * @throws JSONException If the object contains an invalid number. */ public String toString(int indentFactor) throws JSONException { return toString(indentFactor, 0); } /** * Make a prettyprinted JSON text of this JSONObject. * <p/> * Warning: This method assumes that the data structure is acyclical. * * @param indentFactor The number of spaces to add to each level of indentation. * @param indent The indentation of the top level. * @return a printable, displayable, transmittable representation of the object, beginning with <code>{</code> * &nbsp;<small>(left brace)</small> and ending with <code>}</code>&nbsp;<small>(right brace)</small>. * @throws JSONException If the object contains an invalid number. */ String toString(int indentFactor, int indent) throws JSONException { int i; int n = length(); if (n == 0) { return "{}"; } Iterator keys = keys(); StringBuffer sb = new StringBuffer("{"); int newindent = indent + indentFactor; Object o; if (n == 1) { o = keys.next(); sb.append(quote(o.toString())); sb.append(": "); sb.append(valueToString(this.myHashMap.get(o), indentFactor, indent)); } else { while (keys.hasNext()) { o = keys.next(); if (sb.length() > 1) { sb.append(",\n"); } else { sb.append('\n'); } for (i = 0; i < newindent; i += 1) { sb.append(' '); } sb.append(quote(o.toString())); sb.append(": "); sb.append(valueToString(this.myHashMap.get(o), indentFactor, newindent)); } if (sb.length() > 1) { sb.append('\n'); for (i = 0; i < indent; i += 1) { sb.append(' '); } } } sb.append('}'); return sb.toString(); } /** * Make a JSON text of an Object value. If the object has an value.toJSONString() method, then that method will be used to * produce the JSON text. The method is required to produce a strictly conforming text. If the object does not contain a * toJSONString method (which is the most common case), then a text will be produced by the rules. * <p/> * Warning: This method assumes that the data structure is acyclical. * * @param value The value to be serialized. * @return a printable, displayable, transmittable representation of the object, beginning with <code>{</code> * &nbsp;<small>(left brace)</small> and ending with <code>}</code>&nbsp;<small>(right brace)</small>. * @throws JSONException If the value is or contains an invalid number. */ static String valueToString(Object value) throws JSONException { if ((value == null) || value.equals(null)) { return "null"; } if (value instanceof JSONString) { Object o; try { o = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e); } if (o instanceof String) { return (String) o; } throw new JSONException("Bad value from toJSONString: " + o); } if (value instanceof Number) { return numberToString((Number) value); } if ((value instanceof Boolean) || (value instanceof JSONObject) || (value instanceof JSONArray)) { return value.toString(); } return quote(value.toString()); } /** * Make a prettyprinted JSON text of an object value. * <p/> * Warning: This method assumes that the data structure is acyclical. * * @param value The value to be serialized. * @param indentFactor The number of spaces to add to each level of indentation. * @param indent The indentation of the top level. * @return a printable, displayable, transmittable representation of the object, beginning with <code>{</code> * &nbsp;<small>(left brace)</small> and ending with <code>}</code>&nbsp;<small>(right brace)</small>. * @throws JSONException If the object contains an invalid number. */ static String valueToString(Object value, int indentFactor, int indent) throws JSONException { if ((value == null) || value.equals(null)) { return "null"; } try { if (value instanceof JSONString) { Object o = ((JSONString) value).toJSONString(); if (o instanceof String) { return (String) o; } } } catch (Exception e) { /* forget about it */ } if (value instanceof Number) { return numberToString((Number) value); } if (value instanceof Boolean) { return value.toString(); } if (value instanceof JSONObject) { return ((JSONObject) value).toString(indentFactor, indent); } if (value instanceof JSONArray) { return ((JSONArray) value).toString(indentFactor, indent); } return quote(value.toString()); } /** * Write the contents of the JSONObject as JSON text to a writer. For compactness, no whitespace is added. * <p/> * Warning: This method assumes that the data structure is acyclical. * * @return The writer. * @throws JSONException */ public Writer write(Writer writer) throws JSONException { try { boolean b = false; Iterator keys = keys(); writer.write('{'); while (keys.hasNext()) { if (b) { writer.write(','); } Object k = keys.next(); writer.write(quote(k.toString())); writer.write(':'); Object v = this.myHashMap.get(k); if (v instanceof JSONObject) { ((JSONObject) v).write(writer); } else if (v instanceof JSONArray) { ((JSONArray) v).write(writer); } else { writer.write(valueToString(v)); } b = true; } writer.write('}'); return writer; } catch (IOException e) { throw new JSONException(e); } } /** * JSONObject.NULL is equivalent to the value that JavaScript calls null, whilst Java's null is equivalent to the value that * JavaScript calls undefined. */ private static final class Null implements Serializable { private static final long serialVersionUID = -1155578668810010644L; private Null() { super(); } /** * There is only intended to be a single instance of the NULL object, so the clone method returns itself. * * @return NULL. */ @Override protected Object clone() { return this; } /** * A Null object is equal to the null value and to itself. * * @param object An object to test for nullness. * @return true if the object parameter is the JSONObject.NULL object or null. */ @Override public boolean equals(Object object) { return (object == null) || (object == this); } @Override public int hashCode() { return super.hashCode(); } /** * Get the "null" string value. * * @return The string "null". */ @Override public String toString() { return "null"; } private Object readResolve() throws ObjectStreamException { return NULL; } } }
[ "eis_build@eisgroup.com" ]
eis_build@eisgroup.com
73cfa2d98833cc7a9053b781e055be396dbda9d2
994bf9a04abf161236595c786a7ae6825c49b0ae
/MediaMind API Sample Code/src/api/eyeblaster/com/V1/DataContracts/Advertiser/ArrayOfAdvertiserServiceFilter.java
ec296430020b4b8c404f28a8d5de4b593cf11d3e
[]
no_license
easpex/java
7cdfbe26594ee3b51112992a67a00211d1ec355d
ed1caa19a59a3ff40962816de59b80c619c9e92e
refs/heads/master
2021-01-13T17:08:20.805254
2016-10-28T18:06:57
2016-10-28T18:06:57
72,230,514
0
0
null
null
null
null
UTF-8
Java
false
false
32,727
java
/** * ArrayOfAdvertiserServiceFilter.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.4 Built on : Apr 26, 2008 (06:25:17 EDT) */ package api.eyeblaster.com.V1.DataContracts.Advertiser; /** * ArrayOfAdvertiserServiceFilter bean class */ public class ArrayOfAdvertiserServiceFilter implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = ArrayOfAdvertiserServiceFilter Namespace URI = http://api.eyeblaster.com/V1/DataContracts Namespace Prefix = ns2 */ private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://api.eyeblaster.com/V1/DataContracts")){ return "ns2"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } /** * field for AdvertiserServiceFilter * This was an Array! */ protected api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[] localAdvertiserServiceFilter ; /* This tracker boolean wil be used to detect whether the user called the set method * for this attribute. It will be used to determine whether to include this field * in the serialized XML */ protected boolean localAdvertiserServiceFilterTracker = false ; /** * Auto generated getter method * @return api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[] */ public api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[] getAdvertiserServiceFilter(){ return localAdvertiserServiceFilter; } /** * validate the array for AdvertiserServiceFilter */ protected void validateAdvertiserServiceFilter(api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[] param){ } /** * Auto generated setter method * @param param AdvertiserServiceFilter */ public void setAdvertiserServiceFilter(api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[] param){ validateAdvertiserServiceFilter(param); if (param != null){ //update the setting tracker localAdvertiserServiceFilterTracker = true; } else { localAdvertiserServiceFilterTracker = true; } this.localAdvertiserServiceFilter=param; } /** * Auto generated add method for the array for convenience * @param param api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter */ public void addAdvertiserServiceFilter(api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter param){ if (localAdvertiserServiceFilter == null){ localAdvertiserServiceFilter = new api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[]{}; } //update the setting tracker localAdvertiserServiceFilterTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localAdvertiserServiceFilter); list.add(param); this.localAdvertiserServiceFilter = (api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[])list.toArray( new api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[list.size()]); } /** * isReaderMTOMAware * @return true if the reader supports MTOM */ public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { boolean isReaderMTOMAware = false; try{ isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); }catch(java.lang.IllegalArgumentException e){ isReaderMTOMAware = false; } return isReaderMTOMAware; } /** * * @param parentQName * @param factory * @return org.apache.axiom.om.OMElement */ public org.apache.axiom.om.OMElement getOMElement ( final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { ArrayOfAdvertiserServiceFilter.this.serialize(parentQName,factory,xmlWriter); } }; return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( parentQName,factory,dataSource); } public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ serialize(parentQName,factory,xmlWriter,false); } public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ java.lang.String prefix = null; java.lang.String namespace = null; prefix = parentQName.getPrefix(); namespace = parentQName.getNamespaceURI(); if ((namespace != null) && (namespace.trim().length() > 0)) { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); } else { if (prefix == null) { prefix = generatePrefix(namespace); } xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } else { xmlWriter.writeStartElement(parentQName.getLocalPart()); } if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://api.eyeblaster.com/V1/DataContracts"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":ArrayOfAdvertiserServiceFilter", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "ArrayOfAdvertiserServiceFilter", xmlWriter); } } if (localAdvertiserServiceFilterTracker){ if (localAdvertiserServiceFilter!=null){ for (int i = 0;i < localAdvertiserServiceFilter.length;i++){ if (localAdvertiserServiceFilter[i] != null){ localAdvertiserServiceFilter[i].serialize(new javax.xml.namespace.QName("http://api.eyeblaster.com/V1/DataContracts","AdvertiserServiceFilter"), factory,xmlWriter); } else { // write null attribute java.lang.String namespace2 = "http://api.eyeblaster.com/V1/DataContracts"; if (! namespace2.equals("")) { java.lang.String prefix2 = xmlWriter.getPrefix(namespace2); if (prefix2 == null) { prefix2 = generatePrefix(namespace2); xmlWriter.writeStartElement(prefix2,"AdvertiserServiceFilter", namespace2); xmlWriter.writeNamespace(prefix2, namespace2); xmlWriter.setPrefix(prefix2, namespace2); } else { xmlWriter.writeStartElement(namespace2,"AdvertiserServiceFilter"); } } else { xmlWriter.writeStartElement("AdvertiserServiceFilter"); } // write the nil attribute writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter); xmlWriter.writeEndElement(); } } } else { // write null attribute java.lang.String namespace2 = "http://api.eyeblaster.com/V1/DataContracts"; if (! namespace2.equals("")) { java.lang.String prefix2 = xmlWriter.getPrefix(namespace2); if (prefix2 == null) { prefix2 = generatePrefix(namespace2); xmlWriter.writeStartElement(prefix2,"AdvertiserServiceFilter", namespace2); xmlWriter.writeNamespace(prefix2, namespace2); xmlWriter.setPrefix(prefix2, namespace2); } else { xmlWriter.writeStartElement(namespace2,"AdvertiserServiceFilter"); } } else { xmlWriter.writeStartElement("AdvertiserServiceFilter"); } // write the nil attribute writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter); xmlWriter.writeEndElement(); } } xmlWriter.writeEndElement(); } /** * Util method to write an attribute with the ns prefix */ private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } xmlWriter.writeAttribute(namespace,attName,attValue); } /** * Util method to write an attribute without the ns prefix */ private void writeAttribute(java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (namespace.equals("")) { xmlWriter.writeAttribute(attName,attValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace,attName,attValue); } } /** * Util method to write an attribute without the ns prefix */ private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { attributePrefix = registerPrefix(xmlWriter, attributeNamespace); } java.lang.String attributeValue; if (attributePrefix.trim().length() > 0) { attributeValue = attributePrefix + ":" + qname.getLocalPart(); } else { attributeValue = qname.getLocalPart(); } if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace, attName, attributeValue); } } /** * method to handle Qnames */ private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); if (prefix == null) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); java.lang.String namespaceURI = null; java.lang.String prefix = null; for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); } namespaceURI = qnames[i].getNamespaceURI(); if (namespaceURI != null) { prefix = xmlWriter.getPrefix(namespaceURI); if ((prefix == null) || (prefix.length() == 0)) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } } else { stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } } xmlWriter.writeCharacters(stringToWrite.toString()); } } /** * Register a namespace prefix */ private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { prefix = generatePrefix(namespace); while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } return prefix; } /** * databinding method to get an XML representation of this object * */ public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException{ java.util.ArrayList elementList = new java.util.ArrayList(); java.util.ArrayList attribList = new java.util.ArrayList(); if (localAdvertiserServiceFilterTracker){ if (localAdvertiserServiceFilter!=null) { for (int i = 0;i < localAdvertiserServiceFilter.length;i++){ if (localAdvertiserServiceFilter[i] != null){ elementList.add(new javax.xml.namespace.QName("http://api.eyeblaster.com/V1/DataContracts", "AdvertiserServiceFilter")); elementList.add(localAdvertiserServiceFilter[i]); } else { elementList.add(new javax.xml.namespace.QName("http://api.eyeblaster.com/V1/DataContracts", "AdvertiserServiceFilter")); elementList.add(null); } } } else { elementList.add(new javax.xml.namespace.QName("http://api.eyeblaster.com/V1/DataContracts", "AdvertiserServiceFilter")); elementList.add(localAdvertiserServiceFilter); } } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); } /** * Factory class that keeps the parse method */ public static class Factory{ /** * static method to create the object * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element * Postcondition: If this object is an element, the reader is positioned at its end element * If this object is a complex type, the reader is positioned at the end element of its outer element */ public static ArrayOfAdvertiserServiceFilter parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ ArrayOfAdvertiserServiceFilter object = new ArrayOfAdvertiserServiceFilter(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName!=null){ java.lang.String nsPrefix = null; if (fullTypeName.indexOf(":") > -1){ nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); } nsPrefix = nsPrefix==null?"":nsPrefix; java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); if (!"ArrayOfAdvertiserServiceFilter".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (ArrayOfAdvertiserServiceFilter)api.eyeblaster.com.message.Advertiser.ExtensionMapper.getTypeObject( nsUri,type,reader); } } } // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); reader.next(); java.util.ArrayList list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.eyeblaster.com/V1/DataContracts","AdvertiserServiceFilter").equals(reader.getName())){ // Process the array and step past its final element's end. nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil"); if ("true".equals(nillableValue) || "1".equals(nillableValue)){ list1.add(null); reader.next(); } else { list1.add(api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter.Factory.parse(reader)); } //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // We should be at the end element, but make sure while (!reader.isEndElement()) reader.next(); // Step out of this element reader.next(); // Step to next element event. while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isEndElement()){ //two continuous end elements means we are exiting the xml structure loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://api.eyeblaster.com/V1/DataContracts","AdvertiserServiceFilter").equals(reader.getName())){ nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil"); if ("true".equals(nillableValue) || "1".equals(nillableValue)){ list1.add(null); reader.next(); } else { list1.add(api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter.Factory.parse(reader)); } }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setAdvertiserServiceFilter((api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( api.eyeblaster.com.V1.DataContracts.Advertiser.AdvertiserServiceFilter.class, list1)); } // End of if for expected property start element else { } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement()) // A start element we are not expecting indicates a trailing invalid property throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class }
[ "subsinfoapps@gmail.com" ]
subsinfoapps@gmail.com
672a6ceef8ce1a8cf0268f3c29dffce6b86832db
7b009d4dec215a3feacf91439d614cad04c70eef
/app/src/main/java/com/geekban/geekbandandroidproject/UserInfo.java
e5020681bfa90d4cab5121676d36dea8c2b5f429
[]
no_license
linclsky/GeekBandAndroidProject
430fde045a1633a619d5052a0e19a4688ecb49c4
5f67d754fef1b93b1323ba4308ed637ccdbd486a
refs/heads/master
2022-06-06T20:32:00.267620
2020-04-29T23:05:06
2020-04-29T23:05:06
260,064,234
1
0
null
null
null
null
UTF-8
Java
false
false
951
java
package com.geekban.geekbandandroidproject; import java.io.Serializable; /** * Created by Administrator on 2020/2/20. */ public class UserInfo implements Serializable{ private String mUsername; private int mAge; private String mAvatarUrl; private float mWeight; public String getUsername() { return mUsername; } public String getAvatarUrl() { return mAvatarUrl; } public void setAvatarUrl(String avatarUrl) { mAvatarUrl = avatarUrl; } public float getWeight() { return mWeight; } public void setWeight(float weight) { mWeight = weight; } public void setUsername(String username) { mUsername = username; } public int getAge() { return mAge; } public void setAge(int age) { mAge = age; } public UserInfo(String username, int age) { mUsername = username; mAge = age; } }
[ "55120319@qq.com" ]
55120319@qq.com
1fbedc52205a94b57aa3c9c832470187b4a25848
6459035361939086aa04dae784360add15fd1241
/core/src/main/java/com/kis/loader/dbloader/exception/ObjectNotFoundException.java
d25b27fd879da27f83810c2ca3c15ba63582dade
[]
no_license
yasikvor/KisYProject
777162a15b0402c33ecb7997e9166c46dd2afee9
8e2a01a144125973eb7d91afcdf133c10fc8c16b
refs/heads/master
2020-04-05T00:03:40.345902
2018-11-06T12:40:15
2018-11-06T12:40:15
156,381,741
1
0
null
null
null
null
UTF-8
Java
false
false
103
java
package com.kis.loader.dbloader.exception; public class ObjectNotFoundException extends Exception { }
[ "kis.y@dbbest.com" ]
kis.y@dbbest.com
21deb4072af0f9308286476dd20cfddc8636a8eb
42e4f4900d1590c646f3bb29686571f9fcd315ba
/src/main/java/com/icfwx/mqtest/test/Receiver.java
9fc391ab21a9c12b95b4f21281a371846fa40171
[]
no_license
13211331331/activemq-demo
86722cc9d9a05f7bd23caea29958f82a822fcfbb
8cd29dc23d1ea760ac0c041fb4664daf9ef82478
refs/heads/master
2016-09-01T16:37:44.255268
2015-11-03T01:55:45
2015-11-03T01:55:45
45,433,082
0
0
null
null
null
null
UTF-8
Java
false
false
777
java
package com.icfwx.mqtest.test; import java.util.Map; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; //import org.springframework.jms.core.JmsTemplate; /** * Created by cfwx on 2015/11/2. */ public class Receiver { @SuppressWarnings("unchecked") public static void main(String[] args) { ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath:applicationContext-*.xml"); /* JmsTemplate jmsTemplate = (JmsTemplate) ctx.getBean("jmsTemplate"); while(true) { Map<String, Object> map = (Map<String, Object>) jmsTemplate.receiveAndConvert(); System.out.println("收到消息:" + map.get("message")); }*/ } }
[ "bbyshp@126.com" ]
bbyshp@126.com
8155d6b0b954d765f2e0edbeb6935f442ddd1bcc
982f6c3a3c006d2b03f4f53c695461455bee64e9
/src/main/java/com/alipay/api/response/AntMerchantExpandActivityQualificationQueryResponse.java
43c51bb4533b4c55e93af8ebe8e44b185a5d1761
[ "Apache-2.0" ]
permissive
zhaomain/Alipay-Sdk
80ffc0505fe81cc7dd8869d2bf9a894b823db150
552f68a2e7c10f9ffb33cd8e0036b0643c7c2bb3
refs/heads/master
2022-11-15T03:31:47.418847
2020-07-09T12:18:59
2020-07-09T12:18:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,249
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: ant.merchant.expand.activity.qualification.query response. * * @author auto create * @since 1.0, 2019-07-24 13:15:01 */ public class AntMerchantExpandActivityQualificationQueryResponse extends AlipayResponse { private static final long serialVersionUID = 4149647247971837213L; /** * 用户无资格时的具体原因 */ @ApiField("detail_msg") private String detailMsg; /** * 用户无资格时的错误码 */ @ApiField("error_code") private String errorCode; /** * 是否有资格 */ @ApiField("has_qualification") private String hasQualification; public void setDetailMsg(String detailMsg) { this.detailMsg = detailMsg; } public String getDetailMsg( ) { return this.detailMsg; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getErrorCode( ) { return this.errorCode; } public void setHasQualification(String hasQualification) { this.hasQualification = hasQualification; } public String getHasQualification( ) { return this.hasQualification; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
cd3741e09d3bb7780b60992128e9bbf2bacbf921
b40730da840b1c6060476042555d92577f6c49f7
/src/main/java/io/interview/extensibility/validators/CharacterCountCommandValidator.java
43cfd173a00bd8b7ac3eaef4cbc1e6da1d78052f
[]
no_license
lolpany/web-scraper
637129caa8727a9f67a9a4f8b731cc9354001b6c
28a568d7e5b0e8332d41ed0fca15f7573e6b9f30
refs/heads/master
2021-05-29T08:50:43.120327
2015-02-02T15:17:16
2015-02-02T15:17:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
810
java
package io.interview.extensibility.validators; import io.interview.extensibility.commands.CharacterCountDataCommand; import java.util.Iterator; import java.util.List; /** * Created by user on 2015-02-01. */ public class CharacterCountCommandValidator implements CommandValidator { private static final String COMMAND_STRING = "-c"; @Override public CharacterCountDataCommand validateParameter(List<String> parameters) { boolean isPresent = false; Iterator iterator = parameters.iterator(); while (iterator.hasNext()) { if (COMMAND_STRING.equals(iterator.next())) { isPresent = true; iterator.remove(); break; } } return isPresent ? new CharacterCountDataCommand() : null; } }
[ "gbesergey@gmail.com" ]
gbesergey@gmail.com
bf82a00e635375e64201d1e682982b332e045bae
e1ed5f410bba8c05310b6a7dabe65b7ef62a9322
/src/main/java/com/sda/javabyd3/mabr/algorytmy/MainCounting.java
7506493f6940317811c1dccbb399373a14e0b34c
[]
no_license
pmkiedrowicz/javabyd3
252f70e70f0fc71e8ef9019fdd8cea5bd05ca90b
7ff8e93c041f27383b3ad31b43f014c059ef53e3
refs/heads/master
2022-01-01T08:56:08.747392
2019-07-26T19:02:50
2019-07-26T19:02:50
199,065,478
0
0
null
null
null
null
UTF-8
Java
false
false
533
java
package com.sda.javabyd3.mabr.algorytmy; import java.util.Arrays; public class MainCounting { public static void main(String[] args) { Counting counting = new Counting(); System.out.println("Before Sorting : "); int arr[]={1,4,7,3,4,5,6,3,4,8,6,4,4}; System.out.println(Arrays.toString(arr)); arr=counting.countingSort(arr); System.out.println("======================="); System.out.println("After Sorting : "); System.out.println(Arrays.toString(arr)); } }
[ "pmkiedrowicz@gmail.com" ]
pmkiedrowicz@gmail.com
4f5ca6a5fbacdf97ee24f885d535692f91ed58dd
fb6da8023baae5592c38359280eead736b2de53b
/src/main/java/cl/onesnap/springtest/config/OAuth2ServerConfiguration.java
3c25719c827913a6c7c5bf2b22fdba58ad875a11
[]
no_license
bescione/jhipster-angular-typescript
194a2e56cf1bdcd1804b114cd1ad3dfc70fc0771
bbeab794366ff0a95dccfaf0ac1a4db53cc4ab47
refs/heads/master
2020-04-12T18:27:28.291810
2016-01-11T18:46:36
2016-01-11T18:46:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,006
java
package cl.onesnap.springtest.config; import cl.onesnap.springtest.security.AjaxLogoutSuccessHandler; import cl.onesnap.springtest.security.AuthoritiesConstants; import cl.onesnap.springtest.security.Http401UnauthorizedEntryPoint; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer; import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; import javax.inject.Inject; import javax.sql.DataSource; @Configuration public class OAuth2ServerConfiguration { @Configuration @EnableResourceServer protected static class ResourceServerConfiguration extends ResourceServerConfigurerAdapter { @Inject private Http401UnauthorizedEntryPoint authenticationEntryPoint; @Inject private AjaxLogoutSuccessHandler ajaxLogoutSuccessHandler; @Override public void configure(HttpSecurity http) throws Exception { http .exceptionHandling() .authenticationEntryPoint(authenticationEntryPoint) .and() .logout() .logoutUrl("/api/logout") .logoutSuccessHandler(ajaxLogoutSuccessHandler) .and() .csrf() .disable() .headers() .frameOptions().disable() .and() .authorizeRequests() .antMatchers(HttpMethod.OPTIONS, "/**").permitAll() .antMatchers("/api/authenticate").permitAll() .antMatchers("/api/register").permitAll() .antMatchers("/api/logs/**").hasAnyAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/api/**").authenticated() .antMatchers("/websocket/tracker").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/websocket/**").permitAll() .antMatchers("/metrics/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/health/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/trace/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/dump/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/shutdown/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/beans/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/configprops/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/info/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/autoconfig/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/env/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/trace/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/liquibase/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/api-docs/**").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/protected/**").authenticated(); } } @Configuration @EnableAuthorizationServer protected static class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter { @Inject private DataSource dataSource; @Inject private SpringTestProperties springTestProperties; @Bean public TokenStore tokenStore() { return new JdbcTokenStore(dataSource); } @Inject @Qualifier("authenticationManagerBean") private AuthenticationManager authenticationManager; @Override public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { endpoints .tokenStore(tokenStore()) .authenticationManager(authenticationManager); } @Override public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception { oauthServer.allowFormAuthenticationForClients(); } @Override public void configure(ClientDetailsServiceConfigurer clients) throws Exception { clients .inMemory() .withClient(springTestProperties.getSecurity().getAuthentication().getOauth().getClientid()) .scopes("read", "write") .authorities(AuthoritiesConstants.ADMIN, AuthoritiesConstants.USER) .authorizedGrantTypes("password", "refresh_token", "authorization_code", "implicit") .secret(springTestProperties.getSecurity().getAuthentication().getOauth().getSecret()) .accessTokenValiditySeconds(springTestProperties.getSecurity().getAuthentication().getOauth().getTokenValidityInSeconds()); } } }
[ "epotignano@gmail.com" ]
epotignano@gmail.com
7c3339438418abc8afc3e6b470c7fc7cd07356ed
69c9c1c522609d5955a71f3c0e934f3e40c1f2be
/nfe/src/main/java/com/t2tierp/controller/compras/CompraMapaComparativoController.java
332f341356c89be75590b291fc2c5a8b05ac162e
[]
no_license
pedrocalixtrato/DotCompanyERP
05e3856a1f31ea85f91de66a5a4fd34c8851a8f5
48486a972b3d7be7cf5d411fbeef23576b59105a
refs/heads/master
2021-01-18T03:15:48.976071
2017-05-05T14:55:44
2017-05-05T14:55:44
85,836,176
0
0
null
null
null
null
ISO-8859-1
Java
false
false
12,578
java
/* * The MIT License * * Copyright: Copyright (C) 2014 T2Ti.COM * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * The author may be contacted at: t2ti.com@gmail.com * * @author Claudio de Barros (T2Ti.com) * @version 2.0 */ package com.t2tierp.controller.compras; import java.io.Serializable; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; import javax.ejb.EJB; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import org.primefaces.component.datatable.DataTable; import org.primefaces.event.CellEditEvent; import com.t2tierp.controller.AbstractController; import com.t2tierp.controller.T2TiLazyDataModel; import com.t2tierp.model.bean.compras.CompraCotacao; import com.t2tierp.model.bean.compras.CompraCotacaoDetalhe; import com.t2tierp.model.bean.compras.CompraCotacaoPedidoDetalhe; import com.t2tierp.model.bean.compras.CompraFornecedorCotacao; import com.t2tierp.model.bean.compras.CompraPedido; import com.t2tierp.model.bean.compras.CompraPedidoDetalhe; import com.t2tierp.model.bean.compras.CompraTipoPedido; import com.t2tierp.model.dao.Filtro; import com.t2tierp.model.dao.InterfaceDAO; import com.t2tierp.util.FacesContextUtil; @ManagedBean @ViewScoped public class CompraMapaComparativoController extends AbstractController<CompraCotacao> implements Serializable { private static final long serialVersionUID = 1L; private CompraMapaComparativoDataModel dataModel; @EJB private InterfaceDAO<CompraCotacaoDetalhe> compraCotacaoDetalheDao; private List<CompraCotacaoDetalhe> listaCompraCotacaoDetalhe; @EJB private InterfaceDAO<CompraTipoPedido> compraTipoPedidoDao; @EJB private InterfaceDAO<CompraPedido> compraPedidoDao; @EJB private InterfaceDAO<CompraCotacaoPedidoDetalhe> compraCotacaoPedidoDetalheDao; @Override public Class<CompraCotacao> getClazz() { return CompraCotacao.class; } @Override public String getFuncaoBase() { return "COMPRA_MAPA_COMPARATIVO"; } @Override public T2TiLazyDataModel<CompraCotacao> getDataModel() { if (dataModel == null) { dataModel = new CompraMapaComparativoDataModel(); dataModel.setClazz(getClazz()); dataModel.setDao(dao); } return dataModel; } @Override public void alterar() { try { super.alterar(); buscaListaCompracotacaoDetalhe(); } catch (Exception e) { e.printStackTrace(); FacesContextUtil.adiconaMensagem(FacesMessage.SEVERITY_ERROR, "Ocorreu um erro ao buscar os detalhes da cotação!", e.getMessage()); } } public void buscaListaCompracotacaoDetalhe() throws Exception { super.alterar(); List<Filtro> filtros = new ArrayList<>(); filtros.add(new Filtro(Filtro.AND, "compraFornecedorCotacao.compraCotacao", Filtro.IGUAL, getObjeto())); listaCompraCotacaoDetalhe = compraCotacaoDetalheDao.getBeans(CompraCotacaoDetalhe.class, filtros); } @Override public void salvar() { try { buscaListaCompracotacaoDetalhe(); boolean produtoPedido = false; for (CompraCotacaoDetalhe d : listaCompraCotacaoDetalhe) { if (d.getQuantidadePedida() != null) { if (d.getQuantidadePedida().compareTo(BigDecimal.ZERO) == 1) { produtoPedido = true; } } } if (!produtoPedido) { throw new Exception("Nenhum produto com quantidade pedida maior que 0(zero)!"); } //Pedido vindo de cotação sempre será marcado como Normal CompraTipoPedido tipoPedido = compraTipoPedidoDao.getBean(1, CompraTipoPedido.class); if (tipoPedido == null) { throw new Exception("Tipo de Pedido não cadastrado!"); } List<CompraPedido> listaPedido = new ArrayList<>(); List<CompraCotacaoPedidoDetalhe> listaCotacaoPedidoDetalhe = new ArrayList<>(); CompraPedido pedido; Date dataPedido = new Date(); boolean incluiPedido; BigDecimal subTotal; BigDecimal totalDesconto; BigDecimal totalGeral; BigDecimal totalBaseCalculoIcms; BigDecimal totalIcms; BigDecimal totalIpi; for (CompraFornecedorCotacao f : getObjeto().getListaCompraFornecedorCotacao()) { pedido = new CompraPedido(); pedido.setCompraTipoPedido(tipoPedido); pedido.setDataPedido(dataPedido); pedido.setFornecedor(f.getFornecedor()); pedido.setListaCompraPedidoDetalhe(new HashSet<>()); incluiPedido = false; subTotal = BigDecimal.ZERO; totalDesconto = BigDecimal.ZERO; totalGeral = BigDecimal.ZERO; totalBaseCalculoIcms = BigDecimal.ZERO; totalIcms = BigDecimal.ZERO; totalIpi = BigDecimal.ZERO; //inclui os itens no pedido for (CompraCotacaoDetalhe d : listaCompraCotacaoDetalhe) { if (d.getCompraFornecedorCotacao().getId().intValue() == f.getId().intValue()) { if (d.getQuantidadePedida() != null) { if (d.getQuantidadePedida().compareTo(BigDecimal.ZERO) == 1) { if (d.getValorUnitario() == null) { throw new Exception("Valor unitário do produto '" + d.getProduto().getNome() + " não informado!"); } incluiPedido = true; CompraPedidoDetalhe pedidoDetalhe = new CompraPedidoDetalhe(); pedidoDetalhe.setCompraPedido(pedido); pedidoDetalhe.setProduto(d.getProduto()); pedidoDetalhe.setQuantidade(d.getQuantidadePedida()); pedidoDetalhe.setValorUnitario(d.getValorUnitario()); pedidoDetalhe.setValorSubtotal(d.getValorSubtotal()); pedidoDetalhe.setTaxaDesconto(d.getTaxaDesconto()); pedidoDetalhe.setValorDesconto(d.getValorDesconto()); pedidoDetalhe.setValorTotal(d.getValorTotal()); pedidoDetalhe.setBaseCalculoIcms(pedidoDetalhe.getValorTotal()); pedidoDetalhe.setAliquotaIcms(d.getProduto().getAliquotaIcmsPaf()); if (pedidoDetalhe.getAliquotaIcms() != null && pedidoDetalhe.getBaseCalculoIcms() != null) { pedidoDetalhe.setValorIcms(pedidoDetalhe.getBaseCalculoIcms().multiply(pedidoDetalhe.getAliquotaIcms().divide(BigDecimal.valueOf(100), RoundingMode.HALF_DOWN))); } else { pedidoDetalhe.setAliquotaIcms(BigDecimal.ZERO); pedidoDetalhe.setValorIcms(BigDecimal.ZERO); } pedidoDetalhe.setAliquotaIpi(BigDecimal.ZERO); if (pedidoDetalhe.getAliquotaIpi() != null) { pedidoDetalhe.setValorIpi(pedidoDetalhe.getValorTotal().multiply(pedidoDetalhe.getAliquotaIpi().divide(BigDecimal.valueOf(100), RoundingMode.HALF_DOWN))); } else { pedidoDetalhe.setAliquotaIpi(BigDecimal.ZERO); pedidoDetalhe.setValorIpi(BigDecimal.ZERO); } pedido.getListaCompraPedidoDetalhe().add(pedidoDetalhe); subTotal = subTotal.add(pedidoDetalhe.getValorSubtotal()); totalDesconto = totalDesconto.add(pedidoDetalhe.getValorDesconto()); totalGeral = totalGeral.add(pedidoDetalhe.getValorTotal()); totalBaseCalculoIcms = totalBaseCalculoIcms.add(pedidoDetalhe.getBaseCalculoIcms()); totalIcms = totalIcms.add(pedidoDetalhe.getValorIcms()); totalIpi = totalIpi.add(pedidoDetalhe.getValorIpi()); CompraCotacaoPedidoDetalhe cotacaoPedidoDetalhe = new CompraCotacaoPedidoDetalhe(); cotacaoPedidoDetalhe.setCompraPedido(pedido); cotacaoPedidoDetalhe.setCompraCotacaoDetalhe(d); cotacaoPedidoDetalhe.setQuantidadePedida(d.getQuantidadePedida()); listaCotacaoPedidoDetalhe.add(cotacaoPedidoDetalhe); } } } } pedido.setValorSubtotal(subTotal); pedido.setValorDesconto(totalDesconto); pedido.setValorTotalPedido(totalGeral); pedido.setBaseCalculoIcms(totalBaseCalculoIcms); pedido.setValorIcms(totalIcms); pedido.setValorTotalProdutos(totalGeral); pedido.setValorIpi(totalIpi); pedido.setValorTotalNf(totalGeral); if (incluiPedido) { listaPedido.add(pedido); } } for (CompraPedido c : listaPedido) { compraPedidoDao.persist(c); } for (CompraCotacaoPedidoDetalhe c : listaCotacaoPedidoDetalhe) { compraCotacaoPedidoDetalheDao.persist(c); } getObjeto().setSituacao("F"); dao.merge(getObjeto()); voltar(); FacesContextUtil.adiconaMensagem(FacesMessage.SEVERITY_INFO, "Pedido realizado com sucesso!", ""); } catch (Exception e) { e.printStackTrace(); FacesContextUtil.adiconaMensagem(FacesMessage.SEVERITY_ERROR, "Ocorreu um erro ao salvar o registro!", e.getMessage()); } } public void alteraItemFornecedor(CellEditEvent event) { try { DataTable dataTable = (DataTable) event.getSource(); CompraCotacaoDetalhe detalhe = (CompraCotacaoDetalhe) dataTable.getRowData(); BigDecimal quantidadePedida = (BigDecimal) event.getNewValue(); if (quantidadePedida != null) { if (quantidadePedida.compareTo(detalhe.getQuantidade()) == 1) { throw new Exception("Quantidade pedida do produto '" + detalhe.getProduto().getNome() + "' é maior que a quantidade cotada!"); } else if (detalhe.getQuantidadePedida().compareTo(BigDecimal.ZERO) == 1) { detalhe.setQuantidadePedida((BigDecimal) event.getNewValue()); compraCotacaoDetalheDao.merge(detalhe); FacesContextUtil.adiconaMensagem(FacesMessage.SEVERITY_INFO, "Dados salvos com sucesso!", null); } } } catch (Exception e) { e.printStackTrace(); FacesContextUtil.adiconaMensagem(FacesMessage.SEVERITY_ERROR, "Ocorreu um erro ao salvar o registro!", e.getMessage()); } } public List<CompraCotacaoDetalhe> getListaCompraCotacaoDetalhe() { return listaCompraCotacaoDetalhe; } public void setListaCompraCotacaoDetalhe(List<CompraCotacaoDetalhe> listaCompraCotacaoDetalhe) { this.listaCompraCotacaoDetalhe = listaCompraCotacaoDetalhe; } }
[ "pedromiguel@dotcompany.com.br" ]
pedromiguel@dotcompany.com.br
f22faf1b8a4f5ffc77a87b3ec2c3281e186c5ad5
874cff9c5b36843f9d9624119dc6f18312d6ac85
/src/com/df/crawl/CrawlResult.java
cf8488e5c9e1335676a12ce4ec892398baaa8c37
[]
no_license
h140465/Spirder
81db4b91fa59d98463de145c735a416404ed43c2
6eda1ee2f830a1f080863314ca2084c78eafa866
refs/heads/master
2021-01-10T11:00:27.772025
2016-02-26T10:02:02
2016-02-26T10:03:57
52,595,605
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
package com.df.crawl; import java.util.Date; public class CrawlResult { private boolean isSuccess; private int code; private String content; private Date beginTime; private Date endTime; private WebTask task; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getBeginTime() { return beginTime; } public void setBeginTime(Date beginTime) { this.beginTime = beginTime; } public Date getEndTime() { return endTime; } public void setEndTime(Date endTime) { this.endTime = endTime; } public boolean isSuccess() { return isSuccess; } public void setSuccess(boolean isSuccess) { this.isSuccess = isSuccess; } public WebTask getTask() { return task; } public void setTask(WebTask task) { this.task = task; } }
[ "doufu_87@163.com" ]
doufu_87@163.com
c859c47ab221ce2319d08eca7bb859f9ff672f11
9efc2386dc8bbfa3c319fc62b27055eb7766ee4b
/src/com/ksv/threads/TestClass.java
477c47abc570f6cc3b8a7a8843f4cc3ad24f1327
[]
no_license
svkalidas/PlayWithJava
45903069058a7f2223fa4695a71096cd30ed89f3
caa6da55db93d9b5f848a65b7ac52bf2192ebc21
refs/heads/main
2023-05-22T08:26:18.467646
2021-06-15T09:16:21
2021-06-15T09:16:21
377,104,382
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.ksv.threads; import java.util.ArrayList; import java.util.Iterator; import java.util.List; class TestClass2 implements Iterable<Object>{ static int i =0; static Object[] a1 = null; static{ a1 = new Object[10]; } @Override public Iterator<Object> iterator() { Iterator<Object> it = new Iterator<Object>() { @Override public boolean hasNext() { // TODO Auto-generated method stub return false; } @Override public Object next() { // TODO Auto-generated method stub return null; } }; return it ; } public void add(Object obj){ a1[i] = obj; i++; } } public class TestClass { public static void main(String[] args) { Integer i = null; List l1 = new ArrayList(); l1.add("Hello"); l1.add(2); l1.add('c'); List<String> l2 = new ArrayList<String>(); l2.add("Haii"); //l2.add(2); try{ numberPrint(i); }catch(Exception e){ e.printStackTrace(); } Object[] a1 = new Object[10]; System.out.println(a1.length); List<TestClass2> list = new ArrayList<>(); Iterator it1 = list.iterator(); } public static void numberPrint(int i){ System.out.println(i); } }
[ "svkalidas@gmail.com" ]
svkalidas@gmail.com
255e1456d8c57ab7c694cad649f325d3f53349c0
14e2eec07c49d3064a94f11760347eabe1c4f986
/src/test/java/com/doggybites/rx/observables/Filter.java
c2857cbdeb982bae9f09800fbe1c4c01b2d1f1ce
[]
no_license
mefjush/rx-java-workshop
4e3c7d27b8303ab8cdb61f378b2090fbc023098c
2a44d8b519f4253ef8548884eb2adbf30593fb1d
refs/heads/master
2023-07-02T14:47:32.511379
2023-06-20T07:48:39
2023-06-20T07:48:39
65,449,075
0
0
null
null
null
null
UTF-8
Java
false
false
1,975
java
package com.doggybites.rx.observables; import static com.doggybites.rx.observables.Utils.dump; import static com.doggybites.rx.observables.Utils.fixedDelay; import static com.doggybites.rx.observables.Utils.range; import java.util.Random; import java.util.concurrent.TimeUnit; import org.junit.Test; import rx.Observable; import rx.Observable.Transformer; public class Filter { public static final Transformer<Integer,Integer> IS_SQUARE = x -> x.filter(y -> Math.round(Math.sqrt(y))==Math.sqrt(y)); public static final Transformer<Integer,Integer> TIMED = x -> fixedDelay(x, 50, TimeUnit.MILLISECONDS); public static final Transformer<Integer,Integer> TIME_OUT = x -> x.timeout(500, TimeUnit.MILLISECONDS); @Test public void filter() { Observable<Integer> series = range(1,100); Observable<Integer> square = series.compose(IS_SQUARE); dump(square); } @Test public void increasingDelay() { Observable<Integer> series = range(1,10); Observable<Integer> beat = range(1,100).compose(TIMED).compose(IS_SQUARE); dump(series.zipWith(beat, (x,y) -> x)); dump(series.zipWith(beat, (x,y) -> x).compose(TIME_OUT).onExceptionResumeNext(Observable.empty())); } @Test public void echo() { Random random = new Random(); Observable<Integer> series = range(1,10).compose(TIMED); dump(series.flatMap(x -> (random.nextInt()%5==0)? Observable.just(x,x).compose(TIMED): Observable.just(x) )); } @Test public void hiccup() { Random random = new Random(); Observable<Integer> series = range(1,10).compose(TIMED); dump(series.concatMap(x -> (random.nextInt()%5==0)? Observable.just(x,x).compose(TIMED): Observable.just(x) )); } }
[ "paul@adhese.eu" ]
paul@adhese.eu
cc7c57a92fdda1250a241377cf105146b1a64293
1d574ef283d2e2cc2cc861ff96741dc3a4e0975a
/merge-sort/src/main/java/ua/shtramak/MergeSort.java
f0ae7f9b14a1b078b3293cc0e6cf6e451c0a127f
[]
no_license
Shtramak/bobocode-hw-algorithms
bffe0275b1f105fe8c504d6f5bbab5a416e838aa
d9019f3a1e61f802c94c3b0c3ff62a8f7263d653
refs/heads/main
2023-08-11T07:43:13.165077
2021-08-25T15:43:17
2021-08-25T15:56:14
399,872,236
0
0
null
null
null
null
UTF-8
Java
false
false
2,070
java
package ua.shtramak; import java.util.Objects; public class MergeSort { private static int numberOfIterations; private MergeSort() { } public static int sort(int[] array) { Objects.requireNonNull(array); numberOfIterations = 0; mergeSort(array); return numberOfIterations; } private static void mergeSort(int[] array) { numberOfIterations++; int length = array.length; if (length < 2) { return; } int midIndex = length / 2; int[] leftArray = subArrayFrom(array, 0, midIndex); int[] rightArray = subArrayFrom(array, midIndex, length); mergeSort(leftArray); mergeSort(rightArray); sortLeftAndRightArrays(array, leftArray, rightArray); } private static void sortLeftAndRightArrays(int[] resultArray, int[] leftArray, int[] rightArray) { int leftLength = leftArray.length; int rightLength = rightArray.length; int leftIndex = 0; int rightIndex = 0; int resultIndex = 0; while (leftIndex < leftLength && rightIndex < rightLength) { if (leftArray[leftIndex] < rightArray[rightIndex]) { numberOfIterations++; resultArray[resultIndex++] = leftArray[leftIndex++]; } else { numberOfIterations++; resultArray[resultIndex++] = rightArray[rightIndex++]; } } while (leftIndex < leftLength){ numberOfIterations++; resultArray[resultIndex++] = leftArray[leftIndex++]; } while (rightIndex < rightLength){ numberOfIterations++; resultArray[resultIndex++] = rightArray[rightIndex++]; } } private static int[] subArrayFrom(int[] array, int startIndex, int endIndex) { int[] result = new int[endIndex - startIndex]; int index = 0; for (int i = startIndex; i < endIndex; i++) { result[index++] = array[i]; } return result; } }
[ "shtramak@gmail.com" ]
shtramak@gmail.com
0143f100a996b3f4a164a47f12e8566f6935eb2d
341be1f4ffe701bfced516f8074527042745a9b1
/src/main/java/com/airtickets/repository/Repository.java
dbfa3eba8982ef3a74555670a17c7e10758462c2
[]
no_license
Stanislav77753/FinalCrudApp
d1d17cfd33cf7bc808c928c08598982fc27d687f
4213b75edcd9349717837174b9048aa1cdc21df6
refs/heads/master
2020-03-27T20:03:03.393254
2018-09-16T15:56:31
2018-09-16T15:56:31
147,033,644
0
0
null
null
null
null
UTF-8
Java
false
false
2,055
java
package main.java.com.airtickets.repository; import main.java.com.airtickets.exceptions.FileEmptyException; import main.java.com.airtickets.model.Logger; import java.io.*; import java.util.ArrayList; import java.util.List; public interface Repository<T, ID> { void save(T t); void delete(T t); void update(T t); T getById(ID id) throws FileEmptyException; default List<String> getAll(File fileName) throws FileEmptyException{ List<String> entityList = new ArrayList<>(); Long count = 0L; try(BufferedReader in = new BufferedReader(new FileReader(fileName))) { String entityString; do{ entityString = in.readLine(); if(entityString == null && count == 0){ throw new FileEmptyException("\u001B[31m" + "Database " + "\"" + fileName + "\"" + " is empty!"); }else if(entityString != null){ entityList.add(entityString); } count++; }while(entityString != null); } catch (FileNotFoundException e) { Logger.printLog("File " + "\"" + fileName + "\"" + " not found"); } catch (IOException e) { e.printStackTrace(); } return entityList; } default Long getId(File fileName) throws FileEmptyException { Long id = 0L; String str; try(BufferedReader in = new BufferedReader(new FileReader(fileName))){ do{ str = in.readLine(); if(str == null && id == 0L){ throw new FileEmptyException("\u001B[31m" + "Database " + "\"" + fileName + "\"" + " is empty!"); } else if(str != null){ id++; } }while(str != null); } catch (FileNotFoundException e) { Logger.printLog("File " + "\"" + fileName + "\"" + " not found"); } catch (IOException e) { e.printStackTrace(); } return id; } }
[ "maikydyk@mail.ru@git config --global user.email maikydyk@mail.ru" ]
maikydyk@mail.ru@git config --global user.email maikydyk@mail.ru
0c3f9bc02e8ebc7178cf939298bcb0eb1fd0fe42
58e024e93c5f9319dc476548ef562acb267ddd8a
/leilaotdd/src/main/java/br/com/joaogabrieljs/leilaotdd/Avaliador.java
e9c7ff9277f21a7661569f3112eeb40f5d4970e5
[]
no_license
joaogabrieljunq/leilao-tdd-java
6b166aafbbde1e9acc508c673e3150836e9317a6
4fdc5bf496ea85502568a446aff7f8c08d677ef8
refs/heads/master
2022-02-17T13:17:34.548315
2017-09-27T23:31:28
2017-09-27T23:31:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
/** * Desenvolvido em: 27/09/2017 * @author joaogabrieljs */ package br.com.joaogabrieljs.leilaotdd; public class Avaliador { private double maiorDeTodos = Double.NEGATIVE_INFINITY; private double menorDeTodos = Double.POSITIVE_INFINITY; public void avalia(Leilao leilao) { for(Lance lance : leilao.getLances()) { if(lance.getValor() > maiorDeTodos) { maiorDeTodos = lance.getValor(); } if(lance.getValor() < menorDeTodos) { menorDeTodos = lance.getValor(); } } } public double getMaiorLance() { return maiorDeTodos; } public double getMenorLance() { return menorDeTodos; } }
[ "noreply@github.com" ]
noreply@github.com
b4d2669932a635b322a3d78f8267599584d0569a
b1fa42ba0d06fc5534c8fd88a476a202b5134262
/WumpusWorld/src/wumpusworld/MyAgent.java
f810f0df870258b17e493335e41c2ed7a2aa6a23
[]
no_license
albertfiati/Wumpus
b67cfd0d0549b5e2c150e50a242bf4d72faeab08
8eb315454d25725971cb5a32170ed150016da7e8
refs/heads/master
2021-08-23T03:37:36.994708
2017-12-03T00:08:08
2017-12-03T00:08:08
111,302,447
1
0
null
null
null
null
UTF-8
Java
false
false
6,861
java
package wumpusworld; /** * Contains starting code for creating your own Wumpus World agent. Currently * the agent only make a random decision each turn. * * @author Johan Hagelbäck */ public class MyAgent implements Agent { int rnd; private World w; protected QLearningAgent agent; private Position currentPosition; /** * Creates a new instance of your solver agent. * * @param world Current world state */ public MyAgent(World world) { w = world; agent = new QLearningAgent(); currentPosition = new Position(w.getPlayerX(), w.getPlayerY()); } @Override public void train() { Position tempPosition = currentPosition; String move = this.agent.getRandomMove(); execute(move); this.agent.updateQTable(tempPosition, move); } /** * Asks your solver agent to execute an action. */ @Override public void doAction() { String move = agent.getBestMove(currentPosition); execute(move); //Location of the player int cX = w.getPlayerX(); int cY = w.getPlayerY(); if (w.hasWumpus(cX, cY)) { System.out.println("Wampus is here"); w.doAction(World.A_SHOOT); } else if (w.hasGlitter(cX, cY)) { System.out.println("Agent won"); w.doAction(World.A_GRAB); } else if (w.hasPit(cX, cY)) { System.out.println("Fell in the pit"); } // //Basic action: // //Grab Gold if we can. // if (w.hasGlitter(cX, cY)) { // w.doAction(World.A_GRAB); // return; // } // // //Basic action: // //We are in a pit. Climb up. // if (w.isInPit()) { // w.doAction(World.A_CLIMB); // return; // } // // //Test the environment // if (w.hasBreeze(cX, cY)) { // System.out.println("I am in a Breeze"); // } // if (w.hasStench(cX, cY)) { // System.out.println("I am in a Stench"); // } // if (w.hasPit(cX, cY)) { // System.out.println("I am in a Pit"); // } // if (w.getDirection() == World.DIR_RIGHT) { // System.out.println("I am facing Right"); // } // if (w.getDirection() == World.DIR_LEFT) { // System.out.println("I am facing Left"); // } // if (w.getDirection() == World.DIR_UP) { // System.out.println("I am facing Up"); // } // if (w.getDirection() == World.DIR_DOWN) { // System.out.println("I am facing Down"); // } // // //decide next move // rnd = decideRandomMove(); // if (rnd == 0) { // w.doAction(World.A_TURN_LEFT); // w.doAction(World.A_MOVE); // } // // if (rnd == 1) { // w.doAction(World.A_MOVE); // } // // if (rnd == 2) { // w.doAction(World.A_TURN_LEFT); // w.doAction(World.A_TURN_LEFT); // w.doAction(World.A_MOVE); // } // // if (rnd == 3) { // w.doAction(World.A_TURN_RIGHT); // w.doAction(World.A_MOVE); // } } /** * Generates a random instruction for the Agent. */ public int decideRandomMove() { return (int) (Math.random() * 4); } private void execute(String move) { Position nextPosition = agent.getNextPosition(move, currentPosition); //evaluate position agent.evaluate(w, currentPosition); if (w.isValidPosition(nextPosition.getX(), nextPosition.getY())) { switch (move) { case "UP": moveUp(); break; case "DOWN": moveDown(); break; case "LEFT": moveLeft(); break; default: moveRight(); break; } currentPosition = nextPosition; } // else { // System.out.println("Invalid move :("); // } } private void moveUp() { switch (w.getDirection()) { case World.DIR_LEFT: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; case World.DIR_RIGHT: w.doAction(World.A_TURN_LEFT); w.doAction(World.A_MOVE); break; case World.DIR_DOWN: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; default: w.doAction(World.A_MOVE); break; } } private void moveDown() { switch (w.getDirection()) { case World.DIR_LEFT: w.doAction(World.A_TURN_LEFT); w.doAction(World.A_MOVE); break; case World.DIR_RIGHT: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; case World.DIR_UP: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; default: w.doAction(World.A_MOVE); break; } } private void moveLeft() { switch (w.getDirection()) { case World.DIR_UP: w.doAction(World.A_TURN_LEFT); w.doAction(World.A_MOVE); break; case World.DIR_RIGHT: w.doAction(World.A_TURN_LEFT); w.doAction(World.A_TURN_LEFT); w.doAction(World.A_MOVE); break; case World.DIR_DOWN: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; default: w.doAction(World.A_MOVE); break; } } private void moveRight() { switch (w.getDirection()) { case World.DIR_LEFT: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; case World.DIR_UP: w.doAction(World.A_TURN_RIGHT); w.doAction(World.A_MOVE); break; case World.DIR_DOWN: w.doAction(World.A_TURN_LEFT); w.doAction(World.A_MOVE); break; default: w.doAction(World.A_MOVE); break; } } public void printQTable() { this.agent.print(); } }
[ "awkfiati@gmail.com" ]
awkfiati@gmail.com
2fa81273a92c01f45c0b663c981fa31134ace418
06512d44bbc663ecf8c80583e7e474000ec6ff67
/src/main/java/pl/connectis/print/TXTPrinter.java
8a03373e2b1aa85896ed59d5659f7debe84747f3
[]
no_license
GriszaKaramazow/currency-cmdline
7e713bf696c8cc474b547f584277c771a101dbb0
2b6e267b42e2e3e249ccbb37eaf7af08a880cead
refs/heads/master
2020-12-23T21:30:14.600827
2020-04-09T11:08:09
2020-04-09T11:08:09
237,280,250
0
0
null
2020-04-09T12:05:18
2020-01-30T18:41:29
Java
UTF-8
Java
false
false
460
java
package pl.connectis.print; import lombok.extern.slf4j.Slf4j; import pl.connectis.model.ExchangeRates; @Slf4j public class TXTPrinter extends PlainTextPrinter { private final String filePath; public TXTPrinter(String filePath) { this.filePath = filePath; } @Override public void print(ExchangeRates exchangeRates) { log.info("Printing to txt file."); printToTextFile(exchangeRates, filePath, "\t"); } }
[ "grisza.karamazow@gmail.com" ]
grisza.karamazow@gmail.com
fbe9897f41cd5ef66f74d16326541a7e6110529c
da304a602873dc07a3fcd6a94a7dbebb1ab28671
/app/src/main/java/com/example/abc/bankverficationcenter/Information.java
63887fbc3c94a908eb47b20cc2f7e64e8bc2bb72
[]
no_license
Jaldhibadheka/Bankverificationcenter
dec333782793104d20e5cf678fb49b79344951e4
15fe9571f5b914c10bde93783688b04bb4357fe8
refs/heads/master
2021-01-18T17:23:49.215807
2017-03-31T07:50:09
2017-03-31T07:50:09
86,792,524
0
0
null
null
null
null
UTF-8
Java
false
false
1,427
java
package com.example.abc.bankverficationcenter; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class Information extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_information); Button avil =(Button)findViewById(R.id.available); avil.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i1 =new Intent(Information.this,Transaction.class); startActivity(i1); } }); Button navail =(Button) findViewById(R.id.notavailable); navail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i2= new Intent(Information.this,NotAvailableCustomer.class); startActivity(i2); } }); Button forward =(Button) findViewById(R.id.forward); forward.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i3 =new Intent(Information.this,PostponeCust.class); startActivity(i3); } }); } }
[ "jaldhibadheka96.jb@gmail.com" ]
jaldhibadheka96.jb@gmail.com
0cacb06956659e816517911c251be86114addd85
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_1/src/b/e/e/g/Calc_1_1_14469.java
a225fa17b720d6a206c3acb9fd369d759a2454a3
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.e.e.g; public class Calc_1_1_14469 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
d3deabc1c14987770be66187137f14c1c78cbb8d
ac21733ddf2e8d5ebd6c4501be8b497b457f8162
/src/main/java/com/github/m5rian/jdaCommandHandler/commandServices/ICooldownService.java
08b503ddf4e8d340b2b3d6f1fd9e05ada37f331a
[ "MIT" ]
permissive
Zone-Infinity/JdaCommandHandler
e65c6e743014889adb6cee9d04578bf66d6eaca7
19f0fe38492d8f1bc733651bae8a5fde23f9f862
refs/heads/master
2023-08-16T02:18:27.936914
2021-10-16T09:42:33
2021-10-16T09:42:33
416,410,036
0
0
null
null
null
null
UTF-8
Java
false
false
5,839
java
package com.github.m5rian.jdaCommandHandler.commandServices; import com.github.m5rian.jdaCommandHandler.command.CommandEvent; import com.github.m5rian.jdaCommandHandler.command.CooldownTarget; import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.User; import java.util.HashMap; import java.util.Map; /** * This interface provides methods to get cool down data of users for all commands */ public interface ICooldownService { /** * Used for guild specific cooldowns. * <p> * Map containing the guild id and another map with the user id and cooldown expire time. * Either this, {@link ICooldownService#memberCommandSpecificCooldown}, {@link ICooldownService#userCoolDowns} or {@link ICooldownService#userCommandSpecificCooldowns} is used. Not multiple. */ Map<String, Map<String, Long>> memberCoolDowns = new HashMap<>(); /** * Used for guild and command specific cooldowns. * <p> * Map containing the guild id and another map with the user id and yet another map containing the {@link CommandEvent} and the final cooldown expire time. * Either this, {@link ICooldownService#memberCoolDowns}, {@link ICooldownService#userCoolDowns} or {@link ICooldownService#userCommandSpecificCooldowns} is used. Not multiple. */ Map<String, Map<String, Map<CommandEvent, Long>>> memberCommandSpecificCooldown = new HashMap<>(); /** * Used for global cooldowns. * <p> * Map containing the user id and the cooldown expiration time. * Either this, {@link ICooldownService#memberCommandSpecificCooldown}, {@link ICooldownService#userCommandSpecificCooldowns} or {@link ICooldownService#userCommandSpecificCooldowns} is used. Not multiple. */ Map<String, Long> userCoolDowns = new HashMap<>(); /** * Used for global command specific cooldowns. * <p> * Map containing the user id and another map with the {@link CommandEvent} and the final cooldown expire time. * Either this, {@link ICooldownService#memberCoolDowns}, {@link ICooldownService#userCoolDowns} or {@link ICooldownService#userCoolDowns} is used. Not multiple. */ Map<String, Map<CommandEvent, Long>> userCommandSpecificCooldowns = new HashMap<>(); /** * @param user The {@link User} to get the cooldown of. * @param command The {@link CommandEvent} of the executed command. * @param cooldownTarget The set {@link CooldownTarget} (for example in {@link DefaultCommandService#cooldownTarget}). * @return Returns the cooldown expiration time of the {@link User}. If the {@link CooldownTarget#commandSpecific} is set to true a command specific cooldownTarget will be returned. */ default Long getUserCooldown(User user, CommandEvent command, CooldownTarget cooldownTarget) { if (cooldownTarget.commandSpecific) { // User has no cooldown if (!userCommandSpecificCooldowns.containsKey(user.getId()) || !userCommandSpecificCooldowns.get(user.getId()).containsKey(command)) { return 0L; } return userCommandSpecificCooldowns.get(user.getId()).get(command); } else { return userCoolDowns.getOrDefault(user.getId(), 0L); } } default Long getMemberCooldown(Member member, CommandEvent command, CooldownTarget cooldownTarget) { if (cooldownTarget.commandSpecific) { // Member has no cooldown if (!memberCommandSpecificCooldown.containsKey(member.getGuild().getId()) || !memberCommandSpecificCooldown.get(member.getGuild().getId()).containsKey(member.getId()) || !memberCommandSpecificCooldown.get(member.getGuild().getId()).get(member.getId()).containsKey(command)) { return 0L; } return memberCommandSpecificCooldown.get(member.getGuild().getId()).get(member.getId()).get(command); } else { if (!memberCoolDowns.containsKey(member.getGuild().getId())) return 0L; else return memberCoolDowns.get(member.getGuild().getId()).getOrDefault(member.getId(), 0L); } } default void setUserCooldown(User user, CommandEvent command, CooldownTarget target) { if (target.commandSpecific) { if (!userCommandSpecificCooldowns.containsKey(user.getId())) { userCommandSpecificCooldowns.put(user.getId(), new HashMap<>()); } userCommandSpecificCooldowns.get(user.getId()).put(command, System.currentTimeMillis() + command.cooldown() * 1000); } else { userCoolDowns.put(user.getId(), System.currentTimeMillis() + command.cooldown() * 1000); } } default void setMemberCooldown(Member member, CommandEvent command, CooldownTarget target) { if (target.commandSpecific) { if (!memberCommandSpecificCooldown.containsKey(member.getGuild().getId())) { memberCommandSpecificCooldown.put(member.getGuild().getId(), new HashMap<>()); } if (!memberCommandSpecificCooldown.get(member.getGuild().getId()).containsKey(member.getId())) { memberCommandSpecificCooldown.get(member.getGuild().getId()).put(member.getId(), new HashMap<>()); } memberCommandSpecificCooldown.get(member.getGuild().getId()).get(member.getId()).put(command, System.currentTimeMillis() + command.cooldown() * 1000); } else { if (!memberCoolDowns.containsKey(member.getGuild().getId())) { memberCoolDowns.put(member.getGuild().getId(), new HashMap<>()); } memberCoolDowns.get(member.getGuild().getId()).put(member.getId(), System.currentTimeMillis() + command.cooldown() * 1000); } } }
[ "toni_kukoc@gmx.de" ]
toni_kukoc@gmx.de
6e74be77676aa67a0a415d86b7e8d55ff90a6f7a
105b2699ecf25279ccd5e03b9466b46667e2bce5
/JavaSe_Code/Multithreading/src/Box/Box.java
79b679a89d678a1185a301a3d81eb6405a365be3
[]
no_license
LiangLiang723/Java_Exercise
b866f26bc784f27e08be4a2ca6f732029e490ff5
454bd6950e0af0b3a39af0efc32a5c14524a9a26
refs/heads/master
2021-05-18T07:57:14.923090
2020-08-12T05:09:26
2020-08-12T05:09:26
251,188,235
0
0
null
null
null
null
UTF-8
Java
false
false
1,227
java
package Box; public class Box { private int milk; //定义一个成员变量表示奶箱的状态 private boolean state = false; //提供牛奶储存操作 public synchronized void put(int milk) { //如果有牛奶,等待消费 if (state){ try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } //如果没有牛奶,就生产牛奶 this.milk = milk; System.out.println("送奶工将第" + this.milk + "瓶牛奶放进奶箱"); //生产完毕之后,修改奶箱状态 state = true; //唤醒其他等待线程 notifyAll(); } //获取牛奶的操作 public synchronized void get() { //如果没有牛奶,等待生产 if(!state){ try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } //如果有牛奶,就消费牛奶 System.out.println("用户拿到第" + this.milk + "瓶牛奶"); //消费完毕之后,修改奶箱状态 state = false; notifyAll(); } }
[ "690428592@qq.com" ]
690428592@qq.com
edba6ccec6ebb686a1af640f772483e628fdecfe
238d8540569ffbbeae34af306bfdd50cbcfb3152
/NN.java
54c2792b4be3428e7c79d3719a3b68e0f8b2e412
[]
no_license
CelestialSkies95/BiologicallyInspiredComputation
57e492d29f71c7cd598657e14e5693c20c39eec7
68f78a65e938ddf0e92675a846abefbe61123610
refs/heads/master
2021-06-09T23:56:32.708373
2016-11-14T13:29:14
2016-11-14T13:29:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,336
java
package NeuralNetwork; import java.text.NumberFormat; //By Deaven Howarth and Kimberley Stewart public class NN { /* private static int PopulationSize=10; private static int MaxGenerations=20; private static int MAX_POPULATION = 1; private static int MAX_VARIABLES = 6; private static int[][] CurrentPopulation; private static int[][] CurrentX; private static int[][] CurrentY; private static double[] fitness; private static int bestSolution; private static double bestFitness; private static Random random = new Random(); public static void main(String[] args) { int generation; CurrentPopulation = new int[MAX_POPULATION][MAX_VARIABLES]; CurrentX = new int[MAX_POPULATION][MAX_VARIABLES]; CurrentY = new int[MAX_POPULATION][MAX_VARIABLES]; initialiseThePopulation(); } private static int getRandomNumberBetween(int min, int max) { return random.nextInt(max - min) + min; } public static int getRandomNumberFrom(int min, int max) { return getRandomNumberBetween(min, max+1); } private static void initialiseThePopulation(){ int x; int y; bestFitness = 0.0; int solution; //build the chromosome for (int j=0;j<5;j++) { x = getRandomNumberBetween(1,9); y = getRandomNumberBetween(1,9); solution = (x*x)+(y*y); CurrentPopulation[0][j] = solution; CurrentX[0][j] = x; CurrentY[0][j] = y; } for (int j = 0; j < 5; j++) { System.out.print(CurrentPopulation[0][j] + " "); } } */ public static void main(String args[]) { int Input[][] = { {1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9}, {2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9}, {3,1},{3,2},{3,3},{3,4},{3,5},{3,6},{3,7},{3,8},{3,9}, {4,1},{4,2},{4,3},{4,4},{4,5},{4,6},{4,7},{4,8},{4,9}, {5,1},{5,2},{5,3},{5,4},{5,5},{5,6},{5,7},{5,8},{5,9}, {6,1},{6,2},{6,3},{6,4},{6,5},{6,6},{6,7},{6,8},{6,9}, {7,1},{7,2},{7,3},{7,4},{7,5},{7,6},{7,7},{7,8},{7,9}, {8,1},{8,2},{8,3},{8,4},{8,5},{8,6},{8,7},{8,8},{8,9}, {9,1},{9,2},{9,3},{9,4},{9,5},{9,6},{9,7},{9,8},{9,9}, }; int Ideal[][] = { {2} ,{5} ,{10},{17},{26}, {37} ,{50} ,{65} ,{82}, {5} ,{8} ,{13},{20},{29}, {40} ,{53} ,{68} ,{85}, {10},{13},{18},{25},{34}, {45} ,{58} ,{73} ,{90}, {17},{20},{25},{32},{41}, {52} ,{65} ,{80} ,{97}, {26},{29},{34},{41},{50}, {61} ,{74} ,{89} ,{106}, {37},{40},{45},{52},{61}, {72} ,{85} ,{100},{117}, {50},{53},{58},{65},{74}, {85} ,{98} ,{113},{130}, {65},{68},{73},{80},{89}, {100},{113},{128},{145}, {82},{85},{90},{97},{106},{117},{130},{145},{162}, }; System.out.println("learn:"); Network network = new Network(2,1,1,0.7,0.9); NumberFormat Percent = NumberFormat.getPercentInstance(); Percent.setMinimumFractionDigits(6); for(int i=0;i<10000;i++) { for(int j=0;j<Input.length;j++) { network.computeOutputs(Input[j]); network.calcError(Ideal[j]); network.learn(); } System.out.println( "Trial #" + i + ",Error:" + Percent.format(network.getError(Input.length)) ); } System.out.println("Recall:"); for(int i=0;i<Input.length;i++) { for(int j=0;j<Input[0].length;j++) { System.out.print(Input[i][j] +":" ); } double out[] = network.computeOutputs(Input[i]); System.out.println("="+out[0]); } } }
[ "noreply@github.com" ]
noreply@github.com
01425006ad869d7b4fe0109b18105c23b985769f
51bc1189dbde9c872204a32b693cd4f389b0e1cf
/newdeal-project-55/src/main/java/com/eomcs/lms/filter/CharacterEncodingFilter.java
3ef7cdede395223392c707d047c60d3c49490992
[]
no_license
eomjinyoung/newdeal-20181127
cd4e76c64fa5cf6faa2cb167731c86425b4b73b0
1126ba14efb9a646e6abf2119f75cf948a10b229
refs/heads/master
2020-04-08T11:05:38.742972
2018-12-08T14:56:04
2018-12-08T14:56:04
159,293,142
4
8
null
null
null
null
UTF-8
Java
false
false
1,620
java
package com.eomcs.lms.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; @WebFilter("/*") public class CharacterEncodingFilter implements Filter { @Override public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // POST 요청으로 들어온 데이터는 UTF-8 로 인코딩 되어 있다. // 그런데 request.getParameter()의 리턴 값은 Unicode(2byte)이다. // 즉 UTF-8을 JVM이 다루는 Unicode로 변환한 후에 리턴하는 것이다. // 문제는 클라이언트가 보낸 데이터가 UTF-8 로 되어 있다고 // 알려주지 않으면, // getParameter()는 클라이언트가 보낸 데이터가 ISO-8859-1이라고 // 착각을 한다. 즉 영어라고 착각하고 영어를 Unicode 바꾸는 것이다. // 그래서 UTF-8로 인코딩 된 한글 데이터가 Unicode로 바뀔 때 // 깨지는 것이다. // 해결책? // getParameter()를 "최초로" 호출하기 전에 // 클라이언트가 보낸 데이터가 UTF-8로 되어 있다고 알려줘야 한다. // request.setCharacterEncoding("UTF-8"); // 이 필터 다음에 또 다른 필터가 있다면 그 필터를 실행한다. // 없다면 원래 목적지인 서블릿을 실행한다. chain.doFilter(request, response); } }
[ "jinyoung.eom@gmail.com" ]
jinyoung.eom@gmail.com
79801537ef26a18a0c329d364bcd97e53ba95ee4
082cdbc61256e09cab72f8f2aa3ae87cfb02a571
/Sistema-ERP/java/projeto-ERP/src/test/java/com/example/projetoERP/ProjetoErpApplicationTests.java
fb2376fdac79171e18417fbddb24b1da7ffdad8c
[]
no_license
MayconMaiaDev/Sistema-ERP
97a2cb2e14aa2dc26b7cddb36f140a5012e3781b
6fccb09d32e6c21cfcb6a87ad754f7a4b3f086a5
refs/heads/main
2023-06-10T05:54:16.983468
2021-06-26T19:47:48
2021-06-26T19:47:48
380,562,057
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package com.example.projetoERP; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ProjetoErpApplicationTests { @Test void contextLoads() { } }
[ "noreply@github.com" ]
noreply@github.com
e39a9207b56d5622318e3fecf1b227c459e06793
f24a0b57b9915a3fe4a3ab67ba1b9511a43750ab
/FONTS/SOURCE/Oriol/Pair.java
4425c753af80186ae98bb2a0fa9f73ae7afc686c
[]
no_license
avanger9/PROP
55561a5177fbaa42c9448be7f9885e9250cf9d09
a67c9efc6898325c07639551ea567966aad30400
refs/heads/master
2020-04-01T20:07:41.160158
2019-01-27T16:27:03
2019-01-27T16:27:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
188
java
package Persistencia; public class Pair<T1,T2> { public T1 first; public T2 second; public Pair(){} public Pair(T1 first, T2 second) { this.first=first; this.second=second; } }
[ "ferran.esteban@hotmail.com" ]
ferran.esteban@hotmail.com
8b0f5cb43e1c2fe107b6caf4ca5d09c0b687f01d
bfb1acb08ca5a62b6945b2f0d60f3ff7a5608132
/dartagnan/src/main/java/com/dat3m/dartagnan/solver/caat/predicates/relationGraphs/Edge.java
b73567ebe5ddb041786b05a74bf7641fdde760e7
[ "MIT" ]
permissive
hernanponcedeleon/Dat3M
4c8d6e5daea766e189696a523d64b075498e2f41
027b4024dd3b9894473233bc5f197912a7cf7421
refs/heads/master
2023-08-17T20:37:38.814591
2023-08-08T11:14:02
2023-08-08T11:14:02
107,693,841
58
20
MIT
2023-09-06T17:14:18
2017-10-20T15:20:05
Java
UTF-8
Java
false
false
1,816
java
package com.dat3m.dartagnan.solver.caat.predicates.relationGraphs; import com.dat3m.dartagnan.solver.caat.predicates.AbstractDerivable; public class Edge extends AbstractDerivable implements Comparable<Edge> { protected final int dId1; protected final int dId2; public int getFirst() { return dId1; } public int getSecond() { return dId2; } public Edge(int id1, int id2, int time, int derivLength) { super(time, derivLength); this.dId1 = id1; this.dId2 = id2; } public Edge(int id1, int id2) { this(id1, id2, 0, 0); } @Override public Edge with(int time, int derivationLength) { return new Edge(dId1, dId2, time, derivationLength); } @Override public Edge withTime(int time) { return with(time, derivLength); } @Override public Edge withDerivationLength(int derivationLength) { return with(time, derivationLength); } public boolean isLoop() { return dId1 == dId2; } public Edge inverse() { return new Edge(dId2, dId1, time, derivLength); } @Override public int compareTo(Edge o) { int res = this.dId1 - o.dId1; return res != 0 ? res : this.dId2 - o.dId2; } @Override public int hashCode() { int a = dId1; return a ^ (31 * dId2 + 0x9e3779b9 + (a << 6) + (a >> 2)); // Best hashing function ever :) } @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj == null || getClass() != obj.getClass()) { return false; } return equals((Edge)obj); } public boolean equals(Edge e) { return this.dId1 == e.dId1 && this.dId2 == e.dId2; } @Override public String toString() { return "(" + dId1 + "," + dId2 + ")"; } }
[ "tomy.haas@t-online.de" ]
tomy.haas@t-online.de
679b4f3924040d535bed359dee2fa78e52973a9b
779072200d5849c67458efd88aa072e5d62573f7
/flightreservation/src/main/java/com/shail/flightreservation/dto/ReservationUpdateRequest.java
e29b58a5b611b9319dccace023b608cd369936ac
[]
no_license
shailpanchal/miniProjects_Spring
8b068ff15664bb35e7d85023f08e21f6bbcaf283
995e689acdce57f43ab517ded1b965306ddd28d2
refs/heads/master
2022-05-08T15:22:36.648866
2020-04-16T23:33:08
2020-04-16T23:33:08
253,935,279
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.shail.flightreservation.dto; public class ReservationUpdateRequest { private Long id; private Boolean checkedIn; private int numberOfBags; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Boolean getCheckedIn() { return checkedIn; } public void setCheckedIn(Boolean checkedIn) { this.checkedIn = checkedIn; } public int getNumberOfBags() { return numberOfBags; } public void setNumberOfBags(int numberOfBags) { this.numberOfBags = numberOfBags; } }
[ "Shail.Panchal@ab-oco.com" ]
Shail.Panchal@ab-oco.com
23480a7bad53b697ffd69561403403ebe8cd48d8
be0a99ed0a6dd18354a41837316c00ce304f98a5
/JUnitDemo1/src/test/java/com/vam/training/testing/JUnitDemo1/SuiteTest1.java
fab38e488d0365622d939e68ead199d10abcb5ed
[]
no_license
swapnarani45/coredemo
3985c651b01bc6533e4d390811b72497de5c116f
23e76810ab9965cb17e88b2d2bf72f787afa50e3
refs/heads/master
2023-03-29T15:40:08.188488
2021-03-30T11:50:40
2021-03-30T11:50:40
339,993,119
0
0
null
null
null
null
UTF-8
Java
false
false
997
java
package com.vam.training.testing.JUnitDemo1; import static org.junit.Assert.assertEquals; import org.junit.Test; public class SuiteTest1 { public String message = "Raj"; JUnitMessage junitMessage = new JUnitMessage(message); @Test//(expected = ArithmeticException.class) //junit exception test public void testJUnitMessage() { System.out.println("Junit Message is printing "); junitMessage.printMessage(); } @Test public void testJUnitHiMessage() { message = "Hi " + message; System.out.println("Junit Hi Message is printing "); assertEquals(message, junitMessage.printHiMessage()); System.out.println("Suite Test 1 is successful " + message); }}
[ "swapnaraniv@valuemomentum.biz" ]
swapnaraniv@valuemomentum.biz
6fcdd54e09aae427b4b47e74b27cbfc91f5d5011
620939466a5244e74ce1f2b66371d3b0d71a0659
/app/src/main/java/com/example/dell/bankeldam/Model/Postes_Response.java
e8993ee7fdecbca3f0a69f1bbcd254408f3d7645
[]
no_license
yasmeenmahmoud/BloodBank
73518fc546117ad57771f05fba4eb3ec7097f115
44bfed0def28aaa362defa6589c1ac092211d6f4
refs/heads/master
2020-04-16T22:41:36.439716
2019-01-16T04:45:47
2019-01-16T04:45:47
165,883,187
0
0
null
null
null
null
UTF-8
Java
false
false
2,937
java
package com.example.dell.bankeldam.Model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class Postes_Response { @SerializedName("current_page") @Expose private Integer currentPage; @SerializedName("data") @Expose private List<Posts_Data> data = null; @SerializedName("first_page_url") @Expose private String firstPageUrl; @SerializedName("from") @Expose private Integer from; @SerializedName("last_page") @Expose private Integer lastPage; @SerializedName("last_page_url") @Expose private String lastPageUrl; @SerializedName("next_page_url") @Expose private Object nextPageUrl; @SerializedName("path") @Expose private String path; @SerializedName("per_page") @Expose private Integer perPage; @SerializedName("prev_page_url") @Expose private Object prevPageUrl; @SerializedName("to") @Expose private Integer to; @SerializedName("total") @Expose private Integer total; public Integer getCurrentPage() { return currentPage; } public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; } public List<Posts_Data> getData() { return data; } public void setData(List<Posts_Data> data) { this.data = data; } public String getFirstPageUrl() { return firstPageUrl; } public void setFirstPageUrl(String firstPageUrl) { this.firstPageUrl = firstPageUrl; } public Integer getFrom() { return from; } public void setFrom(Integer from) { this.from = from; } public Integer getLastPage() { return lastPage; } public void setLastPage(Integer lastPage) { this.lastPage = lastPage; } public String getLastPageUrl() { return lastPageUrl; } public void setLastPageUrl(String lastPageUrl) { this.lastPageUrl = lastPageUrl; } public Object getNextPageUrl() { return nextPageUrl; } public void setNextPageUrl(Object nextPageUrl) { this.nextPageUrl = nextPageUrl; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public Integer getPerPage() { return perPage; } public void setPerPage(Integer perPage) { this.perPage = perPage; } public Object getPrevPageUrl() { return prevPageUrl; } public void setPrevPageUrl(Object prevPageUrl) { this.prevPageUrl = prevPageUrl; } public Integer getTo() { return to; } public void setTo(Integer to) { this.to = to; } public Integer getTotal() { return total; } public void setTotal(Integer total) { this.total = total; } }
[ "yasmeenmahmoud" ]
yasmeenmahmoud
a200c081733be97a0ec951f15f2de33c3dc1f2f4
1061294152ee4461946c0eb6f1c7618929d50673
/app/src/main/java/com/android/carview/FavoritesFragment/FavoriteCarAdapter.java
8153e31cd3e5c54d190ce9cc50f51130f0f516b1
[]
no_license
shehabosama/showRoomMobileApp
45bef2e859d5dea0b2af3c0d5a76029a088beffc
766d321d39595e50c07dc014090ae8f2580b89e4
refs/heads/master
2022-04-12T11:12:49.174080
2020-04-07T15:46:41
2020-04-07T15:46:41
249,908,029
0
0
null
null
null
null
UTF-8
Java
false
false
8,090
java
package com.android.carview.FavoritesFragment; import android.content.Context; import android.graphics.Paint; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.ViewPager; import com.android.carview.R; import com.android.carview.common.model.Car; import com.android.carview.common.model.MyFavorite; import com.ms.square.android.expandabletextview.ExpandableTextView; import java.util.List; public class FavoriteCarAdapter extends RecyclerView.Adapter<FavoriteCarAdapter.ServiceHoder> { private List<MyFavorite> carList; private Context context; private ImageView[] dots; private AdapterCarInterAction adapterCarInterAction; private boolean toggleCheck=false; public FavoriteCarAdapter(List<MyFavorite> carList, Context context, AdapterCarInterAction adapterCarInterAction) { this.carList = carList; this.context = context; this.adapterCarInterAction = adapterCarInterAction; } @NonNull @Override public FavoriteCarAdapter.ServiceHoder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { LayoutInflater layoutInflater = LayoutInflater.from(context); View view = layoutInflater.inflate(R.layout.custome_new_car_itme,viewGroup,false); return new FavoriteCarAdapter.ServiceHoder(view); } @Override public void onBindViewHolder(@NonNull final FavoriteCarAdapter.ServiceHoder holder, int position) { final MyFavorite car = carList.get(position); // Picasso.with(context) // .load("https://shehabosama.000webhostapp.com/uploads/"+car.getCars().get(0).getCarImage()) // .placeholder(R.drawable.ic_launcher_foreground) // .into(holder.imageView); if (carList.isEmpty()){ adapterCarInterAction.onRefrishing(); } holder.name.setText(car.getCarName()); holder.expandableTextView.setText(car.getCarDescription()); //ImageAdapter imageAdapter = new ImageAdapter(car.getCars(),context); ImagePagerAdapter imageAdapter = new ImagePagerAdapter(context,car.getCars()); holder.viewPager.setAdapter(imageAdapter); //holder.addDots(car.getCars().size()); holder.viewPager.addOnPageChangeListener(null); holder.setListener(car); if(Double.parseDouble(car.getSell_price())==0.0){ holder.price.setText(car.getPrice()); holder.sell_price.setText(""); }else{ holder.price.setText(car.getPrice()); holder.price.setPaintFlags( holder.price.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); holder.sell_price.setText(car.getSell_price()); } holder.drawPageSelectionIndicators(0,car.getCars().size()); holder.imageView.setImageResource(R.drawable.ic_favorite_black_24dp); if(car.getCarCategory().equals("2")){ holder.btn_usage.setText("New"); }else{ holder.btn_usage.setText("Used"); } } @Override public int getItemCount() { return carList.size(); } interface AdapterCarInterAction{ void onRefrishing(); void onClickUnFavorite(MyFavorite car); void onClickItem(MyFavorite car); } public class ServiceHoder extends RecyclerView.ViewHolder { ViewPager viewPager; TextView name, descroption,price,sell_price;; LinearLayout linearLayout; ImageView imageView; Button btn_usage; ExpandableTextView expandableTextView; public ServiceHoder(@NonNull View itemView) { super(itemView); viewPager = itemView.findViewById(R.id.view_pager); name = itemView.findViewById(R.id.name); descroption = itemView.findViewById(R.id.description); linearLayout = itemView.findViewById(R.id.linear); imageView = itemView.findViewById(R.id.toggle_favorite); btn_usage = itemView.findViewById(R.id.usage_image); expandableTextView = itemView.findViewById(R.id.expand_text_view); price = itemView.findViewById(R.id.price); sell_price = itemView.findViewById(R.id.sell_price); } public void setListener(final MyFavorite car){ itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { adapterCarInterAction.onClickItem(car); } }); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(toggleCheck){ imageView.setImageResource(R.drawable.ic_favorite_black_24dp); toggleCheck = false; }else{ adapterCarInterAction.onClickUnFavorite(car); imageView.setImageResource(R.drawable.ic_favorite_border_black_24dp); toggleCheck=true; } } }); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { drawPageSelectionIndicators(position,car.getCars().size()); } @Override public void onPageScrollStateChanged(int state) { } }); } // public void selectDot(int idx, int NUM_PAGES) { // Resources res = context.getResources(); // for (int i = 0; i < NUM_PAGES; i++) { // int drawableId = (i == idx) ? (R.drawable.dots) : (R.drawable.dots_default); // Drawable drawable = res.getDrawable(drawableId); // dots.get(i).setImageDrawable(drawable); // } // } // public void addDots(int NUM_PAGES) { // dots = new ArrayList<>(); // for (int i = 0; i < NUM_PAGES; i++) { // ImageView dot = new ImageView(context); // dot.setPadding(2,2,2,2); // dot.setImageDrawable(context.getResources().getDrawable(R.drawable.dots_default)); // //// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( //// LinearLayout.LayoutParams.WRAP_CONTENT, //// LinearLayout.LayoutParams.WRAP_CONTENT //// ); // linearLayout.addView(dot); // // dots.add(dot); // } // // } private void drawPageSelectionIndicators(int mPosition,int dotsCount){ if(linearLayout!=null) { linearLayout.removeAllViews(); } // linearLayout=(LinearLayout)findViewById(R.id.viewPagerCountDots); dots = new ImageView[dotsCount]; for (int i = 0; i < dotsCount; i++) { dots[i] = new ImageView(context); if(i==mPosition) dots[i].setImageDrawable(context.getResources().getDrawable(R.drawable.dots)); else dots[i].setImageDrawable(context.getResources().getDrawable(R.drawable.dots_default)); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ); params.setMargins(4, 0, 4, 0); linearLayout.addView(dots[i], params); } } } }
[ "shehabosama0122421@gmail.com" ]
shehabosama0122421@gmail.com
19cbbfa833038fed09f95e65ad82ee76b1e5752f
3ed0acddbe6d55cf17fc609810827c87f89cc527
/4-annotationbased-configuration/src/main/java/ru/itsjava/service/CoffeeHouseImpl.java
e658e61005524dfd81a1069eee3f79dd01bbc5ca
[]
no_license
NatlieIva/spring-foundation
51d3a405d9a242b92b8948b6baab019c08bddc53
e8901f00e319f959d76496dd077312cbf8265ce7
refs/heads/master
2023-03-15T00:24:24.990756
2021-03-02T11:09:51
2021-03-02T11:09:51
342,263,348
0
0
null
2021-03-04T11:30:14
2021-02-25T14:03:16
Java
UTF-8
Java
false
false
772
java
package ru.itsjava.service; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import java.util.Scanner; @AllArgsConstructor @Service public class CoffeeHouseImpl implements CoffeeHouse { private final CoffeeService coffeeService; @Override public void coffeeSale() { System.out.println("Hello! What price do you want coffee?"); System.out.println("Americano - 100.0" + '\n' + "Latte - 200.0" + '\n' + "Cappuccino - 150.0" + '\n' + "Espresso - 50.0"); Scanner console = new Scanner(System.in); double order = console.nextDouble(); System.out.println( coffeeService.getCoffeeByPrice(order).getName() + " for you"); } }
[ "natalie_iva@icloud.com" ]
natalie_iva@icloud.com
5b04a762d71745e942837b9b162941855fc9af2b
d4479b557782c521d88e2618076db1ce66fa4843
/app/src/main/java/com/hisense/storemode/utils/PropertyUtils.java
bf7a22c13a57092d276a0cc29ab618fe4bfb2cd0
[]
no_license
davidtps/DemoT
3a74cb308eb81033283d38d59843caa1c39c9ca6
0920fb3f3bd86c747951c823edc04b9c94f8ee31
refs/heads/master
2022-12-07T20:33:06.882452
2020-09-02T11:35:36
2020-09-02T11:35:36
290,993,596
0
0
null
null
null
null
UTF-8
Java
false
false
4,759
java
package com.hisense.storemode.utils; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** * Created by jason on 6/7/16. */ public class PropertyUtils { /** * Get the value for the given key. * * @return an empty string if the key isn't found * @throws IllegalArgumentException if the key exceeds 32 characters */ public static String get(String key) { init(); String value = null; try { value = (String) mGetMethod.invoke(mClazz, key); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return value; } /** * Get the value for the given key. * * @return if the key isn't found, return def if it isn't null, or an empty string otherwise * @throws IllegalArgumentException if the key exceeds 32 characters */ public static String get(String key, String def) { init(); String value = def; try { value = (String) mGetDefMethod.invoke(mClazz, key, def); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return value; } /** * Get the value for the given key, and return as an integer. * * @param key the key to lookup * @param def a default value to return * @return the key parsed as an integer, or def if the key isn't found or * cannot be parsed * @throws IllegalArgumentException if the key exceeds 32 characters */ public static int getInt(String key, int def) { init(); int value = def; try { Integer v = (Integer) mGetIntMethod.invoke(mClazz, key, def); value = v.intValue(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return value; } /** * Get the value for the given key, returned as a boolean. * Values 'n', 'no', '0', 'false' or 'off' are considered false. * Values 'y', 'yes', '1', 'true' or 'on' are considered true. * (case sensitive). * If the key does not exist, or has any other value, then the default * result is returned. * * @param key the key to lookup * @param def a default value to return * @return the key parsed as a boolean, or def if the key isn't found or is * not able to be parsed as a boolean. * @throws IllegalArgumentException if the key exceeds 32 characters */ public static boolean getBoolean(String key, boolean def) { init(); boolean value = def; try { Boolean v = (Boolean) mGetBooleanMethod.invoke(mClazz, key, def); value = v.booleanValue(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return value; } /** * Set the value for the given key. * * @throws IllegalArgumentException if the key exceeds 32 characters * @throws IllegalArgumentException if the value exceeds 92 characters */ public static void set(String key, String val) { init(); try { mSetMethod.invoke(mClazz, key, val); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } //------------------------------------------------------------------- private static Class<?> mClazz = null; private static Method mGetMethod = null; private static Method mGetIntMethod = null; private static Method mGetDefMethod = null; private static Method mGetBooleanMethod = null; private static Method mSetMethod = null; private static void init() { try { if (mClazz == null) { mClazz = Class.forName("android.os.SystemProperties"); mGetMethod = mClazz.getDeclaredMethod("get", String.class); mGetDefMethod = mClazz.getDeclaredMethod("get", String.class, String.class); mGetIntMethod = mClazz.getDeclaredMethod("getInt", String.class, int.class); mGetBooleanMethod = mClazz.getDeclaredMethod("getBoolean", String.class, boolean.class); mSetMethod = mClazz.getDeclaredMethod("set", String.class, String.class); } } catch (Exception e) { e.printStackTrace(); } } }
[ "davidtps@126.com" ]
davidtps@126.com
809b635f448a839ae2d353b2d375b881cb41ca41
ebc25a8640d5286286d522e34ae30750ff7faed3
/AndroidStudioProjects/Project_Sunshine_Github/app/src/main/java/com/kkm/project_sunshine_github/utilities/NetworkUtils.java
e811a0b9d775217b8c957fcbab0af5c2aa2eea0f
[]
no_license
rlarla245/Portfolio
fd8188d48ca26809fae67f80cf70df78c2946dac
b8af0313c8a041bf5e40bb7d0a8a18c8725ab808
refs/heads/master
2020-06-17T18:11:27.096322
2019-07-09T12:26:31
2019-07-09T12:26:31
196,003,420
2
0
null
null
null
null
UTF-8
Java
false
false
2,337
java
package com.kkm.project_sunshine_github.utilities; import android.net.Uri; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.Scanner; /** * These utilities will be used to communicate with the network. */ public class NetworkUtils { final static String GITHUB_BASE_URL = "https://api.github.com/search/repositories"; final static String PARAM_QUERY = "q"; /* * The sort field. One of stars, forks, or updated. * Default: results are sorted by best match if no field is specified. */ final static String PARAM_SORT = "sort"; final static String sortBy = "stars"; /** * Builds the URL used to query Github. * * @param githubSearchQuery The keyword that will be queried for. * @return The URL to use to query the weather server. */ public static URL buildUrl(String githubSearchQuery) { // TODO (1) Fill in this method to build the proper Github query URL Uri builtUri = Uri.parse(GITHUB_BASE_URL).buildUpon() .appendQueryParameter(PARAM_QUERY, githubSearchQuery) .appendQueryParameter(PARAM_SORT, sortBy) .build(); URL url = null; try { url = new URL(builtUri.toString()); } catch (MalformedURLException e) { e.printStackTrace(); } return url; } /** * This method returns the entire result from the HTTP response. * * @param url The URL to fetch the HTTP response from. * @return The contents of the HTTP response. * @throws IOException Related to network and stream reading */ public static String getResponseFromHttpUrl(URL url) throws IOException { HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = urlConnection.getInputStream(); Scanner scanner = new Scanner(in); scanner.useDelimiter("\\A"); boolean hasInput = scanner.hasNext(); if (hasInput) { return scanner.next(); } else { return null; } } finally { urlConnection.disconnect(); } } }
[ "rlarla245@naver.com" ]
rlarla245@naver.com
db022c70a5d482b7d9a1d234a451d14a87ee5969
ea2a4a49066e58bed7dcc32957d34ba01976f989
/Prog1/Date.java
da8dd50ca2e013f77fbe9e490fd1880d1aa802f3
[]
no_license
Krushn786/SoftWare_Methd_2020Spring
057d0d8671ac1d12b0e469ad199536375b28deba
4e31894c63b3f36561f79f845f2d604532e1abb1
refs/heads/master
2022-07-13T00:40:54.096587
2020-05-23T02:50:19
2020-05-23T02:50:19
262,884,810
0
0
null
null
null
null
UTF-8
Java
false
false
6,240
java
import java.util.StringTokenizer; /** * Contains methods for constructing a date and checking if the date is valid. * Contains methods for accessing the day, month, and year individually, * a toString method for converting the object into a string, * and an equals method to check equivalency. * @author Jake Ippolito, Krushn Gor */ public class Date { private int day; private int month; private int year; private static String DELIM = "/"; /** * Constructs a date object containing the month, day, and year given a string. * @param d, string with the format "mm/dd/yyyy" */ public Date(String d) { //use StringTokenizer to parse the String and create a Date object StringTokenizer st = new StringTokenizer(d, DELIM); month = Integer.parseInt(st.nextToken()); day = Integer.parseInt(st.nextToken()); year = Integer.parseInt(st.nextToken()); } /** * Constructs a date object containing the month, day, and year given a Date object. * @param d, Date object */ public Date(Date d) { this.year = d.getYear(); this.month = d.getMonth(); this.day = d.getDay(); } /** * Accessor method for the day. * @return An integer for the day */ public int getDay() { return day; } /** * Accessor method for the month. * @return An integer for the month */ public int getMonth() { return month; } /** * Accessor method for the year. * @return An integer for the year */ public int getYear() { return year; } /** * Checks if the date is valid. * A date is valid if it has the correct number of days in the month for the corresponding year. * @return true if the date is valid, false otherwise. */ public boolean isValid() { if(this.day < 1) { return false; } boolean isLeapYear = false; //Check to see if the year is a quadrennial if(year % Month.QUADRENNIAL == 0) { isLeapYear = true; //Check to see if the year is a centennial if(year % Month.CENTENNIAL == 0) { //Check to see if the year is a quatercentennial if(year % Month.QUATERCENTENNIAL != 0) { isLeapYear = false; } } } //Check each month with their corresponding amount of days switch (month) { case Month.JAN: case Month.MAR: case Month.MAY: case Month.JUL: case Month.AUG: case Month.OCT: case Month.DEC: if(day > Month.DAYS_ODD) { return false; } break; case Month.FEB: //Check if the month is February and check the corresponding amount of days. //If the year is a leap year, add 1 otherwise add 0. if(day > (Month.DAYS_FEB + (isLeapYear ? 1 : 0))) { return false; } break; case Month.APR: case Month.JUN: case Month.SEP: case Month.NOV: if(day > Month.DAYS_EVEN) { return false; } break; default: return false; } return true; } /** * Returns the date in the form of a string. * @return the date in "mm/dd/yyyy" format */ @Override public String toString() { return month + "/" + day + "/" + year; } /** * Checks if an object is equivalent. * An object is equivalent if the object is a date and has the same month, day, and year. * @param obj, object to be compared * @return Returns true if the object is equivalent, false otherwise. */ @Override public boolean equals(Object obj) { // Date x = new Date(); //Date y = new Date(); //xx/yy/zzzz //mm/dd/yyyy if(obj instanceof Date) { Date that = (Date) obj; if (this.day == that.day) if (this.month == that.month) return this.year == that.year; } return false; } /** * Testbed.main used for independent testing of cases on the Date class. * @param args, main arguments, additional arguments unused */ public static void main(String [] args) { Date test1 = new Date("11/30/1998"); Date test2 = new Date("2/29/2016"); Date test3 = new Date("2/29/2015"); Date test4 = new Date("2/29/2000"); Date test5 = new Date("12/31/2020"); Date test6 = new Date("9/31/2019"); Date test7 = new Date("2/29/1600"); Date test8 = new Date("2/30/1600"); Date test9 = new Date("2/29/1700"); Date test10 = new Date(test9); System.out.println("Validity Checks: (Date.isValid())"); System.out.println(test1); System.out.println(test1.isValid()); System.out.println(test2); System.out.println(test2.isValid()); System.out.println(test3); System.out.println(test3.isValid()); System.out.println(test4); System.out.println(test4.isValid()); System.out.println(test5); System.out.println(test5.isValid()); System.out.println(test6); System.out.println(test6.isValid()); System.out.println(test7); System.out.println(test7.isValid()); System.out.println(test8); System.out.println(test8.isValid()); System.out.println(test9); System.out.println(test9.isValid()); System.out.println(); System.out.println("Equivalency Checks: (Date.equal())"); System.out.println("Does Date: 2/29/1700 = 2/29/1700?"); System.out.println(test10.equals(test9)); System.out.println("Does Date: 2/29/1700 = 2/30/1600?"); System.out.println(test10.equals(test8)); String str = new String(); System.out.println("Does Date: 2/29/1700 = (String object)?"); System.out.println(test10.equals(str)); } }
[ "60994136+Krushn786@users.noreply.github.com" ]
60994136+Krushn786@users.noreply.github.com
cb48c01c715e9e2ce23c3a4cb3375a7f4884607c
ad49261fb08f0d9c4bffbb37d15c071d228805c6
/src/test/java/org/sid/democlientrest/DemoClientrestApplicationTests.java
bea7a30f4d645e305c5ac48de7fa6420008948d3
[]
no_license
Haythamfdl/ClientWSREST
e4502787201f30e77a92e4c9ff003c1484de3479
ad25ffce30e27650c27784f55ae0042305da0731
refs/heads/master
2022-12-17T18:32:23.557106
2020-09-22T18:53:46
2020-09-22T18:53:46
297,743,770
0
0
null
null
null
null
UTF-8
Java
false
false
231
java
package org.sid.democlientrest; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class DemoClientrestApplicationTests { @Test void contextLoads() { } }
[ "fdlhaytham@gmail.com" ]
fdlhaytham@gmail.com
c20994b115f42e360f8e888577c55cf6d62c5432
9f38c66cd0b9a5dc252e6af9a3adc804915ff0e9
/java/src/designpatterns/behavioral/visitors/visitors/SingleDispatchandDoubleDispatch/Main.java
009c23046f19deb071f394fd582399da7193f968
[ "MIT" ]
permissive
vuquangtin/designpattern
4d4a7d09780a0ebde6b12f8edf589b6f45b38f62
fc672493ef31647bd02c4122ab01992fca14675f
refs/heads/master
2022-09-12T07:00:42.637733
2020-09-29T04:20:50
2020-09-29T04:20:50
225,505,298
0
0
null
2022-09-01T23:16:34
2019-12-03T01:41:33
Java
UTF-8
Java
false
false
699
java
package visitors.SingleDispatchandDoubleDispatch; /** * <h1>Visitor</h1>Diễn tả 1 hoạt động (thao tác, thuật toán) được thực hiện * trên các phần tử của 1 cấu trúc đối tượng. Visitor cho phép bạn định nghĩa 1 * phép toán mới mà không thay đổi các lớp của các phần tử mà nó thao tác * * @author EMAIL:vuquangtin@gmail.com , tel:0377443333 * @version 1.0.0 * @see <a * href="https://github.com/vuquangtin/designpattern">https://github.com/vuquangtin/designpattern</a> * */ public class Main { public static void main(final String[] args) { Lady lady = new AmericanLady(); lady.accept(new SayLoveVisitor()); } }
[ "tinvuquang@admicro.vn" ]
tinvuquang@admicro.vn
ee4cc65aabb8b0593f9b6e6072f46705f1ed0dd6
10eb68165d955a15290735e1428e1b075547f8ca
/Spring_JDBC/src/main/java/com/spring/template/StudentJDBCTemplate.java
2dd0d746bb5123149c5e4a55dc9dc1cc8d0ba840
[]
no_license
dineshbias/SpringFramework
d09848fc0aea3ba40bbef9208559c21013779614
d8eb99224fe9a04f9fa84d16da38937859637b7e
refs/heads/master
2020-03-10T17:16:09.291743
2018-04-14T08:09:36
2018-04-14T08:09:36
129,495,986
0
0
null
null
null
null
UTF-8
Java
false
false
3,418
java
/** * */ package com.spring.template; import java.util.List; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; import com.spring.dao.StudentDAO; import com.spring.mapper.StudentMapper; import com.spring.pojo.Student; /** * @author edinjos * */ public class StudentJDBCTemplate implements StudentDAO { private DataSource datasource; private JdbcTemplate jdbcTemplateObject; /** * */ public StudentJDBCTemplate() { System.out.println(StudentJDBCTemplate.class + " instantiated..... "); } /* * (non-Javadoc) * * @see com.spring.dao.StudentDAO#setDataSource(javax.sql.DataSource) */ @Override public void setDatasource(DataSource ds) { datasource = ds; jdbcTemplateObject = new JdbcTemplate(ds); } /* * (non-Javadoc) * * @see com.spring.dao.StudentDAO#create(java.lang.String, * java.lang.Integer) */ @Override public void create(String name, Integer age) { String sql = "insert into Student (name,age) values (?,?)"; int count = jdbcTemplateObject.update(sql, name, age); System.out.println(StudentJDBCTemplate.class + " Inserted records..... " + count); } /* * (non-Javadoc) * * @see com.spring.dao.StudentDAO#getStudent(java.lang.Integer) */ @Override public Student getStudent(Integer id) { String sql = "select * from Student where id=?"; Student student = jdbcTemplateObject.queryForObject(sql, new Object[] { id }, new StudentMapper()); System.out.println(StudentJDBCTemplate.class + " Fetched record..... " + student); return student; } /* * (non-Javadoc) * * @see com.spring.dao.StudentDAO#listStudents() */ @Override public List<Student> listStudents() { String sql = "Select * from Student"; List<Student> students = jdbcTemplateObject.query(sql, new StudentMapper()); System.out.println(StudentJDBCTemplate.class + " Fetched records..... " + students.size()); return students; } /* * (non-Javadoc) * * @see com.spring.dao.StudentDAO#delete(java.lang.Integer) */ @Override public void delete(Integer id) { String sql = "delete from Student where id=?"; int count = jdbcTemplateObject.update(sql, id); System.out.println(StudentJDBCTemplate.class + " Deleted records..... " + count); return; } /* * (non-Javadoc) * * @see com.spring.dao.StudentDAO#update(java.lang.Integer, * java.lang.Integer) */ @Override public void update(Integer id, Integer age) { String sql = "Update Student set age=? where id=?"; int count = jdbcTemplateObject.update(sql, age, id); System.out.println(StudentJDBCTemplate.class + " Updated records..... " + count); return; } @Override public void createTable() { String sql = "create table Student" + " ( ID INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1,INCREMENT BY 1), " + "NAME VARCHAR(20) default NULL, " + "AGE INT default NULL, " + "PRIMARY KEY (ID) )"; jdbcTemplateObject.execute(sql); System.out.println(StudentJDBCTemplate.class + "Table Created..... " + sql); } @Override public void deleteTable() { String sql = "DROP table Student"; jdbcTemplateObject.execute(sql); System.out.println(StudentJDBCTemplate.class + "Table Dropped..... " + sql); } }
[ "dineshbias@gmail.com" ]
dineshbias@gmail.com
73b64ddbebefde5cd5be45a792796aedb3d257ff
d77561e1a6dc082130e870b2940de017eb1f311e
/extension-dubbo-common/src/main/java/com/sxzhongf/extension/dubbo/config/ProtocolConfig.java
909979175fe2ed62e547681471d4190ead4d54a1
[]
no_license
Isaac-Zhang/extension-dubbo
9c6167d9a4c8df9103d9e0980587adba10537105
22c67c3a3160bb47579ffad4162ca5129104601d
refs/heads/master
2022-12-22T07:55:38.800009
2020-03-09T09:57:08
2020-03-09T09:57:08
245,061,458
0
0
null
2022-12-14T20:36:13
2020-03-05T03:38:55
Java
UTF-8
Java
false
false
9,876
java
package com.sxzhongf.extension.dubbo.config; import com.sxzhongf.extension.dubbo.common.utils.StringUtils; import com.sxzhongf.extension.dubbo.config.support.Parameter; import java.util.Map; import static com.sxzhongf.extension.dubbo.common.constants.CommonConstants.DUBBO_VERSION_KEY; import static com.sxzhongf.extension.dubbo.common.constants.CommonConstants.SSL_ENABLED_KEY; import static com.sxzhongf.extension.dubbo.config.Constants.PROTOCOLS_SUFFIX; /** * ProtocolConfig * * @author <a href="mailto:magicianisaac@gmail.com">Isaac.Zhang | 若初</a> * @since 2020/3/9 **/ public class ProtocolConfig extends AbstractConfig { private static final long serialVersionUID = 6913423882496634749L; /** * Protocol name */ private String name; /** * Service ip address (when there are multiple network cards available) */ private String host; /** * Service port */ private Integer port; /** * Context path */ private String contextpath; /** * Thread pool */ private String threadpool; /** * Thread pool core thread size */ private Integer corethreads; /** * Thread pool size (fixed size) */ private Integer threads; /** * IO thread pool size (fixed size) */ private Integer iothreads; /** * Thread pool's queue length */ private Integer queues; /** * Max acceptable connections */ private Integer accepts; /** * Protocol codec */ private String codec; /** * Serialization */ private String serialization; /** * Charset */ private String charset; /** * Payload max length */ private Integer payload; /** * Buffer size */ private Integer buffer; /** * Heartbeat interval */ private Integer heartbeat; /** * Access log */ private String accesslog; /** * Transfort */ private String transporter; /** * How information is exchanged */ private String exchanger; /** * Thread dispatch mode */ private String dispatcher; /** * Networker */ private String networker; /** * Sever impl */ private String server; /** * Client impl */ private String client; /** * Supported telnet commands, separated with comma. */ private String telnet; /** * Command line prompt */ private String prompt; /** * Status check */ private String status; /** * Whether to register */ private Boolean register; /** * whether it is a persistent connection */ //TODO add this to provider config private Boolean keepAlive; // TODO add this to provider config private String optimizer; /** * The extension */ private String extension; /** * The customized parameters */ private Map<String, String> parameters; /** * If it's default */ private Boolean isDefault; private Boolean sslEnabled; public ProtocolConfig() { } public ProtocolConfig(String name) { setName(name); } public ProtocolConfig(String name, int port) { setName(name); setPort(port); } @Parameter(excluded = true) public String getName() { return name; } public final void setName(String name) { this.name = name; this.updateIdIfAbsent(name); } @Parameter(excluded = true) public String getHost() { return host; } public void setHost(String host) { this.host = host; } @Parameter(excluded = true) public Integer getPort() { return port; } public final void setPort(Integer port) { this.port = port; } @Deprecated @Parameter(excluded = true) public String getPath() { return getContextpath(); } @Deprecated public void setPath(String path) { setContextpath(path); } @Parameter(excluded = true) public String getContextpath() { return contextpath; } public void setContextpath(String contextpath) { this.contextpath = contextpath; } public String getThreadpool() { return threadpool; } public void setThreadpool(String threadpool) { this.threadpool = threadpool; } public Integer getCorethreads() { return corethreads; } public void setCorethreads(Integer corethreads) { this.corethreads = corethreads; } public Integer getThreads() { return threads; } public void setThreads(Integer threads) { this.threads = threads; } public Integer getIothreads() { return iothreads; } public void setIothreads(Integer iothreads) { this.iothreads = iothreads; } public Integer getQueues() { return queues; } public void setQueues(Integer queues) { this.queues = queues; } public Integer getAccepts() { return accepts; } public void setAccepts(Integer accepts) { this.accepts = accepts; } public String getCodec() { return codec; } public void setCodec(String codec) { this.codec = codec; } public String getSerialization() { return serialization; } public void setSerialization(String serialization) { this.serialization = serialization; } public String getCharset() { return charset; } public void setCharset(String charset) { this.charset = charset; } public Integer getPayload() { return payload; } public void setPayload(Integer payload) { this.payload = payload; } public Integer getBuffer() { return buffer; } public void setBuffer(Integer buffer) { this.buffer = buffer; } public Integer getHeartbeat() { return heartbeat; } public void setHeartbeat(Integer heartbeat) { this.heartbeat = heartbeat; } public String getServer() { return server; } public void setServer(String server) { this.server = server; } public String getClient() { return client; } public void setClient(String client) { this.client = client; } public String getAccesslog() { return accesslog; } public void setAccesslog(String accesslog) { this.accesslog = accesslog; } public String getTelnet() { return telnet; } public void setTelnet(String telnet) { this.telnet = telnet; } @Parameter(escaped = true) public String getPrompt() { return prompt; } public void setPrompt(String prompt) { this.prompt = prompt; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Boolean isRegister() { return register; } public void setRegister(Boolean register) { this.register = register; } public String getTransporter() { return transporter; } public void setTransporter(String transporter) { this.transporter = transporter; } public String getExchanger() { return exchanger; } public void setExchanger(String exchanger) { this.exchanger = exchanger; } /** * typo, switch to use {@link #getDispatcher()} * * @deprecated {@link #getDispatcher()} */ @Deprecated @Parameter(excluded = true) public String getDispather() { return getDispatcher(); } /** * typo, switch to use {@link #getDispatcher()} * * @deprecated {@link #setDispatcher(String)} */ @Deprecated public void setDispather(String dispather) { setDispatcher(dispather); } public String getDispatcher() { return dispatcher; } public void setDispatcher(String dispatcher) { this.dispatcher = dispatcher; } public String getNetworker() { return networker; } public void setNetworker(String networker) { this.networker = networker; } public Map<String, String> getParameters() { return parameters; } public void setParameters(Map<String, String> parameters) { this.parameters = parameters; } public Boolean isDefault() { return isDefault; } public void setDefault(Boolean isDefault) { this.isDefault = isDefault; } @Parameter(key = SSL_ENABLED_KEY) public Boolean getSslEnabled() { return sslEnabled; } public void setSslEnabled(Boolean sslEnabled) { this.sslEnabled = sslEnabled; } public Boolean getKeepAlive() { return keepAlive; } public void setKeepAlive(Boolean keepAlive) { this.keepAlive = keepAlive; } public String getOptimizer() { return optimizer; } public void setOptimizer(String optimizer) { this.optimizer = optimizer; } public String getExtension() { return extension; } public void setExtension(String extension) { this.extension = extension; } @Override public void refresh() { if (StringUtils.isEmpty(this.getName())) { this.setName(DUBBO_VERSION_KEY); } super.refresh(); if (StringUtils.isNotEmpty(this.getId())) { this.setPrefix(PROTOCOLS_SUFFIX); super.refresh(); } } @Override @Parameter(excluded = true) public boolean isValid() { return StringUtils.isNotEmpty(name); } }
[ "zhangpan0614@126.com" ]
zhangpan0614@126.com
4d224a795900c432584ea691f54750d88be9f438
767945b2abdab935e77f9c3d811a78630bc1e07c
/Jumper/app/src/test/java/casadocodigo/com/br/ExampleUnitTest.java
e1543569ea308610409f176a29558f8250086ab9
[]
no_license
FlavioJr1998/Projetos-Basicos
f94661c6a6766068e85fa15e8ef9c6f9fd81c648
43d31ee633f8f0371bc77c2f4b746af697461fe5
refs/heads/master
2021-02-14T05:12:22.503628
2020-03-04T17:26:40
2020-03-04T17:26:40
244,773,107
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package casadocodigo.com.br; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "mocochiflavio@gmail.com" ]
mocochiflavio@gmail.com
da9d734e2a6549403a028aaa91972a613a4f147d
0489c0f0b33922a90ddaf6f3e2fce7e1e364d821
/src/main/java/it/kasoale/utils/StatementsProperties.java
8d6e9751950dd07690841b920c24dffd6843f1c5
[]
no_license
aCasini/FFCore
5069b752cd2026223d070ba25de396f5483aafcd
e2cfef6020de9be41407c8f30b88b3e6ca8f023c
refs/heads/master
2020-12-24T09:55:41.613188
2016-12-02T14:50:33
2016-12-02T14:50:33
73,258,402
0
0
null
null
null
null
UTF-8
Java
false
false
1,049
java
package it.kasoale.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /** * Created by kasoale on 30/10/2016. */ public class StatementsProperties { private static Properties statements = new Properties(); private static InputStream inputStream = null; private static Logger logger = LoggerFactory.getLogger(StatementsProperties.class); public void init(){ try{ logger.info("Loading the Statements properties"); //inputStream = new FileInputStream("./src/main/resources/statements.properties"); inputStream = this.getClass().getResourceAsStream("/statements.properties"); statements.load(inputStream); logger.info("Properties Loaded"); }catch (IOException e){ logger.error(e.getMessage()); } } public static String getValue(String key){ return statements.getProperty(key); } }
[ "kasoale@delorian.local" ]
kasoale@delorian.local
3a279e7b4206c11c8ad114a3f25014129b1801db
ea75f9296cb2a7cb5a65171a181a7e0982b15519
/src/main/java/com/ykh/tang/agent/message/Ip.java
aa2e7d5d5ad0794bd2de614561b7edbe0f9709cc
[]
no_license
toddpan/yhk_cms
90b194103086d67ad9a4ca4d1279515a25a445bc
b9c82051e810101dd66d8a45ce12282b9eba50e6
refs/heads/master
2021-01-16T17:42:57.915432
2015-09-22T14:35:27
2015-09-22T14:35:27
41,914,213
0
0
null
2015-09-13T12:28:25
2015-09-04T12:20:04
Java
UTF-8
Java
false
false
573
java
package com.ykh.tang.agent.message; /** * 2 from chao.li * * @author xianchao.ji * */ public class Ip { int IP0; int IP1; int IP2; int IP3; public int getIP0() { return IP0; } public void setIP0(int iP0) { IP0 = iP0; } public int getIP1() { return IP1; } public void setIP1(int iP1) { IP1 = iP1; } public int getIP2() { return IP2; } public void setIP2(int iP2) { IP2 = iP2; } public int getIP3() { return IP3; } public void setIP3(int iP3) { IP3 = iP3; } }
[ "ant_shake_tree@163.com" ]
ant_shake_tree@163.com
77cd7137b50e057ff0c495add681616a88b0dfae
7c46a44f1930b7817fb6d26223a78785e1b4d779
/store/src/java/com/zimbra/cs/client/soap/LmcItemActionRequest.java
189e86908c57d0a83db9784b11b31fc38afcd70a
[]
no_license
Zimbra/zm-mailbox
20355a191c7174b1eb74461a6400b0329907fb02
8ef6538e789391813b65d3420097f43fbd2e2bf3
refs/heads/develop
2023-07-20T15:07:30.305312
2023-07-03T06:44:00
2023-07-06T10:09:53
85,609,847
67
128
null
2023-09-14T10:12:10
2017-03-20T18:07:01
Java
UTF-8
Java
false
false
2,688
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2006, 2007, 2009, 2010, 2013, 2014, 2016 Synacor, Inc. * * This program 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, * version 2 of the License. * * This program 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 <https://www.gnu.org/licenses/>. * ***** END LICENSE BLOCK ***** */ package com.zimbra.cs.client.soap; import org.dom4j.Element; import org.dom4j.DocumentHelper; import com.zimbra.common.soap.DomUtil; import com.zimbra.common.service.ServiceException; import com.zimbra.common.soap.MailConstants; public class LmcItemActionRequest extends LmcSoapRequest { protected String mIDList; protected String mOp; protected String mTag; protected String mFolder; /** * Set the list of Msg ID's to operate on * @param idList - a list of the messages to operate on */ public void setMsgList(String idList) { mIDList = idList; } /** * Set the operation * @param op - the operation (delete, read, etc.) */ public void setOp(String op) { mOp = op; } public void setTag(String t) { mTag = t; } public void setFolder(String f) { mFolder = f; } public String getMsgList() { return mIDList; } public String getOp() { return mOp; } public String getTag() { return mTag; } public String getFolder() { return mFolder; } protected Element getRequestXML() { Element request = DocumentHelper.createElement(MailConstants.ITEM_ACTION_REQUEST); Element a = DomUtil.add(request, MailConstants.E_ACTION, ""); DomUtil.addAttr(a, MailConstants.A_ID, mIDList); DomUtil.addAttr(a, MailConstants.A_OPERATION, mOp); DomUtil.addAttr(a, MailConstants.A_TAG, mTag); DomUtil.addAttr(a, MailConstants.A_FOLDER, mFolder); return request; } protected LmcSoapResponse parseResponseXML(Element responseXML) throws ServiceException { LmcMsgActionResponse response = new LmcMsgActionResponse(); Element a = DomUtil.get(responseXML, MailConstants.E_ACTION); response.setMsgList(DomUtil.getAttr(a, MailConstants.A_ID)); response.setOp(DomUtil.getAttr(a, MailConstants.A_OPERATION)); return response; } }
[ "shriram.vishwanathan@synacor.com" ]
shriram.vishwanathan@synacor.com
6902c90a64c20b0e518804fefec1f82e03320b1e
2babce22f5d1ccf27c593d2e25b45f669312e63a
/src/main/java/ma/sqli/tests/itevent/room/Suite.java
67f620ec469cb4ecf6be4d5b52cfb2519f570580
[]
no_license
zelouafi/SQLi-eChallenge-2018-Session-2
e055f2e7608701aaaf93ab7e0b8e0bc2c6ecb3c0
4f983fb17fe03cf4a488b7ce7a3d284bd96634d9
refs/heads/master
2020-04-23T12:40:29.085431
2019-02-17T22:01:30
2019-02-17T22:01:30
171,176,624
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
227
java
package ma.sqli.tests.itevent.room; public class Suite extends Room{ /** * @param number */ public Suite(int number) { super(number); } @Override public String print() { return "Suite N°"+number; } }
[ "zelouafi5@gmail.com" ]
zelouafi5@gmail.com
46e60a4a37fa25f094c5ae4d9beeec1817f27dc2
8d62ddc9358d00100b71cb8706e9ae159979b003
/UCB-Src-Test/basic/SetTest.java
320ba2a2a8ea178305f196c2ce18588f9725382c
[]
no_license
Arup/ProgrammingChallenges
0782ba438878c925a5a744a24f14ab26a2b453d9
6f22934a783c918972aa113ffb529163edf95575
refs/heads/master
2021-01-17T15:06:16.070881
2016-07-29T06:08:53
2016-07-29T06:08:53
7,564,720
0
0
null
null
null
null
UTF-8
Java
false
false
1,592
java
package basic; import basics.Set; import junit.framework.TestCase; public class SetTest extends TestCase { public void testConstructor ( ) { Set s = new Set (2); assertTrue (s.isEmpty()); assertFalse (s.member(0)); assertFalse (s.member(1)); } /* public void testInsert ( ) { Set s = new Set (2); s.insert(0); assertFalse (s.isEmpty()); assertTrue (s.member(0)); assertFalse (s.member(1)); s.insert(0); // should have no effect assertFalse (s.isEmpty()); assertTrue (s.member(0)); assertFalse (s.member(1)); } public void testRemove ( ) { Set s = new Set (2); s.insert(0); s.remove(1); assertFalse (s.isEmpty()); assertTrue (s.member(0)); assertFalse (s.member(1)); s.remove(0); assertTrue (s.isEmpty()); assertFalse (s.member(0)); assertFalse (s.member(1)); s.remove(0); // should have no effect assertTrue (s.isEmpty()); assertFalse (s.member(0)); assertFalse (s.member(1)); } public void testTwoInsertsAndRemoves ( ) { Set s = new Set (2); s.insert(0); s.insert(1); assertFalse (s.isEmpty()); assertTrue (s.member(0)); assertTrue (s.member(1)); s.remove(1); assertFalse (s.isEmpty()); assertTrue (s.member(0)); assertFalse (s.member(1)); s.remove(1); // should have no effect assertFalse (s.isEmpty()); assertTrue (s.member(0)); assertFalse (s.member(1)); s.remove(0); assertTrue (s.isEmpty()); assertFalse (s.member(0)); assertFalse (s.member(1)); s.remove(0); // should have no effect assertTrue (s.isEmpty()); assertFalse (s.member(0)); assertFalse (s.member(1)); } */ }
[ "arupkumarkabi@gmail.com" ]
arupkumarkabi@gmail.com
eec55e8b4cb680a66e38e49e265cb1bbc6bc2fc5
55efca380843dff27a934006da4d18aa614a6fb0
/Flier/src/test/java/CurrentStateDisplayTest.java
90936f1bb534a7e41f42c96243416dd8cca15e23
[]
no_license
lijiyao919/Tello_System
09f6fa41bc13a0e3941866af705cf15ca31e2951
d10b2cc0823246082f948d9a95f4bcb6ede891f3
refs/heads/master
2023-07-11T02:54:44.935866
2019-12-08T08:25:57
2019-12-08T08:25:57
209,924,327
0
0
null
null
null
null
UTF-8
Java
false
false
772
java
import Observer.CurrentStateDisplay; import State.DroneState; import Message.Status; import Message.Message; import org.junit.Test; public class CurrentStateDisplayTest { @Test public void testCurrentStateUpdateAndDisplay(){ DroneState ds =DroneState.getInstance(); ds.setInCommandMode(true); CurrentStateDisplay csd = new CurrentStateDisplay(); String msg="mid:-1;x:0;y:0;z:0;mpry:0,0,0;pitch:0;roll:0;yaw:0;"+ "vgx:0;vgy:0;vgz:0;"+ "templ:0;temph:0;"+ "tof:0;h:0;"+ "bat:100;baro:0;"+ "time:0;"+ "agx:0;agy:%s;agz:0"; Status sta = (Status) Message.decode(msg.getBytes(), 0 , 1000); ds.updateFlyingInfo(sta); } }
[ "jiyao.li@aggiemail.usu.edu" ]
jiyao.li@aggiemail.usu.edu
5b6c15fb615af9baa71cc975214e4aacd497eada
b30d23b236b23dffe689a4bac529de98bfee145e
/Project/app/src/main/java/com/example/zizo/object/ChatBox.java
9355b411fcb0f24090778d3e0ed838d20c42b152
[]
no_license
hoanganhgo/ZiZo
14d47c32f9da4cc7f18ad7afd33ddf1c371060ca
3c7f18fd159ac53cdb6624328f6075e3d6a620f1
refs/heads/master
2022-11-15T04:48:47.724778
2020-07-11T08:24:13
2020-07-11T08:24:13
234,242,972
0
0
null
null
null
null
UTF-8
Java
false
false
1,446
java
package com.example.zizo.object; public class ChatBox { private String avatar; private boolean online; private String nickName; private String message; private boolean isNew; private long timeOfMessage; public ChatBox(String avatar, boolean online, String nickName, String message, boolean isNew, long timeOfMessage) { this.avatar=avatar; this.online=online; this.nickName=nickName; this.message=message; this.isNew = isNew; this.timeOfMessage = timeOfMessage; } public String getAvatar() { return avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } public boolean isOnline() { return online; } public void setOnline(boolean online) { this.online = online; } public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public boolean isNew() { return isNew; } public void setNew(boolean aNew) { isNew = aNew; } public long getTimeOfMessage() { return timeOfMessage; } public void setTimeOfMessage(long timeOfMessage) { this.timeOfMessage = timeOfMessage; } }
[ "57594998+hoanganhgo@users.noreply.github.com" ]
57594998+hoanganhgo@users.noreply.github.com
9b071320ae80adfb7d4fec4d7fa70d64fee600f7
91f78ed6e93d97a5719c59dac1b89a6411533ff7
/java/src/detector/SuccessorsPrivatelyDifferentDetector.java
1d19c4fd07c25c64313840025a0acafa3addc288
[ "MIT" ]
permissive
stolba/privacy-analysis
d433e0919321d83873d7a9f6441c86bce4838c08
c74f2e2308d5ffe4467a87ab9144e460955e6de6
refs/heads/master
2022-11-28T05:08:38.431870
2021-10-25T09:23:52
2021-10-25T09:23:52
175,384,626
1
1
MIT
2022-11-15T23:31:10
2019-03-13T09:07:21
Jupyter Notebook
UTF-8
Java
false
false
791
java
package detector; import java.util.EnumSet; import analysis.EnumAlgorithmAssumptions; import tree.SearchState; public class SuccessorsPrivatelyDifferentDetector implements PrivatelyDifferentStateDetectorInterface { public SuccessorsPrivatelyDifferentDetector(EnumSet<EnumAlgorithmAssumptions> assumptions){ } @Override public boolean privatelyDifferent(SearchState s1, SearchState s2) { if(!s1.allSuccessorsReceived || !s2.allSuccessorsReceived) return false; System.out.println("SuccessorsPrivatelyDifferentDetector Passed!"); if(s1.successors.equals(s2.successors)){ System.out.println("SuccessorsPrivatelyDifferentDetector DETECTED!"); return true; }else{ return false; } } @Override public boolean isApplicable() { return true; } }
[ "michal.stolba@agents.fel.cvut.cz" ]
michal.stolba@agents.fel.cvut.cz
c31b123f6a16ef1b13391d7ae85dedd6690a87dd
1017952a33f4b5dcf53a53be122908b6e9c86055
/app/src/main/java/com/example/user/labproject/CUET.java
2e00d77311ec111d3f507701a87dfe4b66e09db2
[]
no_license
Rifat59/Admission-Information-App
e32962e5103c9d618da8e0aa3a4862b09aa89bfa
122043c434e3596ad571d1b972647f9cae6fb2fc
refs/heads/master
2020-11-24T00:21:38.189130
2019-12-13T16:39:58
2019-12-13T16:39:58
227,881,236
0
0
null
null
null
null
UTF-8
Java
false
false
1,960
java
package com.example.user.labproject; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.io.IOException; public class CUET extends AppCompatActivity { private TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cuet); textView = (TextView) findViewById(R.id.textviewid); getWebsite(); } private void getWebsite() { new Thread(new Runnable() { @Override public void run() { final StringBuilder builder = new StringBuilder(); Document doc = null; try { doc = (Document) Jsoup.connect( "http://www.cuet.ac.bd/admission").get(); } catch (IOException e) { e.printStackTrace(); } Elements div = doc.getElementsByClass("col-md-7"); Elements para = div.select("p"); for(Element p : para) { builder.append(p.text()).append("\n").append("\n"); Elements links = p.select("a[href]"); for(Element link : links){ builder.append("Text : ").append(link.text()).append("\n"); builder.append("Link : ").append(link.attr("abs:href")).append("\n").append("\n"); } builder.append("\n").append("\n"); } runOnUiThread(new Runnable() { @Override public void run() { textView.setText(builder.toString()); } }); } }).start(); } }
[ "you@example.com" ]
you@example.com
5448b3dff860ae1f12262766681808adcbbb29ef
8b7f1a008ea484b1d98a849f2cff59bf8b8546f8
/siviras/src/main/java/model/Rol.java
fccd0efc9f73954a1407f645c1ccc9ffebed6b4d
[]
no_license
paulpy/git
1f14e066a71c0c7db00832fcd99c71953ca2c71e
7e10a56e69c1745174d30e435e8ee2110aab3a74
refs/heads/master
2021-01-11T22:02:57.534341
2017-01-14T02:10:59
2017-01-14T02:10:59
78,904,130
0
0
null
null
null
null
UTF-8
Java
false
false
1,430
java
package model; import java.io.Serializable; import javax.persistence.*; import java.util.List; /** * The persistent class for the roles database table. * */ @Entity @Table(name="roles") @NamedQuery(name="Rol.findAll", query="SELECT r FROM Rol r") public class Rol implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.TABLE) @Column(name="role_id_rol") private Integer roleIdRol; @Column(name="role_rol") private String roleRol; //bi-directional many-to-one association to UsuarioRole @OneToMany(mappedBy="rol") private List<UsuarioRole> usuarioRoles; public Rol() { } public Integer getRoleIdRol() { return this.roleIdRol; } public void setRoleIdRol(Integer roleIdRol) { this.roleIdRol = roleIdRol; } public String getRoleRol() { return this.roleRol; } public void setRoleRol(String roleRol) { this.roleRol = roleRol; } public List<UsuarioRole> getUsuarioRoles() { return this.usuarioRoles; } public void setUsuarioRoles(List<UsuarioRole> usuarioRoles) { this.usuarioRoles = usuarioRoles; } public UsuarioRole addUsuarioRole(UsuarioRole usuarioRole) { getUsuarioRoles().add(usuarioRole); usuarioRole.setRole(this); return usuarioRole; } public UsuarioRole removeUsuarioRole(UsuarioRole usuarioRole) { getUsuarioRoles().remove(usuarioRole); usuarioRole.setRole(null); return usuarioRole; } }
[ "pauljourdanbaez@gmail.com" ]
pauljourdanbaez@gmail.com
b59bcaedb189d2e13077a03edfd58ae1df352feb
26147c87ea3c071040aa7bd02a576b3c55395eb4
/src/main/java/io/pivotal/migration/FieldValueLabelHandler.java
161d1cf65ae844ac7c486882212abe3164d5c86b
[]
no_license
simonl2002/jira-to-gh-issues
efc2e15d39d61b715814e5265a9eca8e7a5d5624
50c41ff0d72a12d0555a3198c322fc8e09be1434
refs/heads/master
2022-01-29T22:42:30.305181
2019-01-17T18:08:43
2019-01-17T18:08:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,559
java
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.pivotal.migration; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import java.util.function.Function; import io.pivotal.jira.JiraIssue; import org.eclipse.egit.github.core.Label; import org.springframework.util.Assert; /** * LabelHandler that can be configured with mappings from Jira field values to * Github Labels. * * @author Rossen Stoyanchev */ public class FieldValueLabelHandler implements LabelHandler { /** * Jira field types for which mappings can be registered. */ public enum FieldType { ISSUE_TYPE(LabelFactories.TYPE_LABEL), RESOLUTION(LabelFactories.STATUS_LABEL), STATUS(LabelFactories.STATUS_LABEL), COMPONENT(LabelFactories.IN_LABEL), VERSION(null), LABEL(null); private final Function<String, Label> labelFactory; FieldType(Function<String, Label> labelFactory) { this.labelFactory = labelFactory; } public Function<String, Label> getLabelFactory() { return labelFactory; } } private final Map<String, Label> mappings = new HashMap<>(); void addMapping(FieldType fieldType, String fieldValue, String labelName) { Assert.notNull(fieldType.getLabelFactory(), "No default label creator for " + fieldType); addMapping(fieldType, fieldValue, labelName, fieldType.getLabelFactory()); } void addMapping(FieldType fieldType, String fieldValue, String labelName, Function<String, Label> creator) { String key = getKey(fieldType, fieldValue); mappings.put(key, creator.apply(labelName)); } private String getKey(FieldType fieldType, String fieldValue) { return fieldType + fieldValue.toLowerCase(); } @Override public Set<Label> getAllLabels() { return new HashSet<>(mappings.values()); } @Override public Set<String> getLabelsFor(JiraIssue issue) { Set<String> labels = new LinkedHashSet<>(); JiraIssue.Fields fields = issue.getFields(); if (fields.getIssuetype() != null) { addLabel(labels, getKey(FieldType.ISSUE_TYPE, fields.getIssuetype().getName())); } if (fields.getResolution() != null) { addLabel(labels, getKey(FieldType.RESOLUTION, fields.getResolution().getName())); } if (fields.getStatus() != null) { addLabel(labels, getKey(FieldType.STATUS, fields.getStatus().getName())); } if (fields.getComponents() != null) { fields.getComponents().forEach(component -> { addLabel(labels, getKey(FieldType.COMPONENT, component.getName())); }); } if (issue.getFixVersion() != null) { addLabel(labels, getKey(FieldType.VERSION, issue.getFixVersion().getName())); } if (fields.getLabels() != null) { fields.getLabels().forEach(label -> { addLabel(labels, getKey(FieldType.LABEL, label)); }); } return labels; } private void addLabel(Set<String> labels, String fieldValue) { Label label = mappings.get(fieldValue); if (label != null) { labels.add(label.getName()); } } }
[ "rstoyanchev@pivotal.io" ]
rstoyanchev@pivotal.io
4b81f6b9c4381a6437bb9d7659d6afb24d02dad1
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
/bazaar8.apk-decompiled/sources/i/a/C1091ba.java
6106e28cbc14a1e90fbeaf0cd20e92e30999f57f
[]
no_license
BaseMax/PopularAndroidSource
a395ccac5c0a7334d90c2594db8273aca39550ed
bcae15340907797a91d39f89b9d7266e0292a184
refs/heads/master
2020-08-05T08:19:34.146858
2019-10-06T20:06:31
2019-10-06T20:06:31
212,433,298
2
0
null
null
null
null
UTF-8
Java
false
false
14,372
java
package i.a; import h.c.e; import h.f.b.j; import h.h.g; import i.a.c.A; import i.a.c.B; import i.a.c.m; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import kotlin.TypeCastException; /* renamed from: i.a.ba reason: case insensitive filesystem */ /* compiled from: EventLoop.common.kt */ public abstract class C1091ba extends C1096ca implements P { /* renamed from: d reason: collision with root package name */ public static final AtomicReferenceFieldUpdater f14730d = AtomicReferenceFieldUpdater.newUpdater(C1091ba.class, Object.class, "_queue"); /* renamed from: e reason: collision with root package name */ public static final AtomicReferenceFieldUpdater f14731e = AtomicReferenceFieldUpdater.newUpdater(C1091ba.class, Object.class, "_delayed"); public volatile Object _delayed = null; public volatile Object _queue = null; public volatile boolean isCompleted; /* renamed from: i.a.ba$a */ /* compiled from: EventLoop.common.kt */ public static abstract class a implements Runnable, Comparable<a>, X, B { /* renamed from: a reason: collision with root package name */ public Object f14732a; /* renamed from: b reason: collision with root package name */ public int f14733b; /* renamed from: c reason: collision with root package name */ public long f14734c; public void a(A<?> a2) { if (this.f14732a != C1100ea.f14820a) { this.f14732a = a2; return; } throw new IllegalArgumentException("Failed requirement."); } public final synchronized void f() { Object obj = this.f14732a; if (obj != C1100ea.f14820a) { if (!(obj instanceof b)) { obj = null; } b bVar = (b) obj; if (bVar != null) { bVar.b(this); } this.f14732a = C1100ea.f14820a; } } public A<?> g() { Object obj = this.f14732a; if (!(obj instanceof A)) { obj = null; } return (A) obj; } public int getIndex() { return this.f14733b; } public void setIndex(int i2) { this.f14733b = i2; } public String toString() { return "Delayed[nanos=" + this.f14734c + ']'; } /* renamed from: a */ public int compareTo(a aVar) { j.b(aVar, "other"); long j2 = this.f14734c - aVar.f14734c; if (j2 > 0) { return 1; } return j2 < 0 ? -1 : 0; } public final boolean a(long j2) { return j2 - this.f14734c >= 0; } public final synchronized int a(long j2, b bVar, C1091ba baVar) { j.b(bVar, "delayed"); j.b(baVar, "eventLoop"); if (this.f14732a == C1100ea.f14820a) { return 2; } synchronized (bVar) { a aVar = (a) bVar.a(); if (baVar.isCompleted) { return 1; } if (aVar == null) { bVar.f14735c = j2; } else { long j3 = aVar.f14734c; if (j3 - j2 < 0) { j2 = j3; } if (j2 - bVar.f14735c > 0) { bVar.f14735c = j2; } } if (this.f14734c - bVar.f14735c < 0) { this.f14734c = bVar.f14735c; } bVar.a(this); return 0; } } } /* renamed from: i.a.ba$b */ /* compiled from: EventLoop.common.kt */ public static final class b extends A<a> { /* renamed from: c reason: collision with root package name */ public long f14735c; public b(long j2) { this.f14735c = j2; } } /* JADX WARNING: Removed duplicated region for block: B:32:0x0055 */ /* Code decompiled incorrectly, please refer to instructions dump. */ public long A() { /* r7 = this; boolean r0 = r7.B() if (r0 == 0) goto L_0x000b long r0 = r7.x() return r0 L_0x000b: java.lang.Object r0 = r7._delayed i.a.ba$b r0 = (i.a.C1091ba.b) r0 if (r0 == 0) goto L_0x004f boolean r1 = r0.c() if (r1 != 0) goto L_0x004f i.a.Na r1 = i.a.Oa.a() if (r1 == 0) goto L_0x0022 long r1 = r1.b() goto L_0x0026 L_0x0022: long r1 = java.lang.System.nanoTime() L_0x0026: monitor-enter(r0) i.a.c.B r3 = r0.a() // Catch:{ all -> 0x004c } r4 = 0 if (r3 == 0) goto L_0x0046 i.a.ba$a r3 = (i.a.C1091ba.a) r3 // Catch:{ all -> 0x004c } boolean r5 = r3.a((long) r1) // Catch:{ all -> 0x004c } r6 = 0 if (r5 == 0) goto L_0x003c boolean r3 = r7.b(r3) // Catch:{ all -> 0x004c } goto L_0x003d L_0x003c: r3 = 0 L_0x003d: if (r3 == 0) goto L_0x0044 i.a.c.B r3 = r0.a((int) r6) // Catch:{ all -> 0x004c } r4 = r3 L_0x0044: monitor-exit(r0) goto L_0x0047 L_0x0046: monitor-exit(r0) L_0x0047: i.a.ba$a r4 = (i.a.C1091ba.a) r4 if (r4 == 0) goto L_0x004f goto L_0x0026 L_0x004c: r1 = move-exception monitor-exit(r0) throw r1 L_0x004f: java.lang.Runnable r0 = r7.G() if (r0 == 0) goto L_0x0058 r0.run() L_0x0058: long r0 = r7.x() return r0 */ throw new UnsupportedOperationException("Method not decompiled: i.a.C1091ba.A():long"); } public final void F() { if (!K.a() || this.isCompleted) { while (true) { Object obj = this._queue; if (obj == null) { if (f14730d.compareAndSet(this, null, C1100ea.f14821b)) { return; } } else if (obj instanceof m) { ((m) obj).a(); return; } else if (obj != C1100ea.f14821b) { m mVar = new m(8, true); if (obj != null) { mVar.a((Runnable) obj); if (f14730d.compareAndSet(this, obj, mVar)) { return; } } else { throw new TypeCastException("null cannot be cast to non-null type kotlinx.coroutines.Runnable /* = java.lang.Runnable */"); } } else { return; } } } else { throw new AssertionError(); } } public final Runnable G() { while (true) { Object obj = this._queue; if (obj == null) { return null; } if (obj instanceof m) { if (obj != null) { m mVar = (m) obj; Object f2 = mVar.f(); if (f2 != m.f14766c) { return (Runnable) f2; } f14730d.compareAndSet(this, obj, mVar.e()); } else { throw new TypeCastException("null cannot be cast to non-null type kotlinx.coroutines.Queue<kotlinx.coroutines.Runnable /* = java.lang.Runnable */> /* = kotlinx.coroutines.internal.LockFreeTaskQueueCore<kotlinx.coroutines.Runnable /* = java.lang.Runnable */> */"); } } else if (obj == C1100ea.f14821b) { return null; } else { if (f14730d.compareAndSet(this, obj, null)) { if (obj != null) { return (Runnable) obj; } throw new TypeCastException("null cannot be cast to non-null type kotlinx.coroutines.Runnable /* = java.lang.Runnable */"); } } } } /* JADX WARNING: Code restructure failed: missing block: B:15:0x002b, code lost: if (r0 == i.a.C1100ea.a()) goto L_0x001a; */ /* Code decompiled incorrectly, please refer to instructions dump. */ public boolean H() { /* r4 = this; boolean r0 = r4.z() r1 = 0 if (r0 != 0) goto L_0x0008 return r1 L_0x0008: java.lang.Object r0 = r4._delayed i.a.ba$b r0 = (i.a.C1091ba.b) r0 if (r0 == 0) goto L_0x0015 boolean r0 = r0.c() if (r0 != 0) goto L_0x0015 return r1 L_0x0015: java.lang.Object r0 = r4._queue r2 = 1 if (r0 != 0) goto L_0x001c L_0x001a: r1 = 1 goto L_0x002e L_0x001c: boolean r3 = r0 instanceof i.a.c.m if (r3 == 0) goto L_0x0027 i.a.c.m r0 = (i.a.c.m) r0 boolean r1 = r0.c() goto L_0x002e L_0x0027: i.a.c.v r3 = i.a.C1100ea.f14821b if (r0 != r3) goto L_0x002e goto L_0x001a L_0x002e: return r1 */ throw new UnsupportedOperationException("Method not decompiled: i.a.C1091ba.H():boolean"); } public final void I() { Na a2 = Oa.a(); long b2 = a2 != null ? a2.b() : System.nanoTime(); while (true) { b bVar = (b) this._delayed; if (bVar != null) { a aVar = (a) bVar.f(); if (aVar != null) { a(b2, aVar); } else { return; } } else { return; } } } public final void J() { this._queue = null; this._delayed = null; } public final void b(long j2, a aVar) { j.b(aVar, "delayedTask"); int c2 = c(j2, aVar); if (c2 != 0) { if (c2 == 1) { a(j2, aVar); } else if (c2 != 2) { throw new IllegalStateException("unexpected result"); } } else if (a(aVar)) { E(); } } public final int c(long j2, a aVar) { if (this.isCompleted) { return 1; } b bVar = (b) this._delayed; if (bVar == null) { f14731e.compareAndSet(this, null, new b(j2)); Object obj = this._delayed; if (obj != null) { bVar = (b) obj; } else { j.a(); throw null; } } return aVar.a(j2, bVar, this); } public void shutdown() { Ma.f14650b.c(); this.isCompleted = true; F(); do { } while (A() <= 0); I(); } public long x() { if (super.x() == 0) { return 0; } Object obj = this._queue; if (obj != null) { if (obj instanceof m) { if (!((m) obj).c()) { return 0; } } else if (obj == C1100ea.f14821b) { return Long.MAX_VALUE; } else { return 0; } } b bVar = (b) this._delayed; if (bVar != null) { a aVar = (a) bVar.d(); if (aVar != null) { long j2 = aVar.f14734c; Na a2 = Oa.a(); return g.a(j2 - (a2 != null ? a2.b() : System.nanoTime()), 0); } } return Long.MAX_VALUE; } public final void a(e eVar, Runnable runnable) { j.b(eVar, "context"); j.b(runnable, "block"); a(runnable); } public final void a(Runnable runnable) { j.b(runnable, "task"); if (b(runnable)) { E(); } else { M.f14648g.a(runnable); } } public final boolean b(Runnable runnable) { while (true) { Object obj = this._queue; if (this.isCompleted) { return false; } if (obj == null) { if (f14730d.compareAndSet(this, null, runnable)) { return true; } } else if (obj instanceof m) { if (obj != null) { m mVar = (m) obj; int a2 = mVar.a(runnable); if (a2 == 0) { return true; } if (a2 == 1) { f14730d.compareAndSet(this, obj, mVar.e()); } else if (a2 == 2) { return false; } } else { throw new TypeCastException("null cannot be cast to non-null type kotlinx.coroutines.Queue<kotlinx.coroutines.Runnable /* = java.lang.Runnable */> /* = kotlinx.coroutines.internal.LockFreeTaskQueueCore<kotlinx.coroutines.Runnable /* = java.lang.Runnable */> */"); } } else if (obj == C1100ea.f14821b) { return false; } else { m mVar2 = new m(8, true); if (obj != null) { mVar2.a((Runnable) obj); mVar2.a(runnable); if (f14730d.compareAndSet(this, obj, mVar2)) { return true; } } else { throw new TypeCastException("null cannot be cast to non-null type kotlinx.coroutines.Runnable /* = java.lang.Runnable */"); } } } } public final boolean a(a aVar) { b bVar = (b) this._delayed; return (bVar != null ? (a) bVar.d() : null) == aVar; } }
[ "MaxBaseCode@gmail.com" ]
MaxBaseCode@gmail.com
6197ce367c43fcd8f21296d0dd5f11a18727945e
59a565803bb8043c957e451e17bd34ebb7a35733
/modules/packed-base/src/main/java/packed/internal/hook/ExtensionOnHookDescriptor.java
233cefbd345e3142a19993a37c1e994b6cd6d9c8
[ "Apache-2.0" ]
permissive
kaspernielsen/packedtmp
e16f71165bc395ac258adc56dcbb774a8b4aa59b
14302eb1a120c3d778a1fd9bf9d466f87d36920b
refs/heads/master
2020-07-01T22:38:09.308647
2019-08-07T20:23:42
2019-08-07T20:23:42
154,554,629
0
0
null
2018-11-02T09:13:50
2018-10-24T19:07:08
Java
UTF-8
Java
false
false
10,140
java
/* * Copyright (c) 2008 Kasper Nielsen. * * 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 packed.internal.hook; import static java.util.Objects.requireNonNull; import java.lang.annotation.Annotation; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles.Lookup; import java.lang.reflect.InaccessibleObjectException; import java.lang.reflect.Method; import java.lang.reflect.Parameter; import java.lang.reflect.ParameterizedType; import java.util.IdentityHashMap; import java.util.function.Supplier; import app.packed.component.ComponentConfiguration; import app.packed.container.Extension; import app.packed.hook.AnnotatedFieldHook; import app.packed.hook.AnnotatedMethodHook; import app.packed.hook.AnnotatedTypeHook; import app.packed.hook.OnHook; import app.packed.util.IllegalAccessRuntimeException; import app.packed.util.InvalidDeclarationException; import app.packed.util.NativeImage; import packed.internal.util.StringFormatter; /** This class contains information about {@link OnHook} methods for an extension type. */ final class ExtensionOnHookDescriptor { /** A cache of descriptors for a particular extension type. */ private static final ClassValue<ExtensionOnHookDescriptor> CACHE = new ClassValue<>() { @SuppressWarnings("unchecked") @Override protected ExtensionOnHookDescriptor computeValue(Class<?> type) { return new Builder((Class<? extends Extension>) type).build(); } }; /** A map of all methods that take a aggregator result object. Is always located on the actual extension. */ final IdentityHashMap<Class<?>, MethodHandle> aggregators; /** A map of all methods that takes a {@link AnnotatedFieldHook}. */ private final IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotatedFields; /** A map of all methods that takes a {@link AnnotatedMethodHook}. */ private final IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotatedMethods; /** A map of all methods that takes a {@link AnnotatedMethodHook}. */ final IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotatedTypes; /** The extension type we manage information for. */ private final Class<? extends Extension> extensionType; /** * Creates a new manager from the specified builder. * * @param builder * the builder to create the manager from */ private ExtensionOnHookDescriptor(Builder builder) { this.extensionType = builder.extensionType; this.aggregators = builder.aggregators; this.annotatedFields = builder.annotatedFields; this.annotatedMethods = builder.annotatedMethods; this.annotatedTypes = builder.annotatedTypes; }; MethodHandle findMethodHandleForAnnotatedField(PackedAnnotatedFieldHook<?> paf) { MethodHandle mh = annotatedFields.get(paf.annotation().annotationType()); if (mh == null) { throw new UnsupportedOperationException("" + paf.annotation().annotationType() + " for extension " + extensionType); } return mh; } MethodHandle findMethodHandleForAnnotatedMethod(PackedAnnotatedMethodHook<?> paf) { MethodHandle mh = annotatedMethods.get(paf.annotation().annotationType()); if (mh == null) { throw new UnsupportedOperationException(); } return mh; } /** * Returns a descriptor for the specified extensionType * * @param extensionType * the extension type to return a descriptor for * @return the descriptor * @throws InvalidDeclarationException * if the usage of {@link OnHook} on the extension does not adhere to contract */ static ExtensionOnHookDescriptor get(Class<? extends Extension> extensionType) { return CACHE.get(extensionType); } /** A builder for {@link ExtensionOnHookDescriptor}. */ private static class Builder { final IdentityHashMap<Class<?>, MethodHandle> aggregators = new IdentityHashMap<>(); /** A map of all methods that takes a {@link AnnotatedFieldHook}. */ private final IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotatedFields = new IdentityHashMap<>(); /** A map of all methods that takes a {@link AnnotatedMethodHook}. */ private final IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotatedMethods = new IdentityHashMap<>(); /** A map of all methods that takes a {@link AnnotatedMethodHook}. */ private final IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotatedTypes = new IdentityHashMap<>(); /** The type of extension that will be activated. */ private final Class<? extends Extension> extensionType; private Builder(Class<? extends Extension> extensionType) { this.extensionType = requireNonNull(extensionType); } /** * @param lookup * @param method * @param oh */ private void addHookMethod(Lookup lookup, Method method, OnHook oh) { if (method.getParameterCount() != 2) { throw new InvalidDeclarationException( "Methods annotated with @OnHook on extensions must have exactly two parameter, method = " + StringFormatter.format(method)); } if (method.getParameterTypes()[0] != ComponentConfiguration.class) { throw new InvalidDeclarationException("OOPS"); } Parameter p = method.getParameters()[1]; Class<?> cl = p.getType(); Class<? extends Supplier<?>> aggregateType = oh.aggreateWith(); if (aggregateType != ExtensionHookPerComponentGroup.NoAggregator.class) { MethodHandle mh; try { method.setAccessible(true); mh = lookup.unreflect(method); } catch (IllegalAccessException | InaccessibleObjectException e) { throw new IllegalAccessRuntimeException("In order to use the extension " + StringFormatter.format(extensionType) + ", the module '" + extensionType.getModule().getName() + "' in which the extension is located must be 'open' to 'app.packed.base'", e); } NativeImage.registerMethod(method); aggregators.put(aggregateType, mh); OnHookAggregatorDescriptor oha = OnHookAggregatorDescriptor.get(aggregateType); annotatedFields.putAll(oha.annotatedFields); annotatedMethods.putAll(oha.annotatedMethods); annotatedTypes.putAll(oha.annotatedTypes); // aggregators.p // Do something } else if (cl == AnnotatedFieldHook.class) { addHookMethod0(lookup, method, p, annotatedFields); } else if (cl == AnnotatedMethodHook.class) { addHookMethod0(lookup, method, p, annotatedMethods); } else if (cl == AnnotatedTypeHook.class) { addHookMethod0(lookup, method, p, annotatedTypes); } else { throw new InvalidDeclarationException("Methods annotated with @OnHook on hook aggregates must have exactly one parameter of type " + AnnotatedFieldHook.class.getSimpleName() + ", " + AnnotatedMethodHook.class.getSimpleName() + ", or" + AnnotatedTypeHook.class.getSimpleName() + ", " + " for method = " + StringFormatter.format(method)); } } private void addHookMethod0(Lookup lookup, Method method, Parameter p, IdentityHashMap<Class<? extends Annotation>, MethodHandle> annotations) { ParameterizedType pt = (ParameterizedType) p.getParameterizedType(); @SuppressWarnings("unchecked") Class<? extends Annotation> annotationType = (Class<? extends Annotation>) pt.getActualTypeArguments()[0]; if (annotations.containsKey(annotationType)) { throw new InvalidDeclarationException("There are multiple methods annotated with @OnHook on " + StringFormatter.format(method.getDeclaringClass()) + " that takes " + p.getParameterizedType()); } // Check that we have not added another previously for the same annotation MethodHandle mh; try { method.setAccessible(true); mh = lookup.unreflect(method); } catch (IllegalAccessException | InaccessibleObjectException e) { throw new IllegalAccessRuntimeException("In order to use the extension " + StringFormatter.format(extensionType) + ", the module '" + extensionType.getModule().getName() + "' in which the extension is located must be 'open' to 'app.packed.base'", e); } NativeImage.registerMethod(method); annotations.put(annotationType, mh); } private ExtensionOnHookDescriptor build() { for (Class<?> c = extensionType; c != Extension.class; c = c.getSuperclass()) { for (Method method : c.getDeclaredMethods()) { OnHook oh = method.getAnnotation(OnHook.class); if (oh != null) { addHookMethod(MethodHandles.lookup(), method, oh); } } } return new ExtensionOnHookDescriptor(this); } } }
[ "kasperni@gmail.com" ]
kasperni@gmail.com