blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 132
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 28
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
352
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fcea537ba728204cffd810144560bea386787397
|
54c28a1a5f7fa16b4442f55340abcb4b193e4397
|
/network-server/src/main/java/com/programyourhome/immerse/network/server/action/PlayScenarioAction.java
|
5d0fbda7796b62c0b87a4a6c42c87ab4c59865a4
|
[
"Apache-2.0"
] |
permissive
|
OrangeBaoWang/immerse
|
cb0e7a26b8ad214fcf329db96f90e14267237451
|
3b89232b7f6b9e229d1f127cb1135d305c856893
|
refs/heads/master
| 2021-10-11T00:27:58.982416
| 2019-01-19T20:55:46
| 2019-01-19T20:55:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 777
|
java
|
package com.programyourhome.immerse.network.server.action;
import java.io.IOException;
import java.io.ObjectInput;
import java.util.UUID;
import com.programyourhome.immerse.domain.Scenario;
import com.programyourhome.immerse.network.server.ImmerseServer;
/**
* Play a scenario on the mixer.
*/
public class PlayScenarioAction extends Action<UUID> {
@Override
public UUID perform(ImmerseServer server, ObjectInput objectInput) throws ClassNotFoundException, IOException {
Scenario scenario = this.read(objectInput, Scenario.class);
if (!server.hasMixer()) {
throw new IllegalStateException("Server does not have a mixer, playing a scenario is not possible");
}
return server.getMixer().playScenario(scenario);
}
}
|
[
"ewjmulder@yahoo.com"
] |
ewjmulder@yahoo.com
|
1c9bd5d8a484d2870ea45aa043d41ca901c76463
|
ecf2c40f613588fa95f9c3109554f6a00be97762
|
/src/main/java/com/byron/base/router/Dispatcher.java
|
39a59debe41d1e8979d7e2a96ece5c2e8d9a3389
|
[] |
no_license
|
LengBoCode/base
|
72b5ac539e2f95c391a80d8ac0eb2c0fae0bba9a
|
23f2bc68f25dd076e6bde0af808a1e4b5c694b87
|
refs/heads/master
| 2022-12-23T15:45:30.111447
| 2020-09-12T06:55:32
| 2020-09-12T06:55:32
| 288,433,133
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 672
|
java
|
package com.byron.base.router;
import java.util.HashMap;
/**
* 每个需要通信的组件内都有一个receiver
* 组件内通信的具体动作都有一个action
* Dispatcher负责统一管理receiver和action
*/
public class Dispatcher {
private static HashMap<String, BaseReceiver> receivers = new HashMap<>();
public static void registerReceiver(String receiverName, BaseReceiver receiver) {
receivers.put(receiverName, receiver);
}
public static void request(String receiver, String action, Response response, Object... params) {
receivers.get(receiver).invokeAction(action,response, params);
}
}
|
[
"byrongleng@tencent.com"
] |
byrongleng@tencent.com
|
b24bc82e84ba6f2a87f0074bf6425260d381ffe8
|
80576460f983a1ce5e11348e144257d6a2e12a97
|
/Integracao/ContaCapitalIntegracaoEJB/src/test/java/br/com/sicoob/sisbr/cca/integracao/negocio/servicos/ejb/CapesIntegracaoServicoEJBTest.java
|
79148645bf0a4316640ba8f2045065e1072a5c52
|
[] |
no_license
|
pabllo007/cca
|
8d3812e403deccdca5ba90745b188e10699ff44c
|
99c24157ff08459ea3e7c2415ff75bcb6a0102e4
|
refs/heads/master
| 2022-12-01T05:20:26.998529
| 2019-10-27T21:33:11
| 2019-10-27T21:33:11
| 217,919,304
| 0
| 0
| null | 2022-11-24T06:24:00
| 2019-10-27T21:31:25
|
Java
|
UTF-8
|
Java
| false
| false
| 45,656
|
java
|
/*
*
*/
package br.com.sicoob.sisbr.cca.integracao.negocio.servicos.ejb;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import br.com.bancoob.excecao.BancoobException;
import br.com.sicoob.capes.api.negocio.delegates.AnotacaoPessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.BemPessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.ClienteDelegate;
import br.com.sicoob.capes.api.negocio.delegates.EnderecoPessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.FonteRendaPessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.PessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.PessoaFisicaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.PessoaJuridicaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.ReferenciaPessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.RelacionamentoPessoaDelegate;
import br.com.sicoob.capes.api.negocio.delegates.TelefonePessoaDelegate;
import br.com.sicoob.capes.api.negocio.vo.AnotacaoPessoaVO;
import br.com.sicoob.capes.api.negocio.vo.BemPessoaVO;
import br.com.sicoob.capes.api.negocio.vo.ClienteVO;
import br.com.sicoob.capes.api.negocio.vo.EnderecoPessoaVO;
import br.com.sicoob.capes.api.negocio.vo.FonteRendaPessoaVO;
import br.com.sicoob.capes.api.negocio.vo.PessoaFisicaVO;
import br.com.sicoob.capes.api.negocio.vo.PessoaJuridicaVO;
import br.com.sicoob.capes.api.negocio.vo.PessoaVO;
import br.com.sicoob.capes.api.negocio.vo.ReferenciaPessoaVO;
import br.com.sicoob.capes.api.negocio.vo.RelacionamentoPessoaVO;
import br.com.sicoob.capes.api.negocio.vo.TelefonePessoaVO;
import br.com.sicoob.sisbr.cca.integracao.negocio.delegates.CapesIntegracaoDelegate;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.AnotacaoPessoaDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.BemPessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.EnderecoPessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.FonteRendaPessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.PessoaFisicaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.PessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.PessoaJuridicaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.ReferenciaPessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.RelacionamentoPessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.dto.TelefonePessoaIntegracaoDTO;
import br.com.sicoob.sisbr.cca.integracao.negocio.excecao.IntegracaoCapesNegocioException;
import br.com.sicoob.sisbr.localidade.api.filtro.LocApiFabricaFiltro;
import br.com.sicoob.sisbr.localidade.api.filtro.LocApiFiltroTipoLogradouro;
import br.com.sicoob.sisbr.localidade.api.negocio.delegates.LocApiTipoLogradouroDelegate;
public class CapesIntegracaoServicoEJBTest {
@Test
public void testObterPessoaInstituicao() throws BancoobException {
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaVO pessoaVO = new PessoaVO();
PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class);
EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO);
ejb.setPessoaDelegate(mockPessoaDelegate);
EasyMock.replay(mockPessoaDelegate);
PessoaIntegracaoDTO pessoa = ejb.obterPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoa);
EasyMock.verify(mockPessoaDelegate);
}
@Ignore
public void testObterPessoaInstituicaoError() throws BancoobException {
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
boolean exception = true;
try{
ejb.obterPessoaInstituicao(idPessoa, idInstituicao);
Assert.fail("Erro");
}catch(Exception e){
exception = false;
Assert.assertEquals(IntegracaoCapesNegocioException.class, e.getClass());
}
Assert.assertFalse(exception);
}
@Test
public void testObterPessoaInstituicaoNull() throws BancoobException {
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class);
EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null);
ejb.setPessoaDelegate(mockPessoaDelegate);
EasyMock.replay(mockPessoaDelegate);
PessoaIntegracaoDTO pessoa = ejb.obterPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoa);
EasyMock.verify(mockPessoaDelegate);
}
@Test
public void testObterPessoaFisicaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaFisicaVO pessoaFisicaVO = new PessoaFisicaVO();
PessoaFisicaDelegate mockPessoaFisicaDelegate = EasyMock.createMock(PessoaFisicaDelegate.class);
EasyMock.expect(mockPessoaFisicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaFisicaVO);
ejb.setPessoaFisicaDelegate(mockPessoaFisicaDelegate);
EasyMock.replay(mockPessoaFisicaDelegate);
PessoaFisicaIntegracaoDTO pessoa = ejb.obterPessoaFisicaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoa);
EasyMock.verify(mockPessoaFisicaDelegate);
}
@Ignore
public void testObterPessoaFisicaInstituicaoErro() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
boolean exception = true;
try{
ejb.obterPessoaFisicaInstituicao(idPessoa, idInstituicao);
Assert.fail("Erro");
}catch(Exception e){
exception = false;
Assert.assertEquals(IntegracaoCapesNegocioException.class, e.getClass());
}
Assert.assertFalse(exception);
}
@Test
public void testObterPessoaFisicaInstituicaoNull() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaFisicaDelegate mockPessoaFisicaDelegate = EasyMock.createMock(PessoaFisicaDelegate.class);
EasyMock.expect(mockPessoaFisicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null);
ejb.setPessoaFisicaDelegate(mockPessoaFisicaDelegate);
EasyMock.replay(mockPessoaFisicaDelegate);
PessoaFisicaIntegracaoDTO pessoa = ejb.obterPessoaFisicaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoa);
EasyMock.verify(mockPessoaFisicaDelegate);
}
public void testObterEnderecoPessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
EnderecoPessoaVO enderecoPessoaVO = new EnderecoPessoaVO();
enderecoPessoaVO.setIdTipoLogradouro(Short.valueOf("1"));
List<EnderecoPessoaVO> lstEnderecoVO = new ArrayList();
EnderecoPessoaDelegate mockEnderecoPessoaDelegate = EasyMock.createMock(EnderecoPessoaDelegate.class);
EasyMock.expect(mockEnderecoPessoaDelegate.obterEnderecoCorrespondenciaPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(enderecoPessoaVO);
EasyMock.expect(mockEnderecoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstEnderecoVO);
LocApiFiltroTipoLogradouro filtroLog = new LocApiFabricaFiltro().createLocApiFiltroTipoLogradouro();
filtroLog.setId(enderecoPessoaVO.getIdTipoLogradouro().intValue());
String logradouro = "sad";
LocApiTipoLogradouroDelegate mockLocApiTipoLogradouroDelegate = EasyMock.createMock(LocApiTipoLogradouroDelegate.class);
EasyMock.expect(mockLocApiTipoLogradouroDelegate.pesquisarTiposLogradouro(filtroLog).get(0).getDescricao()).andReturn(logradouro);
ejb.setEnderecoPessoaDelegate(mockEnderecoPessoaDelegate);
ejb.setLocApiTipoLogradouroDelegate(mockLocApiTipoLogradouroDelegate);
EasyMock.replay(mockEnderecoPessoaDelegate, mockLocApiTipoLogradouroDelegate);
EnderecoPessoaIntegracaoDTO endereco = ejb.obterEnderecoPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(endereco);
EasyMock.verify(mockEnderecoPessoaDelegate, mockLocApiTipoLogradouroDelegate);
}
@Test
public void testObterTelefonePessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
TelefonePessoaVO tel1 = new TelefonePessoaVO();
tel1.setTelefone("123");
tel1.setRamal("123");
tel1.setIdTelefone(Long.valueOf("1"));
tel1.setIdInstituicao(123);
tel1.setDescricaoTipoTelefone("casa");
tel1.setDdd("ddd");
tel1.setDataHoraInicio(new Date());
tel1.setCpfCnpj("cpfCnpj");
tel1.setCodigoTipoTelefone(Short.valueOf("0"));
TelefonePessoaVO tel2 = new TelefonePessoaVO();
tel2.setTelefone("123");
tel2.setRamal("123");
tel2.setIdTelefone(Long.valueOf("1"));
tel2.setIdInstituicao(123);
tel2.setDescricaoTipoTelefone("casa");
tel2.setDdd("ddd");
tel2.setDataHoraInicio(new Date());
tel2.setCpfCnpj("cpfCnpj");
tel2.setCodigoTipoTelefone(Short.valueOf("1"));
TelefonePessoaVO tel3 = new TelefonePessoaVO();
lstTelefonePessoaVO.add(tel1);
lstTelefonePessoaVO.add(tel2);
lstTelefonePessoaVO.add(tel3);
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockTelefonePessoaDelegate);
TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(telefone);
EasyMock.verify(mockTelefonePessoaDelegate);
}
@Test
public void testObterTelefonePessoaInstituicao2() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
TelefonePessoaVO tel1 = new TelefonePessoaVO();
tel1.setTelefone("123");
tel1.setRamal("123");
tel1.setIdTelefone(Long.valueOf("1"));
tel1.setIdInstituicao(123);
tel1.setDescricaoTipoTelefone("casa");
tel1.setDdd(null);
tel1.setDataHoraInicio(new Date());
tel1.setCpfCnpj("cpfCnpj");
tel1.setCodigoTipoTelefone(Short.valueOf("0"));
TelefonePessoaVO tel2 = new TelefonePessoaVO();
tel2.setTelefone(null);
tel2.setRamal("123");
tel2.setIdTelefone(Long.valueOf("1"));
tel2.setIdInstituicao(123);
tel2.setDescricaoTipoTelefone("casa");
tel2.setDdd("ddd");
tel2.setDataHoraInicio(new Date());
tel2.setCpfCnpj("cpfCnpj");
tel2.setCodigoTipoTelefone(Short.valueOf("1"));
TelefonePessoaVO tel3 = new TelefonePessoaVO();
lstTelefonePessoaVO.add(tel1);
lstTelefonePessoaVO.add(tel2);
lstTelefonePessoaVO.add(tel3);
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockTelefonePessoaDelegate);
TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(telefone);
EasyMock.verify(mockTelefonePessoaDelegate);
}
@Test
public void testObterTelefonePessoaInstituicao3() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
TelefonePessoaVO tel1 = new TelefonePessoaVO();
tel1.setTelefone(null);
tel1.setRamal("123");
tel1.setIdTelefone(Long.valueOf("1"));
tel1.setIdInstituicao(123);
tel1.setDescricaoTipoTelefone("casa");
tel1.setDdd("123");
tel1.setDataHoraInicio(new Date());
tel1.setCpfCnpj("cpfCnpj");
tel1.setCodigoTipoTelefone(Short.valueOf("0"));
TelefonePessoaVO tel2 = new TelefonePessoaVO();
tel2.setTelefone(null);
tel2.setRamal("123");
tel2.setIdTelefone(Long.valueOf("1"));
tel2.setIdInstituicao(123);
tel2.setDescricaoTipoTelefone("casa");
tel2.setDdd(null);
tel2.setDataHoraInicio(new Date());
tel2.setCpfCnpj("cpfCnpj");
tel2.setCodigoTipoTelefone(Short.valueOf("1"));
TelefonePessoaVO tel3 = new TelefonePessoaVO();
lstTelefonePessoaVO.add(tel1);
lstTelefonePessoaVO.add(tel2);
lstTelefonePessoaVO.add(tel3);
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockTelefonePessoaDelegate);
TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(telefone);
EasyMock.verify(mockTelefonePessoaDelegate);
}
@Test
public void testObterTelefonePessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockTelefonePessoaDelegate);
TelefonePessoaIntegracaoDTO telefone = ejb.obterTelefonePessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(telefone);
EasyMock.verify(mockTelefonePessoaDelegate);
}
@Test
public void testObterFonteRendaPessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<FonteRendaPessoaVO> lstfonteRendaVO = new ArrayList();
FonteRendaPessoaVO fonteRendaPessoaVO = new FonteRendaPessoaVO();
lstfonteRendaVO.add(fonteRendaPessoaVO);
FonteRendaPessoaDelegate mockFonteRendaPessoaDelegate = EasyMock.createMock(FonteRendaPessoaDelegate.class);
EasyMock.expect(mockFonteRendaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstfonteRendaVO);
ejb.setFonteRendaPessoaDelegate(mockFonteRendaPessoaDelegate);
EasyMock.replay(mockFonteRendaPessoaDelegate);
FonteRendaPessoaIntegracaoDTO fonteRendaPessoaIntegracaoDTO = ejb.obterFonteRendaPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(fonteRendaPessoaIntegracaoDTO);
EasyMock.verify(mockFonteRendaPessoaDelegate);
}
@Test
public void testObterFonteRendaPessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<FonteRendaPessoaVO> lstfonteRendaVO = new ArrayList();
FonteRendaPessoaDelegate mockFonteRendaPessoaDelegate = EasyMock.createMock(FonteRendaPessoaDelegate.class);
EasyMock.expect(mockFonteRendaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstfonteRendaVO);
ejb.setFonteRendaPessoaDelegate(mockFonteRendaPessoaDelegate);
EasyMock.replay(mockFonteRendaPessoaDelegate);
FonteRendaPessoaIntegracaoDTO fonteRendaPessoaIntegracaoDTO = ejb.obterFonteRendaPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(fonteRendaPessoaIntegracaoDTO);
EasyMock.verify(mockFonteRendaPessoaDelegate);
}
@Test
public void testObterBemPessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<BemPessoaVO> lstBemPessoaVO = new ArrayList();
BemPessoaVO bemPessoaVO = new BemPessoaVO();
bemPessoaVO.setValorAtualMercado(BigDecimal.TEN);
bemPessoaVO.setPercentual(BigDecimal.TEN);
lstBemPessoaVO.add(bemPessoaVO);
BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class);
EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO);
ejb.setBemPessoaDelegate(mockBemPessoaDelegate);
EasyMock.replay(mockBemPessoaDelegate);
BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(bemPessoaIntegracaoDTO);
EasyMock.verify(mockBemPessoaDelegate);
}
@Test
public void testObterBemPessoaInstituicao2() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<BemPessoaVO> lstBemPessoaVO = new ArrayList();
BemPessoaVO bemPessoaVO = new BemPessoaVO();
bemPessoaVO.setValorAtualMercado(null);
bemPessoaVO.setPercentual(BigDecimal.TEN);
lstBemPessoaVO.add(bemPessoaVO);
BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class);
EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO);
ejb.setBemPessoaDelegate(mockBemPessoaDelegate);
EasyMock.replay(mockBemPessoaDelegate);
BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(bemPessoaIntegracaoDTO);
EasyMock.verify(mockBemPessoaDelegate);
}
@Test
public void testObterBemPessoaInstituicao3() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<BemPessoaVO> lstBemPessoaVO = new ArrayList();
BemPessoaVO bemPessoaVO = new BemPessoaVO();
BemPessoaVO bemPessoaVO2 = new BemPessoaVO();
bemPessoaVO.setValorAtualMercado(BigDecimal.TEN);
bemPessoaVO.setPercentual(null);
lstBemPessoaVO.add(bemPessoaVO);
lstBemPessoaVO.add(bemPessoaVO2);
BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class);
EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO);
ejb.setBemPessoaDelegate(mockBemPessoaDelegate);
EasyMock.replay(mockBemPessoaDelegate);
BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(bemPessoaIntegracaoDTO);
EasyMock.verify(mockBemPessoaDelegate);
}
@Test
public void testObterBemPessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<BemPessoaVO> lstBemPessoaVO = new ArrayList();
BemPessoaDelegate mockBemPessoaDelegate = EasyMock.createMock(BemPessoaDelegate.class);
EasyMock.expect(mockBemPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstBemPessoaVO);
ejb.setBemPessoaDelegate(mockBemPessoaDelegate);
EasyMock.replay(mockBemPessoaDelegate);
BemPessoaIntegracaoDTO bemPessoaIntegracaoDTO = ejb.obterBemPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(bemPessoaIntegracaoDTO);
EasyMock.verify(mockBemPessoaDelegate);
}
@Test
public void testObterReferenciaPessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<ReferenciaPessoaVO> lstReferenciaPessoaVO = new ArrayList();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
ReferenciaPessoaVO referenciaPessoaVO1 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO2 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO3 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO4 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO5 = new ReferenciaPessoaVO();
referenciaPessoaVO1.setDdd(Short.valueOf("61"));
referenciaPessoaVO1.setTelefone("3215436");
referenciaPessoaVO2.setCodigoTipoReferencia(Short.valueOf("2"));
referenciaPessoaVO3.setDdd(Short.valueOf("61"));
referenciaPessoaVO3.setTelefone("3215436");
referenciaPessoaVO4.setCodigoTipoReferencia(Short.valueOf("1"));
lstReferenciaPessoaVO.add(referenciaPessoaVO1);
lstReferenciaPessoaVO.add(referenciaPessoaVO2);
lstReferenciaPessoaVO.add(referenciaPessoaVO3);
lstReferenciaPessoaVO.add(referenciaPessoaVO4);
lstReferenciaPessoaVO.add(referenciaPessoaVO5);
ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class);
EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstReferenciaPessoaVO);
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO).anyTimes();
ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate);
ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(referenciaPessoa);
EasyMock.verify(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate);
}
@Test
public void testObterReferenciaPessoaInstituicao2() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<ReferenciaPessoaVO> lstReferenciaPessoaVO = new ArrayList();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
ReferenciaPessoaVO referenciaPessoaVO1 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO2 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO3 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO4 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO5 = new ReferenciaPessoaVO();
referenciaPessoaVO1.setDdd(Short.valueOf("61"));
referenciaPessoaVO2.setCodigoTipoReferencia(Short.valueOf("2"));
referenciaPessoaVO3.setDdd(Short.valueOf("61"));
referenciaPessoaVO4.setCodigoTipoReferencia(Short.valueOf("4"));
lstReferenciaPessoaVO.add(referenciaPessoaVO1);
lstReferenciaPessoaVO.add(referenciaPessoaVO2);
lstReferenciaPessoaVO.add(referenciaPessoaVO3);
lstReferenciaPessoaVO.add(referenciaPessoaVO4);
lstReferenciaPessoaVO.add(referenciaPessoaVO5);
ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class);
EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstReferenciaPessoaVO);
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO).anyTimes();
ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate);
ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(referenciaPessoa);
EasyMock.verify(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate);
}
@Test
public void testObterReferenciaPessoaInstituicao3() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<ReferenciaPessoaVO> lstReferenciaPessoaVO = new ArrayList();
List<TelefonePessoaVO> lstTelefonePessoaVO = new ArrayList();
ReferenciaPessoaVO referenciaPessoaVO1 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO2 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO3 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO4 = new ReferenciaPessoaVO();
ReferenciaPessoaVO referenciaPessoaVO5 = new ReferenciaPessoaVO();
referenciaPessoaVO1.setDdd(Short.valueOf("61"));
referenciaPessoaVO1.setTelefone("3215436");
referenciaPessoaVO2.setCodigoTipoReferencia(Short.valueOf("5"));
referenciaPessoaVO3.setDdd(Short.valueOf("61"));
referenciaPessoaVO3.setTelefone("3215436");
referenciaPessoaVO4.setCodigoTipoReferencia(Short.valueOf("3"));
lstReferenciaPessoaVO.add(referenciaPessoaVO1);
lstReferenciaPessoaVO.add(referenciaPessoaVO2);
lstReferenciaPessoaVO.add(referenciaPessoaVO3);
lstReferenciaPessoaVO.add(referenciaPessoaVO4);
lstReferenciaPessoaVO.add(referenciaPessoaVO5);
ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class);
EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstReferenciaPessoaVO);
TelefonePessoaDelegate mockTelefonePessoaDelegate = EasyMock.createMock(TelefonePessoaDelegate.class);
EasyMock.expect(mockTelefonePessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(lstTelefonePessoaVO).anyTimes();
ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate);
ejb.setTelefonePessoaDelegate(mockTelefonePessoaDelegate);
EasyMock.replay(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate);
ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(referenciaPessoa);
EasyMock.verify(mockReferenciaPessoaDelegate, mockTelefonePessoaDelegate);
}
@Test
public void testObterReferenciaPessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<ReferenciaPessoaVO> referenciaPessoaVO = new ArrayList();
ReferenciaPessoaDelegate mockReferenciaPessoaDelegate = EasyMock.createMock(ReferenciaPessoaDelegate.class);
EasyMock.expect(mockReferenciaPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(referenciaPessoaVO);
ejb.setReferenciaPessoaDelegate(mockReferenciaPessoaDelegate);
EasyMock.replay(mockReferenciaPessoaDelegate);
ReferenciaPessoaIntegracaoDTO referenciaPessoa = ejb.obterReferenciaPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(referenciaPessoa);
EasyMock.verify(mockReferenciaPessoaDelegate);
}
@Test
public void testObterPessoaJuridicaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaJuridicaVO pessoaJuridicaVO = new PessoaJuridicaVO();
PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class);
EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaJuridicaVO);
ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate);
EasyMock.replay(mockPessoaJuridicaDelegate);
PessoaJuridicaIntegracaoDTO pessoaJuridica = ejb.obterPessoaJuridicaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoaJuridica);
EasyMock.verify(mockPessoaJuridicaDelegate);
}
@Test
public void testObterPessoaJuridicaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class);
EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null);
ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate);
EasyMock.replay(mockPessoaJuridicaDelegate);
PessoaJuridicaIntegracaoDTO pessoaJuridica = ejb.obterPessoaJuridicaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoaJuridica);
EasyMock.verify(mockPessoaJuridicaDelegate);
}
@Test
public void testObterConjugePessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relConjPessoaVOLst = new ArrayList();
RelacionamentoPessoaVO relacionamentoPessoaVO = new RelacionamentoPessoaVO();
relConjPessoaVOLst.add(relacionamentoPessoaVO);
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterConjugesPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relConjPessoaVOLst);
PessoaVO pessoaVO = new PessoaVO();
PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class);
EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes();
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
ejb.setPessoaDelegate(mockPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listRelacionamentos = ejb.obterConjugePessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listRelacionamentos);
EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
}
@Test
public void testObterConjugePessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relConjPessoaVOLst = new ArrayList();
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterConjugesPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relConjPessoaVOLst);
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listRelacionamentos = ejb.obterConjugePessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listRelacionamentos);
EasyMock.verify(mockRelacionamentoPessoaDelegate);
}
@Test
public void testObterRepresentantesLegaisPessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList();
RelacionamentoPessoaVO relacionamentoPessoaVO1 = new RelacionamentoPessoaVO();
relacionamentoPessoaVO1.setCodigoTipoRelacionamento(Short.valueOf("1"));
RelacionamentoPessoaVO relacionamentoPessoaVO2 = new RelacionamentoPessoaVO();
relacionamentoPessoaVO2.setCodigoTipoRelacionamento(Short.valueOf("5"));
RelacionamentoPessoaVO relacionamentoPessoaVO3 = new RelacionamentoPessoaVO();
relacionamentoPessoaVO3.setCodigoTipoRelacionamento(Short.valueOf("6"));
RelacionamentoPessoaVO relacionamentoPessoaVO4 = new RelacionamentoPessoaVO();
relacionamentoPessoaVO4.setCodigoTipoRelacionamento(Short.valueOf("9"));
RelacionamentoPessoaVO relacionamentoPessoaVO5 = new RelacionamentoPessoaVO();
relacionamentoPessoaVO5.setCodigoTipoRelacionamento(Short.valueOf("3"));
relReprPessoaVOLst.add(relacionamentoPessoaVO1);
relReprPessoaVOLst.add(relacionamentoPessoaVO2);
relReprPessoaVOLst.add(relacionamentoPessoaVO3);
relReprPessoaVOLst.add(relacionamentoPessoaVO4);
relReprPessoaVOLst.add(relacionamentoPessoaVO5);
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relReprPessoaVOLst);
PessoaVO pessoaVO = new PessoaVO();
PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class);
EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes();
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
ejb.setPessoaDelegate(mockPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamentos = ejb.obterRepresentantesLegaisPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listaRelacionamentos);
EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
}
@Test
public void testObterRepresentantesLegaisPessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList();
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relReprPessoaVOLst);
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamentos = ejb.obterRepresentantesLegaisPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listaRelacionamentos);
EasyMock.verify(mockRelacionamentoPessoaDelegate);
}
@Test
public void testObterRepresentantesLegaisPessoaInstituicaoNull() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList();
RelacionamentoPessoaVO relacionamentoPessoaVO = new RelacionamentoPessoaVO();
relReprPessoaVOLst.add(relacionamentoPessoaVO);
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(relReprPessoaVOLst);
PessoaVO pessoaVO = new PessoaVO();
PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class);
EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes();
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
ejb.setPessoaDelegate(mockPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamentos = ejb.obterRepresentantesLegaisPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listaRelacionamentos);
EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
}
@Test
public void testObterResponsavelLegalPessoaInstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList();
RelacionamentoPessoaVO relacionamentoPessoaVO = new RelacionamentoPessoaVO();
relReprPessoaVOLst.add(relacionamentoPessoaVO);
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicaoTipo(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyShort())).andReturn(relReprPessoaVOLst);
PessoaVO pessoaVO = new PessoaVO();
PessoaDelegate mockPessoaDelegate = EasyMock.createMock(PessoaDelegate.class);
EasyMock.expect(mockPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaVO).anyTimes();
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
ejb.setPessoaDelegate(mockPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamento = ejb.obterResponsavelLegalPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listaRelacionamento);
EasyMock.verify(mockRelacionamentoPessoaDelegate, mockPessoaDelegate);
}
@Test
public void testObterResponsavelLegalPessoaInstituicaoEmpty() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<RelacionamentoPessoaVO> relReprPessoaVOLst = new ArrayList();
RelacionamentoPessoaDelegate mockRelacionamentoPessoaDelegate = EasyMock.createMock(RelacionamentoPessoaDelegate.class);
EasyMock.expect(mockRelacionamentoPessoaDelegate.obterPorPessoaInstituicaoTipo(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyShort())).andReturn(relReprPessoaVOLst);
ejb.setRelacionamentoPessoaDelegate(mockRelacionamentoPessoaDelegate);
EasyMock.replay(mockRelacionamentoPessoaDelegate);
List<RelacionamentoPessoaIntegracaoDTO> listaRelacionamento = ejb.obterResponsavelLegalPessoaInstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(listaRelacionamento);
EasyMock.verify(mockRelacionamentoPessoaDelegate);
}
@Test
public void testObterPessoaJuridicaFormaConstituicao() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaJuridicaVO pessoaJuridicaVO = new PessoaJuridicaVO();
ClienteVO clienteVO = new ClienteVO();
PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class);
EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoaJuridicaVO);
ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class);
EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(clienteVO);
ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate);
ejb.setClienteDelegate(mockClienteDelegate);
EasyMock.replay(mockPessoaJuridicaDelegate, mockClienteDelegate);
PessoaIntegracaoDTO pessoa = ejb.obterPessoaJuridicaFormaConstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoa);
EasyMock.verify(mockPessoaJuridicaDelegate, mockClienteDelegate);
}
@Test
public void testObterPessoaJuridicaFormaConstituicaoNull() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaJuridicaDelegate mockPessoaJuridicaDelegate = EasyMock.createMock(PessoaJuridicaDelegate.class);
EasyMock.expect(mockPessoaJuridicaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null);
ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class);
EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(null);
ejb.setPessoaJuridicaDelegate(mockPessoaJuridicaDelegate);
ejb.setClienteDelegate(mockClienteDelegate);
EasyMock.replay(mockPessoaJuridicaDelegate, mockClienteDelegate);
PessoaIntegracaoDTO pessoa = ejb.obterPessoaJuridicaFormaConstituicao(idPessoa, idInstituicao);
Assert.assertNotNull(pessoa);
EasyMock.verify(mockPessoaJuridicaDelegate, mockClienteDelegate);
}
@Test
public void testIsPessoaJuridica() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
PessoaIntegracaoDTO pessoa = new PessoaIntegracaoDTO();
CapesIntegracaoDelegate mockCapesIntegracaoDelegate = EasyMock.createMock(CapesIntegracaoDelegate.class);
EasyMock.expect(mockCapesIntegracaoDelegate.obterPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(pessoa);
ejb.setCapesIntegracaoDelegate(mockCapesIntegracaoDelegate);
EasyMock.replay(mockCapesIntegracaoDelegate);
Boolean bol = ejb.isPessoaJuridica(idPessoa, idInstituicao);
Assert.assertNotNull(bol);
EasyMock.verify(mockCapesIntegracaoDelegate);
}
@Test
public void testisClienteCadastrado() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
ClienteVO cli = new ClienteVO();
cli.setIdPessoa(1);
cli.setCpfCnpj("123321321");
ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class);
EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(cli);
ejb.setClienteDelegate(mockClienteDelegate);
EasyMock.replay(mockClienteDelegate);
Boolean bol = ejb.isClienteCadastrado(idPessoa, idInstituicao);
Assert.assertNotNull(bol);
EasyMock.verify(mockClienteDelegate);
}
@Test
public void testisClienteCadastradoNull() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
ClienteVO cli = new ClienteVO();
ClienteDelegate mockClienteDelegate = EasyMock.createMock(ClienteDelegate.class);
EasyMock.expect(mockClienteDelegate.obterPorIdPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt())).andReturn(cli);
ejb.setClienteDelegate(mockClienteDelegate);
EasyMock.replay(mockClienteDelegate);
Boolean bol = ejb.isClienteCadastrado(idPessoa, idInstituicao);
Assert.assertNotNull(bol);
EasyMock.verify(mockClienteDelegate);
}
@Test
public void testObterAnotacoesBaixadas() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<AnotacaoPessoaVO> lstAnotacaoVO = new ArrayList();
AnotacaoPessoaVO anotacaoPessoaVO = new AnotacaoPessoaVO();
lstAnotacaoVO.add(anotacaoPessoaVO);
AnotacaoPessoaDelegate mockAnotacaoPessoaDelegate = EasyMock.createMock(AnotacaoPessoaDelegate.class);
EasyMock.expect(mockAnotacaoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(lstAnotacaoVO);
ejb.setAnotacaoPessoaDelegate(mockAnotacaoPessoaDelegate);
EasyMock.replay(mockAnotacaoPessoaDelegate);
List<AnotacaoPessoaDTO> lstAnotacoes = ejb.obterAnotacoesBaixadas(idPessoa, idInstituicao);
Assert.assertNotNull(lstAnotacoes);
EasyMock.verify(mockAnotacaoPessoaDelegate);
}
@Test
public void testObterAnotacoesBaixadasNull() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<AnotacaoPessoaVO> lstAnotacaoVO = new ArrayList();
AnotacaoPessoaVO anotacaoPessoaVO = new AnotacaoPessoaVO();
AnotacaoPessoaDelegate mockAnotacaoPessoaDelegate = EasyMock.createMock(AnotacaoPessoaDelegate.class);
EasyMock.expect(mockAnotacaoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(lstAnotacaoVO);
ejb.setAnotacaoPessoaDelegate(mockAnotacaoPessoaDelegate);
EasyMock.replay(mockAnotacaoPessoaDelegate);
List<AnotacaoPessoaDTO> lstAnotacoes = ejb.obterAnotacoesBaixadas(idPessoa, idInstituicao);
Assert.assertNotNull(lstAnotacoes);
EasyMock.verify(mockAnotacaoPessoaDelegate);
}
@Test
public void testObterAnotacoesVigentes() throws BancoobException{
Integer idPessoa = 1;
Integer idInstituicao = 2;
CapesIntegracaoServicoEJB ejb = new CapesIntegracaoServicoEJB();
List<AnotacaoPessoaVO> lstAnotacaoVO = new ArrayList();
AnotacaoPessoaVO anotacaoPessoaVO = new AnotacaoPessoaVO();
lstAnotacaoVO.add(anotacaoPessoaVO);
AnotacaoPessoaDelegate mockAnotacaoPessoaDelegate = EasyMock.createMock(AnotacaoPessoaDelegate.class);
EasyMock.expect(mockAnotacaoPessoaDelegate.obterPorPessoaInstituicao(EasyMock.anyInt(), EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(lstAnotacaoVO);
ejb.setAnotacaoPessoaDelegate(mockAnotacaoPessoaDelegate);
EasyMock.replay(mockAnotacaoPessoaDelegate);
List<AnotacaoPessoaDTO> lstAnotacoes = ejb.obterAnotacoesVigentes(idPessoa, idInstituicao);
Assert.assertNotNull(lstAnotacoes);
EasyMock.verify(mockAnotacaoPessoaDelegate);
}
}
|
[
"="
] |
=
|
00f254f491d2e43411351684dc4fef11d300dfa7
|
c298bb6cc956a95ed570624a48d378098ff2e0e1
|
/achilles-core/src/main/java/info/archinnov/achilles/internals/parser/accessors/Getter.java
|
0dec9979c4cd5eaefe5feb058fd428f7becac0fc
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
pgbhagat/Achilles
|
d1280ea296704280e67fd46e102922101c832fce
|
bba5e456a03e488c5f978cb818d817e5008eab91
|
refs/heads/master
| 2023-08-16T04:38:03.362601
| 2018-02-23T11:42:23
| 2018-02-23T11:42:23
| 122,614,004
| 0
| 0
|
Apache-2.0
| 2023-08-05T18:31:17
| 2018-02-23T11:40:13
|
Java
|
UTF-8
|
Java
| false
| false
| 764
|
java
|
/*
* Copyright (C) 2012-2017 DuyHai DOAN
*
* 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 info.archinnov.achilles.internals.parser.accessors;
@FunctionalInterface
public interface Getter<ENTITY, VALUEFROM> {
VALUEFROM get(ENTITY entity);
}
|
[
"doanduyhai@gmail.com"
] |
doanduyhai@gmail.com
|
00c6848767c075064918ca810b84e0827db45f19
|
e96faaa3164146f8e8a96b459dc05145569b6eb6
|
/fx-gateway-server/src/main/java/com/fx/cloud/gateway/server/service/IGatewayRouteService.java
|
5906496fbacbeb2648aa1751a24530197ac4580c
|
[] |
no_license
|
GX13697255906/fx
|
55f136bbc866be06e65c6f5b1a30251316dce9a2
|
f36eadd067b7d74d5b540158c25c25319842e38f
|
refs/heads/main
| 2022-01-20T08:32:27.444075
| 2022-01-20T03:32:55
| 2022-01-20T03:32:55
| 253,255,107
| 0
| 0
| null | 2021-04-26T20:08:15
| 2020-04-05T14:32:28
|
Java
|
UTF-8
|
Java
| false
| false
| 469
|
java
|
package com.fx.cloud.gateway.server.service;
import com.fx.cloud.gateway.server.entity.GatewayRoute;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 开放网关-路由 服务类
* </p>
*
* @author xun.guo
* @since 2022-01-12
*/
public interface IGatewayRouteService extends IService<GatewayRoute> {
/**
* 获取所有fx服务
*
* @return
*/
List<GatewayRoute> getAllFxService();
}
|
[
"2594226416@qq.com"
] |
2594226416@qq.com
|
42b03abc1cb79ec0568b013425b2f56374f87c71
|
351d07ae12c4a1331299a9dca90aeb7e25cf258b
|
/NumberGuess/gen/edu/harding/numberguess/BuildConfig.java
|
e683e8c31313f525441c2e38f04dfb32d94da234
|
[] |
no_license
|
tdurey/NumberGuess
|
74cee9188d6a672a249d3a93d5a31b372ebeead4
|
70a143dbdd628a5c5258ed38055eaef364c4a6a9
|
refs/heads/master
| 2016-09-03T06:31:59.316879
| 2014-05-05T06:53:55
| 2014-05-05T06:54:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 165
|
java
|
/** Automatically generated file. DO NOT MODIFY */
package edu.harding.numberguess;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
|
[
"tdurey@harding.edu"
] |
tdurey@harding.edu
|
d41bd071a1ccc1c24e33de30e1e68281cbdf3db6
|
9c27398b8808a59b476ea7f7b82a6faaa50e4027
|
/src/main/java/br/alura/patterns/memento/Contrato.java
|
142f6eeafc7e23cfa9c1901bd813ff9b17883085
|
[] |
no_license
|
gabrielsmartins/design-patterns-II
|
09605f18708640c729c377d3ac8b6df0779ae126
|
80b7a22a0c0ca7938dd314f0af772e1123058581
|
refs/heads/master
| 2022-01-24T18:16:01.702605
| 2019-10-20T18:37:26
| 2019-10-20T18:37:26
| 216,408,972
| 0
| 0
| null | 2022-01-21T23:32:33
| 2019-10-20T18:36:02
|
Java
|
UTF-8
|
Java
| false
| false
| 1,125
|
java
|
package br.alura.patterns.memento;
import java.time.LocalDateTime;
public class Contrato {
private LocalDateTime data;
private String cliente;
private TipoContrato tipo;
public Contrato(LocalDateTime data, String cliente, TipoContrato tipo) {
this.data = data;
this.cliente = cliente;
this.tipo = tipo;
}
public LocalDateTime getData() {
return data;
}
public String getCliente() {
return cliente;
}
public TipoContrato getTipo() {
return tipo;
}
public void avanca() {
if(this.tipo == TipoContrato.NOVO)
this.tipo = TipoContrato.EM_ANDAMENTO;
else if(this.tipo == TipoContrato.EM_ANDAMENTO)
this.tipo = TipoContrato.ACERTADO;
else if(this.tipo == TipoContrato.ACERTADO)
this.tipo = TipoContrato.CONCLUIDO;
}
public Estado salvaEstado() {
return new Estado(new Contrato(this.data, this.cliente, this.tipo));
}
public void restaura(Estado estado) {
this.data = estado.getContrato().getData();
this.cliente = estado.getContrato().getCliente();
this.tipo = estado.getContrato().getTipo();
}
}
|
[
"ga.smartins94@gmail.com"
] |
ga.smartins94@gmail.com
|
772419905df676d67d98219b8e6aee5b3f17ef7b
|
2b8c4443062c92ebed1093a979c92a5e38a5d70a
|
/src/main/java/com/korabelska/demo/repository/impl/DoctorRepositoryImpl.java
|
511764c10851a0e3e6ec173a204e6382ca415245
|
[] |
no_license
|
yuliiakorabelska/data-jdbc
|
cb30d08bb9a56bc45de5c8c985c8a4d38ba34d0a
|
b8f0d106b6c741837e82af30a48822c94a1d3763
|
refs/heads/master
| 2022-06-09T18:31:42.193080
| 2020-05-05T13:50:13
| 2020-05-05T13:50:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,854
|
java
|
package com.korabelska.demo.repository.impl;
import com.google.cloud.spanner.Key;
import com.korabelska.demo.exceptions.EntityNotFoundException;
import com.korabelska.demo.model.Doctor;
import com.korabelska.demo.repository.BaseRepository;
import org.springframework.cloud.gcp.data.spanner.core.SpannerTemplate;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Repository
public class DoctorRepositoryImpl extends BaseRepository<Doctor, String> {
private static final Class<Doctor> REPOSITORY_CLASS = Doctor.class;
public DoctorRepositoryImpl(SpannerTemplate spannerTemplate) {
super(spannerTemplate);
}
@Override
public Doctor create(Doctor doctor) {
doctor.setDoctorId(UUID.randomUUID().toString());
spannerTemplate.insert(doctor);
return doctor;
}
@Override
public Doctor updateExisting(Doctor doctor) throws EntityNotFoundException {
Key key = Key.of(doctor.getHospitalId(), doctor.getDepartmentId(), doctor.getDoctorId());
if (spannerTemplate.existsById(REPOSITORY_CLASS, key)) {
spannerTemplate.update(doctor);
return doctor;
}
throw new EntityNotFoundException(doctor.getDoctorId());
}
@Override
public List<Doctor> findAll() {
List<Doctor> doctors = spannerTemplate.readAll(REPOSITORY_CLASS);
return doctors;
}
@Override
public Optional<Doctor> findByKey(String... keys) {
Doctor doctor = spannerTemplate.read(REPOSITORY_CLASS, Key.of(keys));
return Optional.ofNullable(doctor);
}
@Override
public void deleteByKey(String... keys) {
spannerTemplate.delete(REPOSITORY_CLASS, Key.of(keys));
}
}
|
[
"fedosenkoj@gmail.com"
] |
fedosenkoj@gmail.com
|
8e496177009633c6c9e1926f2c8c3eb661a2f358
|
1dfd0e45975f1cf7ff9f9561ff2cc18559e5c7df
|
/Projects/中证技术CMS/zzjscms/src/main/java/com/zzjs/cms/entity/vo/ComponentTypeVo.java
|
58fa367069ab4cfcd577f0b1012237e2515e2975
|
[
"Apache-2.0"
] |
permissive
|
fengmoboygithub/main_respository
|
20434a7a676707916a035d4f19f40dba56f26186
|
c17bc196ae606ce4af503b68af7a926a8e677986
|
refs/heads/master
| 2023-01-12T23:43:15.501710
| 2020-11-18T15:48:48
| 2020-11-18T15:48:48
| 313,973,726
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,185
|
java
|
package com.zzjs.cms.entity.vo;
import java.util.Date;
import java.util.List;
import com.zzjs.cms.constant.ComponentTypeConstant;
import com.zzjs.cms.entity.Component;
/**
* 组件类型vo类
*
* @author yinlong
*
*/
public class ComponentTypeVo {
/**
* 组件类型ID
*/
private long tpCompTypeId;
/**
* 组件类型名称
*/
private String compTypeName;
/**
* 组件提示
*/
private String compTypeTip;
/**
* 排序
*/
private int tpSort;
/**
* 创建时间
*/
private Date tpCreateTime;
/**
* 更新时间
*/
private Date tpUpdateTime;
/**
* 组件类型描述
*/
private ComponentTypeConstant.compTypeDesc compTypeDesc;
/**
* html页面对应标签id
*/
private String htmlId;
/**
* 组件类型下的所有组件
*/
private List<Component> components;
public List<Component> getComponents() {
return components;
}
public void setComponents(List<Component> components) {
this.components = components;
}
public long getTpCompTypeId() {
return tpCompTypeId;
}
public void setTpCompTypeId(long tpCompTypeId) {
this.tpCompTypeId = tpCompTypeId;
}
public String getCompTypeName() {
return compTypeName;
}
public void setCompTypeName(String compTypeName) {
this.compTypeName = compTypeName;
}
public String getCompTypeTip() {
return compTypeTip;
}
public void setCompTypeTip(String compTypeTip) {
this.compTypeTip = compTypeTip;
}
public int getTpSort() {
return tpSort;
}
public void setTpSort(int tpSort) {
this.tpSort = tpSort;
}
public Date getTpCreateTime() {
return tpCreateTime;
}
public void setTpCreateTime(Date tpCreateTime) {
this.tpCreateTime = tpCreateTime;
}
public Date getTpUpdateTime() {
return tpUpdateTime;
}
public void setTpUpdateTime(Date tpUpdateTime) {
this.tpUpdateTime = tpUpdateTime;
}
public ComponentTypeConstant.compTypeDesc getCompTypeDesc() {
return compTypeDesc;
}
public void setCompTypeDesc(ComponentTypeConstant.compTypeDesc compTypeDesc) {
this.compTypeDesc = compTypeDesc;
}
public String getHtmlId() {
return htmlId;
}
public void setHtmlId(String htmlId) {
this.htmlId = htmlId;
}
}
|
[
"yangyanchao@otc-tech.cn"
] |
yangyanchao@otc-tech.cn
|
28586d568fb7f3c837a3f284387318bc8dd79b57
|
8e61a9658370a6ddb46316c9930d14aa6b37902f
|
/src/JP420000/bssv/e1/oracle/ShowSalesDetailLinePricing.java
|
bac21a7d9bcbe0646e30be04b02bcfa446d19be8
|
[] |
no_license
|
alanOO7/JDE_SOAP
|
dc1b1c1bfd7063542af8062bd61bcf165d84bcbc
|
7fc78ee5510a61bd0f7ffe75265b4aac023b372e
|
refs/heads/master
| 2020-05-31T14:10:55.762874
| 2019-06-05T05:34:56
| 2019-06-05T05:34:56
| 190,322,382
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 17,997
|
java
|
/**
* ShowSalesDetailLinePricing.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package JP420000.bssv.e1.oracle;
public class ShowSalesDetailLinePricing extends JP420000.bssv.e1.oracle.ValueObject implements java.io.Serializable {
private java.lang.String adjustmentScheduleCode;
private java.util.Calendar datePriceEffective;
private java.lang.String itemPriceGroupCode;
private java.lang.String priceCode1;
private java.lang.String priceCode2;
private java.lang.String priceCode3;
private java.math.BigDecimal priceExtendedDomestic;
private java.math.BigDecimal priceExtendedForeign;
private java.math.BigDecimal priceUnitDomestic;
private java.math.BigDecimal priceUnitForeign;
private java.lang.String unitOfMeasureCodePricing;
public ShowSalesDetailLinePricing() {
}
public ShowSalesDetailLinePricing(
java.lang.String adjustmentScheduleCode,
java.util.Calendar datePriceEffective,
java.lang.String itemPriceGroupCode,
java.lang.String priceCode1,
java.lang.String priceCode2,
java.lang.String priceCode3,
java.math.BigDecimal priceExtendedDomestic,
java.math.BigDecimal priceExtendedForeign,
java.math.BigDecimal priceUnitDomestic,
java.math.BigDecimal priceUnitForeign,
java.lang.String unitOfMeasureCodePricing) {
this.adjustmentScheduleCode = adjustmentScheduleCode;
this.datePriceEffective = datePriceEffective;
this.itemPriceGroupCode = itemPriceGroupCode;
this.priceCode1 = priceCode1;
this.priceCode2 = priceCode2;
this.priceCode3 = priceCode3;
this.priceExtendedDomestic = priceExtendedDomestic;
this.priceExtendedForeign = priceExtendedForeign;
this.priceUnitDomestic = priceUnitDomestic;
this.priceUnitForeign = priceUnitForeign;
this.unitOfMeasureCodePricing = unitOfMeasureCodePricing;
}
/**
* Gets the adjustmentScheduleCode value for this ShowSalesDetailLinePricing.
*
* @return adjustmentScheduleCode
*/
public java.lang.String getAdjustmentScheduleCode() {
return adjustmentScheduleCode;
}
/**
* Sets the adjustmentScheduleCode value for this ShowSalesDetailLinePricing.
*
* @param adjustmentScheduleCode
*/
public void setAdjustmentScheduleCode(java.lang.String adjustmentScheduleCode) {
this.adjustmentScheduleCode = adjustmentScheduleCode;
}
/**
* Gets the datePriceEffective value for this ShowSalesDetailLinePricing.
*
* @return datePriceEffective
*/
public java.util.Calendar getDatePriceEffective() {
return datePriceEffective;
}
/**
* Sets the datePriceEffective value for this ShowSalesDetailLinePricing.
*
* @param datePriceEffective
*/
public void setDatePriceEffective(java.util.Calendar datePriceEffective) {
this.datePriceEffective = datePriceEffective;
}
/**
* Gets the itemPriceGroupCode value for this ShowSalesDetailLinePricing.
*
* @return itemPriceGroupCode
*/
public java.lang.String getItemPriceGroupCode() {
return itemPriceGroupCode;
}
/**
* Sets the itemPriceGroupCode value for this ShowSalesDetailLinePricing.
*
* @param itemPriceGroupCode
*/
public void setItemPriceGroupCode(java.lang.String itemPriceGroupCode) {
this.itemPriceGroupCode = itemPriceGroupCode;
}
/**
* Gets the priceCode1 value for this ShowSalesDetailLinePricing.
*
* @return priceCode1
*/
public java.lang.String getPriceCode1() {
return priceCode1;
}
/**
* Sets the priceCode1 value for this ShowSalesDetailLinePricing.
*
* @param priceCode1
*/
public void setPriceCode1(java.lang.String priceCode1) {
this.priceCode1 = priceCode1;
}
/**
* Gets the priceCode2 value for this ShowSalesDetailLinePricing.
*
* @return priceCode2
*/
public java.lang.String getPriceCode2() {
return priceCode2;
}
/**
* Sets the priceCode2 value for this ShowSalesDetailLinePricing.
*
* @param priceCode2
*/
public void setPriceCode2(java.lang.String priceCode2) {
this.priceCode2 = priceCode2;
}
/**
* Gets the priceCode3 value for this ShowSalesDetailLinePricing.
*
* @return priceCode3
*/
public java.lang.String getPriceCode3() {
return priceCode3;
}
/**
* Sets the priceCode3 value for this ShowSalesDetailLinePricing.
*
* @param priceCode3
*/
public void setPriceCode3(java.lang.String priceCode3) {
this.priceCode3 = priceCode3;
}
/**
* Gets the priceExtendedDomestic value for this ShowSalesDetailLinePricing.
*
* @return priceExtendedDomestic
*/
public java.math.BigDecimal getPriceExtendedDomestic() {
return priceExtendedDomestic;
}
/**
* Sets the priceExtendedDomestic value for this ShowSalesDetailLinePricing.
*
* @param priceExtendedDomestic
*/
public void setPriceExtendedDomestic(java.math.BigDecimal priceExtendedDomestic) {
this.priceExtendedDomestic = priceExtendedDomestic;
}
/**
* Gets the priceExtendedForeign value for this ShowSalesDetailLinePricing.
*
* @return priceExtendedForeign
*/
public java.math.BigDecimal getPriceExtendedForeign() {
return priceExtendedForeign;
}
/**
* Sets the priceExtendedForeign value for this ShowSalesDetailLinePricing.
*
* @param priceExtendedForeign
*/
public void setPriceExtendedForeign(java.math.BigDecimal priceExtendedForeign) {
this.priceExtendedForeign = priceExtendedForeign;
}
/**
* Gets the priceUnitDomestic value for this ShowSalesDetailLinePricing.
*
* @return priceUnitDomestic
*/
public java.math.BigDecimal getPriceUnitDomestic() {
return priceUnitDomestic;
}
/**
* Sets the priceUnitDomestic value for this ShowSalesDetailLinePricing.
*
* @param priceUnitDomestic
*/
public void setPriceUnitDomestic(java.math.BigDecimal priceUnitDomestic) {
this.priceUnitDomestic = priceUnitDomestic;
}
/**
* Gets the priceUnitForeign value for this ShowSalesDetailLinePricing.
*
* @return priceUnitForeign
*/
public java.math.BigDecimal getPriceUnitForeign() {
return priceUnitForeign;
}
/**
* Sets the priceUnitForeign value for this ShowSalesDetailLinePricing.
*
* @param priceUnitForeign
*/
public void setPriceUnitForeign(java.math.BigDecimal priceUnitForeign) {
this.priceUnitForeign = priceUnitForeign;
}
/**
* Gets the unitOfMeasureCodePricing value for this ShowSalesDetailLinePricing.
*
* @return unitOfMeasureCodePricing
*/
public java.lang.String getUnitOfMeasureCodePricing() {
return unitOfMeasureCodePricing;
}
/**
* Sets the unitOfMeasureCodePricing value for this ShowSalesDetailLinePricing.
*
* @param unitOfMeasureCodePricing
*/
public void setUnitOfMeasureCodePricing(java.lang.String unitOfMeasureCodePricing) {
this.unitOfMeasureCodePricing = unitOfMeasureCodePricing;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof ShowSalesDetailLinePricing)) return false;
ShowSalesDetailLinePricing other = (ShowSalesDetailLinePricing) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.adjustmentScheduleCode==null && other.getAdjustmentScheduleCode()==null) ||
(this.adjustmentScheduleCode!=null &&
this.adjustmentScheduleCode.equals(other.getAdjustmentScheduleCode()))) &&
((this.datePriceEffective==null && other.getDatePriceEffective()==null) ||
(this.datePriceEffective!=null &&
this.datePriceEffective.equals(other.getDatePriceEffective()))) &&
((this.itemPriceGroupCode==null && other.getItemPriceGroupCode()==null) ||
(this.itemPriceGroupCode!=null &&
this.itemPriceGroupCode.equals(other.getItemPriceGroupCode()))) &&
((this.priceCode1==null && other.getPriceCode1()==null) ||
(this.priceCode1!=null &&
this.priceCode1.equals(other.getPriceCode1()))) &&
((this.priceCode2==null && other.getPriceCode2()==null) ||
(this.priceCode2!=null &&
this.priceCode2.equals(other.getPriceCode2()))) &&
((this.priceCode3==null && other.getPriceCode3()==null) ||
(this.priceCode3!=null &&
this.priceCode3.equals(other.getPriceCode3()))) &&
((this.priceExtendedDomestic==null && other.getPriceExtendedDomestic()==null) ||
(this.priceExtendedDomestic!=null &&
this.priceExtendedDomestic.equals(other.getPriceExtendedDomestic()))) &&
((this.priceExtendedForeign==null && other.getPriceExtendedForeign()==null) ||
(this.priceExtendedForeign!=null &&
this.priceExtendedForeign.equals(other.getPriceExtendedForeign()))) &&
((this.priceUnitDomestic==null && other.getPriceUnitDomestic()==null) ||
(this.priceUnitDomestic!=null &&
this.priceUnitDomestic.equals(other.getPriceUnitDomestic()))) &&
((this.priceUnitForeign==null && other.getPriceUnitForeign()==null) ||
(this.priceUnitForeign!=null &&
this.priceUnitForeign.equals(other.getPriceUnitForeign()))) &&
((this.unitOfMeasureCodePricing==null && other.getUnitOfMeasureCodePricing()==null) ||
(this.unitOfMeasureCodePricing!=null &&
this.unitOfMeasureCodePricing.equals(other.getUnitOfMeasureCodePricing())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getAdjustmentScheduleCode() != null) {
_hashCode += getAdjustmentScheduleCode().hashCode();
}
if (getDatePriceEffective() != null) {
_hashCode += getDatePriceEffective().hashCode();
}
if (getItemPriceGroupCode() != null) {
_hashCode += getItemPriceGroupCode().hashCode();
}
if (getPriceCode1() != null) {
_hashCode += getPriceCode1().hashCode();
}
if (getPriceCode2() != null) {
_hashCode += getPriceCode2().hashCode();
}
if (getPriceCode3() != null) {
_hashCode += getPriceCode3().hashCode();
}
if (getPriceExtendedDomestic() != null) {
_hashCode += getPriceExtendedDomestic().hashCode();
}
if (getPriceExtendedForeign() != null) {
_hashCode += getPriceExtendedForeign().hashCode();
}
if (getPriceUnitDomestic() != null) {
_hashCode += getPriceUnitDomestic().hashCode();
}
if (getPriceUnitForeign() != null) {
_hashCode += getPriceUnitForeign().hashCode();
}
if (getUnitOfMeasureCodePricing() != null) {
_hashCode += getUnitOfMeasureCodePricing().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ShowSalesDetailLinePricing.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://oracle.e1.bssv.JP420000/", "showSalesDetailLinePricing"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("adjustmentScheduleCode");
elemField.setXmlName(new javax.xml.namespace.QName("", "adjustmentScheduleCode"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("datePriceEffective");
elemField.setXmlName(new javax.xml.namespace.QName("", "datePriceEffective"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("itemPriceGroupCode");
elemField.setXmlName(new javax.xml.namespace.QName("", "itemPriceGroupCode"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceCode1");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceCode1"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceCode2");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceCode2"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceCode3");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceCode3"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceExtendedDomestic");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceExtendedDomestic"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceExtendedForeign");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceExtendedForeign"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceUnitDomestic");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceUnitDomestic"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("priceUnitForeign");
elemField.setXmlName(new javax.xml.namespace.QName("", "priceUnitForeign"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "decimal"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("unitOfMeasureCodePricing");
elemField.setXmlName(new javax.xml.namespace.QName("", "unitOfMeasureCodePricing"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"alan_oo7@outlook.com"
] |
alan_oo7@outlook.com
|
0b205454ffa163fc970044dfa4af03e27a275746
|
ba4112172790b1c55a0640ee7c6ae69fc3939098
|
/src/RadarChartPlatform.java
|
4266fe51f907f72cc00238bde4766b35c93ae975
|
[] |
no_license
|
RoloAdriana/TFG_Adriana_Rolo_inchausti
|
f7ae2756d789d9d899077eec42690668a66a17a0
|
5c571b1c4469f9d5559736b8eedee75514e14f88
|
refs/heads/master
| 2016-09-06T04:37:46.946315
| 2015-06-21T17:58:31
| 2015-06-21T17:58:31
| 37,819,697
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,976
|
java
|
import java.awt.*;
import org.jfree.chart.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.labels.*;
import org.jfree.chart.title.*;
import org.jfree.data.category.*;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
import org.jfree.util.*;
public class RadarChartPlatform extends ApplicationFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
public DefaultCategoryDataset dataset;
public SpiderWebPlot plot;
public RadarChartPlatform(String title, String[] features) {
super(title);
String series1 = "First";
String series2 = "Second";
String series3 = "Third";
String category1 = "puntos";
String category2 = "ObjetosCogidos";
String category3 = "tiempoJuego";
String category4 = "EnemigosAcabados";
String category5 = "flechaDerecha";
String category6 = "flechaIzqda";
String category7 = "saltos";
String category8 = "vidasPerdidasCaidas";
String category9 = "vidasPerdidasEnemigos";
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(5.0, series1, category1);
dataset.addValue(5.0, series1, category2);
dataset.addValue(5.0, series1, category3);
dataset.addValue(5.0, series1, category4);
dataset.addValue(5.0, series1, category5);
dataset.addValue(5.0, series1, category6);
dataset.addValue(5.0, series1, category7);
dataset.addValue(5.0, series1, category8);
dataset.addValue(5.0, series1, category9);
dataset.addValue(2.0, series2, category1);
dataset.addValue(4.0, series2, category2);
dataset.addValue(5.0, series2, category3);
dataset.addValue(3.0, series2, category4);
dataset.addValue(3.9, series2, category5);
dataset.addValue(4.3, series2, category6);
dataset.addValue(5.0, series2, category7);
dataset.addValue(3.5, series2, category8);
dataset.addValue(4.0, series2, category9);
SpiderWebPlot plot = new SpiderWebPlot(dataset);
plot.setStartAngle(90);
plot.setInteriorGap(0.20);
plot.setToolTipGenerator(new StandardCategoryToolTipGenerator());
JFreeChart chart = new JFreeChart("", TextTitle.DEFAULT_FONT, plot, false);
ChartUtilities.applyCurrentTheme(chart);
ChartPanel chartPanel = new ChartPanel(chart);
this.plot = (SpiderWebPlot) chartPanel.getChart().getPlot();
this.dataset = (DefaultCategoryDataset) plot.getDataset();
chartPanel.setPreferredSize(new Dimension(500, 270));
setContentPane(chartPanel);
}
public static void main(String[] args) {
RadarChartPlatform demo = new RadarChartPlatform("Chart");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}
}
|
[
"adrianarolo@hotmail.com"
] |
adrianarolo@hotmail.com
|
bd8108c690970b1f487845a92f37fac652154091
|
e18fc8d3cedf8499df91de319801095f52e11081
|
/src/main/java/ru/progect/AppMain.java
|
ba28649747402c64ba27a57fe9b7ab28eab6771b
|
[] |
no_license
|
SheeRMooN/springF
|
ae03d5fd94254085b785f5c17f0bbac3d1e5f17f
|
a8a504ad51c06be2d2bd433094614c41f5af179c
|
refs/heads/master
| 2023-03-28T00:27:54.967291
| 2021-03-30T12:01:10
| 2021-03-30T12:01:10
| 352,735,626
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 759
|
java
|
package ru.progect;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import ru.progect.musicType.MusicPlayers;
public class AppMain {
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
SpringConfig.class
);
// SingletonWater singletonWater = context.getBean("singletonWater", SingletonWater.class);
// PrototypeWater prototypeWater = context.getBean("prototypeWater", PrototypeWater.class);
//
// singletonWater.hashOut();
// prototypeWater.hashOut();
MusicPlayers musicPlayers = context.getBean("musicPlayers", MusicPlayers.class);
musicPlayers.playMusic();
}
}
|
[
"legionerus@yandex.ru"
] |
legionerus@yandex.ru
|
d9fc5b99c9f39a229a7ccd195d976aab4ec092b2
|
3c5a076e323b58cd8cee661200840ed698897484
|
/JAVA/spring/springfm-di-annotation/springfm-di-annotation/src/main/java/com/liteworm/App.java
|
8183cc600fa6a4261cfb732307853a8668fcc8e2
|
[
"Apache-2.0"
] |
permissive
|
LiteWorm/wormlearning
|
a221f6dd94004aec635ade991f44555497d5e163
|
64fd89cc53e65f264a5c134d207403c5a2565e92
|
refs/heads/master
| 2023-09-01T18:53:12.268838
| 2023-08-31T01:27:00
| 2023-08-31T01:27:00
| 249,720,611
| 0
| 1
|
Apache-2.0
| 2023-08-23T05:33:53
| 2020-03-24T13:50:29
|
Java
|
UTF-8
|
Java
| false
| false
| 175
|
java
|
package com.liteworm;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
|
[
"ly090820@gmail.com"
] |
ly090820@gmail.com
|
d95c87ae2d08c56bd2fb944fb37b057928e61588
|
4c81abdbfb3d32ca3285ce5ab74c390d63e8ed7d
|
/app/src/main/java/smart/budget/expense/base/BaseActivity.java
|
80262ce9c43eef42770017250da112025f38e482
|
[
"MIT"
] |
permissive
|
dhirajkumarsan/Expense
|
4cfceab7491511aee4df326c0952ebeae7f7a34f
|
6ead68a11d1415b83851db40537b1b38c9cc44be
|
refs/heads/master
| 2023-02-16T09:48:33.020802
| 2021-01-06T17:04:36
| 2021-01-06T17:04:36
| 325,222,834
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 293
|
java
|
package smart.budget.expense.base;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.auth.FirebaseAuth;
public class BaseActivity extends AppCompatActivity {
public String getUid() {
return FirebaseAuth.getInstance().getCurrentUser().getUid();
}
}
|
[
"bhavansharora21@gmail.com"
] |
bhavansharora21@gmail.com
|
76accde9069424c364bf7d3793303374545a89a3
|
a65ef3e98a8218ae774cbf000e6ba408abd5533a
|
/WebApp18/src/com/test/FriendDTO.java
|
3c650515a0c7fb2cedb2553796e40307fd84328d
|
[] |
no_license
|
SaeRomii/WebStudy
|
b5f510b63622a272bab228ace510ab357abbba21
|
58a37fb87d8384deeb78905214b7b610c97abaa6
|
refs/heads/main
| 2023-05-29T00:00:34.972254
| 2021-06-09T14:04:09
| 2021-06-09T14:04:09
| 362,139,361
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 773
|
java
|
/*=====================
FriendDTO.java
=====================*/
package com.test;
public class FriendDTO
{
private String userName; //-- 이름
private String userAge; //-- 나이
private String gender; //-- 성별
private String[] boys; //-- 이상형
// getter / setter
public String getUserName()
{
return userName;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserAge()
{
return userAge;
}
public void setUserAge(String userAge)
{
this.userAge = userAge;
}
public String getGender()
{
return gender;
}
public void setGender(String gender)
{
this.gender = gender;
}
public String[] getBoys()
{
return boys;
}
public void setBoys(String[] boys)
{
this.boys = boys;
}
}
|
[
"rmimimi22@gmail.com"
] |
rmimimi22@gmail.com
|
826443c5ef8e8b4235e121013c146e4a28de7878
|
d1dd0c7d2063c5a5ae50e2d944795a3e4afaeb95
|
/surefire-3.0.0-M5/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4VersionsIT.java
|
dbf087c33b3006183c45c8cf45cf2c173af8c356
|
[
"Apache-2.0"
] |
permissive
|
wessam1292/finalcertificates
|
e42945e28ce6b2f4f17c92dcc18b9b9aa1e1ed35
|
b580a23ac9f1e669041d611558b6f12369f522a3
|
refs/heads/master
| 2023-01-07T02:20:09.881872
| 2020-10-30T19:27:53
| 2020-10-30T19:27:53
| 305,834,552
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,758
|
java
|
package org.apache.maven.surefire.its;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import java.util.Collection;
import static java.util.Arrays.asList;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_0;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_1;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_10;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_11;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_12;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_13;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_2;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_3;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_3_1;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_4;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_5;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_6;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_7;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_1;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_2;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_9;
import static org.junit.runners.Parameterized.Parameters;
/**
* Basic suite test using all known versions of JUnit 4.x
*
* @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
*/
@RunWith( Parameterized.class )
public class JUnit4VersionsIT
extends SurefireJUnit4IntegrationTestCase
{
@Parameters( name = "{index}: JUnit {0}" )
public static Collection<Object[]> junitVersions()
{
return asList( new Object[][] {
{ JUNIT_4_0 },
{ JUNIT_4_1 },
{ JUNIT_4_2 },
{ JUNIT_4_3 },
{ JUNIT_4_3_1 },
{ JUNIT_4_4 },
{ JUNIT_4_5 },
{ JUNIT_4_6 },
{ JUNIT_4_7 },
{ JUNIT_4_8 },
{ JUNIT_4_8_1 },
{ JUNIT_4_8_2 },
{ JUNIT_4_9 },
{ JUNIT_4_10 },
{ JUNIT_4_11 },
{ JUNIT_4_12 },
{ JUNIT_4_13 }
} );
}
@Parameter
@SuppressWarnings( "checkstyle:visibilitymodifier" )
public JUnitVersion version;
@Test
public void testJunit()
{
version.configure( unpack() )
.executeTest()
.verifyErrorFree( 1 );
}
private SurefireLauncher unpack()
{
return unpack( "/junit4", version.toString() );
}
}
|
[
"wessam.gamal1992@gmail.com"
] |
wessam.gamal1992@gmail.com
|
80c7b29967c46c971cf3632b56fcbd54479734af
|
4da9097315831c8639a8491e881ec97fdf74c603
|
/src/StockIT-v1-release_source_from_JADX/sources/com/facebook/imagepipeline/producers/EncodedCacheKeyMultiplexProducer.java
|
82229735b5279d8783ba48e80d52ad3665eaac8e
|
[
"Apache-2.0"
] |
permissive
|
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
|
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
|
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
|
refs/heads/main
| 2023-08-11T06:17:05.659651
| 2021-10-01T08:48:06
| 2021-10-01T08:48:06
| 410,595,708
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,169
|
java
|
package com.facebook.imagepipeline.producers;
import android.util.Pair;
import com.facebook.cache.common.CacheKey;
import com.facebook.imagepipeline.cache.CacheKeyFactory;
import com.facebook.imagepipeline.image.EncodedImage;
import com.facebook.imagepipeline.request.ImageRequest;
public class EncodedCacheKeyMultiplexProducer extends MultiplexProducer<Pair<CacheKey, ImageRequest.RequestLevel>, EncodedImage> {
private final CacheKeyFactory mCacheKeyFactory;
public EncodedCacheKeyMultiplexProducer(CacheKeyFactory cacheKeyFactory, boolean z, Producer producer) {
super(producer, "EncodedCacheKeyMultiplexProducer", z);
this.mCacheKeyFactory = cacheKeyFactory;
}
/* access modifiers changed from: protected */
public Pair<CacheKey, ImageRequest.RequestLevel> getKey(ProducerContext producerContext) {
return Pair.create(this.mCacheKeyFactory.getEncodedCacheKey(producerContext.getImageRequest(), producerContext.getCallerContext()), producerContext.getLowestPermittedRequestLevel());
}
public EncodedImage cloneOrNull(EncodedImage encodedImage) {
return EncodedImage.cloneOrNull(encodedImage);
}
}
|
[
"57108396+atul-vyshnav@users.noreply.github.com"
] |
57108396+atul-vyshnav@users.noreply.github.com
|
be1e53d605349bb7e08c98ec22612c84fdb538dd
|
c45c05d217ff12403c96e1caa7f27c4e0ebe0528
|
/src/test/java/tech/blacksource/blacknectar/service/BlackNectarAssertionsTest.java
|
1c0b5a9e3b36afca59c808ec639e21257d254443
|
[
"Apache-2.0"
] |
permissive
|
BlackSourceLabs/BlackNectar-Service
|
2827705aa8f026322f6f0f52ab8b0fb4250d72e6
|
866a12638a8cca20c2f5dbc49c2d88b403bd88c5
|
refs/heads/develop
| 2021-06-18T06:05:39.558041
| 2017-04-19T15:31:30
| 2017-04-19T15:31:30
| 74,163,779
| 6
| 1
| null | 2017-04-18T20:43:40
| 2016-11-18T20:24:30
|
Java
|
UTF-8
|
Java
| false
| false
| 5,613
|
java
|
/*
* Copyright 2017 BlackSource, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package tech.blacksource.blacknectar.service;
import java.util.Arrays;
import com.google.gson.JsonObject;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import sir.wellington.alchemy.collections.sets.Sets;
import tech.blacksource.blacknectar.ebt.balance.State;
import tech.blacksource.blacknectar.ebt.balance.StateWebsiteFactory;
import tech.sirwellington.alchemy.arguments.AlchemyAssertion;
import tech.sirwellington.alchemy.arguments.FailedAssertionException;
import tech.sirwellington.alchemy.test.junit.runners.*;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.*;
import static tech.sirwellington.alchemy.generator.AlchemyGenerator.one;
import static tech.sirwellington.alchemy.test.junit.ThrowableAssertion.*;
/**
* @author SirWellington
*/
@Repeat
@RunWith(AlchemyTestRunner.class)
public class BlackNectarAssertionsTest
{
@Mock
private StateWebsiteFactory websiteFactory;
@GenerateString
private String normalString;
@GenerateString(length = BlackNectarAssertions.MAX_QUERY_PARAMETER_ARGUMENT_LENGTH * 2)
private String longString;
@GenerateEnum
private State state;
@Before
public void setUp() throws Exception
{
setupData();
setupMocks();
}
private void setupData() throws Exception
{
}
private void setupMocks() throws Exception
{
when(websiteFactory.getSupportedStates())
.thenReturn(Sets.copyOf(Arrays.asList(State.values())));
}
@DontRepeat
@Test
public void testCannotInstantiate() throws Exception
{
assertThrows(BlackNectarAssertions.class::newInstance);
}
@Test
public void testArgumentWithSaneLength() throws Exception
{
AlchemyAssertion<String> assertion = BlackNectarAssertions.argumentWithSaneLength();
assertThat(assertion, notNullValue());
assertion.check(normalString);
assertThrows(() -> assertion.check(longString)).isInstanceOf(FailedAssertionException.class);
}
@DontRepeat
@Test
public void testArgumentWithSaneLengthWithEmptyArgs() throws Exception
{
AlchemyAssertion<String> assertion = BlackNectarAssertions.argumentWithSaneLength();
//These checks should not cause an exception.
assertion.check("");
assertion.check(null);
}
@Test
public void testSupportedState() throws Exception
{
AlchemyAssertion<State> assertion = BlackNectarAssertions.supportedState(websiteFactory);
assertThat(assertion, notNullValue());
assertion.check(state);
}
@DontRepeat
@Test
public void testSupportedStateWithUnsupportedState() throws Exception
{
when(websiteFactory.getSupportedStates()).thenReturn(Sets.emptySet());
AlchemyAssertion<State> assertion = BlackNectarAssertions.supportedState(websiteFactory);
assertThat(assertion, notNullValue());
assertThrows(() -> assertion.check(state)).isInstanceOf(FailedAssertionException.class);
}
@DontRepeat
@Test
public void testSupportedStateWithBadArgs() throws Exception
{
assertThrows(() -> BlackNectarAssertions.supportedState(null))
.isInstanceOf(IllegalArgumentException.class);
}
@Test
public void testObjectWithField() throws Exception
{
String field = normalString;
String value = longString;
AlchemyAssertion<JsonObject> assertion = BlackNectarAssertions.objectWithField(field);
assertNotNull(assertion);
JsonObject object = one(BlackNectarGenerators.jsonObjects());
object.addProperty(field, value);
assertion.check(object);
}
@Test
public void testObjectWithFieldWhenDoesNotHaveObject() throws Exception
{
String field = normalString;
AlchemyAssertion<JsonObject> assertion = BlackNectarAssertions.objectWithField(field);
assertNotNull(assertion);
JsonObject object = one(BlackNectarGenerators.jsonObjects());
assertThrows(() -> assertion.check(object)).isInstanceOf(FailedAssertionException.class);
}
@DontRepeat
@Test
public void testObjectWithFieldWithBadObject() throws Exception
{
String field = normalString;
AlchemyAssertion<JsonObject> assertion = BlackNectarAssertions.objectWithField(field);
assertNotNull(assertion);
assertThrows(() -> assertion.check(null)).isInstanceOf(FailedAssertionException.class);
}
@DontRepeat
@Test
public void testObjectWithFieldWithBadArgs() throws Exception
{
assertThrows(() -> BlackNectarAssertions.objectWithField("")).isInstanceOf(IllegalArgumentException.class);
assertThrows(() -> BlackNectarAssertions.objectWithField(null)).isInstanceOf(IllegalArgumentException.class);
}
}
|
[
"jwellington.moreno@gmail.com"
] |
jwellington.moreno@gmail.com
|
eaeeefc1236afae8cf26362504dd568386d6e76b
|
900961ee56d18be726ba0a7f468281b8a1be9bc2
|
/src/main/java/it/cnr/istc/pst/platinum/ai/framework/microkernel/lang/flaw/FlawCategoryType.java
|
37037ff90beb0418344d2614a68cbc31f7f15aad
|
[
"Apache-2.0"
] |
permissive
|
pstlab/PLATINUm
|
767f77ea7405639673f26fd399e2a14dcdb511f8
|
3b949ee8312090f696e83413849e0c90f50a070a
|
refs/heads/master
| 2023-04-29T11:19:55.606724
| 2023-04-17T09:51:06
| 2023-04-17T09:51:06
| 123,152,138
| 14
| 0
|
Apache-2.0
| 2020-10-15T14:34:14
| 2018-02-27T15:54:16
|
Java
|
UTF-8
|
Java
| false
| false
| 519
|
java
|
package it.cnr.istc.pst.platinum.ai.framework.microkernel.lang.flaw;
/**
*
* @author anacleto
*
*/
public enum FlawCategoryType
{
/**
* Category of flaws that entail only planning decisions to be solved
*/
PLANNING,
/**
* Category of flaws that entail only scheduling decisions to be solved
*/
SCHEDULING,
/**
* Category of flaws that entail both planning and scheduling decisions to be solved
*/
PLANNING_SCHEDULING,
/**
* Category of flaws that cannot be solved
*/
UNSOLVABLE;
}
|
[
"umbrico.alessandro@gmail.com"
] |
umbrico.alessandro@gmail.com
|
1d5bc1566d9fa92b4fc0bf1e60590ab9ae07646a
|
811a6ae32474291f492b97e03251cce935bb2d42
|
/app/src/main/java/ch/six/sixwallet/backend/six_p2p/callbacks/SendRequestCallback.java
|
463313bef5a23d9b5ad45aa7f4dcbba58bdc98cc
|
[] |
no_license
|
paddyzab/sixwallet
|
226d356a1006f53400f2877e3761097e060156e9
|
d1a5461924b8bac7a4d5fc7ae29071e8c4f18ea4
|
refs/heads/master
| 2016-09-03T07:36:20.380669
| 2015-03-21T16:48:26
| 2015-03-21T16:48:26
| 32,590,162
| 0
| 1
| null | 2015-03-21T15:36:22
| 2015-03-20T15:02:18
|
Java
|
UTF-8
|
Java
| false
| false
| 526
|
java
|
package ch.six.sixwallet.backend.six_p2p.callbacks;
import android.util.Log;
import ch.six.sixwallet.Home;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
public class SendRequestCallback implements Callback {
@Override
public void success(Object o, Response response) {
Log.d(Home.class.getSimpleName(), response.toString());
}
@Override
public void failure(RetrofitError error) {
Log.d(Home.class.getSimpleName(), error.toString());
}
}
|
[
"patryk.zabicki@gmail.com"
] |
patryk.zabicki@gmail.com
|
11b0f215ac7bfce6ade8dc2084daa1fbefd1838c
|
c5529aaceac08cf0a929e00d33264832ed55a929
|
/eatlibrary/src/main/java/com/e_at/eatlibrary/utils/GeneralUtil.java
|
39c0b0594c41c2915cf5e474cefc424b81c7713f
|
[] |
no_license
|
codingWhenever/super_order
|
5b3c1aa71e64ac58fa5ae4bd0c096a4f5928d2e1
|
199c23d1610bb140f59360e75553191ee4109dbd
|
refs/heads/master
| 2021-08-14T10:02:30.793174
| 2017-11-15T10:00:53
| 2017-11-15T10:00:53
| 109,657,767
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 630
|
java
|
package com.e_at.eatlibrary.utils;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
public class GeneralUtil {
/**
* 获取版本名
*
* @return 当前应用的版本号
*/
public static String getVersionName(Context context) {
try {
PackageManager manager = context.getPackageManager();
PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
return info.versionName;
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
}
|
[
"136088653@qq.com"
] |
136088653@qq.com
|
90aeaf393b6abade182dd5a2e9912dffe6450a82
|
6d5cadbb452ca7be0e7b1e3d4e71fe221861ed29
|
/app/src/test/java/com/davidgh/weatherinfo/ExampleUnitTest.java
|
cb14f228f26002953512a9c7553f15639e12636a
|
[] |
no_license
|
davitgh/WeatherInfo
|
f6770546905461ca00741cee646e262e1f6b70ba
|
5d3527b806f763ddcd07bb30fc32669452a1440c
|
refs/heads/master
| 2021-05-03T04:33:28.833151
| 2018-02-07T13:35:18
| 2018-02-07T13:35:18
| 120,619,345
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 401
|
java
|
package com.davidgh.weatherinfo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"davit.ghukasyan@yahoo.com"
] |
davit.ghukasyan@yahoo.com
|
435a137212d844365f5ae06fc51a22d7d339696f
|
e76b9c328c32f3bc19148ce1b42fd2a2aea182e2
|
/src/main/java/info/smartkit/eip/obtuse_octo_prune/configs/StaticResourceConfiguration.java
|
7d3bb4080bf1bb12c5658a8bc01a045669124b60
|
[
"MIT"
] |
permissive
|
yangboz/spring-boot-elasticsearch-LIRE-docker
|
8e84a2b4743189c6f766c348a9c524b88f795693
|
70414fa7555bb00dd055ccb249067f572b3486e1
|
refs/heads/master
| 2021-07-22T07:31:23.966678
| 2017-11-01T15:21:31
| 2017-11-01T15:21:31
| 44,301,575
| 7
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,263
|
java
|
package info.smartkit.eip.obtuse_octo_prune.configs;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
public class StaticResourceConfiguration extends WebMvcConfigurerAdapter {
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
"classpath:/META-INF/resources/", "classpath:/resources/",
"classpath:/static/", "classpath:/public/"};
/**
* Add our static resources folder mapping.
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//
registry.addResourceHandler("/**").addResourceLocations(
CLASSPATH_RESOURCE_LOCATIONS);
//
registry.addResourceHandler("/uploads/**").addResourceLocations(
"classpath:/uploads/");
// Jasper report
registry.addResourceHandler("/static/**").addResourceLocations(
"classpath:/static/");
// registry.addResourceHandler("/reports/**").addResourceLocations("classpath:/reports/");
//
super.addResourceHandlers(registry);
}
}
|
[
"YoungWelle@gmail.com"
] |
YoungWelle@gmail.com
|
b71c28de89732397e11b046ddebf6b2fa4c4cce2
|
45b77c4898fff71af1604f244fe65b665cfbfb66
|
/src/main/java/com/example/web/controller/TweetController.java
|
f7932042964f895ffb10ff2156904c6a9113c39c
|
[] |
no_license
|
rokuyamad/pictweet_java
|
945f3a96984515d03c57d50cfa0b0e6265e4b546
|
874146de71feb231c1dd821972b8380c66f72a37
|
refs/heads/master
| 2021-10-10T06:02:37.572372
| 2019-01-07T13:38:09
| 2019-01-07T13:38:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,058
|
java
|
package com.example.web.controller;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.example.business.domain.Tweet;
import com.example.business.domain.User;
import com.example.business.repository.TweetRepository;
import com.example.business.repository.UserRepository;
import com.example.util.UserCustom;
@Controller
public class TweetController {
@Autowired
private TweetRepository tweetRepository;
@Autowired
private UserRepository userRepository;
@ModelAttribute(name = "login_user")
public UserDetails setLoginUser(@AuthenticationPrincipal UserDetails userDetails) {
return userDetails;
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView index(@PageableDefault(size = 5) Pageable pageable, ModelAndView mav, @AuthenticationPrincipal UserDetails userDetails) {
Page<Tweet> tweets = tweetRepository.findAllByOrderByIdDesc(pageable);
mav.addObject("tweets", tweets);
mav.addObject("login_user", userDetails);
mav.setViewName("tweet/index");
return mav;
}
@RequestMapping(value = "/tweet/new", method = RequestMethod.GET)
public ModelAndView newTweet(ModelAndView mav) {
mav.setViewName("tweet/new");
return mav;
}
@RequestMapping(value = "/tweet/new", method = RequestMethod.POST)
public ModelAndView createTweet(@ModelAttribute Tweet tweet, @AuthenticationPrincipal UserCustom userCustom , ModelAndView mav) {
User user = userRepository.findOne(userCustom.getId());
tweet.setUser(user);
tweetRepository.saveAndFlush(tweet);
mav.setViewName("tweet/create");
return mav;
}
@RequestMapping(value = "/tweet/{id}/edit", method = RequestMethod.GET)
public ModelAndView editTweet(@PathVariable("id") Long id, ModelAndView mav) {
Tweet tweet = tweetRepository.findOne(id);
mav.addObject("tweet", tweet);
mav.setViewName("tweet/edit");
return mav;
}
@RequestMapping(value = "/tweet/{id}/edit", method = RequestMethod.POST)
public ModelAndView updateTweet(@ModelAttribute Tweet editTweet, @PathVariable("id") Long id, @AuthenticationPrincipal UserCustom userCustom, ModelAndView mav) {
Tweet tweet = tweetRepository.findOne(id);
if (!tweet.getUser().getId().equals(userCustom.getId())) {
mav.setViewName("redirect:/tweet/" + id + "/edit");
return mav;
}
BeanUtils.copyProperties(editTweet, tweet);
tweetRepository.save(tweet);
mav.setViewName("tweet/update");
return mav;
}
@RequestMapping(value = "/tweet/{id}/delete", method = RequestMethod.POST)
public ModelAndView deleteTweet(@PathVariable("id") Long id, @AuthenticationPrincipal UserCustom userCustom, ModelAndView mav) {
Tweet tweet = tweetRepository.findOne(id);
if (!tweet.getUser().getId().equals(userCustom.getId())) {
mav.setViewName("redirect:/");
return mav;
}
tweetRepository.delete(tweet);
mav.setViewName("redirect:/");
return mav;
}
@RequestMapping(value = "/tweet/{id}", method = RequestMethod.GET)
ModelAndView show(@PathVariable Long id, ModelAndView mav) {
Tweet tweet = tweetRepository.findOne(id);
mav.addObject("tweet", tweet);
mav.setViewName("tweet/show");
return mav;
}
}
|
[
"dr19950228@gmail.com"
] |
dr19950228@gmail.com
|
ce94a9017be6206d736d746beb840b33ef5bc3bb
|
96c161bbc218794a1c7216af301ebcd584265ae6
|
/src/dbQuery/MySqlImageTest.java
|
de78c82d3262b7503acf2327097228c3649eff48
|
[] |
no_license
|
dpmihai/test
|
b23d57812156d174990e819be7fa878c2957b16a
|
0eab964edfc13ebd1a7179d806cb2b5e6d2772a4
|
refs/heads/master
| 2020-04-15T22:50:03.796014
| 2017-07-28T12:33:03
| 2017-07-28T12:33:03
| 6,610,594
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,464
|
java
|
package dbQuery;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MySqlImageTest {
public static Connection openConnection(String username, String password) throws SQLException {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (java.lang.ClassNotFoundException e) {
throw new SQLException("Cannot load database driver");
}
String url = "jdbc:mysql://vs511.intranet.asf.ro/nextdemo";
return DriverManager.getConnection(url, username, password);
}
public static void insertImage(Connection conn, String name, String img) {
int len;
PreparedStatement pstmt;
try {
String query = "INSERT INTO images VALUES (?, ?)";
File file = new File(img);
FileInputStream fis = new FileInputStream(file);
len = (int) file.length();
pstmt = conn.prepareStatement(query);
pstmt.setString(1, name);
pstmt.setBinaryStream(2, fis, len);
pstmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void getImageData(Connection conn, String name) {
byte[] fileBytes;
String query;
try {
query = "select image from images where name like '" + name + "'";
Statement state = conn.createStatement();
ResultSet rs = state.executeQuery(query);
if (rs.next()) {
Blob aBlob = rs.getBlob(1);
fileBytes = aBlob.getBytes(1, (int) aBlob.length());
OutputStream targetFile = new FileOutputStream("d://new.png");
targetFile.write(fileBytes);
targetFile.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Connection con = null;
try {
con = openConnection("nextuser", "zefcaHet5");
System.out.println("Connected");
insertImage(con, "Mike", "D:\\Public\\nextreports-server-os\\webapp\\images\\alarm.png");
System.out.println("Image inserted");
getImageData(con, "Mike");
System.out.println("Image read");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
|
[
"dpmihai@yahoo.com"
] |
dpmihai@yahoo.com
|
6690674ae5c3ef80222d631f95ba93534a9b4b00
|
5eea41464206cffd9aeceaadb184b5661e31a481
|
/src/test/java/features/RunFeature.java
|
7b42d19ed820c6ed3adad3fa542d7b4e84043ce3
|
[] |
no_license
|
YDanot/pandemic-bdd-12022019
|
b668dd1b74055b10e17c8e6896dd4b65e1141b89
|
494f81367ae9bcaa6f614b7a1a558b65cc036146
|
refs/heads/master
| 2020-04-22T15:14:22.792977
| 2019-02-13T08:39:29
| 2019-02-13T08:39:29
| 170,471,507
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 253
|
java
|
package features;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(strict = true,
glue = {"features"},tags = {"~@wip"}
)
public class RunFeature {
}
|
[
"yann.danot.c@thalesdigital.io"
] |
yann.danot.c@thalesdigital.io
|
337718eb0bac800bef11ef04e544dbf44e32d491
|
342ae302ac609c118a08d16097f8816fb2b66000
|
/src/main/java/com/nroad/okr/web/rest/vm/package-info.java
|
3c9e6e261cb9ae422c138255a45946fefa65dbc1
|
[] |
no_license
|
51888/okrserver
|
ee668c90c3fa553d061f4918e9985f0d33a72ec2
|
1c4478b949af20b45ca5a964ba8ee4377daa8b02
|
refs/heads/master
| 2021-08-23T07:55:37.693595
| 2017-12-04T06:54:09
| 2017-12-04T06:54:09
| 113,006,515
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 95
|
java
|
/**
* View Models used by Spring MVC REST controllers.
*/
package com.nroad.okr.web.rest.vm;
|
[
"jhipster-bot@users.noreply.github.com"
] |
jhipster-bot@users.noreply.github.com
|
4f22b6b265ae84b923e8edc545f57deec7b33237
|
c177a0815d5d5c47dd52376954081d5d4fd12bb0
|
/app/src/main/java/com/probe31/probe/sleepyapp/MODEL/InitResponse.java
|
687517dce052d5db119b142fbe1b672fd8a2a6fb
|
[] |
no_license
|
probhe31/sleepApp
|
b58247d75ec8bdf046c07e521636258a3d765522
|
23c63aa559a1a4fde764657d438bb6b594d43530
|
refs/heads/master
| 2020-03-23T04:22:07.100032
| 2018-07-21T16:12:03
| 2018-07-21T16:12:03
| 141,079,087
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 732
|
java
|
package com.probe31.probe.sleepyapp.MODEL;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class InitResponse {
@SerializedName("status")
@Expose
private int status ;
@SerializedName("status_label")
@Expose
private String status_label;
@SerializedName("sleep_hour")
@Expose
private String sleep_hour;
@SerializedName("message")
@Expose
private String message;
public int getStatus() {
return status;
}
public String getStatus_label() {
return status_label;
}
public String getSleep_hour() {
return sleep_hour;
}
public String getMessage() {
return message;
}
}
|
[
"bheer31@gmail.com"
] |
bheer31@gmail.com
|
1b68fbaffff4a00dd52ed75cc478ff7037f8a396
|
5ab0ba8af9dbdff39a880a5fa9da2cc2ee8ac915
|
/SEblog/src/com/DAO/UserStat.java
|
057c727416c31b38e10a2c4060235f6bf5fce232
|
[] |
no_license
|
ffflyteam/SEBlog
|
7bdc9c1eed0b9716ee9cdfe95809bafeb6ae2ac5
|
e5e98f241e3544128ba61e04d2348477d4986299
|
refs/heads/master
| 2020-05-16T12:05:05.025850
| 2019-06-16T14:43:01
| 2019-06-16T14:43:01
| 178,838,440
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 212
|
java
|
package com.DAO;
public enum UserStat {
NORMAL(0), //正常使用中
BE_FROZEN(1), //被冻结
;
private int id;
private UserStat(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
|
[
"1012246892@qq.com"
] |
1012246892@qq.com
|
56ee06f3fc3605d613635d7fe029feabd009e0f7
|
977bc9c6bcf97364015de2dffa99c42306e422d7
|
/src/AnnotationTest/AnnotationLogic.java
|
643e4203d53432373978485c6a3c8144f1ab70b5
|
[] |
no_license
|
MeiChen26/LeetcodeTest
|
e6911047d34ee4c1b227d0d503118f76867822ea
|
85466f48c1ca935a0a21c15a1fbba22243b523a9
|
refs/heads/master
| 2021-02-07T20:23:01.427744
| 2020-03-23T04:31:07
| 2020-03-23T04:31:07
| 244,073,074
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 657
|
java
|
package AnnotationTest;
import java.lang.reflect.Method;
public class AnnotationLogic {
public static void annotationLogic() {
Class useAnnotationClass = UseAnnotation.class;
for(Method method : useAnnotationClass.getMethods()) {
SimpleAnnotation simpleAnnotation = (SimpleAnnotation)method.getAnnotation(SimpleAnnotation.class);
if(simpleAnnotation != null) {
System.out.println(" Method Name : " + method.getName());
System.out.println(" value : " + simpleAnnotation.value());
System.out.println(" --------------------------- ");
}
}
}
}
|
[
"meitong@meitongdeMacBook-Pro.local"
] |
meitong@meitongdeMacBook-Pro.local
|
5699a72fb1d8852633df5988fba54012d4e1bf45
|
e64a9ff88c950ca4a3fc7179b965c458302dec72
|
/app/src/main/java/DetectionService.java
|
e6ae6a81140631994be36399e8aaaac1191a2840
|
[] |
no_license
|
mupacif/gmaps
|
2943ec5b46c1f4bd02c787d9edfc6e2d4d21e79a
|
b71125eefcaa157219ad157892063b1704aba0e8
|
refs/heads/master
| 2021-01-22T18:34:06.029846
| 2017-03-15T15:58:04
| 2017-03-15T15:58:04
| 85,093,455
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 639
|
java
|
import android.app.IntentService;
import android.content.Intent;
import android.nfc.Tag;
import com.google.android.gms.location.ActivityRecognition;
import com.google.android.gms.location.ActivityRecognitionResult;
import com.google.android.gms.location.GeofencingEvent;
/**
* Created by student on 15-03-17.
*/
public class DetectionService extends IntentService {
public final static String Tag = "detected_is";
public DetectionService()
{
super(Tag);
}
@Override
public void onCreate() {
super.onCreate();
}
@Override
protected void onHandleIntent(Intent intent) {
}
}
|
[
"student@bt-training.be"
] |
student@bt-training.be
|
c7b690a11da71000281fe0e8c50b6ef0162c11b6
|
7991248e6bccacd46a5673638a4e089c8ff72a79
|
/base/common/src/main/java/org/artifactory/request/ResponseWithStatusHolderMapper.java
|
353da81e81c519ce722ea828071213c08f96697f
|
[] |
no_license
|
theoriginalshaheedra/artifactory-oss
|
69b7f6274cb35c79db3a3cd613302de2ae019b31
|
415df9a9467fee9663850b4b8b4ee5bd4c23adeb
|
refs/heads/master
| 2023-04-23T15:48:36.923648
| 2021-05-05T06:15:24
| 2021-05-05T06:15:24
| 364,455,815
| 1
| 0
| null | 2021-05-05T07:11:40
| 2021-05-05T03:57:33
|
Java
|
UTF-8
|
Java
| false
| false
| 1,501
|
java
|
/*
*
* Artifactory is a binaries repository manager.
* Copyright (C) 2018 JFrog Ltd.
*
* Artifactory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Artifactory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Artifactory. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.artifactory.request;
import org.apache.http.HttpStatus;
import org.artifactory.common.StatusHolder;
/**
* Only maps exceptions in case there is no status code inside the status holder
*
* @author Shay Yaakov
*/
public class ResponseWithStatusHolderMapper extends ResponseStatusCodesMapper {
private StatusHolder statusHolder;
public ResponseWithStatusHolderMapper(StatusHolder statusHolder) {
this.statusHolder = statusHolder;
}
@Override
public int getStatusCode(Throwable e) {
int statusCode = statusHolder.getStatusCode();
if (statusCode != HttpStatus.SC_INTERNAL_SERVER_ERROR) {
return statusCode;
}
return super.getStatusCode(e);
}
}
|
[
"david.monichi@gmail.com"
] |
david.monichi@gmail.com
|
b1453c4e3c42610bb1d623c26ec7af1b181f50b5
|
94aced6041168236c183e3c5129f150b03899cbd
|
/src/test/java/helpers/Helpers.java
|
8875c38937e453e4e06b44fb2a7309eead899885
|
[] |
no_license
|
jdmaury94/qaAutomationCarnival
|
8568a979a58d568e8d87c4103024c8e8682e04a5
|
95da40aee26def27b770cf8591a7a19fefbfd8a8
|
refs/heads/master
| 2020-09-25T07:28:16.233549
| 2019-12-04T21:00:44
| 2019-12-04T21:00:44
| 225,948,688
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,805
|
java
|
package helpers;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import java.util.ArrayList;
import java.util.List;
public class Helpers {
public int formatStringToNumber(String string){
return Integer.parseInt(string.substring(2,5));
}
public boolean checkSortedList(List<Integer> pricesList) {
for(int i=0;i<pricesList.size()-1;i++){
if(pricesList.get(i)>pricesList.get(i+1))
return false;
}
return true;
}
public void sendKeysNTimes(int minPrice, int maxPrice, WebElement minBtn, WebElement maxBtn, WebDriver driver){
Actions move = new Actions(driver);
int timesToRight = (minPrice - 400)/10;
int timesToLeft = (800 - maxPrice)/10;
System.out.println(timesToRight);
System.out.println(timesToLeft);
minBtn.click();
for(int i = 1;i<=timesToRight;i++){
move.sendKeys(Keys.ARROW_RIGHT).build().perform();
}
maxBtn.click();
for(int i = 1;i<=timesToLeft;i++){
move.sendKeys(Keys.ARROW_LEFT).build().perform();
}
}
public List<String> getResultsIds(WebDriver driver){
List<String> cruisesIds = new ArrayList<>();
List<WebElement> results = driver.findElements(By.className("vrg-search-unit"));
for (WebElement result : results) {
cruisesIds.add(result.getAttribute("data-itinerary-uuid"));
}
System.out.println(cruisesIds);
return cruisesIds;
}
public int randomIndex(List<String> uuids){
int random = (int)Math.floor(Math.random()*(uuids.size()));
return random;
}
}
|
[
"jdmaury94@gmail.com"
] |
jdmaury94@gmail.com
|
965abb5b828b269200370361bf443efbf722c40e
|
2eb567cb893850bec197ead1491f3e802cff93e6
|
/java-se-samples/base/src/main/java/apibase/common/DoubleTest.java
|
6cc93296ff5a66e9b129988e9ecf2042325e45b3
|
[] |
no_license
|
doubleview/java-awesome-demo
|
4ca9971f01ab7b3be6fbefb76f9a7d8c78de0ed0
|
983491df02bf9c83978cbec83b93d1a68b1b2275
|
refs/heads/master
| 2022-12-22T10:12:26.250184
| 2021-07-25T05:58:22
| 2021-07-25T05:58:22
| 96,692,018
| 0
| 0
| null | 2022-12-16T09:52:49
| 2017-07-09T15:07:56
|
Java
|
UTF-8
|
Java
| false
| false
| 351
|
java
|
package apibase.common;
public class DoubleTest {
public static void main(String args[]) {
System.out.println("0.05 + 0.01 = " + (0.05 + 0.01));
System.out.println("1.0 - 0.42 = " + (1.0 - 0.42));
System.out.println("4.015 * 100 = " + (4.015 * 100));
System.out.println("123.3 / 100 = " + (123.3 / 100));
}
}
|
[
"doubleview@163.com"
] |
doubleview@163.com
|
c73fd9c021e409dd14b7a7a47a5de55a1c51b0f1
|
144f75c44a30ac458268123e349ae5d4de766275
|
/server/src/main/java/me/noos/worker/RatingServlet.java
|
47d38962939d28c22647bcaeb35bc254b48cc684
|
[] |
no_license
|
charlesbihis/noos
|
9b5096cdadac9b648cbea261454980876e46c47a
|
90ce9128d43c0d3dc100c0f362ea4a413173273a
|
refs/heads/master
| 2020-05-30T12:07:06.754706
| 2012-12-16T04:10:20
| 2012-12-16T04:10:20
| 7,187,090
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,666
|
java
|
package me.noos.worker;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import me.noos.engine.recommendation.collaborative.data.BaseDataset;
import me.noos.engine.recommendation.collaborative.data.DiggData;
import me.noos.engine.recommendation.collaborative.data.RatingBuilder;
import me.noos.engine.recommendation.collaborative.model.Item;
import me.noos.engine.recommendation.collaborative.model.Rating;
import me.noos.engine.recommendation.collaborative.model.User;
import me.noos.engine.recommendation.collaborative.recommender.DiggDelphi;
import me.noos.engine.recommendation.content.rss.DiggStoryItem;
import me.noos.model.Model;
public class RatingServlet extends HttpServlet {
private static final long serialVersionUID = -2691763071179461336L;
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Model model = Model.getInstance();
String username = req.getParameter("user");
String itemIdString = req.getParameter("itemid");
String ratingString = req.getParameter("rating");
int itemId = Integer.parseInt(itemIdString);
int ratingValue = Integer.parseInt(ratingString);
// get our dataset
BaseDataset ds = model.getDataset();
if (ds == null) {
ds = DiggData.loadData("king5_stories.csv");
model.setDataset(ds);
}
// consult the oracle
DiggDelphi delphi = model.getDelphi();
if (delphi == null) {
delphi = new DiggDelphi(ds);
model.setDelphi(delphi);
}
// identify our user
List<User> users = new ArrayList<User>(ds.getUsers());
User user = ds.getUser(1); // shouldn't initialize like this, but doing for demo
for (User u : users) {
if (u.getName().toLowerCase().equals(username)) {
user = u;
}
}
// find the story
Item item = ds.getItem(1); // ditto - shouldn't initialize like this, but doing for demo
for (Item i : ds.getItems()) {
if (i.getId() == itemId) {
item = i;
}
}
Rating rating = new Rating(user.getId(), item.getId(), ratingValue);
rating.setItem(item);
user.addRating(rating);
ds.add(user);
user.addUserContent(item.getItemContent());
System.out.println("User \"" + user.getName() + "\" submitted a rating of value " + rating.getRating() + " for story \"" + item.getName() + "\"");
}
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
}
}
|
[
"charles@whoischarles.com"
] |
charles@whoischarles.com
|
d4ee5e264c215efff129c588bbb4c022597fa7e6
|
47eb777cb6bd21fa48287f5fd998f8e4ec5c7f06
|
/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/LogAggregationService.java
|
315f28cf05514c510c29545a1d9dd0274a606480
|
[
"CDDL-1.1",
"LicenseRef-scancode-protobuf",
"BSD-3-Clause",
"BSD-2-Clause-Views",
"EPL-1.0",
"LicenseRef-scancode-unknown-license-reference",
"CDDL-1.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"Classpath-exception-2.0",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"GCC-exception-3.1",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain",
"CC-PDDC",
"LicenseRef-scancode-unknown"
] |
permissive
|
qtt-bigdata/hadoop
|
55f0d9df970b2e98388fe3b480a028157d59fa4f
|
ebb348814fb49967cd33ad604d6fa4c4f3f5146c
|
refs/heads/qtt-2.6.0-5.16.1
| 2023-01-22T01:16:51.642516
| 2019-06-28T02:20:28
| 2019-06-28T02:20:28
| 177,924,762
| 0
| 2
|
Apache-2.0
| 2023-01-02T21:54:53
| 2019-03-27T05:34:46
|
Java
|
UTF-8
|
Java
| false
| false
| 20,055
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.PrivilegedExceptionAction;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileContext;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.service.AbstractService;
import org.apache.hadoop.util.concurrent.HadoopExecutors;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.LogAggregationContext;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.event.Dispatcher;
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
import org.apache.hadoop.yarn.logaggregation.ContainerLogsRetentionPolicy;
import org.apache.hadoop.yarn.logaggregation.LogAggregationUtils;
import org.apache.hadoop.yarn.server.nodemanager.Context;
import org.apache.hadoop.yarn.server.nodemanager.DeletionService;
import org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationEvent;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationEventType;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerAppFinishedEvent;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerAppStartedEvent;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerContainerFinishedEvent;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
public class LogAggregationService extends AbstractService implements
LogHandler {
private static final Log LOG = LogFactory
.getLog(LogAggregationService.class);
/*
* Expected deployment TLD will be 1777, owner=<NMOwner>, group=<NMGroup -
* Group to which NMOwner belongs> App dirs will be created as 770,
* owner=<AppOwner>, group=<NMGroup>: so that the owner and <NMOwner> can
* access / modify the files.
* <NMGroup> should obviously be a limited access group.
*/
/**
* Permissions for the top level directory under which app directories will be
* created.
*/
private static final FsPermission TLDIR_PERMISSIONS = FsPermission
.createImmutable((short) 01777);
/**
* Permissions for the Application directory.
*/
private static final FsPermission APP_DIR_PERMISSIONS = FsPermission
.createImmutable((short) 0770);
private final Context context;
private final DeletionService deletionService;
private final Dispatcher dispatcher;
private LocalDirsHandlerService dirsHandler;
Path remoteRootLogDir;
String remoteRootLogDirSuffix;
private NodeId nodeId;
private final ConcurrentMap<ApplicationId, AppLogAggregator> appLogAggregators;
@VisibleForTesting
ExecutorService threadPool;
public LogAggregationService(Dispatcher dispatcher, Context context,
DeletionService deletionService, LocalDirsHandlerService dirsHandler) {
super(LogAggregationService.class.getName());
this.dispatcher = dispatcher;
this.context = context;
this.deletionService = deletionService;
this.dirsHandler = dirsHandler;
this.appLogAggregators =
new ConcurrentHashMap<ApplicationId, AppLogAggregator>();
}
protected void serviceInit(Configuration conf) throws Exception {
this.remoteRootLogDir =
new Path(conf.get(YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
YarnConfiguration.DEFAULT_NM_REMOTE_APP_LOG_DIR));
this.remoteRootLogDirSuffix =
conf.get(YarnConfiguration.NM_REMOTE_APP_LOG_DIR_SUFFIX,
YarnConfiguration.DEFAULT_NM_REMOTE_APP_LOG_DIR_SUFFIX);
int threadPoolSize = getAggregatorThreadPoolSize(conf);
this.threadPool = HadoopExecutors.newFixedThreadPool(threadPoolSize,
new ThreadFactoryBuilder()
.setNameFormat("LogAggregationService #%d")
.build());
super.serviceInit(conf);
}
@Override
protected void serviceStart() throws Exception {
// NodeId is only available during start, the following cannot be moved
// anywhere else.
this.nodeId = this.context.getNodeId();
super.serviceStart();
}
@Override
protected void serviceStop() throws Exception {
LOG.info(this.getName() + " waiting for pending aggregation during exit");
stopAggregators();
super.serviceStop();
}
private void stopAggregators() {
threadPool.shutdown();
// if recovery on restart is supported then leave outstanding aggregations
// to the next restart
boolean shouldAbort = context.getNMStateStore().canRecover()
&& !context.getDecommissioned();
// politely ask to finish
for (AppLogAggregator aggregator : appLogAggregators.values()) {
if (shouldAbort) {
aggregator.abortLogAggregation();
} else {
aggregator.finishLogAggregation();
}
}
while (!threadPool.isTerminated()) { // wait for all threads to finish
for (ApplicationId appId : appLogAggregators.keySet()) {
LOG.info("Waiting for aggregation to complete for " + appId);
}
try {
if (!threadPool.awaitTermination(30, TimeUnit.SECONDS)) {
threadPool.shutdownNow(); // send interrupt to hurry them along
}
} catch (InterruptedException e) {
LOG.warn("Aggregation stop interrupted!");
break;
}
}
for (ApplicationId appId : appLogAggregators.keySet()) {
LOG.warn("Some logs may not have been aggregated for " + appId);
}
}
protected FileSystem getFileSystem(Configuration conf) throws IOException {
return this.remoteRootLogDir.getFileSystem(conf);
}
void verifyAndCreateRemoteLogDir(Configuration conf) {
// Checking the existence of the TLD
FileSystem remoteFS = null;
try {
remoteFS = getFileSystem(conf);
} catch (IOException e) {
throw new YarnRuntimeException("Unable to get Remote FileSystem instance", e);
}
boolean remoteExists = true;
try {
FsPermission perms =
remoteFS.getFileStatus(this.remoteRootLogDir).getPermission();
if (!perms.equals(TLDIR_PERMISSIONS)) {
LOG.warn("Remote Root Log Dir [" + this.remoteRootLogDir
+ "] already exist, but with incorrect permissions. "
+ "Expected: [" + TLDIR_PERMISSIONS + "], Found: [" + perms
+ "]." + " The cluster may have problems with multiple users.");
}
} catch (FileNotFoundException e) {
remoteExists = false;
} catch (IOException e) {
throw new YarnRuntimeException(
"Failed to check permissions for dir ["
+ this.remoteRootLogDir + "]", e);
}
if (!remoteExists) {
LOG.warn("Remote Root Log Dir [" + this.remoteRootLogDir
+ "] does not exist. Attempting to create it.");
try {
Path qualified =
this.remoteRootLogDir.makeQualified(remoteFS.getUri(),
remoteFS.getWorkingDirectory());
remoteFS.mkdirs(qualified, new FsPermission(TLDIR_PERMISSIONS));
remoteFS.setPermission(qualified, new FsPermission(TLDIR_PERMISSIONS));
UserGroupInformation loginUser = UserGroupInformation.getLoginUser();
String primaryGroupName = null;
try {
primaryGroupName = loginUser.getPrimaryGroupName();
} catch (IOException e) {
LOG.warn("No primary group found. The remote root log directory" +
" will be created with the HDFS superuser being its group " +
"owner. JobHistoryServer may be unable to read the directory.");
}
// set owner on the remote directory only if the primary group exists
if (primaryGroupName != null) {
remoteFS.setOwner(qualified,
loginUser.getShortUserName(), primaryGroupName);
}
} catch (IOException e) {
throw new YarnRuntimeException("Failed to create remoteLogDir ["
+ this.remoteRootLogDir + "]", e);
}
}
}
Path getRemoteNodeLogFileForApp(ApplicationId appId, String user) {
return LogAggregationUtils.getRemoteNodeLogFileForApp(
this.remoteRootLogDir, appId, user, this.nodeId,
this.remoteRootLogDirSuffix);
}
Path getRemoteAppLogDir(ApplicationId appId, String user) {
return LogAggregationUtils.getRemoteAppLogDir(this.remoteRootLogDir, appId,
user, this.remoteRootLogDirSuffix);
}
private void createDir(FileSystem fs, Path path, FsPermission fsPerm)
throws IOException {
FsPermission dirPerm = new FsPermission(fsPerm);
fs.mkdirs(path, dirPerm);
FsPermission umask = FsPermission.getUMask(fs.getConf());
if (!dirPerm.equals(dirPerm.applyUMask(umask))) {
fs.setPermission(path, new FsPermission(fsPerm));
}
}
private boolean checkExists(FileSystem fs, Path path, FsPermission fsPerm)
throws IOException {
boolean exists = true;
try {
FileStatus appDirStatus = fs.getFileStatus(path);
if (!APP_DIR_PERMISSIONS.equals(appDirStatus.getPermission())) {
fs.setPermission(path, APP_DIR_PERMISSIONS);
}
} catch (FileNotFoundException fnfe) {
exists = false;
}
return exists;
}
protected void createAppDir(final String user, final ApplicationId appId,
UserGroupInformation userUgi) {
try {
userUgi.doAs(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
try {
// TODO: Reuse FS for user?
FileSystem remoteFS = getFileSystem(getConfig());
// Only creating directories if they are missing to avoid
// unnecessary load on the filesystem from all of the nodes
Path appDir = LogAggregationUtils.getRemoteAppLogDir(
LogAggregationService.this.remoteRootLogDir, appId, user,
LogAggregationService.this.remoteRootLogDirSuffix);
appDir = appDir.makeQualified(remoteFS.getUri(),
remoteFS.getWorkingDirectory());
if (!checkExists(remoteFS, appDir, APP_DIR_PERMISSIONS)) {
Path suffixDir = LogAggregationUtils.getRemoteLogSuffixedDir(
LogAggregationService.this.remoteRootLogDir, user,
LogAggregationService.this.remoteRootLogDirSuffix);
suffixDir = suffixDir.makeQualified(remoteFS.getUri(),
remoteFS.getWorkingDirectory());
if (!checkExists(remoteFS, suffixDir, APP_DIR_PERMISSIONS)) {
Path userDir = LogAggregationUtils.getRemoteLogUserDir(
LogAggregationService.this.remoteRootLogDir, user);
userDir = userDir.makeQualified(remoteFS.getUri(),
remoteFS.getWorkingDirectory());
if (!checkExists(remoteFS, userDir, APP_DIR_PERMISSIONS)) {
createDir(remoteFS, userDir, APP_DIR_PERMISSIONS);
}
createDir(remoteFS, suffixDir, APP_DIR_PERMISSIONS);
}
createDir(remoteFS, appDir, APP_DIR_PERMISSIONS);
}
} catch (IOException e) {
LOG.error("Failed to setup application log directory for "
+ appId, e);
throw e;
}
return null;
}
});
} catch (Exception e) {
throw new YarnRuntimeException(e);
}
}
@SuppressWarnings("unchecked")
private void initApp(final ApplicationId appId, String user,
Credentials credentials, ContainerLogsRetentionPolicy logRetentionPolicy,
Map<ApplicationAccessType, String> appAcls,
LogAggregationContext logAggregationContext) {
ApplicationEvent eventResponse;
try {
verifyAndCreateRemoteLogDir(getConfig());
initAppAggregator(appId, user, credentials, logRetentionPolicy, appAcls,
logAggregationContext);
eventResponse = new ApplicationEvent(appId,
ApplicationEventType.APPLICATION_LOG_HANDLING_INITED);
} catch (YarnRuntimeException e) {
LOG.warn("Application failed to init aggregation", e);
eventResponse = new ApplicationEvent(appId,
ApplicationEventType.APPLICATION_LOG_HANDLING_FAILED);
}
this.dispatcher.getEventHandler().handle(eventResponse);
}
FileContext getLocalFileContext(Configuration conf) {
try {
return FileContext.getLocalFSFileContext(conf);
} catch (IOException e) {
throw new YarnRuntimeException("Failed to access local fs");
}
}
protected void initAppAggregator(final ApplicationId appId, String user,
Credentials credentials, ContainerLogsRetentionPolicy logRetentionPolicy,
Map<ApplicationAccessType, String> appAcls,
LogAggregationContext logAggregationContext) {
// Get user's FileSystem credentials
final UserGroupInformation userUgi =
UserGroupInformation.createRemoteUser(user);
if (credentials != null) {
userUgi.addCredentials(credentials);
}
// New application
final AppLogAggregator appLogAggregator =
new AppLogAggregatorImpl(this.dispatcher, this.deletionService,
getConfig(), appId, userUgi, this.nodeId, dirsHandler,
getRemoteNodeLogFileForApp(appId, user), logRetentionPolicy,
appAcls, logAggregationContext, this.context,
getLocalFileContext(getConfig()));
if (this.appLogAggregators.putIfAbsent(appId, appLogAggregator) != null) {
throw new YarnRuntimeException("Duplicate initApp for " + appId);
}
// wait until check for existing aggregator to create dirs
YarnRuntimeException appDirException = null;
try {
// Create the app dir
createAppDir(user, appId, userUgi);
} catch (Exception e) {
appLogAggregator.disableLogAggregation();
if (!(e instanceof YarnRuntimeException)) {
appDirException = new YarnRuntimeException(e);
} else {
appDirException = (YarnRuntimeException)e;
}
appLogAggregators.remove(appId);
closeFileSystems(userUgi);
throw appDirException;
}
// TODO Get the user configuration for the list of containers that need log
// aggregation.
// Schedule the aggregator.
Runnable aggregatorWrapper = new Runnable() {
public void run() {
try {
appLogAggregator.run();
} finally {
appLogAggregators.remove(appId);
closeFileSystems(userUgi);
}
}
};
this.threadPool.execute(aggregatorWrapper);
}
protected void closeFileSystems(final UserGroupInformation userUgi) {
try {
FileSystem.closeAllForUGI(userUgi);
} catch (IOException e) {
LOG.warn("Failed to close filesystems: ", e);
}
}
// for testing only
@Private
int getNumAggregators() {
return this.appLogAggregators.size();
}
private void stopContainer(ContainerId containerId, int exitCode) {
// A container is complete. Put this containers' logs up for aggregation if
// this containers' logs are needed.
AppLogAggregator aggregator = this.appLogAggregators.get(
containerId.getApplicationAttemptId().getApplicationId());
if (aggregator == null) {
LOG.warn("Log aggregation is not initialized for " + containerId
+ ", did it fail to start?");
return;
}
aggregator.startContainerLogAggregation(containerId, exitCode == 0);
}
@SuppressWarnings("unchecked")
private void stopApp(ApplicationId appId) {
// App is complete. Finish up any containers' pending log aggregation and
// close the application specific logFile.
AppLogAggregator aggregator = this.appLogAggregators.get(appId);
if (aggregator == null) {
LOG.warn("Log aggregation is not initialized for " + appId
+ ", did it fail to start?");
this.dispatcher.getEventHandler().handle(
new ApplicationEvent(appId,
ApplicationEventType.APPLICATION_LOG_HANDLING_FAILED));
return;
}
aggregator.finishLogAggregation();
}
@Override
public void handle(LogHandlerEvent event) {
switch (event.getType()) {
case APPLICATION_STARTED:
LogHandlerAppStartedEvent appStartEvent =
(LogHandlerAppStartedEvent) event;
initApp(appStartEvent.getApplicationId(), appStartEvent.getUser(),
appStartEvent.getCredentials(),
appStartEvent.getLogRetentionPolicy(),
appStartEvent.getApplicationAcls(),
appStartEvent.getLogAggregationContext());
break;
case CONTAINER_FINISHED:
LogHandlerContainerFinishedEvent containerFinishEvent =
(LogHandlerContainerFinishedEvent) event;
stopContainer(containerFinishEvent.getContainerId(),
containerFinishEvent.getExitCode());
break;
case APPLICATION_FINISHED:
LogHandlerAppFinishedEvent appFinishedEvent =
(LogHandlerAppFinishedEvent) event;
stopApp(appFinishedEvent.getApplicationId());
break;
default:
; // Ignore
}
}
@VisibleForTesting
public ConcurrentMap<ApplicationId, AppLogAggregator> getAppLogAggregators() {
return this.appLogAggregators;
}
@VisibleForTesting
public NodeId getNodeId() {
return this.nodeId;
}
private int getAggregatorThreadPoolSize(Configuration conf) {
int threadPoolSize;
try {
threadPoolSize = conf.getInt(YarnConfiguration
.NM_LOG_AGGREGATION_THREAD_POOL_SIZE,
YarnConfiguration.DEFAULT_NM_LOG_AGGREGATION_THREAD_POOL_SIZE);
} catch (NumberFormatException ex) {
LOG.warn("Invalid thread pool size. Setting it to the default value " +
"in YarnConfiguration");
threadPoolSize = YarnConfiguration.
DEFAULT_NM_LOG_AGGREGATION_THREAD_POOL_SIZE;
}
if(threadPoolSize <= 0) {
LOG.warn("Invalid thread pool size. Setting it to the default value " +
"in YarnConfiguration");
threadPoolSize = YarnConfiguration.
DEFAULT_NM_LOG_AGGREGATION_THREAD_POOL_SIZE;
}
return threadPoolSize;
}
}
|
[
"zhengyafei@innotechx.com"
] |
zhengyafei@innotechx.com
|
790f7f4a0bba3d21165945c86e0be37ac389a850
|
7a0fcd986daafa6329f118986d3ebdf52a1ec525
|
/app/src/test/java/com/example/zengwei/curve/ExampleUnitTest.java
|
1bd7ae4a945d0518db1cba91f8afda28d4759a47
|
[] |
no_license
|
cbdgit/Curve
|
5240c77c308f43e789fd75483925ea6639bc35a4
|
a0d566c26c30a26105bc4f1864a7d988505d808b
|
refs/heads/master
| 2020-04-13T18:48:42.264176
| 2018-08-17T09:39:48
| 2018-08-17T09:39:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 403
|
java
|
package com.example.zengwei.curve;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"13085486819@163.com"
] |
13085486819@163.com
|
64b98d65f6f3da09fb3781e4f7697e244300f00e
|
80b69edf29f51d34cee8b2e8a5956e4a82a8bff1
|
/codesnipt/com/kalllx/code/util/NumberDetect.java
|
50b2830d0fc4f51467422b5a3d158a92a7c71685
|
[
"MIT"
] |
permissive
|
kalllx/codesnipt
|
850b155b78af71d796af982d686c4aa5f3820378
|
a4d78912c82c07c5011808ec5161475f293d50ab
|
refs/heads/master
| 2016-09-06T06:18:07.923316
| 2014-03-20T10:26:46
| 2014-03-20T10:26:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 690
|
java
|
package com.kalllx.code.util;
public class NumberDetect {
public static void main(String[] args) {
String str1="1122.2.2";
String str2="111";
String str3="111.2";
String str4="111s";
String str5="111.s";
String str6="1s11";
System.out.println(str1+":"+isNum(str1));
System.out.println(str2+":"+isNum(str2));
System.out.println(str3+":"+isNum(str3));
System.out.println(str4+":"+isNum(str4));
System.out.println(str5+":"+isNum(str5));
System.out.println(str6+":"+isNum(str6));
}
public static boolean isNum(String str){
//return str.matches("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$");
return str.matches("^([0-9]+)$");
}
}
|
[
"kalllx@yahoo.cn"
] |
kalllx@yahoo.cn
|
074573013a2ba904887b9a559f894685946c8d25
|
ec9ea88075728c82d1ecb026d846294e87092887
|
/src/main/java/com/algaworks/brewer/model/Pedido.java
|
c9b8e5be9b7968846541dac4ed505fca7a3608fe
|
[] |
no_license
|
Beleboni/spring-project
|
f4d6a6fa60253ea32198c65640dee436faa4bd20
|
e4bfb4411caa86679422583963efd7fb277e5e4d
|
refs/heads/master
| 2021-01-13T05:23:47.336037
| 2017-05-08T01:47:01
| 2017-05-08T01:47:01
| 81,392,941
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,350
|
java
|
package com.algaworks.brewer.model;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.DynamicUpdate;
@Entity
@Table(name = "pedido")
@DynamicUpdate
public class Pedido {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long codigo;
@Column(name = "data_criacao")
private LocalDateTime dataCriacao;
@Column(name = "valor_total")
private BigDecimal valorTotal = BigDecimal.ZERO;
private String observacao;
@ManyToOne
@JoinColumn(name = "codigo_cliente")
private Cliente cliente;
@ManyToOne
@JoinColumn(name = "codigo_usuario")
private Usuario usuario;
@ManyToOne
@JoinColumn(name = "codigo_representada")
private Representada representada;
@ManyToOne
@JoinColumn(name = "codigo_banco")
private Banco banco;
@Enumerated(EnumType.STRING)
private StatusVenda status = StatusVenda.ORCAMENTO;
@OneToMany(mappedBy = "pedido", cascade = CascadeType.ALL, orphanRemoval = true)
private List<ItemPedido> itens = new ArrayList<>();
@Transient
private String uuid;
public boolean isNovo() {
return codigo == null;
}
public Long getCodigo() {
return codigo;
}
public void setCodigo(Long codigo) {
this.codigo = codigo;
}
public LocalDateTime getDataCriacao() {
return dataCriacao;
}
public void setDataCriacao(LocalDateTime dataCriacao) {
this.dataCriacao = dataCriacao;
}
public BigDecimal getValorTotal() {
return valorTotal;
}
public void setValorTotal(BigDecimal valorTotal) {
this.valorTotal = valorTotal;
}
public String getObservacao() {
return observacao;
}
public void setObservacao(String observacao) {
this.observacao = observacao;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public StatusVenda getStatus() {
return status;
}
public void setStatus(StatusVenda status) {
this.status = status;
}
public List<ItemPedido> getItens() {
return itens;
}
public void setItens(List<ItemPedido> itens) {
this.itens = itens;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public boolean isNova() {
return codigo == null;
}
public void adicionarItens(List<ItemPedido> itens) {
this.itens = itens;
this.itens.forEach(i -> i.setPedido(this));
}
public BigDecimal getValorTotalItens() {
return getItens().stream()
.map(ItemPedido::getValorTotal)
.reduce(BigDecimal::add)
.orElse(BigDecimal.ZERO);
}
public void calcularValorTotal() {
this.valorTotal = calcularValorTotal(getValorTotalItens());
}
public Long getDiasCriacao() {
LocalDate inicio = dataCriacao != null ? dataCriacao.toLocalDate() : LocalDate.now();
return ChronoUnit.DAYS.between(inicio, LocalDate.now());
}
public boolean isSalvarPermitido() {
return !status.equals(StatusVenda.CANCELADA);
}
public boolean isSalvarProibido() {
return !isSalvarPermitido();
}
private BigDecimal calcularValorTotal(BigDecimal valorTotalItens) {
BigDecimal valorTotal = valorTotalItens;
return valorTotal;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((codigo == null) ? 0 : codigo.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Pedido other = (Pedido) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
return false;
return true;
}
}
|
[
"fernando.beleboni@hotmail.com"
] |
fernando.beleboni@hotmail.com
|
20256d7ce6ba53e3d891ac7e085c17e9e7d7ba1e
|
5dd9a978e06a37a31c9d1f94e7aa3c35bda90254
|
/src/main/java/pl/maciejd/ws/TestRunWS.java
|
470177e2b1029458369112165d2ab46955c50392
|
[] |
no_license
|
maciejd/greenfield-jee
|
dc91c6f7c1f4217bb38f8018c864121fe0864e05
|
64885aa7ebd6ec7d71f5c168517367c11ffd135d
|
refs/heads/master
| 2020-07-27T02:06:17.138947
| 2016-11-14T13:14:00
| 2016-11-14T13:14:00
| 73,705,313
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,121
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pl.maciejd.ws;
import javax.ejb.EJBTransactionRolledbackException;
import javax.inject.Inject;
import javax.jws.WebService;
import javax.ws.rs.NotFoundException;
import pl.maciejd.ejb.facades.TestRunWSFacade;
import pl.maciejd.model.TestSuite;
/**
*
* @author Maciej
*/
@WebService(endpointInterface = "pl.maciejd.ws.TestRunWsSEI")
public class TestRunWS implements TestRunWsSEI {
@Inject
TestRunWSFacade trfa;
@Override
public void createTestRun(Long suiteId, String name) throws Exception {
TestSuite suite = null;
try {
suite = trfa.findSuite(suiteId);
if (suite == null) {
throw new NotFoundException("Suite with given ID does not exist");
}
} catch (EJBTransactionRolledbackException e2) {
throw new IllegalArgumentException("Suite ID must be an integer");
}
trfa.createRun(suite, name);
}
}
|
[
"maciej.dobrowolski@atos.net"
] |
maciej.dobrowolski@atos.net
|
414392dc70bbfa846d38f59f04e528db1271b6aa
|
6d40a559ca0f874ae7ac922a19b5aaac8dec2e93
|
/src/main/java/ch/uzh/seal/BLogDiff/model/rest/Job.java
|
a0b22d1bc3166ac3abd4580ddd6155cd05553372
|
[] |
no_license
|
noahch/blogdiff
|
a4cfcd07fd308c9dedeafd7d3e5be0df7e1094b9
|
c19e9bf5824935ddd607c5cf2b93c4de215036f0
|
refs/heads/master
| 2022-11-28T15:08:42.672199
| 2019-07-30T15:54:20
| 2019-07-30T15:54:20
| 184,011,057
| 0
| 0
| null | 2022-11-16T11:48:42
| 2019-04-29T06:16:37
|
Java
|
UTF-8
|
Java
| false
| false
| 1,004
|
java
|
package ch.uzh.seal.BLogDiff.model.rest;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@JsonIgnoreProperties(ignoreUnknown = true)
@ToString
public class Job {
@Getter
@Setter
private Long id;
@Getter
@Setter
private String state;
@Getter
@Setter
private Repository repository;
@Getter
@Setter
private Build build;
@Getter
@Setter
private String number;
@Getter
@Setter
@JsonProperty("finished_at")
private String finishedAt;
@JsonIgnore
public int getNumberAsInt(){
if(number != null){
String[] nbrs = number.split("\\.");
return Integer.valueOf(nbrs[nbrs.length-1]);
}else{
return -1;
}
}
@Getter
@Setter
private boolean parsedSuccessfully;
}
|
[
"noah.chavannes@gmail.com"
] |
noah.chavannes@gmail.com
|
4bfc270e3dfc044f017d0ee6d3d0a6b1ca6e9186
|
fab79c220c6175ba553c94c4d176959469589219
|
/src/main/java/nc/block/tile/generator/BlockFusionCore.java
|
01f3c599670dc5073d1903ec5f611e2f6c78d4ed
|
[
"CC0-1.0"
] |
permissive
|
remclave/NuclearCraft
|
bf155280583ef4667a7dea60832264bf24909198
|
e873333ad22c0918515376c246a6b0b906aa920a
|
refs/heads/master
| 2020-03-25T08:56:26.322487
| 2018-06-15T15:44:01
| 2018-06-15T15:44:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,155
|
java
|
package nc.block.tile.generator;
import nc.block.tile.BlockInventory;
import nc.block.tile.IActivatable;
import nc.config.NCConfig;
import nc.init.NCBlocks;
import nc.proxy.CommonProxy;
import nc.tile.generator.TileFusionCore;
import nc.util.BlockPosHelper;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFusionCore extends BlockInventory implements IActivatable {
public BlockFusionCore() {
super("fusion_core", Material.IRON);
setCreativeTab(CommonProxy.TAB_FUSION);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileFusionCore();
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return new AxisAlignedBB(-1.0F, 0.0F, -1.0F, 2.0F, 3.0F, 2.0F);
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
public boolean canPlaceBlockAt(World world, BlockPos pos) {
BlockPosHelper helper = new BlockPosHelper(pos);
for (BlockPos blockPos : helper.cuboid(-1, 0, -1, 1, 2, 1)) if (!(isAir(world, blockPos))) return false;
return true;
}
@Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
super.onBlockAdded(world, pos, state);
BlockPosHelper helper = new BlockPosHelper(pos);
for (BlockPos blockPos : helper.squareRing(1, 0)) setSide(world, blockPos);
for (BlockPos blockPos : helper.cuboid(-1, 1, -1, 1, 1, 1)) setSide(world, blockPos);
for (BlockPos blockPos : helper.cuboid(-1, 2, -1, 1, 2, 1)) setTop(world, blockPos);
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
BlockPosHelper helper = new BlockPosHelper(pos);
for (BlockPos blockPos : helper.squareRing(1, 0)) setAir(world, blockPos);
for (BlockPos blockPos : helper.cuboid(-1, 1, -1, 1, 2, 1)) setAir(world, blockPos);
world.removeTileEntity(pos);
}
private boolean isAir(World world, BlockPos pos) {
Material mat = world.getBlockState(pos).getMaterial();
return mat == Material.AIR || mat == Material.FIRE || mat == Material.WATER || mat == Material.VINE || mat == Material.SNOW;
}
private void setAir(World world, BlockPos pos) {
world.destroyBlock(pos, false);
}
private void setSide(World world, BlockPos pos) {
IBlockState dummy = NCBlocks.fusion_dummy_side.getDefaultState();
world.setBlockState(pos, dummy);
}
private void setTop(World world, BlockPos pos) {
IBlockState dummy = NCBlocks.fusion_dummy_top.getDefaultState();
world.setBlockState(pos, dummy);
}
@Override
public void setState(boolean active, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
keepInventory = true;
world.setBlockState(pos, NCBlocks.fusion_core.getDefaultState(), 3);
keepInventory = false;
if (tile != null) {
tile.validate();
world.setTileEntity(pos, tile);
}
}
@Override
public boolean hasComparatorInputOverride(IBlockState state) {
return true;
}
@Override
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileFusionCore) {
TileFusionCore core = (TileFusionCore) tile;
double strength = core.getAlternateComparator() ? (double)core.heat/core.getMaxHeat() : (double)core.efficiency/(double)NCConfig.fusion_comparator_max_efficiency;
return (int) MathHelper.clamp(15D*strength, 0, 15);
}
return Container.calcRedstone(world.getTileEntity(pos));
}
}
|
[
"joedodd35@gmail.com"
] |
joedodd35@gmail.com
|
794719462b35219e36d5d9b363db1258968f2b24
|
1b351ae881eec2382ced71d5e696e17df62e079e
|
/src/main/java/com/ATeam/twoDotFiveD/server/gameClientHandler.java
|
c226e337bbce22cb143081c5dac62bcc2049b2a4
|
[] |
no_license
|
Mitsugaru/TwoDotFiveD
|
1d5b07dfeb45b089e241b78f4ca391c385743ef3
|
ef14a0de2c95e171a24e214286a00b756d8d068a
|
refs/heads/master
| 2021-01-19T08:46:06.979538
| 2012-04-22T00:30:40
| 2012-04-22T00:30:40
| 3,261,232
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 440
|
java
|
package com.ATeam.twoDotFiveD.server;
import java.net.DatagramPacket;
import java.net.InetAddress;
public class gameClientHandler {
private InetAddress address;
private int port;
public void set(InetAddress anAddress, int aPort){
address=anAddress;
port=aPort;
}
public DatagramPacket message(byte[] data){
return new DatagramPacket(data, data.length, address, port);
}
public boolean active() {
return address!=null;
}
}
|
[
"jwadd001@gmail.com"
] |
jwadd001@gmail.com
|
97dc6f94c345630bd001328c75ae1ec8a2b814da
|
d1e4d358f739f8f63b2b7e10d3c2f7a56c490568
|
/app/src/main/java/com/bnsantos/fyber/adapters/OfferViewHolder.java
|
7b49f234705f21750cfe822c9223d3141ccfb340
|
[
"Apache-2.0"
] |
permissive
|
bnsantos/fyber-demo
|
3d073c200eb50b282f5e13f483231c617d04c107
|
eb98df13c64de52b0b1d5e7c6f6929c820f5b767
|
refs/heads/master
| 2016-08-11T20:26:09.501196
| 2015-11-22T21:29:04
| 2015-11-22T21:29:04
| 46,625,763
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,512
|
java
|
package com.bnsantos.fyber.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bnsantos.fyber.R;
import com.bnsantos.fyber.model.Offer;
import com.bnsantos.fyber.model.Thumbnail;
import com.squareup.picasso.Picasso;
/**
* Created by bruno on 21/11/15.
*/
public class OfferViewHolder extends RecyclerView.ViewHolder {
private final TextView title;
private final TextView teaser;
private final ImageView thumbnail;
public OfferViewHolder(View itemView) {
super(itemView);
title = (TextView) itemView.findViewById(R.id.title);
teaser = (TextView) itemView.findViewById(R.id.teaser);
thumbnail = (ImageView) itemView.findViewById(R.id.thumbnail);
}
public void bind(Context context, Offer offer) {
title.setText(offer.getTitle());
teaser.setText(offer.getTeaser());
Thumbnail thumb = offer.getThumbnail();
if (thumb != null) {
if (thumb.getHires() != null) {
Picasso.with(context).load(thumb.getHires()).fit().into(thumbnail);
} else if (thumb.getLowres() != null) {
Picasso.with(context).load(thumb.getLowres()).fit().into(thumbnail);
} else {
thumbnail.setImageResource(R.drawable.fyber);
}
} else {
thumbnail.setImageResource(R.drawable.fyber);
}
}
}
|
[
"brunonascimentosantos@gmail.com"
] |
brunonascimentosantos@gmail.com
|
2ec5c71e00b54815165f7850d98a61495daee0af
|
a9b274fa9510171ad5b389a318a2b3a73b0b0655
|
/src/main/java/com/test/weather/weather/config/RedisConfig.java
|
224d7e942fdfebb75c558b013df2fddb51193ec4
|
[] |
no_license
|
lukehanabi/weather
|
258ce0ff00f9a80a33f89e0d019eba491d740b93
|
b4f446c56c0ea47408e31f84b88cae92cde298f9
|
refs/heads/master
| 2020-04-20T14:44:15.648940
| 2019-02-03T04:26:40
| 2019-02-03T04:26:40
| 168,908,307
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 879
|
java
|
package com.test.weather.weather.config;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
@Configuration
@EnableCaching
@PropertySource("classpath:application.properties")
public class RedisConfig {
@Bean
JedisConnectionFactory jedisConnectionFactory() {
return new JedisConnectionFactory();
}
@Bean
public RedisTemplate<String, Object> redisTemplate() {
RedisTemplate<String, Object> template = new RedisTemplate<>();
template.setConnectionFactory(jedisConnectionFactory());
return template;
}
}
|
[
"lucas.luduena@gmail.com"
] |
lucas.luduena@gmail.com
|
ea09926eb5d18ecc866a76fcfb8ad44a5c291d50
|
d16eaadf146fe636f6607068f1dd853489a3f64a
|
/src/main/java/com/ynyes/kjxjr/entity/TdOrder.java
|
00e936feba97458055d583cb70bf80c31c1bb91d
|
[] |
no_license
|
nieshr/xjr
|
ce824b7183634d1d72970d6082221e85e73a8dfe
|
70ba60c262055d1b75f30a2b386fe67970da5e19
|
refs/heads/master
| 2021-01-10T07:10:13.758215
| 2015-12-31T10:13:36
| 2015-12-31T10:13:36
| 43,426,501
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 13,646
|
java
|
package com.ynyes.kjxjr.entity;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 订单
*
* 记录了订单详情
*
* @author Sharon
*
*/
@Entity
public class TdOrder {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
// 订单号
@Column(unique=true)
private String orderNumber;
// 订单商品
@OneToMany
@JoinColumn(name="tdOrderId")
private List<TdOrderGoods> orderGoodsList;
//车牌
@Column
private String carCode;
//车型
@Column
private String carType;
// 收货地址
@Column
private String shippingAddress;
// 收货人
@Column
private String shippingName;
// 收货电话
@Column
private String shippingPhone;
// 邮政编码
@Column
private String postalCode;
// 支付方式(线下同盟店)
@Column
private Long shopId;
// 支付方式名称(同盟店名称)
@Column
private String shopTitle;
// 支付方式
@Column
private Long payTypeId;
// 支付方式名称
@Column
private String payTypeTitle;
// 支付方式手续费
@Column(scale=2)
private Double payTypeFee;
// 配送方式
@Column
private Long deliverTypeId;
// 配送方式名称
@Column
private String deliverTypeTitle;
// 配送方式名称
@Column(scale=2)
private Double deliverTypeFee;
// 快递公司
@Column
private String expressCampany;
// 快递单号
@Column
private String expressNumber;
// 快递详情查询接口
@Column
private String expressUri;
// 用户留言备注
@Column
private String userRemarkInfo;
// 后台备注
@Column
private String remarkInfo;
// 是否索要发票
@Column
private Boolean isNeedInvoice;
// 发票抬头
@Column
private String invoiceTitle;
// 发票内容
@Column
private String invoiceContent;
// 发票类型
@Column
private String invoiceType;
// 预约服务时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date appointmentTime;
// 下单时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date orderTime;
// 取消时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
// 确认时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date checkTime;
// 付款时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date payTime;
// 付尾款时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date payLeftTime;
// 配送时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date deliveryTime;
// 服务时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date serviceTime;
// 收货时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date receiveTime;
// 评价时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date commentTime;
// 完成时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date finishTime;
// 订单状态 2:待付款 3:待付尾款 4:待服务 5:待评价 6: 已完成 7: 已取消 8: 支付取消(失败) 9: 已删除
@Column
private Long statusId;
// 订单取消原因
@Column
private String cancelReason;
// 用户
@Column
private String username;
// 发货时间
@Column
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date sendTime;
// 配货人
@Column
private String deliveryPerson;
// 配送人
@Column
private String distributionPerson;
// 收款人
@Column
private String moneyReceivePerson;
// 商品总金额
@Column(scale=2)
private Double totalGoodsPrice;
// 订单总金额
@Column(scale=2)
private Double totalPrice;
// 订单尾款总金额,有些订单需付尾款
@Column(scale=2)
private Double totalLeftPrice;
// 排序号
@Column
private Long sortId;
// 使用积分数
@Column
private Long pointUse;
// 可获取积分
@Column
private Long points;
// 是否在线付款
@Column
private Boolean isOnlinePay;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOrderNumber() {
return orderNumber;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public List<TdOrderGoods> getOrderGoodsList() {
return orderGoodsList;
}
public void setOrderGoodsList(List<TdOrderGoods> orderGoodsList) {
this.orderGoodsList = orderGoodsList;
}
public String getShippingAddress() {
return shippingAddress;
}
public void setShippingAddress(String shippingAddress) {
this.shippingAddress = shippingAddress;
}
public String getShippingName() {
return shippingName;
}
public void setShippingName(String shippingName) {
this.shippingName = shippingName;
}
public String getShippingPhone() {
return shippingPhone;
}
public void setShippingPhone(String shippingPhone) {
this.shippingPhone = shippingPhone;
}
public Long getPayTypeId() {
return payTypeId;
}
public void setPayTypeId(Long payTypeId) {
this.payTypeId = payTypeId;
}
public String getPayTypeTitle() {
return payTypeTitle;
}
public void setPayTypeTitle(String payTypeTitle) {
this.payTypeTitle = payTypeTitle;
}
public Double getPayTypeFee() {
return payTypeFee;
}
public void setPayTypeFee(Double payTypeFee) {
this.payTypeFee = payTypeFee;
}
public String getDeliverTypeTitle() {
return deliverTypeTitle;
}
public void setDeliverTypeTitle(String deliverTypeTitle) {
this.deliverTypeTitle = deliverTypeTitle;
}
public Long getDeliverTypeId() {
return deliverTypeId;
}
public void setDeliverTypeId(Long deliverTypeId) {
this.deliverTypeId = deliverTypeId;
}
public Double getDeliverTypeFee() {
return deliverTypeFee;
}
public void setDeliverTypeFee(Double deliverTypeFee) {
this.deliverTypeFee = deliverTypeFee;
}
public String getUserRemarkInfo() {
return userRemarkInfo;
}
public void setUserRemarkInfo(String userRemarkInfo) {
this.userRemarkInfo = userRemarkInfo;
}
public String getRemarkInfo() {
return remarkInfo;
}
public void setRemarkInfo(String remarkInfo) {
this.remarkInfo = remarkInfo;
}
public Boolean getIsNeedInvoice() {
return isNeedInvoice;
}
public void setIsNeedInvoice(Boolean isNeedInvoice) {
this.isNeedInvoice = isNeedInvoice;
}
public String getInvoiceTitle() {
return invoiceTitle;
}
public void setInvoiceTitle(String invoiceTitle) {
this.invoiceTitle = invoiceTitle;
}
public String getInvoiceContent() {
return invoiceContent;
}
public void setInvoiceContent(String invoiceContent) {
this.invoiceContent = invoiceContent;
}
public String getInvoiceType() {
return invoiceType;
}
public void setInvoiceType(String invoiceType) {
this.invoiceType = invoiceType;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public Date getCheckTime() {
return checkTime;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Date getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(Date deliveryTime) {
this.deliveryTime = deliveryTime;
}
public Date getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(Date receiveTime) {
this.receiveTime = receiveTime;
}
public Date getFinishTime() {
return finishTime;
}
public void setFinishTime(Date finishTime) {
this.finishTime = finishTime;
}
public Long getStatusId() {
return statusId;
}
public void setStatusId(Long statusId) {
this.statusId = statusId;
}
public String getCancelReason() {
return cancelReason;
}
public void setCancelReason(String cancelReason) {
this.cancelReason = cancelReason;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getExpressCampany() {
return expressCampany;
}
public void setExpressCampany(String expressCampany) {
this.expressCampany = expressCampany;
}
public String getExpressNumber() {
return expressNumber;
}
public void setExpressNumber(String expressNumber) {
this.expressNumber = expressNumber;
}
public String getExpressUri() {
return expressUri;
}
public void setExpressUri(String expressUri) {
this.expressUri = expressUri;
}
public Date getSendTime() {
return sendTime;
}
public void setSendTime(Date sendTime) {
this.sendTime = sendTime;
}
public String getDeliveryPerson() {
return deliveryPerson;
}
public void setDeliveryPerson(String deliveryPerson) {
this.deliveryPerson = deliveryPerson;
}
public String getDistributionPerson() {
return distributionPerson;
}
public void setDistributionPerson(String distributionPerson) {
this.distributionPerson = distributionPerson;
}
public String getMoneyReceivePerson() {
return moneyReceivePerson;
}
public void setMoneyReceivePerson(String moneyReceivePerson) {
this.moneyReceivePerson = moneyReceivePerson;
}
public Double getTotalGoodsPrice() {
return totalGoodsPrice;
}
public void setTotalGoodsPrice(Double totalGoodsPrice) {
this.totalGoodsPrice = totalGoodsPrice;
}
public Double getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(Double totalPrice) {
this.totalPrice = totalPrice;
}
public Long getSortId() {
return sortId;
}
public void setSortId(Long sortId) {
this.sortId = sortId;
}
public Long getPoints() {
return points;
}
public void setPoints(Long points) {
this.points = points;
}
public Boolean getIsOnlinePay() {
return isOnlinePay;
}
public void setIsOnlinePay(Boolean isOnlinePay) {
this.isOnlinePay = isOnlinePay;
}
public Date getCancelTime() {
return cancelTime;
}
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
public Date getCommentTime() {
return commentTime;
}
public void setCommentTime(Date commentTime) {
this.commentTime = commentTime;
}
public Long getPointUse() {
return pointUse;
}
public void setPointUse(Long pointUse) {
this.pointUse = pointUse;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public String getShopTitle() {
return shopTitle;
}
public void setShopTitle(String shopTitle) {
this.shopTitle = shopTitle;
}
public Date getAppointmentTime() {
return appointmentTime;
}
public void setAppointmentTime(Date appointmentTime) {
this.appointmentTime = appointmentTime;
}
public String getCarCode() {
return carCode;
}
public void setCarCode(String carCode) {
this.carCode = carCode;
}
public String getCarType() {
return carType;
}
public void setCarType(String carType) {
this.carType = carType;
}
public Double getTotalLeftPrice() {
return totalLeftPrice;
}
public void setTotalLeftPrice(Double totalLeftPrice) {
this.totalLeftPrice = totalLeftPrice;
}
public Date getPayLeftTime() {
return payLeftTime;
}
public void setPayLeftTime(Date payLeftTime) {
this.payLeftTime = payLeftTime;
}
public Date getServiceTime() {
return serviceTime;
}
public void setServiceTime(Date serviceTime) {
this.serviceTime = serviceTime;
}
}
|
[
"125540670@qq.com"
] |
125540670@qq.com
|
43609e3a339e51be8b7e6fae354fd124897ba36e
|
834940f2650709bc252ea48a80d63c99f3033011
|
/src/service/com/cyberup/service/course/CourseKemService.java
|
5699d756a3dbc25076f873646a420dcd267957e5
|
[] |
no_license
|
yoonjinseok/cuinfo
|
a802cd1d38f923c5b6e71eea92f86ee9d5fb4dc4
|
4acf4ec1c120d534ec124c6b8181008c5a92743d
|
refs/heads/master
| 2023-01-04T07:40:05.314756
| 2020-11-02T17:11:51
| 2020-11-02T17:11:51
| 309,440,573
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,189
|
java
|
package com.cyberup.service.course;
import java.lang.reflect.Method;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.cyberup.dao.course.CourseKemDao;
import com.cyberup.dao.course.CourseKemLongDao;
import com.cyberup.dao.course.MetaDicDao;
import com.cyberup.model.course.CollectionType;
import com.cyberup.model.course.Course;
import com.cyberup.model.course.MetaDic;
import common.Logger;
@Service
@Transactional
public class CourseKemService {
private Logger logger = Logger.getLogger(CourseKemService.class);
@Autowired
private CourseKemDao courseKemDao;
@Autowired
private CourseKemLongDao courseKemLongDao;
@Autowired
private MetaDicDao metaDicDao;
public void insertInfo(Integer courseId, Integer collTypeId, Integer metadicId, String kemVal) {
if("Y".equals(metaDicDao.selectInfo(metadicId).getLongYn()))
this.courseKemLongDao.insertInfo(courseId, collTypeId, metadicId, kemVal);
else
this.courseKemDao.insertInfo(courseId, collTypeId, metadicId, kemVal);
}
public int deleteInfo(Integer courseId, Integer collTypeId, Integer metadicId) {
return this.courseKemDao.deleteInfo(courseId, collTypeId, metadicId);
}
public int deleteList(Integer courseId, String collType, Integer collTypeId) {
return this.courseKemDao.deleteList(courseId, collType, collTypeId);
}
public void updateInfo(Integer courseId, Integer collTypeId, Integer metadicId, String kemVal)
{
if("Y".equals(metaDicDao.selectInfo(metadicId).getLongYn()))
this.courseKemLongDao.updateInfo(courseId, collTypeId, metadicId, kemVal);
else
this.courseKemDao.updateInfo(courseId, collTypeId, metadicId, kemVal);
}
public void construct(Integer courseId, Integer collTypeId, Course course)
{
List<MetaDic> list = metaDicDao.selectList(CollectionType.COURSE.getValue());
for(int i = 0; i < list.size(); i++)
{
if(list.get(i).getElement().equals("regDate")
|| list.get(i).getElement().equals("modDate")
|| list.get(i).getElement().equals("delDate"))
continue;
Object val = "";
try {
Method method = course.getClass().getMethod("get" + StringUtils.capitalize(list.get(i).getElement()));
val = method.invoke(course);
} catch (Exception e) {
if(list.get(i).getElement().equals("identifier"))
val = course.getCourseIdentifier();
else if(list.get(i).getElement().equals("grantAll"))
val = course.getPublicYn();
else if(list.get(i).getElement().startsWith("departmentcode"))
val = course.getDepartmentId();
else if(list.get(i).getElement().startsWith("grad"))
val = course.getGradYear();
else if(list.get(i).getElement().startsWith("gradth"))
val = course.getGradSemester();
else if(list.get(i).getElement().startsWith("termyear"))
val = course.getTermYear();
else if(list.get(i).getElement().startsWith("termth"))
val = course.getTermSemester();
else if(list.get(i).getElement().startsWith("startdate"))
val = course.getSvcStart();
else if(list.get(i).getElement().startsWith("enddate"))
val = course.getSvcEnd();
else
logger.error(list.get(i).getElement() + "("+val+") : " + e.getMessage(), e);
}
if("Y".equals(list.get(i).getLongYn()))
this.courseKemLongDao.insertInfo(courseId, collTypeId, list.get(i).getMetadicId(), String.valueOf(val));
else
this.courseKemDao.insertInfo(courseId, collTypeId, list.get(i).getMetadicId(), String.valueOf(val));
}
}
public void demolish(Integer courseId, String collType, Integer collTypeId)
{
this.courseKemDao.deleteList(courseId, collType, collTypeId);
this.courseKemLongDao.deleteList(courseId, collType, collTypeId);
}
public void deleteNotIn(Integer courseId, String collType, String[] collTypeIds)
{
this.courseKemDao.deleteNotIn(courseId, collType, collTypeIds);
this.courseKemLongDao.deleteNotIn(courseId, collType, collTypeIds);
}
}
|
[
"jsyoon@kotech.co.kr"
] |
jsyoon@kotech.co.kr
|
cd01582a4e5ccaf31b29766723bf47df7cb93d1b
|
91a950c8641f415c275bde20a1f9744bab4c7a74
|
/src/test/java/com/dbs/weather/weatherservice/WeatherserviceApplicationTests.java
|
998197002c358e2f0eb2318ca52656e20cf02555
|
[] |
no_license
|
sst2k2/weatherservice
|
3636556f15546398040ba8e9e0439117689ae652
|
68413a27bea3d85efd14dc651b85fa246c6f79a7
|
refs/heads/master
| 2020-09-01T04:19:00.174479
| 2019-10-31T23:48:13
| 2019-10-31T23:48:13
| 218,878,530
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,104
|
java
|
package com.dbs.weather.weatherservice;
import com.dbs.weather.controller.WeatherController;
import com.dbs.weather.entities.ForecastEntity;
import com.dbs.weather.repository.WeatherRepository;
import com.dbs.weather.service.MapInfoRetrieverImpl;
import org.junit.Before;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.client.ExpectedCount;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.web.client.RestTemplate;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
class WeatherserviceApplicationTests {
@Autowired
private WeatherController weatherController;
@Autowired
private MockMvc mockMvc;
@Autowired
private WeatherRepository repository;
@Value("map.base.url")
private String mapQuestUrl;
@Test
public void contextLoads() throws Exception{
assertThat(weatherController).isNotNull();
assertThat(repository).isNotNull();
}
@Test
public void shouldReturnDefaultMessage() throws Exception{
this.mockMvc.perform(get("/weather")).andExpect(status().isOk());
}
@Test
public void checkMongoDbConnection() throws Exception{
assertThat(repository.findAll()).isNotEmpty();
}
}
|
[
"shushantgotmare90@gmail.com"
] |
shushantgotmare90@gmail.com
|
81eafbc46fc7197eb7959f0d365b3e67014e7d8e
|
2b2fb797deec885ceb6104d6a12460ee906cfa7d
|
/backend/src/main/java/com/vlad/backend/dto/OurRecipeDTO.java
|
03f4c14f4cce5ca8c7fdfe1832897126b77d2096
|
[] |
no_license
|
iluczvlad/vlad_repo
|
8f6fdb90d248cec12a98b11d5fa2a46831f36bd1
|
c222775bcdd4b2d78a118b94289bc8d6335176f7
|
refs/heads/master
| 2022-12-10T16:55:17.805972
| 2019-05-30T14:45:58
| 2019-05-30T14:45:58
| 141,588,100
| 0
| 0
| null | 2022-12-09T04:59:37
| 2018-07-19T14:03:40
|
Vue
|
UTF-8
|
Java
| false
| false
| 618
|
java
|
package com.vlad.backend.dto;
import java.util.List;
public class OurRecipeDTO {
private Long id;
private String name;
private List<IngredientDTO> ingredients;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<IngredientDTO> getIngredients() {
return ingredients;
}
public void setIngredients(List<IngredientDTO> ingredients) {
this.ingredients = ingredients;
}
}
|
[
"iluczvlad@gmail.com"
] |
iluczvlad@gmail.com
|
a0930860ddeec1c461e0ec8a03f3ca7560bdc291
|
33b7f43d96f76971b16edf23fa872ceca2c2d24c
|
/Java/RepasoSegundoParcial/Ej7/Library.java
|
4ecd34353c30445a0b42f4c0a7508ed62a9cd629
|
[] |
no_license
|
pdomins/POO
|
077f856f896c57489f85d9491190dab6fa02e366
|
14d73b43f53123b0ab09f34ebfc3c2d6ad6e6664
|
refs/heads/master
| 2022-12-18T22:22:36.751302
| 2020-09-15T12:42:12
| 2020-09-15T12:42:12
| 286,754,222
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,441
|
java
|
package ar.itba.edu.POO.RepasoSegundoParcial.Ej7;
import java.time.LocalDate;
import java.util.*;
public class Library {
Map<String, BookInfo> bookMap = new HashMap<>();
Map<Clients, Loan> loans = new HashMap<>();
public Library addBook(String title, int stock){
bookMap.put(title, new BookInfo(title,stock));
return this;
}
public void borrowBook(Clients client, String bookTitle, LocalDate date) {
if (!bookMap.containsKey(bookTitle)){
throw new IllegalArgumentException("Book not found");
}
bookMap.get(bookTitle).borrowBook();
loans.put(client, new Loan(client, bookTitle,date));
}
public void printDueLoansBooks(LocalDate date) {
System.out.println("Due loans at "+ date.toString());
Set<Clients> loanClients = loans.keySet();
for (Clients client : loanClients){
if (date.isAfter(loans.get(client).getDate().plusDays(loans.get(client).getClient().getLoanTime()))){
System.out.println(client.getName()+" ("+loans.get(client).getBookTitle()+" - "+loans.get(client).getDate()+")");
}
}
System.out.println();
}
public void returnBook(Clients client) {
Loan returning = loans.remove(client);
if (returning == null){
throw new IllegalArgumentException();
}
bookMap.get(returning.getBookTitle()).returnBook();
}
}
|
[
"pdomingues@itba.edu.ar"
] |
pdomingues@itba.edu.ar
|
95ffbaf3d0fc8736b3c08363055fd3de260b4bed
|
b5b024e463f5cd3e3c4b693687cb9c787f16a168
|
/remote-diagnosis-service/src/main/java/com/remote/diagnosis/service/domain/BaseDomain.java
|
2b9908bc7451beda230cd33d78ba78749ecdaaac
|
[] |
no_license
|
xiaoweibianchen/remote-diagnosis
|
99f6947cec73d1dfa48c0bf72943edcb8a5aff1f
|
6d827f4de1f276a6f30c091edb063bcc60487a6d
|
refs/heads/master
| 2020-12-03T03:43:20.384340
| 2017-08-27T10:21:23
| 2017-08-27T10:21:23
| 95,765,357
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 958
|
java
|
package com.remote.diagnosis.service.domain;
import java.io.Serializable;
import java.util.Date;
public class BaseDomain implements Serializable {
private String created;
private Date createdDate;
private String modified;
private Date modifiedDate;
public String getCreated() {
return created;
}
public void setCreated(String created) {
this.created = created;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public String getModified() {
return modified;
}
public void setModified(String modified) {
this.modified = modified;
}
public Date getModifiedDate() {
return modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
}
|
[
"liwei14@JRA4W42B273012.JDJR.360buyAD.local"
] |
liwei14@JRA4W42B273012.JDJR.360buyAD.local
|
78f08abac3f542daae843eddef7721f1167b0ab6
|
49f1893292bab017c3e29babfcdf0d3086996e1f
|
/app/src/main/java/br/com/movies_tek/data/db/Converters.java
|
8a48898a14112f2195de881ec84b339fd9f057d9
|
[] |
no_license
|
ksdrof500/movies
|
4897b6483d0054cba8547833c54c28e7c39a84af
|
c3a71542c86d23057633dc6080c3e4bf894d06fe
|
refs/heads/master
| 2020-03-27T18:40:50.581438
| 2019-04-22T23:00:33
| 2019-04-22T23:00:33
| 146,936,676
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 488
|
java
|
package br.com.movies_tek.data.db;
import android.arch.persistence.room.TypeConverter;
import java.util.Date;
public class Converters {
@TypeConverter
public static Date fromTimestamp(Long value) {
if (value == null) {
return new Date(0L);
}
return new Date(value);
}
@TypeConverter
public static Long toTimestamp(Date date) {
if (date == null) {
return 0L;
}
return date.getTime();
}
}
|
[
"filipenunes.developer@gmail.com"
] |
filipenunes.developer@gmail.com
|
7c7924672b79c9d7d2455149884d92d501669d88
|
ca93d74d71f5d992f03ec8b79b5b5fe08aac4f5f
|
/src/main/java/com/hengyun/service/patient/SNMacRelationService.java
|
a13d1d228914f6cfde90d7962a8ef560af888019
|
[] |
no_license
|
jarvisxiong/dev
|
29d2445d89f97b385218d14d74700c5f026f8dac
|
ceeefde8d2e15f9d246ff700428583e0721d0d52
|
refs/heads/master
| 2021-01-01T06:55:52.363282
| 2016-07-07T06:22:09
| 2016-07-07T06:22:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 413
|
java
|
package com.hengyun.service.patient;
import com.hengyun.domain.patient.SNMacRelation;
import com.hengyun.service.BaseService;
/**
* @author bob E-mail:panbaoan@thealth.cn
* @version 创建时间:2016年5月13日 下午4:53:40
* 类说明
*/
public interface SNMacRelationService extends BaseService<SNMacRelation,Integer>{
public void add(SNMacRelation snMacRelation);
public String getSN(String mac);
}
|
[
"bob@thealth.cn"
] |
bob@thealth.cn
|
e5de8ea2608ec86dd1758777a10b55f80aba535a
|
ba4b3f72c53eb80f7cc52e93348032dd352c686e
|
/MyLib/src/org/me/mylib/LibClass.java
|
0c25edbb2192c4f2c52f2aaad4b8023d1a902c41
|
[] |
no_license
|
Jerek426/HomeWork1
|
2e6dff9fe730f0f26541774d993e0f8a6b11bf81
|
8c88df71be7dbadf868e8efba8cb126d58036025
|
refs/heads/master
| 2021-01-19T03:24:12.162418
| 2013-02-08T02:48:33
| 2013-02-08T02:48:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 541
|
java
|
package org.me.mylib;
/**
*
* @author Devon Dimone
*/
public class LibClass
{
/**
*
* @param args
* @return
*/
public static String acrostic(String[] args)
{
StringBuffer b = new StringBuffer();
for (int i = 0; i < args.length; i++)
{
if (args[i].length() > i)
{
b.append(args[i].charAt(i));
}
else
{
b.append('?');
}
}
return b.toString();
}
}
|
[
"you@example.com"
] |
you@example.com
|
b0af261ce2c753a1946ad2e29df93d33d5982317
|
179e0ec445a1223b44a3600665ee5d4a5d9609f1
|
/NeverQuit/src/main/java/wdMethods/WdMethods.java
|
551908024a4c9713fe328e8c30b405dd0ec8d5b5
|
[] |
no_license
|
HarishDasyam/GitProject
|
443988ee8eb7edc3bff5c5bcc7f4aa0cae977ae3
|
94d77fb06d79fe88c6a932044737a997c17fc549
|
refs/heads/master
| 2021-08-07T14:52:47.851471
| 2020-04-19T13:05:40
| 2020-04-19T13:05:40
| 157,100,894
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,078
|
java
|
package wdMethods;
import java.net.MalformedURLException;
import org.openqa.selenium.ElementNotVisibleException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
public interface WdMethods {
/**
* This method will launch the Any browser and
* maximise the browser and set the wait for 30 seconds
* and load the url
* @author Babu - TestLeaf
* @param browser - This will load the specified browser
* @throws MalformedURLException
*/
public void startApp(String browser,String url);
/**
* This method will locate the element using any given locator
* @param locator - The locator by which the element to be found
* @param locValue - The locator value by which the element to be found
* @author Babu - TestLeaf
* @throws NoSuchElementException
*/
public WebElement locateElement(String locator, String locValue) ;
/**
* This method will locate the element using id
* @param locValue - The locator value by which the element to be found
* @author Babu - TestLeaf
* @throws NoSuchElementException
*/
public WebElement locateElement(String locValue) ;
/**
* This method will enter the value in the given text field
* @param ele - The Webelement (text field) in which the data to be entered
* @param data - The data to be sent to the webelement
* @author Babu - TestLeaf
* @throws ElementNotVisibleException *
*/
public void type(WebElement ele, String data) ;
/**
* This method will click the element and take snap
* @param ele - The Webelement (button/link/element) to be clicked
* @author Babu - TestLeaf
*/
public void click(WebElement ele);
/**
* This method will get the text of the element
* @param ele - The Webelement (button/link/element) in which text to be retrieved
* @author Babu - TestLeaf
*/
public String getText(WebElement ele);
/**
* This method will select the drop down visible text
* @param ele - The Webelement (dropdown) to be selected
* @param value The value to be selected (visibletext) from the dropdown
* @author Babu - TestLeaf
*/
public void selectDropDownUsingText(WebElement ele, String value) ;
/**
* This method will select the drop down using index
* @param ele - The Webelement (dropdown) to be selected
* @param index The index to be selected from the dropdown
* @author Babu - TestLeaf
*/
public void selectDropDownUsingIndex(WebElement ele, int index) ;
/**
* This method will verify browser actual title with expected
* @param title - The expected title of the browser
* @author Babu - TestLeaf
*/
public boolean verifyTitle(String expectedTitle);
/**
* This method will verify exact given text with actual text on the given element
* @param ele - The Webelement in which the text to be need to be verified
* @param expectedText - The expected text to be verified
* @author Babu - TestLeaf
*/
public void verifyExactText(WebElement ele, String expectedText);
/**
* This method will verify given text contains actual text on the given element
* @param ele - The Webelement in which the text to be need to be verified
* @param expectedText - The expected text to be verified
* @author Babu - TestLeaf
*/
public void verifyPartialText(WebElement ele, String expectedText);
/**
* This method will verify exact given attribute's value with actual value on the given element
* @param ele - The Webelement in which the attribute value to be need to be verified
* @param attribute - The attribute to be checked (like value, href etc)
* @param value - The value of the attribute
* @author Babu - TestLeaf
*/
public void verifyExactAttribute(WebElement ele, String attribute, String value);
/**
* This method will verify partial given attribute's value with actual value on the given element
* @param ele - The Webelement in which the attribute value to be need to be verified
* @param attribute - The attribute to be checked (like value, href etc)
* @param value - The value of the attribute
* @author Babu - TestLeaf
*/
public void verifyPartialAttribute(WebElement ele, String attribute, String value);
/**
* This method will verify if the element (Radio button, Checkbox) is selected
* @param ele - The Webelement (Radio button, Checkbox) to be verified
* @author Babu - TestLeaf
*/
public void verifySelected(WebElement ele);
/**
* This method will verify if the element is visible in the DOM
* @param ele - The Webelement to be checked
* @author Babu - TestLeaf
*/
public void verifyDisplayed(WebElement ele);
/**
* This method will switch to the Window of interest
* @param index The window index to be switched to. 0 -> first window
* @author Babu - TestLeaf
*/
public void switchToWindow(int index);
/**
* This method will switch to the specific frame
* @param ele - The Webelement (frame) to be switched
* @author Babu - TestLeaf
*/
public void switchToFrame(WebElement ele);
/**
* This method will accept the alert opened
* @author Babu - TestLeaf
*/
public void acceptAlert();
/**
* This method will dismiss the alert opened
* @author Babu - TestLeaf
*/
public void dismissAlert();
/**
* This method will return the text of the alert
* @author Babu - TestLeaf
*/
public String getAlertText();
/**
* This method will take snapshot of the browser
* @author Babu - TestLeaf
*/
public long takeSnap();
/**
* This method will close the active browser
* @author Babu - TestLeaf
*/
public void closeBrowser();
/**
* This method will close all the browsers
* @author Babu - TestLeaf
*/
public void closeAllBrowsers();
}
|
[
"HARISH@HARISH_DASYAM"
] |
HARISH@HARISH_DASYAM
|
13782baa8df1a14de6cf029c88e30b12434f1174
|
c663b981af3566743a774fae261548255947bfdc
|
/srth-osgi/uk.nhs.cfh.dsp.srth.information.model.impl/src/test/java/uk/nhs/cfh/dsp/srth/information/model/impl/internal/ClinicalEntityFactoryImplTest.java
|
75331b4b8f6ab560d367ea2a2a132ed7f68bc426
|
[] |
no_license
|
termlex/snofyre
|
c653295ecb1b2a28a44d111ff7603a3cc639e7eb
|
2622c524377ed7cc77a9aae9f1ec522b00da2b7c
|
refs/heads/master
| 2022-05-22T18:37:18.579877
| 2022-03-25T15:23:41
| 2022-03-25T15:23:41
| 34,781,765
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,111
|
java
|
/**
* Crown Copyright (C) 2008 - 2011
*
* 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 uk.nhs.cfh.dsp.srth.information.model.impl.internal;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import uk.nhs.cfh.dsp.snomed.converters.human.readable.HumanReadableRender;
import uk.nhs.cfh.dsp.snomed.dao.TerminologyConceptDAO;
import uk.nhs.cfh.dsp.snomed.expression.model.CloseToUserExpression;
import uk.nhs.cfh.dsp.snomed.expression.model.impl.CloseToUserExpressionImpl;
import uk.nhs.cfh.dsp.snomed.expressiongenerator.SituationExpressionGenerator;
import uk.nhs.cfh.dsp.snomed.normaliser.NormalFormGenerator;
import uk.nhs.cfh.dsp.snomed.objectmodel.SnomedConcept;
import uk.nhs.cfh.dsp.srth.information.model.impl.ClinicalEntityFactory;
import uk.nhs.cfh.dsp.srth.information.model.om.clinical.ClinicalEntity;
import uk.nhs.cfh.dsp.srth.information.model.om.clinical.entity.*;
// TODO: Auto-generated Javadoc
/**
* <br>Version : @#VersionNumber#@
* <br>Written by @author Jay Kola
* <br>Created on Jan 20, 2010 at 4:58:56 PM.
*/
public class ClinicalEntityFactoryImplTest extends AbstractDependencyInjectionSpringContextTests {
/** The test normal form generator. */
private NormalFormGenerator testNormalFormGenerator;
/** The test human readable renderer. */
private HumanReadableRender testHumanReadableRenderer;
/** The test situation expression generator. */
private SituationExpressionGenerator testSituationExpressionGenerator;
/** The test terminology dao. */
private TerminologyConceptDAO testTerminologyDAO;
/** The test entity factory service. */
private ClinicalEntityFactory testEntityFactoryService;
/** The Constant conceptId. */
private static final String conceptId = "22298006";
/** The concept. */
private SnomedConcept concept;
/* (non-Javadoc)
* @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations()
*/
protected String[] getConfigLocations()
{
return new String[] {"META-INF/spring/bundle-context-test.xml"};
}
/* (non-Javadoc)
* @see org.springframework.test.AbstractSingleSpringContextTests#onSetUp()
*/
@Override
protected void onSetUp() throws Exception {
assertNotNull("Normal form generator must not be null", testNormalFormGenerator);
assertNotNull("Human readable renderer must not be null", testHumanReadableRenderer);
assertNotNull("Situation generator must not be null", testSituationExpressionGenerator);
assertNotNull("Data Access Object must not be null", testTerminologyDAO);
concept = (SnomedConcept) testTerminologyDAO.getTerminologyConcept(conceptId);
assertNotNull("Concept must not be null", concept);
}
/**
* Sets the test entity factory service.
*
* @param testEntityFactoryService the new test entity factory service
*/
public void setTestEntityFactoryService(ClinicalEntityFactory testEntityFactoryService) {
this.testEntityFactoryService = testEntityFactoryService;
}
/**
* Test get clinical feature entity.
*
* @throws Exception the exception
*/
public void testGetClinicalFeatureEntity() throws Exception {
CloseToUserExpression expression = new CloseToUserExpressionImpl(concept);
assertNotNull("Close to user expression must not be null", expression);
ClinicalFindingEntity entity = testEntityFactoryService.getClinicalFindingEntity(expression);
assertNotNull("Feature entity must not be null", entity);
assertNotNull("Expression in entity must not be null", entity.getExpression());
assertEquals("Expression in entity must be the ctu", expression.getUuid(), entity.getExpression().getUuid());
}
/**
* Test get clinical finding entity.
*
* @throws Exception the exception
*/
public void testGetClinicalFindingEntity() throws Exception {
assertNotNull("Finding entity must not be null", testEntityFactoryService.getClinicalFindingEntity());
}
/**
* Test get investigation entity.
*
* @throws Exception the exception
*/
public void testGetInvestigationEntity() throws Exception {
assertNotNull("Investigation entity must not be null", testEntityFactoryService.getInvestigationEntity());
}
/**
* Test get intervention entity.
*
* @throws Exception the exception
*/
public void testGetInterventionEntity() throws Exception {
assertNotNull("Intervention entity must not be null", testEntityFactoryService.getInterventionEntity());
}
/**
* Test get medication entity.
*
* @throws Exception the exception
*/
public void testGetMedicationEntity() throws Exception {
assertNotNull("Medication entity must not be null", testEntityFactoryService.getMedicationEntity());
}
/**
* Test get anatomical location entity.
*
* @throws Exception the exception
*/
public void testGetAnatomicalLocationEntity() throws Exception {
assertNotNull("Anatomical entity must not be null", testEntityFactoryService.getAnatomicalLocationEntity());
}
/**
* Test get entity.
*
* @throws Exception the exception
*/
public void testGetEntity() throws Exception {
assertTrue("Must return Feature Entity", testEntityFactoryService.getEntity(ClinicalEntity.Type.FEATURE) instanceof ClinicalFeatureEntity);
assertTrue("Must return Finding Entity", testEntityFactoryService.getEntity(ClinicalEntity.Type.FINDING) instanceof ClinicalFindingEntity);
assertTrue("Must return Intervention Entity", testEntityFactoryService.getEntity(ClinicalEntity.Type.INTERVENTION) instanceof InterventionEntity);
assertTrue("Must return Investigation Entity", testEntityFactoryService.getEntity(ClinicalEntity.Type.INVESTIGATION) instanceof InvestigationEntity);
assertTrue("Must return Medication Entity", testEntityFactoryService.getEntity(ClinicalEntity.Type.MEDICATION) instanceof MedicationEntity);
assertTrue("Must return Anatomical Entity", testEntityFactoryService.getEntity(ClinicalEntity.Type.ANATOMICAL_LOCATION) instanceof AnatomicalLocationEntity);
}
/**
* Sets the test normal form generator.
*
* @param testNormalFormGenerator the new test normal form generator
*/
public void setTestNormalFormGenerator(NormalFormGenerator testNormalFormGenerator) {
this.testNormalFormGenerator = testNormalFormGenerator;
}
/**
* Sets the test human readable renderer.
*
* @param testHumanReadableRenderer the new test human readable renderer
*/
public void setTestHumanReadableRenderer(HumanReadableRender testHumanReadableRenderer) {
this.testHumanReadableRenderer = testHumanReadableRenderer;
}
/**
* Sets the test situation expression generator.
*
* @param testSituationExpressionGenerator the new test situation expression generator
*/
public void setTestSituationExpressionGenerator(SituationExpressionGenerator testSituationExpressionGenerator) {
this.testSituationExpressionGenerator = testSituationExpressionGenerator;
}
/**
* Sets the test terminology dao.
*
* @param testTerminologyDAO the new test terminology dao
*/
public void setTestTerminologyDAO(TerminologyConceptDAO testTerminologyDAO) {
this.testTerminologyDAO = testTerminologyDAO;
}
}
|
[
"jay.kola@29ca23ef-472f-bbfa-ca66-17e9de3a230d"
] |
jay.kola@29ca23ef-472f-bbfa-ca66-17e9de3a230d
|
be64a5bae4e94ed1db3131d9147cc6406ed71b83
|
4bd68d9ccb8d993fc84a5d90f7504b9b1d518dd9
|
/FitnessTracker/src/main/java/com/springmvc/service/ExerciseService.java
|
f2dbf402e95035f6075fd03315ce542f24118beb
|
[] |
no_license
|
jayMcoder/HandsOn-SpringMVC
|
f14be9bf37800312ed47787f94f0a26671bbdf0c
|
e6cf676d396b84399fc7d2cdc02dada3c9c4a08b
|
refs/heads/master
| 2020-05-16T14:11:34.420337
| 2019-04-30T15:38:43
| 2019-04-30T15:38:43
| 183,095,607
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 169
|
java
|
package com.springmvc.service;
import java.util.List;
import com.springmvc.model.Activity;
public interface ExerciseService {
List<Activity> findAllActivities();
}
|
[
"jayaram.mani@optum.com"
] |
jayaram.mani@optum.com
|
20785e43bc8f0db721e31cbfb9aa6d33a0b94d4a
|
58a4d1486a30ea16742707f0da565bc4cd25e562
|
/eclipse/VerilogExpress/src/verilogExpress/SequentualDoer.java
|
5e864965c2ea2254010970fd2f65054c82e9a8e5
|
[] |
no_license
|
JEdward7777/VerilogExpress
|
95fa248e381a43d9628b497ffd1ccd26def5cd2d
|
ba6d22c88e28acaacfb482d5d08f5c3e096a1017
|
refs/heads/master
| 2021-06-01T23:40:47.953614
| 2018-06-21T18:02:04
| 2018-06-21T18:02:04
| 6,460,616
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,993
|
java
|
package verilogExpress;
import java.util.HashSet;
public class SequentualDoer extends DoBlock {
static HashSet< String > usedStateVars = new HashSet< String >();
@Override
String getDoneSignal() {
return listToDo.getLast().getDoneSignal();
}
@Override
public String getChildActiveSignal(Doable doable) {
return getActiveWireName( doable );
}
private static String getActiveWireName( Doable doable ){ return doable.getUniqueName() + "_IsActiveWire"; }
private static String getRegName( Doable doable ){ return doable.getUniqueName() + "_Reg"; }
private static String getParamName( Doable doable ){ return doable.getUniqueName() + "_StateParam"; }
private static String getResetParamName( Doable doable ){ return doable.getUniqueName() + "_ResetStateParam"; }
@Override
public
String genTopCode(String indent) {
String result = super.genTopCode(indent);
if( !listToDo.isEmpty() ){
result += indent + "reg [31:0] " + getRegName( this ) + ";\n";
result += "\n";
int doerCount = 0;
result += indent + "parameter " + getResetParamName( this ) + " = " + (doerCount++) + ";\n";
for( Doable doer : listToDo ){
result += indent + "parameter " + getParamName( doer ) + " = " + (doerCount++) + ";\n";
}
result += "\n";
for( Doable doable : listToDo ){
result += indent + "wire " + getActiveWireName( doable ) + ";\n";
}
}
return result;
}
@Override
public
String genMiddleCode(String indent) throws Exception {
String result = super.genMiddleCode( indent );
if( !listToDo.isEmpty() ){
result += indent + "always @( posedge " + parrent.getClockSignal() + " )\n";
result += indent + "if( " + parrent.getResetSignal() + " || !( " + getActiveSignal()+ ") )begin\n";
result += indent + " " + getRegName( this ) + " <= " + getResetParamName(this) + ";\n";
result += indent + "end else case( " + getRegName( this ) + ")\n";
result += indent + " " + getResetParamName(this) + ": begin\n";
result += indent + " if( " + getActiveSignal() + " )begin\n";
result += indent + " " + getRegName( this ) + " <= " + getParamName( listToDo.getFirst() ) + ";\n";
result += indent + " end\n";
result += indent + " end\n";
//for( int doableNum = 0; doableNum < listToDo.size(); ++doableNum ){
// result += indent + ""
//}
for( int doableNum = 0; doableNum < listToDo.size(); ++doableNum ){
Doable doable = listToDo.get( doableNum );
Doable nextDoable = doableNum < listToDo.size()-1?listToDo.get( doableNum+1 ) : null;
result+=indent+" " + getParamName( doable ) + ": begin\n";
result+=indent+" if( " + doable.getDoneSignal() + " ) begin\n";
if( nextDoable != null ){
result+=indent+" " + getRegName( this ) + " <= " + getParamName(nextDoable) + ";\n";
}else{
//go to reset for a count before we start out again.
//to give the parent a chance to drop the active signal
result+=indent+" " + getRegName( this ) + " <= " + getResetParamName(this) + ";\n";
}
result+=indent+" end\n";
result+=indent+" end\n";
}
result += indent + " default: begin\n";
result += indent + " " + getRegName( this ) + " <= " + getResetParamName(this) + ";\n";
result += indent + " end\n";
result += indent + "endcase\n";
}
return result;
}
@Override
public String genBottomCode(String indent) {
String result = super.genBottomCode( indent );
for( Doable doable : listToDo ){
result += indent + "assign " + getActiveWireName( doable ) + " = (" + getRegName( this ) + " == " + getParamName( doable ) + " );\n";
}
return result;
}
@Override
String getDescribeName() {
//if( true ) throw new NullPointerException( "Here!" );
return "SequentualDoer";
}
}
|
[
"Gorge7777@gmail.com"
] |
Gorge7777@gmail.com
|
f052f1eae60eefdc88432a022b87f80d148ee6bc
|
c4203c32915c1ee09fd0ebe37149db351f8434ca
|
/baselibrary/src/main/java/com/yyyu/baselibrary/ui/widget/BounceScrollView.java
|
032a7cc7e1c677f78472ae85d068e064ae620d35
|
[] |
no_license
|
yuqibiao2/LSM
|
8eb23b017f124227a21c7a37ad8cda65e127228d
|
f1c872ecfc155c1f6800abcb4d1f5dba633649e5
|
refs/heads/master
| 2020-03-06T16:13:28.696197
| 2019-01-03T07:47:35
| 2019-01-03T07:47:35
| 126,969,699
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,454
|
java
|
package com.yyyu.baselibrary.ui.widget;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.TranslateAnimation;
import android.widget.ScrollView;
/**
* 弹性ScrollView
*
*/
public class BounceScrollView extends ScrollView {
private static final String TAG = "BounceScrollView";
private View inner;// 孩子View
private float y;// 点击时y坐标
private Rect normal = new Rect();// 矩形(这里只是个形式,只是用于判断是否需要动画.)
private boolean isCount = false;// 是否开始计算
private float lastX = 0;
private float lastY = 0;
private float currentX = 0;
private float currentY = 0;
private float distanceX = 0;
private float distanceY = 0;
private boolean upDownSlide = false; //判断上下滑动的flag
public BounceScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/***
* 根据 XML 生成视图工作完成.该函数在生成视图的最后调用,在所有子视图添加完之后. 即使子类覆盖了 onFinishInflate
* 方法,也应该调用父类的方法,使该方法得以执行.
*/
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (getChildCount() > 0) {
inner = getChildAt(0);
View view;
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
// TODO Auto-generated method stub
currentX = ev.getX();
currentY = ev.getY();
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_MOVE:
distanceX = currentX - lastX;
distanceY = currentY - lastY;
if (Math.abs(distanceX) < Math.abs(distanceY) && Math.abs(distanceY) > 12) {
upDownSlide = true;
}
break;
case MotionEvent.ACTION_UP:
break;
default:
break;
}
lastX = currentX;
lastY = currentY;
if (upDownSlide && inner != null) commOnTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
// TODO Auto-generated method stub
return super.onInterceptTouchEvent(ev);
}
/***
* 监听touch
*/
@Override
public boolean onTouchEvent(MotionEvent ev) {
return super.onTouchEvent(ev);
}
/***
* 触摸事件
*
* @param ev
*/
public void commOnTouchEvent(MotionEvent ev) {
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_UP:
// 手指松开.
if (isNeedAnimation()) {
animation();
isCount = false;
}
clear0();
break;
case MotionEvent.ACTION_MOVE:
final float preY = y;// 按下时的y坐标
float nowY = ev.getY();// 时时y坐标
int deltaY = (int) (preY - nowY);// 滑动距离
if (!isCount) {
deltaY = 0; // 在这里要归0.
}
y = nowY;
// 当滚动到最上或者最下时就不会再滚动,这时移动布局
if (isNeedMove()) {
// 初始化头部矩形
if (normal.isEmpty()) {
// 保存正常的布局位置
normal.set(inner.getLeft(), inner.getTop(),
inner.getRight(), inner.getBottom());
}
// 移动布局
inner.layout(inner.getLeft(), inner.getTop() - deltaY / 2,
inner.getRight(), inner.getBottom() - deltaY / 2);
}
isCount = true;
break;
default:
break;
}
}
/***
* 回缩动画
*/
public void animation() {
// 开启移动动画
TranslateAnimation ta = new TranslateAnimation(0, 0, inner.getTop(),
normal.top);
ta.setDuration(200);
inner.startAnimation(ta);
// 设置回到正常的布局位置
inner.layout(normal.left, normal.top, normal.right, normal.bottom);
normal.setEmpty();
}
// 是否需要开启动画
public boolean isNeedAnimation() {
return !normal.isEmpty();
}
/***
* 是否需要移动布局 inner.getMeasuredHeight():获取的是控件的总高度
*
* getHeight():获取的是屏幕的高度
*
* @return
*/
public boolean isNeedMove() {
int offset = inner.getMeasuredHeight() - getHeight();
int scrollY = getScrollY();
// 0是顶部,后面那个是底部
if (scrollY == 0 || scrollY == offset) {
return true;
}
return false;
}
private void clear0() {
lastX = 0;
lastY = 0;
distanceX = 0;
distanceY = 0;
upDownSlide = false;
}
}
|
[
"yuqibiao19920605"
] |
yuqibiao19920605
|
ff4f9b1dd0286a600ed1bdd6ed827350b42e341d
|
a09b4d2050f997a972a23225b96cc5b726f70bbe
|
/rmi/DynamicInvocation.java
|
70afdec97d88fc501fd7879d9db2b2de9e9e2c9e
|
[] |
no_license
|
cczhong11/Remote-Method-Invocation
|
a9a0636b2c074890d3c83f4ea81e92fb0b3c5a6b
|
21d7f4037c9fa2238fdb5be5c264c90a843e5128
|
refs/heads/master
| 2021-01-25T09:52:33.923415
| 2018-02-28T18:09:34
| 2018-02-28T18:09:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,336
|
java
|
package rmi;
import java.net.*;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class DynamicInvocation<T> implements InvocationHandler{
//the information stored in each handler to handle requests
private Class<T> remote_interface;
private InetSocketAddress remote_addr;
public DynamicInvocation(InetSocketAddress addr, Class<T> c)
{
remote_interface = c;
remote_addr = addr;
}
/**
* my_toString: report the name of remote interface implemented by the stub
* and remote address(hostname + port) of the skeleton
* @param proxy
* the proxy being invoked
*/
private String my_toString(Object proxy)
{
DynamicInvocation<T> DynamicHandler = (DynamicInvocation<T>)Proxy.getInvocationHandler(proxy);
return DynamicHandler.remote_interface.getName() + " " + DynamicHandler.remote_addr.toString();
}
/**
* my_hashCode: when the client is requesting the hashCode function of Stub,
* the proxy object should implement the hashCode function rather
* than sending it to the server
* @param proxy
* the proxy being invoked
*/
private int my_hashCode(Object proxy)
{
return my_toString(proxy).hashCode();
}
/**
* two stubs are considered equal if they implement the same interface & connect to
* the same skeleton
* Note: should deal with null situation
* @param proxy
* the proxy being invoked
* @param args
* the arguments of equals function
*/
private boolean my_equals(Object proxy, Object[] args)
{
try
{
if (my_hashCode(proxy) == my_hashCode(args[0])) return true;
}
catch (Exception e)
{
return false;
}
return false;
}
/**
* when a method is called, invoke and open a new connection
* @param proxy
* the proxy object created for the stub, the method is invoked on
* @param method
* the method transferred to the server
* @param args
* the method arguments
*/
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
//check if it is the stub's self function
String method_name = method.getName();
if (method_name.equals("hashCode"))
{
return my_hashCode(proxy);
}
if (method_name == "equals")
{
return my_equals(proxy, args);
}
if (method_name == "toString")
{
return my_toString(proxy);
}
//otherwise it should forward the request to the server
//open a connection with the remote server
ObjectOutputStream out = null;
ObjectInputStream in = null;
Socket client = null;
try
{
InetAddress server = remote_addr.getAddress();
int port = remote_addr.getPort();
client = new Socket(server, port);
out = new ObjectOutputStream(client.getOutputStream());
out.flush();
}catch(Exception e)
{
client.close();
System.out.println("Fail to create output stream to server.");
throw new RMIException("RMI: Fail to create output stream to server.");
}
//create the input stream
try
{
in = new ObjectInputStream(client.getInputStream());
}catch(Exception e)
{
client.close();
throw new RMIException("RMI: Fail to create input stream to server.");
}
//send
try
{
out.writeObject(method.getName());
out.writeObject(args);
out.writeObject(null);
out.flush();
}catch(Exception e)
{
client.close();
in.close();
out.close();
System.out.println("Error in sending the data!");
throw new RMIException("RMI: Error in sending the data!");
}
//receive
Object returned_obj;
try
{
returned_obj = (Object)in.readObject();
}catch(Exception e)
{
client.close();
in.close();
out.close();
System.out.println("Error in receiving the data!");
throw new RMIException("Error in receiving the data!");
}
//raise the same exception
if (returned_obj instanceof Exception)
{
throw (java.lang.Throwable)returned_obj;
}
//close connection
try
{
out.close();
in.close();
client.close();
}catch(Exception e)
{
System.out.println("Error in closing socket");
throw new RMIException("Error in closing socket.");
}
//return the object to client
return returned_obj;
}
}
|
[
"tczhong24@gmail.com"
] |
tczhong24@gmail.com
|
60f6c1d8e44802703b0f8b339541e7cc62cc843e
|
ee16d6fce032df72e16dc2078396c10a83af1a3e
|
/ELF16/src/main/java/vtigerTestScripts/TC_12Test.java
|
dbd88279899e0d9cee32d5f3a19a637d9713792c
|
[] |
no_license
|
Abhishek-M-97/Testing
|
4c68618e3498d1ea3a52bea855def8db1704bbed
|
223eac45144dbb8f08f8637af4bb5a601f756566
|
refs/heads/master
| 2023-07-13T02:14:00.183038
| 2021-09-02T10:10:59
| 2021-09-02T10:10:59
| 364,866,254
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,487
|
java
|
package vtigerTestScripts;
import genericLibrary.*;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import org.testng.Reporter;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import pomRepository.*;
/***
*
* @author Abhishek
*
*/
@Listeners(ITestListnerUtil.class)
public class TC_12Test extends BaseClass {
@Test
public void createContactTC_12() throws InterruptedException {
HomePage homePage= new HomePage(driver);
CreatingNewContact newContact= new CreatingNewContact(driver);
ContactsPage contacts= new ContactsPage(driver);
String expectedHomePageTitle="Administrator - Home - vtiger CRM 5 - Commercial Open Source CRM";
String homePageTitle = driver.getTitle();
Assert.assertEquals(homePageTitle,expectedHomePageTitle,"Homepage is not displayed");
Reporter.log("HomePage is displayed",true);
//Step 3:Contact List page should be display
homePage.getContacts().click();
String expectedContactsPageTitle="Administrator - Contacts - vtiger CRM 5 - Commercial Open Source CRM";
String contactsPageTitle = driver.getTitle();
Assert.assertEquals(contactsPageTitle,expectedContactsPageTitle,"Contacts is not displayed");
Reporter.log("ContatctPage is displayed",true);
//Step 4:Creating New Contact button should be display
contacts.getCreatebtn().click();
String expectedNewContactPageTitle="Administrator - Contacts - vtiger CRM 5 - Commercial Open Source CRM";
String newContactPageTitle=driver.getTitle();
Assert.assertEquals(expectedNewContactPageTitle,newContactPageTitle,"Creating New Contact Page is not displayed");
Reporter.log("Creating New Contact Page is displayed",true);
//Step 5:Contact should be created with message Contact Information Updated today
newContact.getLastName().sendKeys("demo");
newContact.getGroupRadiobtn().click();
WebElement groupListBox = newContact.getGroupListBox();
Select select=new Select(groupListBox);
Thread.sleep(2000);
select.selectByVisibleText("Team Selling");
Thread.sleep(2000);
newContact.getSave().click();
String expectedContactInfoPageTitle="Administrator - Contacts - vtiger CRM 5 - Commercial Open Source CRM";
String contactInfoPageTitle=driver.getTitle();
Assert.assertEquals(contactInfoPageTitle, expectedContactInfoPageTitle,"Contact Update Information Page is not displayed");
Reporter.log("Contatct Information Updated Page is displayed",true);
}
}
|
[
"Abhishek@ABHISHEK"
] |
Abhishek@ABHISHEK
|
49161a195ea4a7044a299256b9fc1c9680410d71
|
95bbe09da876e356c9376fe979ef7a9bf90822df
|
/src/main/java/org/citygml4j/ade/energy/model/core/FloorAreaProperty.java
|
1fb751ceff3a93b6601be110562b99c3a8a058d4
|
[
"Apache-2.0"
] |
permissive
|
citygml4j/energy-ade-citygml4j
|
ef954ab104a690c0169d3ca10b65301e871cdcde
|
663f32cdcdc579b95ff6d6427a728c61f9b30e47
|
refs/heads/master
| 2022-08-29T17:07:51.335493
| 2022-08-25T11:56:24
| 2022-08-25T11:56:24
| 157,459,176
| 9
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,035
|
java
|
/*
* energy-ade-citygml4j - Energy ADE module for citygml4j
* https://github.com/citygml4j/energy-ade-citygml4j
*
* energy-ade-citygml4j is part of the citygml4j project
*
* Copyright 2019-2021 Claus Nagel <claus.nagel@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 org.citygml4j.ade.energy.model.core;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.gml.base.AssociationByRep;
public class FloorAreaProperty extends AssociationByRep<FloorArea> implements ADEModelObject {
public FloorAreaProperty() {
}
public FloorAreaProperty(FloorArea floorArea) {
super(floorArea);
}
public FloorArea getFloorArea() {
return super.getObject();
}
public boolean isSetFloorArea() {
return super.isSetObject();
}
public void setFloorArea(FloorArea floorArea) {
super.setObject(floorArea);
}
public void unsetFloorArea() {
super.unsetObject();
}
@Override
public Class<FloorArea> getAssociableClass() {
return FloorArea.class;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new FloorAreaProperty(), copyBuilder);
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
FloorAreaProperty copy = (target == null) ? new FloorAreaProperty() : (FloorAreaProperty)target;
return super.copyTo(copy, copyBuilder);
}
}
|
[
"cnagel@virtualcitysystems.de"
] |
cnagel@virtualcitysystems.de
|
fc6d59a3f0144f0469982082b29e6f0ed93e374c
|
49c57475dae2ade37bc1d7cdd0d2af540ca2a62d
|
/changgou-service/changgou-service-goods/src/main/java/com/changgou/goods/service/impl/SkuServiceImpl.java
|
80f5b4bf8242637afdaf92c7775f2058edd9e19c
|
[] |
no_license
|
a76037385a/changgou-parent
|
3ac014839792a61f0f866752bd104392219d61e3
|
c72e5fff0ca1e4d4de8e6080881d851fd4a7c070
|
refs/heads/master
| 2022-06-29T20:21:53.160752
| 2019-08-25T07:14:21
| 2019-08-25T07:14:21
| 204,235,253
| 0
| 0
| null | 2022-06-17T03:30:24
| 2019-08-25T02:18:11
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 7,513
|
java
|
package com.changgou.goods.service.impl;
import com.changgou.goods.dao.SkuMapper;
import com.changgou.goods.pojo.Sku;
import com.changgou.goods.service.SkuService;
import com.changgou.order.pojo.OrderItem;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
/****
* @Author:www.itheima.com
* @Description:Sku业务层接口实现类
* @Date 黑马畅购商城
*****/
@Service
public class SkuServiceImpl implements SkuService {
@Autowired
private SkuMapper skuMapper;
@Autowired
private RedisTemplate redisTemplate;
/***
* 订单库存递减
* @param username
* Cart_wangwu
*/
@Override
public void decount(String username) {
//从购物车中获取所有明细列表
List<OrderItem> orderItems = redisTemplate.boundHashOps("Cart_"+username).values();
//List<OrderItem> 循环递减
if(orderItems!=null){
for (OrderItem orderItem : orderItems) {
//先查询出该SKU对应的数据
//Sku sku = skuMapper.selectByPrimaryKey(orderItem.getSkuId());
//让该SKU数据-购买数量
//sku.setNum(sku.getNum()-orderItem.getNum());
//保存到数据库
//skuMapper.updateByPrimaryKeySelective(sku);
//数据库运算->防止超卖
int count = skuMapper.decrCount(orderItem.getSkuId(), orderItem.getNum());
if(count<=0){
throw new RuntimeException("超卖!");
}
}
}
}
/***
* 根据状态搜索所有List<Sku>
* @param status
* @return
*/
@Override
public List<Sku> findByStatus(String status) {
//select * from table where status = ?
Sku sku = new Sku();
sku.setStatus(status);
//执行搜索
return skuMapper.select(sku);
}
/**
* Sku条件+分页查询
* @param sku 查询条件
* @param page 页码
* @param size 页大小
* @return 分页结果
*/
@Override
public PageInfo<Sku> findPage(Sku sku, int page, int size){
//分页
PageHelper.startPage(page,size);
//搜索条件构建
Example example = createExample(sku);
//执行搜索
return new PageInfo<Sku>(skuMapper.selectByExample(example));
}
/**
* Sku分页查询
* @param page
* @param size
* @return
*/
@Override
public PageInfo<Sku> findPage(int page, int size){
//静态分页
PageHelper.startPage(page,size);
//分页查询
return new PageInfo<Sku>(skuMapper.selectAll());
}
/**
* Sku条件查询
* @param sku
* @return
*/
@Override
public List<Sku> findList(Sku sku){
//构建查询条件
Example example = createExample(sku);
//根据构建的条件查询数据
return skuMapper.selectByExample(example);
}
/**
* Sku构建查询对象
* @param sku
* @return
*/
public Example createExample(Sku sku){
Example example=new Example(Sku.class);
Example.Criteria criteria = example.createCriteria();
if(sku!=null){
// 商品id
if(!StringUtils.isEmpty(sku.getId())){
criteria.andEqualTo("id",sku.getId());
}
// 商品条码
if(!StringUtils.isEmpty(sku.getSn())){
criteria.andEqualTo("sn",sku.getSn());
}
// SKU名称
if(!StringUtils.isEmpty(sku.getName())){
criteria.andLike("name","%"+sku.getName()+"%");
}
// 价格(分)
if(!StringUtils.isEmpty(sku.getPrice())){
criteria.andEqualTo("price",sku.getPrice());
}
// 库存数量
if(!StringUtils.isEmpty(sku.getNum())){
criteria.andEqualTo("num",sku.getNum());
}
// 库存预警数量
if(!StringUtils.isEmpty(sku.getAlertNum())){
criteria.andEqualTo("alertNum",sku.getAlertNum());
}
// 商品图片
if(!StringUtils.isEmpty(sku.getImage())){
criteria.andEqualTo("image",sku.getImage());
}
// 商品图片列表
if(!StringUtils.isEmpty(sku.getImages())){
criteria.andEqualTo("images",sku.getImages());
}
// 重量(克)
if(!StringUtils.isEmpty(sku.getWeight())){
criteria.andEqualTo("weight",sku.getWeight());
}
// 创建时间
if(!StringUtils.isEmpty(sku.getCreateTime())){
criteria.andEqualTo("createTime",sku.getCreateTime());
}
// 更新时间
if(!StringUtils.isEmpty(sku.getUpdateTime())){
criteria.andEqualTo("updateTime",sku.getUpdateTime());
}
// SPUID
if(!StringUtils.isEmpty(sku.getSpuId())){
criteria.andEqualTo("spuId",sku.getSpuId());
}
// 类目ID
if(!StringUtils.isEmpty(sku.getCategoryId())){
criteria.andEqualTo("categoryId",sku.getCategoryId());
}
// 类目名称
if(!StringUtils.isEmpty(sku.getCategoryName())){
criteria.andEqualTo("categoryName",sku.getCategoryName());
}
// 品牌名称
if(!StringUtils.isEmpty(sku.getBrandName())){
criteria.andEqualTo("brandName",sku.getBrandName());
}
// 规格
if(!StringUtils.isEmpty(sku.getSpec())){
criteria.andEqualTo("spec",sku.getSpec());
}
// 销量
if(!StringUtils.isEmpty(sku.getSaleNum())){
criteria.andEqualTo("saleNum",sku.getSaleNum());
}
// 评论数
if(!StringUtils.isEmpty(sku.getCommentNum())){
criteria.andEqualTo("commentNum",sku.getCommentNum());
}
// 商品状态 1-正常,2-下架,3-删除
if(!StringUtils.isEmpty(sku.getStatus())){
criteria.andEqualTo("status",sku.getStatus());
}
}
return example;
}
/**
* 删除
* @param id
*/
@Override
public void delete(Long id){
skuMapper.deleteByPrimaryKey(id);
}
/**
* 修改Sku
* @param sku
*/
@Override
public void update(Sku sku){
skuMapper.updateByPrimaryKey(sku);
}
/**
* 增加Sku
* @param sku
*/
@Override
public void add(Sku sku){
skuMapper.insert(sku);
}
/**
* 根据ID查询Sku
* @param id
* @return
*/
@Override
public Sku findById(Long id){
return skuMapper.selectByPrimaryKey(id);
}
/**
* 查询Sku全部数据
* @return
*/
@Override
public List<Sku> findAll() {
return skuMapper.selectAll();
}
}
|
[
"76037385@qq.com"
] |
76037385@qq.com
|
daee6ea735009681a91d25623a65aaadb1e24cb9
|
0639ae56532079d5622f00c8faeb8003c5eea6f3
|
/Designpattern2/src/com/riversand/structural/decorator/BreadTypeDecorator.java
|
b7331f8e92f83f0fca6adac192947ebb52454187
|
[] |
no_license
|
ritam-sarkar/JavaBasics
|
7ffacaf27f14d38a7223b9350e8f1ef57a8689c1
|
eba9fbb916881fa88d8a8798423042356bb31a3d
|
refs/heads/master
| 2023-04-07T09:26:15.607580
| 2023-03-16T03:13:36
| 2023-03-16T03:13:36
| 102,585,573
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 400
|
java
|
package com.riversand.structural.decorator;
public class BreadTypeDecorator extends SandwichDecorator {
private String breadType;
public BreadTypeDecorator(Sandwich customsandwich, String breadType) {
super(customsandwich);
this.breadType = breadType;
}
public String make() {
return super.make()+" + "+addBreadType();
}
private String addBreadType() {
return this.breadType;
}
}
|
[
"rit.style@gmail.com"
] |
rit.style@gmail.com
|
c751490b6edae859d7116c18c1d0490672524417
|
caa2efc6c09b2a69943b173dec19952a213fd7ae
|
/odin-core/src/main/java/com/purplepip/odin/creation/flow/DefaultFlow.java
|
6f0c795738e34735e6db7aa40f5d0ea2887853ca
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
ianhomer/odin
|
83963bf214442f696782c96222b432f40cefa15c
|
ac3e4a5ddbe5c441fc9fb22fa5f06a996ec1454c
|
refs/heads/main
| 2021-10-19T22:27:29.709053
| 2020-11-15T17:37:40
| 2020-11-15T17:37:40
| 79,387,599
| 6
| 0
|
NOASSERTION
| 2021-10-05T21:04:08
| 2017-01-18T21:44:23
|
Java
|
UTF-8
|
Java
| false
| false
| 2,672
|
java
|
/*
* Copyright (c) 2017 the original author or authors. 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.purplepip.odin.creation.flow;
import com.purplepip.odin.clock.Clock;
import com.purplepip.odin.clock.Loop;
import com.purplepip.odin.clock.MeasureContext;
import com.purplepip.odin.clock.measure.MeasureProvider;
import com.purplepip.odin.clock.tick.Tock;
import com.purplepip.odin.creation.sequence.Sequence;
import com.purplepip.odin.events.Event;
import com.purplepip.odin.events.ScanForwardEvent;
import lombok.extern.slf4j.Slf4j;
/**
* Default flow implementation.
*/
@Slf4j
public class DefaultFlow<S extends Sequence> implements MutableFlow<S> {
private S sequence;
private final MeasureContext context;
/**
* Create flow.
*
* @param clock clock
* @param measureProvider measure provider
*/
public DefaultFlow(Clock clock, MeasureProvider measureProvider) {
this.context = new MeasureContext(clock, measureProvider);
}
@Override
public void setSequence(S sequence) {
this.sequence = sequence;
}
@Override
public S getSequence() {
return sequence;
}
@Override
public MeasureContext getContext() {
return context;
}
@Override
public Event getNextEvent(Tock tock) {
/*
* Create local and temporary mutable tock for this function execution.
*/
Loop loop = new Loop(sequence.getLoopLength(), tock.getPosition());
int i = 0;
long maxScanForward = context.getClock().getMaxLookForward().floor();
Event event = null;
while (event == null && i < maxScanForward) {
event = sequence.getNextEvent(context, loop);
if (event == null) {
LOG.trace("{} : No event found at tock {}, incrementing loop", sequence.getName(), loop);
loop.increment();
i++;
}
}
if (event == null) {
LOG.trace("No notes found in the next {} ticks after tock {} for sequence {}",
maxScanForward, tock, getSequence());
event = new ScanForwardEvent(loop.getPosition().getLimit());
}
return event;
}
@Override
public void initialise() {
sequence.initialise();
}
}
|
[
"ian.homer@gmail.com"
] |
ian.homer@gmail.com
|
57f89d077a1aecaf51f91aae173c82c0f57f15ed
|
6814f68e6382945116005747a7111a326ef7ca84
|
/src/multi_thread/Chapter3/notifyAll/ThreadB.java
|
7976f9db0a11bca942b4b1f8f60394b8ebf50a8e
|
[] |
no_license
|
ranxin1022/java_concurrency
|
81538d3300256dc664f7f32c011c3552ada7b03b
|
d37e1ca5bbff10ae16ee5a106600005907d9f6c8
|
refs/heads/master
| 2020-03-22T09:44:32.494051
| 2018-07-05T14:00:52
| 2018-07-05T14:00:52
| 139,857,491
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 302
|
java
|
package multi_thread.Chapter3.notifyAll;
public class ThreadB extends Thread
{
private Object lock;
public ThreadB(Object lock)
{
this.lock = lock;
}
@Override
public void run()
{
Service service = new Service();
service.testMethod(lock);
}
}
|
[
"346150054@qq.com"
] |
346150054@qq.com
|
b893ea935815baa5f15f524aea136dd63e33cc13
|
ca7da6499e839c5d12eb475abe019370d5dd557d
|
/spring-context-indexer/src/test/java/org/springframework/context/index/sample/type/SpecializedRepo.java
|
a28f9485122d2266928e353b02fa1161978e5612
|
[
"Apache-2.0"
] |
permissive
|
yangfancoming/spring-5.1.x
|
19d423f96627636a01222ba747f951a0de83c7cd
|
db4c2cbcaf8ba58f43463eff865d46bdbd742064
|
refs/heads/master
| 2021-12-28T16:21:26.101946
| 2021-12-22T08:55:13
| 2021-12-22T08:55:13
| 194,103,586
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 122
|
java
|
package org.springframework.context.index.sample.type;
public interface SpecializedRepo<T> extends Repo<T, Long> {
}
|
[
"34465021+jwfl724168@users.noreply.github.com"
] |
34465021+jwfl724168@users.noreply.github.com
|
8a1240fe095f0af4ea99079626c1627d59d8eb3e
|
d254ff443950042970aec7ef96d3654a21e2cf27
|
/jharwal_problem1/src/jharwal_problem1/CAI5.java
|
3530ca5d72560996622c8230626943658eb84c5e
|
[] |
no_license
|
aryanjharwal/jharwal_assignment3
|
0c20ff1e4b27e9a87787b73f250b100e47e82f17
|
439099c964add001924fa785f2d86c28e01eca8b
|
refs/heads/master
| 2021-01-15T06:45:38.681176
| 2020-02-25T04:47:29
| 2020-02-25T04:47:29
| 242,904,696
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,553
|
java
|
package jharwal_problem1;
import java.security.SecureRandom;
import java.util.Scanner;
public class CAI5 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String flag;
do {
//calling quiz
quiz(sc);
//getting user input about next round
System.out.print("\nDo you want another round?(yes/no): ");
flag = sc.next();
System.out.println();
}while(flag.equalsIgnoreCase("yes"));
sc.close();
}
public static void quiz(Scanner sc) {
SecureRandom rand = new SecureRandom();
int countCorrect = 0;
int x,i,correctAns=0;
int max = readDifficulty(sc);
int problemtype = readProblemType(sc);
for ( i = 1; i <= 10; i++) {
int first = rand.nextInt(max);
int second = rand.nextInt(max);
switch(problemtype){
case 1:
correctAns = call_method(first, second, i,1);
break;
case 2:
correctAns = call_method(first, second, i,2);
break;
case 3:
correctAns = call_method(first, second, i,3);
break;
case 4:
correctAns = call_method(first, second, i,4);
break;
case 5:
x = rand.nextInt(4)+1; // rand between 1-4
correctAns = call_method(first, second, i,x);
break;
default:
System.out.println("Wrong choice!!");
break;
}
int response = readResponse(sc);
if (isAnswerCorrect(correctAns, response)) {
displayCorrectResponse(rand);
countCorrect++;
} else
displayIncorrectResponse(rand);
}
displayCompletionMessage(countCorrect);
}
private static void displayCompletionMessage(int countCorrect) {
double percent = ((double) countCorrect / 10.0) * 100.0;
System.out.println("\nYou Scored: " + percent + "%");
if (percent < 75)
System.out.println("Please ask your teacher for extra help.");
else
System.out.println("Congratulations, you are ready to go to next level!");
}
private static void displayIncorrectResponse(SecureRandom rand) {
String incorrect[] = { "No. Please try again.", "Wrong. Try once more.", "Don't give up!", "No. Keep trying." };
// generating random index
int index = rand.nextInt(incorrect.length);
System.out.println(incorrect[index]);
}
private static void displayCorrectResponse(SecureRandom rand) {
String appreciate[] = { "Very good!", "Excellent", "Nice work!", "Keep up the good work!" };
// generating random index
int index = rand.nextInt(appreciate.length);
System.out.println(appreciate[index]);
}
private static boolean isAnswerCorrect(int correctAns, int response) {
return correctAns == response;
}
private static int readResponse(Scanner sc) {
System.out.print("Ans. ");
int response = sc.nextInt();
return response;
}
private static int readDifficulty(Scanner sc){
System.out.println("Choose the difficulty level");
System.out.print("Difficulty(1-4)? ");
int response = sc.nextInt();
switch (response){
case 1:
response = 10;
break;
case 2:
response = 100;
break;
case 3:
response = 1000;
break;
case 4:
response = 10000;
break;
default:
System.out.println("Wrong choice!!");
break;
}
return response;
}
private static int readProblemType(Scanner sc){
System.out.println("Choose the problem type");
System.out.print("Problem Type(1-5)? ");
int response = sc.nextInt();
return response;
}
private static int multiply(int first, int second, int i) {
System.out.println("Q."+i+" how much is " + first + " X " + second + "?");
int correctAns = first * second;
return correctAns;
}
private static int add(int first, int second, int i) {
System.out.println("Q."+i+" how much is " + first + " + " + second + "?");
int correctAns = first + second;
return correctAns;
}
private static int subtract(int first, int second, int i) {
System.out.println("Q."+i+" how much is " + first + " - " + second + "?");
int correctAns = first - second;
return correctAns;
}
private static int division(int first, int second, int i) {
System.out.println("Q."+i+" how much is " + first + " / " + second + "?");
int correctAns = first / second;
return correctAns;
}
private static int call_method(int first,int second,int i, int choice){
int ans=0;
switch (choice){
case 1:
ans = add(first,second,i);
break;
case 2:
ans = subtract(first,second,i);
break;
case 3:
ans = multiply(first,second,i);
break;
case 4:
ans = division(first,second,i);
break;
}
return ans;
}
private static int generateQuestionArgument(SecureRandom rand, int difficulty) {
int argument = 0;
if (difficulty == 1)
argument = rand.nextInt(10);
else if (difficulty == 2)
argument = rand.nextInt(100);
else if (difficulty == 3)
argument = rand.nextInt(1000);
else
argument = rand.nextInt(10000);
return argument;
}
}
|
[
"aryan@localhost"
] |
aryan@localhost
|
4180c85ac6098927740cac685368da377943c805
|
d60e287543a95a20350c2caeabafbec517cabe75
|
/LACCPlus/Hadoop/2668_1.java
|
b4c4dad1beebb40499e646457f499388e9253463
|
[
"MIT"
] |
permissive
|
sgholamian/log-aware-clone-detection
|
242067df2db6fd056f8d917cfbc143615c558b2c
|
9993cb081c420413c231d1807bfff342c39aa69a
|
refs/heads/main
| 2023-07-20T09:32:19.757643
| 2021-08-27T15:02:50
| 2021-08-27T15:02:50
| 337,837,827
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 245
|
java
|
//,temp,SwiftUtils.java,113,117,temp,RandomTextDataGenerator.java,124,131
//,3
public class xxx {
public static void debugEx(Logger log, String text, Exception ex) {
if (log.isDebugEnabled()) {
log.debug(text + ex, ex);
}
}
};
|
[
"sgholami@uwaterloo.ca"
] |
sgholami@uwaterloo.ca
|
128f880660bcd92d21fe8fe427302b1a04ab02f0
|
e9376e9d9da01844014a9785808e24e292cdd9e7
|
/app/src/main/java/app/com/esenatenigeria/model/BillsModel.java
|
177a048e41bff65110dcf21d687c4d054ff1b701
|
[] |
no_license
|
sh7verma/nass_
|
6f16264e3fa6e74d4c744d31b791c893b3f26b5b
|
56b7a6af0786edcfa682369b04ad919e828c7950
|
refs/heads/master
| 2020-05-09T20:42:26.389838
| 2018-09-28T11:47:49
| 2018-09-28T11:47:49
| 181,417,480
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,100
|
java
|
package app.com.esenatenigeria.model;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Index;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;
import java.util.List;
import app.com.esenatenigeria.utils.Encode;
/**
* Created by dev on 26/4/18.
*/
public class BillsModel {
static private Encode encode = new Encode();
private int statusCode;
private String message;
private DataBeanX data;
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public DataBeanX getDataX() {
return data;
}
public void setDataX(DataBeanX data) {
this.data = data;
}
public static class DataBeanX {
private int count;
private List<DataBean> data;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
}
@Entity(tableName = "BillsDataBean", indices = {@Index(value = {"doc_id"},
unique = true)})
public static class DataBean {
/**
* doc_id : 5addad53f58204746f80c03b
* category : SbA06tQMWcg8GR7Yh+RiTA==
* chamber : 9ZjqcZ0HS8yvraRMyThHOg==
* date : 2017-11-17T00:00:00.000Z
* session : null
* parliament : null
* docURL : FsGrVtqTOKTEYoXievB4tXOxnCLdz4FUZgiai04uKMw+85uiktr7MBH+qVqRleNW
* name : FIaYb7vVjo7AYDjQ7oQOExH67DmTeWe5VLRj6gG1vQjYTBOiLdrwAlwwjNHudKM+xe9eEYnuJkWKlCAJru5T2Q==
* __v : 0
*/
@PrimaryKey
@ColumnInfo(name = "doc_id")
@NonNull
private String doc_id;
@ColumnInfo(name = "bill_category")
private String category;
@ColumnInfo(name = "bill_chamber")
private String chamber;
@ColumnInfo(name = "bill_date")
private String date;
@ColumnInfo(name = "bill_summary")
private String summary;
@ColumnInfo(name = "bills_source")
private String source;
@ColumnInfo(name = "bill_session")
private String session;
@ColumnInfo(name = "bill_parliament")
private String parliament;
@ColumnInfo(name = "bill_docURL")
private String docURL;
@ColumnInfo(name = "bill_docLocalPath")
private String docLocalPath;
@ColumnInfo(name = "bill_name")
private String name;
@ColumnInfo(name = "bill_codeUpdatedAt")
private String codeUpdatedAt;
public String getCodeUpdatedAt() {
return codeUpdatedAt;
}
public void setCodeUpdatedAt(String codeUpdatedAt) {
this.codeUpdatedAt = codeUpdatedAt;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getDocLocalPath() {
return docLocalPath;
}
public void setDocLocalPath(String docLocalPath) {
this.docLocalPath = docLocalPath;
}
public String getDoc_id() {
return doc_id;
}
public void setDoc_id(String doc_id) {
this.doc_id = doc_id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getChamber() {
return chamber;
}
public void setChamber(String chamber) {
this.chamber = chamber;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getSession() {
return session;
}
public void setSession(String session) {
this.session = session;
}
public String getParliament() {
return parliament;
}
public void setParliament(String parliament) {
this.parliament = parliament;
}
public String getDocURL() {
return docURL;
}
public void setDocURL(String docURL) {
this.docURL = docURL;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
|
[
"shubham.v@applify.co"
] |
shubham.v@applify.co
|
ff1f227a39f0f8b27607870de3e2dd27617c9a0d
|
eb6a8d1f92b8620de8a5bdd8223a6fdd4560066e
|
/cli/src/main/java/com/github/microwww/security/cli/help/Nullable.java
|
a4b13c16b0acf6e065b99bdeab9b453330455f2f
|
[
"Apache-2.0"
] |
permissive
|
microwww/URL-security
|
3f94482c77ce242415229645f7125d4924e81c15
|
c1587d817769a047211a2a2405ef130a6a5c1cfe
|
refs/heads/main
| 2023-01-31T11:48:10.106472
| 2020-12-16T03:18:36
| 2020-12-16T03:18:36
| 310,476,616
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 79
|
java
|
package com.github.microwww.security.cli.help;
public @interface Nullable {
}
|
[
"lcs.005@163.com"
] |
lcs.005@163.com
|
c41ae3d81f20a6de968917215a272a0da85f3445
|
cfc60fc1148916c0a1c9b421543e02f8cdf31549
|
/src/testcases/CWE113_HTTP_Response_Splitting/CWE113_HTTP_Response_Splitting__URLConnection_setHeaderServlet_07.java
|
7e776e5d7cd5be87562ae4f7a9a454eb1edb305a
|
[
"LicenseRef-scancode-public-domain"
] |
permissive
|
zhujinhua/GitFun
|
c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2
|
987f72fdccf871ece67f2240eea90e8c1971d183
|
refs/heads/master
| 2021-01-18T05:46:03.351267
| 2012-09-11T16:43:44
| 2012-09-11T16:43:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 15,941
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__URLConnection_setHeaderServlet_07.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-07.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: URLConnection Read a string from a web server with URLConnection
* GoodSource: A hardcoded string
* Sinks: setHeaderServlet
* GoodSink: URLEncode input
* BadSink : querystring to setHeader()
* Flow Variant: 07 Control flow: if(private_five==5) and if(private_five!=5)
*
* */
package testcases.CWE113_HTTP_Response_Splitting;
import testcasesupport.*;
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Logger;
import java.net.URLEncoder;
public class CWE113_HTTP_Response_Splitting__URLConnection_setHeaderServlet_07 extends AbstractTestCaseServlet
{
/* The variable below is not declared "final", but is never assigned
any other value so a tool should be able to identify that reads of
this will always give its initialized value. */
private int private_five = 5;
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
URLConnection conn = (new URL("http://www.example.org/")).openConnection();
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* read input from URLConnection */
instrread = new InputStreamReader(conn.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine(); // This will be reading the first "line" of the response body,
// which could be very long if there are no newlines in the HTML
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-16");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
/* goodG2B1() - use goodsource and badsink by changing first private_five==5 to private_five!=5 */
private void goodG2B1(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* INCIDENTAL: CWE 570 Statement is Always False */
if(private_five!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
URLConnection conn = (new URL("http://www.example.org/")).openConnection();
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* read input from URLConnection */
instrread = new InputStreamReader(conn.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine(); // This will be reading the first "line" of the response body,
// which could be very long if there are no newlines in the HTML
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
}
}
else {
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-16");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in first if */
private void goodG2B2(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
URLConnection conn = (new URL("http://www.example.org/")).openConnection();
BufferedReader buffread = null;
InputStreamReader instrread = null;
try {
/* read input from URLConnection */
instrread = new InputStreamReader(conn.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine(); // This will be reading the first "line" of the response body,
// which could be very long if there are no newlines in the HTML
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally {
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
}
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-16");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
/* goodB2G1() - use badsource and goodsink by changing second private_five==5 to private_five!=5 */
private void goodB2G1(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
URLConnection conn = (new URL("http://www.example.org/")).openConnection();
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* read input from URLConnection */
instrread = new InputStreamReader(conn.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine(); // This will be reading the first "line" of the response body,
// which could be very long if there are no newlines in the HTML
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
/* INCIDENTAL: CWE 570 Statement is Always False */
if(private_five!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
else {
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-16");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
/* goodB2G2() - use badsource and goodsink by reversing statements in second if */
private void goodB2G2(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
URLConnection conn = (new URL("http://www.example.org/")).openConnection();
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* read input from URLConnection */
instrread = new InputStreamReader(conn.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine(); // This will be reading the first "line" of the response body,
// which could be very long if there are no newlines in the HTML
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-16");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B1(request, response);
goodG2B2(request, response);
goodB2G1(request, response);
goodB2G2(request, response);
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"amitf@chackmarx.com"
] |
amitf@chackmarx.com
|
0d907239607e7262828d8ab07f83a06afe59adfe
|
fe2feb6a4df973c9809463eefd1234eb7f34534a
|
/Stream/src/eicoma/com/github/stream/practice/StreamDemo7.java
|
ae3c8f3659018c66e4a61a4ffd26bc73a0ab024b
|
[] |
no_license
|
Eicoma/some-practice
|
49511594b8e4d92344f8355389b15a83b105ba26
|
abd3b4dcaf6eae0f830352278d0e3d46df82aa62
|
refs/heads/master
| 2023-08-13T18:39:39.609257
| 2021-10-20T03:49:47
| 2021-10-20T03:49:47
| 356,270,679
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,968
|
java
|
package eicoma.com.github.stream.practice;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
/**
* 案例需求
* <p>
* 现在有两个ArrayList集合,分别存储6名男演员名称和6名女演员名称,要求完成如下的操作
* <p>
* - 男演员只要名字为3个字的前三人
* - 女演员只要姓林的,并且不要第一个
* - 把过滤后的男演员姓名和女演员姓名合并到一起
* - 把上一步操作后的元素作为构造方法的参数创建演员对象,遍历数据
* <p>
* 演员类Actor已经提供,里面有一个成员变量,一个带参构造方法,以及成员变量对应的get/set方法
*/
public class StreamDemo7 {
public static void main(String[] args) {
List<String> list1 = new ArrayList<>();
List<String> list2 = new ArrayList<>();
list1.add("周润发");
list1.add("成龙");
list1.add("刘德华");
list1.add("吴京");
list1.add("周星驰");
list1.add("李连杰");
list2.add("林心如");
list2.add("张曼玉");
list2.add("林青霞");
list2.add("柳岩");
list2.add("林志玲");
list2.add("王祖贤");
Stream<String> manStream = list1.stream().filter(
(String s) -> {
return s.length() == 3;
}
).limit(3);
Stream<String> womanStream = list2.stream().filter(
(String s) -> {
return s.startsWith("林");
}
).skip(1);
//将两个流合并到一个流stream中
Stream<String> stream = Stream.concat(manStream, womanStream);
//用lambda表达式去遍历stream流中的所有元素并使用
stream.forEach(
(String name) -> {
Actor actor = new Actor(name);
System.out.println(actor);
});
}
}
|
[
"328084834@qq.com"
] |
328084834@qq.com
|
a9b8020599a8a65d91ba4f6fc0c33a2f79c35f5b
|
29a25e7ae2be4b84e56c55a8ae32ee745ec7f107
|
/jPDFmelange/JPanelViewPrefs.java
|
09a48d315a796b03afb2ea45de41b89335c7b0f6
|
[] |
no_license
|
dertoki/jPDFmelange
|
83a637bed9ae597ed9a7e7e5ecef227a06abe293
|
ab29e34dfe538b7472801aac2cc494c7be38f112
|
refs/heads/master
| 2021-01-01T05:50:38.878341
| 2014-03-09T18:17:55
| 2014-03-09T18:17:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 11,197
|
java
|
/***************************************************************************
* Copyright (C) 2008 by Tobias Tandetzki *
* tandetzki.tobias@t-online.de *
* *
* 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; either version 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
package jPDFmelange;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.border.EtchedBorder;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Rectangle;
import java.util.ResourceBundle;
public class JPanelViewPrefs extends JPanel {
/**
* A panel with PDF preferences used in MelangeJFrame and MelangePreferencesDialog.
*
* @author tobias tandetzki 12.07.2009
*/
private static final long serialVersionUID = 1L;
private ResourceBundle messages = null;
public JTextPane jTextPanePageLayout = null;
public JTextPane jTextPanePageMode = null;
public JComboBox jComboBoxPageLayout = null;
public JComboBox jComboBoxPageMode = null;
public JCheckBox jCheckBoxHideToolbar = null;
public JCheckBox jCheckBoxHideMenubar = null;
public JCheckBox jCheckBoxHideWindowUI = null;
public JCheckBox jCheckBoxFitWindow = null;
public JCheckBox jCheckBoxCenterWindow = null;
public JCheckBox jCheckBoxDisplayDocTitle = null;
/**
* This method initializes
*
*/
public JPanelViewPrefs() {
super();
initialize();
set();
}
/**
* This method set the values of elements
*
*/
public void set() {
for (String element: MelangeJFrame.PageLayout.keySet()){
jComboBoxPageLayout.addItem(getMessages().getString(element));
}
String pref = getMessages().getString(MelangeJFrame.prefPageLayout);
jComboBoxPageLayout.setSelectedItem((Object)pref);
for (String element: MelangeJFrame.PageMode.keySet()){
jComboBoxPageMode.addItem(getMessages().getString(element));
}
pref = getMessages().getString(MelangeJFrame.prefPageMode);
jComboBoxPageMode.setSelectedItem((Object)pref);
}
/**
* This method returns the PageMode as non locale
*
* @return String
*/
public String getKeyPageMode(){
String localkey = (String) jComboBoxPageMode.getSelectedItem();
for (String key: MelangeJFrame.PageMode.keySet())
if (getMessages().getString(key).equals(localkey)){
return key;
}
return null;
}
/**
* This method returns the PageLayout as non locale
*
* @return String
*/
public String getKeyPageLayout(){
String localkey = (String) jComboBoxPageLayout.getSelectedItem();
for (String key: MelangeJFrame.PageLayout.keySet())
if (getMessages().getString(key).equals(localkey)){
return key;
}
return null;
}
/**
* This method initializes this
*
*/
private void initialize() {
this.setLayout(null);
this.setBounds(new Rectangle(10, 170, 361, 261));
this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
this.add(getJTextPanePageMode(), null);
this.add(getJTextPanePageLayout(), null);
this.add(getJComboBoxPageLayout(), null);
this.add(getJComboBoxPageMode(), null);
this.add(getJCheckBoxHideToolbar(), null);
this.add(getJCheckBoxHideMenubar(), null);
this.add(getJCheckBoxHideWindowUI(), null);
this.add(getJCheckBoxFitWindow(), null);
this.add(getJCheckBoxCenterWindow(), null);
this.add(getJCheckBoxDisplayDocTitle(), null);
}
/**
* This method initializes jTextPanePageLayout
*
* @return javax.swing.JTextPane
*/
private JTextPane getJTextPanePageLayout() {
if (jTextPanePageLayout == null) {
String string = getMessages().getString("PageLayout");
jTextPanePageLayout = new JTextPane();
jTextPanePageLayout.setBounds(new Rectangle(10, 40, 101, 21));
jTextPanePageLayout.setForeground(Color.GRAY);
jTextPanePageLayout.setPreferredSize(new Dimension(70, 21));
jTextPanePageLayout.setEditable(false);
jTextPanePageLayout.setBackground(new Color(238, 238, 238));
jTextPanePageLayout.setText(string);
}
return jTextPanePageLayout;
}
/**
* This method initializes jTextPanePageMode
*
* @return javax.swing.JTextPane
*/
private JTextPane getJTextPanePageMode() {
if (jTextPanePageMode == null) {
jTextPanePageMode = new JTextPane();
jTextPanePageMode.setBounds(new Rectangle(10, 10, 101, 21));
jTextPanePageMode.setForeground(Color.GRAY);
jTextPanePageMode.setText(getMessages().getString("PageMode"));
jTextPanePageMode.setBackground(new Color(238, 238, 238));
jTextPanePageMode.setEditable(false);
}
return jTextPanePageMode;
}
/**
* This method initializes jComboBoxPageLayout
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBoxPageLayout() {
if (jComboBoxPageLayout == null) {
jComboBoxPageLayout = new JComboBox();
jComboBoxPageLayout.setBounds(new Rectangle(120, 40, 231, 24));
jComboBoxPageLayout.setBackground(Color.white);
jComboBoxPageLayout.setEnabled(false);
}
return jComboBoxPageLayout;
}
/**
* This method initializes jComboBoxPageMode
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBoxPageMode() {
if (jComboBoxPageMode == null) {
jComboBoxPageMode = new JComboBox();
jComboBoxPageMode.setBounds(new Rectangle(120, 10, 231, 24));
jComboBoxPageMode.setBackground(Color.white);
jComboBoxPageMode.setSelectedItem(getMessages().getString(MelangeJFrame.prefPageMode));
jComboBoxPageMode.setEnabled(false);
}
return jComboBoxPageMode;
}
/**
* This method initializes jCheckBoxHideToolbar
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBoxHideToolbar() {
if (jCheckBoxHideToolbar == null) {
jCheckBoxHideToolbar = new JCheckBox();
jCheckBoxHideToolbar.setBounds(new Rectangle(10, 80, 341, 21));
jCheckBoxHideToolbar.setFont(new Font("Dialog", Font.PLAIN, 12));
jCheckBoxHideToolbar.setText(getMessages().getString("Page_HIDETOOLBAR"));
jCheckBoxHideToolbar.setEnabled(false);
jCheckBoxHideToolbar.setSelected(MelangeJFrame.prefHideToolbar);
}
return jCheckBoxHideToolbar;
}
/**
* This method initializes jCheckBoxHideMenubar
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBoxHideMenubar() {
if (jCheckBoxHideMenubar == null) {
jCheckBoxHideMenubar = new JCheckBox();
jCheckBoxHideMenubar.setBounds(new Rectangle(10, 110, 341, 21));
jCheckBoxHideMenubar.setFont(new Font("Dialog", Font.PLAIN, 12));
jCheckBoxHideMenubar.setText(getMessages().getString("Page_HIDEMENUBAR"));
jCheckBoxHideMenubar.setEnabled(false);
jCheckBoxHideMenubar.setSelected(MelangeJFrame.prefHideMenubar);
}
return jCheckBoxHideMenubar;
}
/**
* This method initializes jCheckBoxHideWindowUI
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBoxHideWindowUI() {
if (jCheckBoxHideWindowUI == null) {
jCheckBoxHideWindowUI = new JCheckBox();
jCheckBoxHideWindowUI.setBounds(new Rectangle(10, 140, 341, 21));
jCheckBoxHideWindowUI.setFont(new Font("Dialog", Font.PLAIN, 12));
jCheckBoxHideWindowUI.setText(getMessages().getString("Page_HIDEWINDOWUI"));
jCheckBoxHideWindowUI.setEnabled(false);
jCheckBoxHideWindowUI.setSelected(MelangeJFrame.prefHideWindowUI);
}
return jCheckBoxHideWindowUI;
}
/**
* This method initializes jCheckBoxFitWindow
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBoxFitWindow() {
if (jCheckBoxFitWindow == null) {
jCheckBoxFitWindow = new JCheckBox();
jCheckBoxFitWindow.setBounds(new Rectangle(10, 170, 341, 21));
jCheckBoxFitWindow.setFont(new Font("Dialog", Font.PLAIN, 12));
jCheckBoxFitWindow.setText(getMessages().getString("Page_FITWINDOW"));
jCheckBoxFitWindow.setEnabled(false);
jCheckBoxFitWindow.setSelected(MelangeJFrame.prefFitWindow);
}
return jCheckBoxFitWindow;
}
/**
* This method initializes jCheckBoxCenterWindow
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBoxCenterWindow() {
if (jCheckBoxCenterWindow == null) {
jCheckBoxCenterWindow = new JCheckBox();
jCheckBoxCenterWindow.setBounds(new Rectangle(10, 200, 341, 21));
jCheckBoxCenterWindow.setFont(new Font("Dialog", Font.PLAIN, 12));
jCheckBoxCenterWindow.setText(getMessages().getString("Page_CENTERWINDOW"));
jCheckBoxCenterWindow.setEnabled(false);
jCheckBoxCenterWindow.setSelected(MelangeJFrame.prefCenterWindow);
}
return jCheckBoxCenterWindow;
}
/**
* This method initializes jCheckBoxDisplayDocTitle
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBoxDisplayDocTitle() {
if (jCheckBoxDisplayDocTitle == null) {
jCheckBoxDisplayDocTitle = new JCheckBox();
jCheckBoxDisplayDocTitle.setBounds(new Rectangle(10, 230, 341, 21));
jCheckBoxDisplayDocTitle.setFont(new Font("Dialog", Font.PLAIN, 12));
jCheckBoxDisplayDocTitle.setEnabled(false);
jCheckBoxDisplayDocTitle.setSelected(MelangeJFrame.prefDisplayDocTitle);
jCheckBoxDisplayDocTitle.setText(getMessages().getString("Page_DISPLAYDOCTITLE"));
jCheckBoxDisplayDocTitle.setVisible(false);
}
return jCheckBoxDisplayDocTitle;
}
/**
* This method initializes messages
*
* @return java.util.PropertyResourceBundle
*/
private ResourceBundle getMessages() {
if (messages == null) {
messages = ResourceBundle.getBundle("resources/MelangeMessages", MelangeJFrame.locale);
}
return messages;
}
/**
* This method initializes jCheckBoxEnablePDFViewerPrefs
*
* @return void
*/
public void setEnablePDFViewerPrefs(boolean isenabled) {
if (isenabled){
for (int i=0; i<this.getComponentCount();i++){
this.getComponent(i).setEnabled(true);
this.getComponent(i).setForeground(Color.BLACK);
};
} else {
for (int i=0; i<this.getComponentCount();i++){
this.getComponent(i).setEnabled(false);
this.getComponent(i).setForeground(Color.GRAY);
}
}
}
} // @jve:decl-index=0:visual-constraint="10,10"
|
[
"dertoki"
] |
dertoki
|
dc26462833a9781094f0a2b5ab5b960b72e85788
|
93b52ef4c7ce3d90ee881346f7340971142b4bba
|
/Lesson8/src/MemoryDataService.java
|
37affe61fa641ddda622244028a7192683581434
|
[] |
no_license
|
KarinaZelenkevich/Lesson8
|
68b6f39da33dbc053467e9121803c4d803f397cf
|
638179cf907f270803bde3e49d3fd101d1441f3c
|
refs/heads/master
| 2023-08-14T18:43:57.738201
| 2021-10-08T10:30:30
| 2021-10-08T10:30:30
| 414,942,991
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 542
|
java
|
import java.util.ArrayList;
import java.util.List;
public class MemoryDataService implements DataService{
private List<String> list = new ArrayList<>();
@Override
public void add(String text) throws LowMemory {
if (list.size()>4) {
throw new LowMemory();
} else {
list.add(text);
}
}
@Override
public String get() throws EmptyMemory {
if (list.size() < 1) {
throw new EmptyMemory();
} else {
return list.remove(1);
}
}
}
|
[
"pioni.mika@mail.ru"
] |
pioni.mika@mail.ru
|
0e9aced758bb65938359fa5e4b655d3965e64719
|
e07bb764864d7f618a245b242489e5f55acd879a
|
/code/tdt-base-support/tdt-sys/src/main/java/com/tdt/sys/core/attribute/AttributeSetInteceptor.java
|
cd08f83d74cb8f14cbe5423713d32283de43beb5
|
[] |
no_license
|
gechangjiang/wms
|
b61e7aed8a983a6bfbf4044289d8cf2dd67561d1
|
45d9ba6f6c0ca6d3ebee617a625199073b29b345
|
refs/heads/main
| 2023-07-03T21:21:21.464250
| 2021-08-09T08:53:14
| 2021-08-09T08:53:14
| 393,873,738
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,107
|
java
|
/**
* Copyright 2018-2020 thedreamtree (https://gitee.com/thedreamtree)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tdt.sys.core.attribute;
import com.tdt.base.shiro.ShiroUser;
import com.tdt.sys.core.shiro.ShiroKit;
import com.tdt.sys.core.util.DefaultImages;
import org.apache.shiro.authc.AuthenticationException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 自动渲染当前用户信息登录属性 的过滤器
*
* @author gcj
* @Date 2018/10/30 4:30 PM
*/
public class AttributeSetInteceptor extends HandlerInterceptorAdapter {
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
//没有视图的直接跳过过滤器
if (modelAndView == null || modelAndView.getViewName() == null) {
return;
}
//视图结尾不是html的直接跳过
if (!modelAndView.getViewName().endsWith("html")) {
return;
}
ShiroUser user = ShiroKit.getUser();
if (user == null) {
throw new AuthenticationException("当前没有登录账号!");
} else {
modelAndView.addObject("name", user.getName());
modelAndView.addObject("avatar", DefaultImages.defaultAvatarUrl());
modelAndView.addObject("email", user.getEmail());
}
}
}
|
[
"812829269@qq.com"
] |
812829269@qq.com
|
184d191b91a65aeb8e2b6c012d62e30eda607c40
|
9af5abe79a9d2d38b2d6d34c4d821a07935e3339
|
/src/main/java/com/phonemetra/turbo/binary/BinaryNameMapper.java
|
0923caa525bc9db34ac32b4a1ecbc9103c4ee11c
|
[
"Apache-2.0"
] |
permissive
|
Global-localhost/TurboSQL
|
a66b70a8fdb4cd67642dda0dad132986f2b9165c
|
10dd81a36a0e25b1f786e366eb3ed9af0e5e325b
|
refs/heads/master
| 2022-12-17T05:48:16.652086
| 2019-04-16T23:02:00
| 2019-04-16T23:02:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,631
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.phonemetra.turbo.binary;
import com.phonemetra.turbo.configuration.BinaryConfiguration;
/**
* Maps type and field names to different names. Prepares class/type names
* and field names before pass them to {@link BinaryIdMapper}.
* <p>
* Binary name mapper can be configured for all binary objects via
* {@link BinaryConfiguration#getNameMapper()} method,
* or for a specific binary type via {@link BinaryTypeConfiguration#getNameMapper()} method.
* @see BinaryIdMapper
*/
public interface BinaryNameMapper {
/**
* Gets type clsName.
*
* @param clsName Class came
* @return Type name.
*/
String typeName(String clsName);
/**
* Gets field name.
*
* @param fieldName Field name.
* @return Field name.
*/
String fieldName(String fieldName);
}
|
[
"devteam@phonemetra.com"
] |
devteam@phonemetra.com
|
3264804fb1be87b577be11b4b0ee869929d9d243
|
2d24ff8a02feafb160c3665042aecd3154da0b14
|
/Ex_203_Kniffel/src/BL/DiceTableModel.java
|
6b8303f6c1d790b75bafcb5e88b4bdf0ab551076
|
[] |
no_license
|
hanslissi/17_Exercise_203_AdvancedKniffel
|
ca20b0f1d992f38aa7c04ccecfd5a15b502a6360
|
a3e23361677d044313db07a08bc7de9c6ca6ec2c
|
refs/heads/master
| 2020-04-04T20:51:23.837694
| 2018-11-05T18:41:11
| 2018-11-05T18:41:11
| 156,263,412
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,571
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package BL;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.ImageIcon;
import javax.swing.table.AbstractTableModel;
/**
*
* @author johannesriedmueller
*/
public class DiceTableModel extends AbstractTableModel {
private int[] diceNumbers = {1, 2, 3, 4, 5};
public void scramble(int[] numsNotToScramble) {
Random r = new Random();
int notScrambleCounter = 0;
for (int i = 0; i < diceNumbers.length; i++) {
if (!(i == numsNotToScramble[notScrambleCounter])) {
diceNumbers[i] = 1 + r.nextInt(5);
} else if (notScrambleCounter != numsNotToScramble.length - 1) {
notScrambleCounter++;
}
}
fireTableRowsUpdated(0, diceNumbers.length - 1);
}
public void scramble() {
Random r = new Random();
for (int i = 0; i < diceNumbers.length; i++) {
diceNumbers[i] = 1 + r.nextInt(6);
}
fireTableRowsUpdated(0, diceNumbers.length - 1);
}
@Override
public int getRowCount() {
return 1;
}
@Override
public int getColumnCount() {
return diceNumbers.length;
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
return diceNumbers[columnIndex];
}
public int[] getDiceNumbers() {
return diceNumbers;
}
}
|
[
"johannesriedmueller@johanness-mbp.home"
] |
johannesriedmueller@johanness-mbp.home
|
ef38d478f67296aa3706a5f6bda71520043d8c92
|
c7d3ad19ea7a8d7e8a9899351c15748c0311ee9c
|
/ArdavanGhaffari/QL/src/main/java/nl/uva/ql/ast/expression/binaryexpression/Subtraction.java
|
aa8325c1a76214f17d27038fc658358e86785f11
|
[] |
no_license
|
software-engineering-amsterdam/multi-ql
|
97f6f6060b40411a01aa3ca0071c9dc1745a67b4
|
89b68e22284f7f77c192ab90dbd4c1e985ed7acc
|
refs/heads/master
| 2022-04-29T08:22:12.454404
| 2022-04-19T10:59:57
| 2022-04-19T10:59:57
| 50,788,430
| 2
| 2
| null | 2022-04-19T10:59:58
| 2016-01-31T18:25:34
|
Java
|
UTF-8
|
Java
| false
| false
| 451
|
java
|
package nl.uva.ql.ast.expression.binaryexpression;
import nl.uva.ql.ast.expression.Expression;
import nl.uva.ql.visitors.ExpressionVisitor;
public class Subtraction extends BinaryExpression{
public Subtraction(Expression leftExpression, Expression rightExprssion, int line) {
super(leftExpression, rightExprssion, line);
}
@Override
public <T> T accept(ExpressionVisitor<T> expressionVisitor) {
return expressionVisitor.visit(this);
}
}
|
[
"ardavan.ghaffari@student.uva.nl"
] |
ardavan.ghaffari@student.uva.nl
|
f4cb37090fc60229ce540c05b19a4b6a3973cbb8
|
e76706fd2faa89b8c3ec96c97ba6db5a6017e697
|
/src/main/java/com/adusoft/web/exception/InternalServerException.java
|
c5fd4e3f07c95534941857862dfebec9b4045b08
|
[] |
no_license
|
adusoft/timebuddy
|
c4683cb075f73f83649cb998fd50538e2b3f9526
|
c1ad7865b51214d8e6708dd518d8df99da537f53
|
refs/heads/master
| 2020-12-24T16:50:20.559917
| 2015-02-10T21:20:00
| 2015-02-10T21:20:00
| 30,863,936
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 179
|
java
|
package com.adusoft.web.exception;
public class InternalServerException extends RuntimeException {
public InternalServerException(String message) {
super(message);
}
}
|
[
"adam.nowaczyk@softwaremind.pl"
] |
adam.nowaczyk@softwaremind.pl
|
759407c348f0d80a2d6c2f96a34ed8815a529fa0
|
9a8dd9507963838ec8ebd8b51d02d457b225fe54
|
/src/ChickenSub.java
|
f310e6872a962b2414e8955976d1053044487c4d
|
[] |
no_license
|
EunPyoLee/decorator-servway
|
ed6e9da5624f45bd15cca22477f29820b053d1c1
|
3e90f5cf0c850fdd94cfbe6600edd66a4d614bc8
|
refs/heads/master
| 2023-07-22T14:30:06.977953
| 2021-09-01T11:58:19
| 2021-09-01T11:58:19
| 400,963,552
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 500
|
java
|
import common.Glossary;
import common.type.BaseEnum;
import common.type.BreadEnum;
public class ChickenSub extends Sub {
private BreadEnum bread;
private final Glossary glossary;
public ChickenSub(BreadEnum b, Glossary g){
this.bread = b;
this.name = "Chicken" + " " + b.toString();
this.glossary = g;
}
@Override
public double getCost() throws Exception{
return glossary.getBaseCost(BaseEnum.CHICKEN) + glossary.getBreadCost(bread);
}
}
|
[
"eunpyo@umich.edu"
] |
eunpyo@umich.edu
|
5d18e08ad89ac5548cbb97021b3ddc784b90595b
|
8994b05deec0adf97da101bc8ddcd361865f00fb
|
/src/edit/GeneralTableModel.java
|
b4dc96fd8cfa52b38359bac086860f8ee57176c1
|
[] |
no_license
|
JaroslawHryszko/MISTA
|
ed9bc3f4c46d1bf612348a6b449c6e5f3024a64c
|
087d399538e4f5f2a54fd1a3561c2929a359aa92
|
refs/heads/master
| 2022-07-01T16:52:01.783312
| 2022-05-28T12:29:40
| 2022-05-28T12:29:40
| 365,211,048
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,816
|
java
|
/*
Author Dianxiang Xu
*/
package edit;
import java.awt.Dimension;
import java.util.*;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import locales.LocaleBundle;
public class GeneralTableModel extends AbstractTableModel {
private static final long serialVersionUID = 1L;
protected String[] columnNames;
protected Vector<Vector<Object>> data;
protected boolean editable;
private int totalColumnCount;
private int visibleColumnCount;
public GeneralTableModel(Vector<Vector<Object>> data, String[] columnNames, int totalColumnCount, boolean editable){
this.data = data;
this.columnNames = new String[columnNames.length];
for (int i=0; i<columnNames.length; i++)
this.columnNames[i] = LocaleBundle.bundleString(columnNames[i]);
this.totalColumnCount = totalColumnCount;
this.editable = editable;
visibleColumnCount = columnNames.length;
}
public void setMinimumRows(int rows){
int index = data.size();
while (index++<rows){
addRow();
}
}
public Vector<Vector<Object>> getData(){
return data;
}
public String getColumnName(int column) {
return columnNames[column];
}
public void setColumnName(int column, String name) {
columnNames[column] = name;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public Class getColumnClass(int columnIndex) {
// if (columnIndex==0)
// return Integer.class;
return String.class;
}
public boolean isCellEditable(int row, int column) {
return column!=0 && editable;
}
public Object getValueAt(int row, int column) {
Vector<Object> rowVector = data.get(row);
return rowVector.get(column);
}
public void setValueAt(Object value, int row, int column) {
Vector<Object> rowVector = data.get(row);
rowVector.set(column, value);
fireTableCellUpdated(row, column);
}
public boolean isEmptyRow(int row) {
Vector<Object> rowData = data.get(row);
// 0 index is the number
for (int index=1; index<rowData.size(); index++){
Object cell = rowData.get(index);
// if (cell!=null && cell instanceof String && !((String)cell).trim().equals(""))
// return false;
if (cell!=null && !cell.toString().trim().equals(""))
return false;
}
return true;
}
public boolean isEmptyTable(){
for (int row=0; row<data.size(); row++)
if (!isEmptyRow(row))
return false;
return true;
}
public boolean hasEnoughEmptyRowsAtBottom(){
int MAX=30;
if (data.size()<MAX)
return false;
int numberOfEmptyRows=0;
for (int row=data.size()-1; row>=0 && numberOfEmptyRows<MAX; row--){
if (isEmptyRow(row))
numberOfEmptyRows++;
else
break;
}
return numberOfEmptyRows>=MAX;
}
public int getRowCount() {
return data.size();
}
public int getColumnCount() {
return columnNames.length;
}
public int getVisibleColumnCount(){
return visibleColumnCount;
}
public void removeRow(int index){
data.remove(index);
updateNumbers(index);
fireTableRowsDeleted(index, index);
}
public void addRow() {
Vector<Object> newRow = new Vector<Object>();
newRow.add(""+(data.size()+1));
for (int column =1; column<totalColumnCount; column++)
newRow.add(null);
data.add(newRow);
fireTableRowsInserted(data.size()-1, data.size()-1);
}
public void insertRow(int index) {
Vector<Object> newRow = new Vector<Object>();
newRow.add(""+index);
for (int column =1; column<totalColumnCount; column++)
newRow.add(null);
data.insertElementAt(newRow, index);
updateNumbers(index);
fireTableRowsInserted(index, index);
}
public String rowString(int index){
String result = "";
Vector<Object> vector = data.get(index);
for (Object object: vector)
if (object!=null)
result +=" "+object.toString();
return result;
}
private void updateNumbers(int start){
int index = start;
while (index<data.size()){
Vector<Object> row = data.get(index);
row.set(0, ""+(index+1));
index++;
}
}
public String toString(){
String result = "";
for (int i=0; i<data.size(); i++){
result+= rowString(i);
}
return result;
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
}
Vector<Object> v1 = new Vector<Object>();
v1.add("1");
v1.add("picpup(x)");
v1.add("handempty");
v1.add("ontable");
v1.add("when");
v1.add("effect");
v1.add("inscription");
Vector<Object> v2 = new Vector<Object>();
v2.add("1");
v2.add("picpup(x)");
v2.add("handempty");
v2.add("ontable");
v2.add("when");
v2.add("effect");
v2.add("inscription");
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
data.add(v1);
data.add(v2);
String[] columnNames = {"1", "2", "3", "4"};
GeneralTableModel tableModel = new GeneralTableModel(data, columnNames, 7, true);
JTable table = new JTable(tableModel);
table.setColumnSelectionAllowed(false);
table.setDefaultRenderer(String.class, new DefaultTableCellRenderer());//new TextAreaCellRenderer());
JFrame frame = new JFrame("Table");
/* frame.addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent e ) {
System.exit(0);
}
});
*/
JScrollPane scrollpane = new JScrollPane(table);
scrollpane.setPreferredSize(new Dimension(800,500));
frame.getContentPane().add(scrollpane);
frame.pack();
frame.setVisible(true);
}
}
|
[
"dxu@ENG401259.local"
] |
dxu@ENG401259.local
|
5bc281ee729a30cd0a5fe3e4a34c7c060a618608
|
d9ac23429bc6f606fae300b38026ebfabb7e0b96
|
/fsm-stateless4j/src/main/java/com/liuqitech/fsm/stateless4j/State.java
|
b1bf656e8c1ba0aaa87861f9afa2ac1dbdfd5b7f
|
[] |
no_license
|
liuqitoday/fsm-demo
|
b802ccb16fdb4f2d0777eeaf821228debae2b83d
|
343ae55f66e527feb28ddca5bd425a07c0556dac
|
refs/heads/master
| 2021-03-06T23:12:31.792271
| 2020-03-10T07:13:18
| 2020-03-10T07:13:18
| 246,231,497
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 243
|
java
|
package com.liuqitech.fsm.stateless4j;
/**
* 订单状态枚举
*/
public enum State {
/**
* 已确认
*/
CONFIRMED,
/**
* 已付款
*/
PAID,
/**
* 已发货
*/
SHIPPED,
/**
* 已签收
*/
RECEIVED;
}
|
[
"liuqitoday@163.com"
] |
liuqitoday@163.com
|
1a219e65901ce41935aaa1ca680ba3fa44e7e633
|
ed57c8a0efe0f8c3c38e33e52efe7bd5db97f7a9
|
/web1/src/main/java/com/example/web1/service/ICommentService.java
|
424c50498658d413ca0ede76f058f7eff8611a83
|
[] |
no_license
|
sonbt1993/web1
|
5293e8a37f4125f5b873a34de5ce8389a02bf0d5
|
06e351568670a433ec2c982784d224d3cd002b79
|
refs/heads/main
| 2023-02-24T23:43:43.634777
| 2021-02-01T16:10:56
| 2021-02-01T16:10:56
| 334,679,714
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 72
|
java
|
package com.example.web1.service;
public interface ICommentService {
}
|
[
"sonbutung@gmail.com"
] |
sonbutung@gmail.com
|
717ccc1e771341b4d9a6d3cfd48960f82bbe247c
|
14a44eaa62df3aed9a429b8dec700b62da688a08
|
/src/main/java/HibernateProyect/HibernateProyect/modelo/Usuario.java
|
ee25e5afddae920f5288f2e5fd5ac4164fc881d1
|
[] |
no_license
|
daniatenciano/HibernateProyect
|
23374f35f8efde0d04fe3da6b82773158c025d6e
|
cb1a524d043bd66055836ed1bde106b2313ad678
|
refs/heads/master
| 2020-03-11T09:05:47.791851
| 2018-04-20T12:12:58
| 2018-04-20T12:12:58
| 129,901,827
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,089
|
java
|
package HibernateProyect.HibernateProyect.modelo;
import java.io.*;
import java.util.*;
import javax.persistence.*;
@Entity
@Table(name = "A_USU")
@Inheritance(strategy = InheritanceType.JOINED)
public class Usuario implements Serializable {
@Id
@GeneratedValue
@Column(name = "USU_ID")
private int idUsuario;
@Column(name="USU_LOG", nullable=false, unique = true)
private String login;
@Column(name = "USU_PAS", nullable = false)
private String password;
@Column(name = "USU_FEC", nullable = false)
private Date fechaAlta;
public Usuario() {
}
public int getIdUsuario() {
return idUsuario;
}
public void setIdUsuario(int idUsuario) {
this.idUsuario = idUsuario;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Date getFechaAlta() {
return fechaAlta;
}
public void setFechaAlta(Date fechaAlta) {
this.fechaAlta = fechaAlta;
}
}
|
[
"daniatenciano@hotmail.es"
] |
daniatenciano@hotmail.es
|
0b93d735bd8588289fadad0b6ec6c9a30d9a147f
|
ed345750a6330dceaaf20fe6f05e33c8f34b2d2b
|
/java2-SchaumSeries/cap05/CocheCambioManual.java
|
0c0d0dc49d17c0c8d3b3bfa7befc274baff0c593
|
[] |
no_license
|
unaidelao/Java-Exercises
|
6425cb7003a0a350ddd24bf26c6674879ab73138
|
667a33f8d4e931cd895eb188e59460745349faa2
|
refs/heads/master
| 2021-01-11T16:34:39.878378
| 2019-07-21T23:42:26
| 2019-07-21T23:42:26
| 80,112,170
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 568
|
java
|
/**
* Programación en Java 2 - Serie Schaum
*
* Ejercicio 5.15 parte 2 de 3.
*
* Subclase CocheCambioManual, que hereda de la superclase Coche.
*/
public class CocheCambioManual extends Coche {
public CocheCambioManual(String matricula) {
// llamada al constructor de la superclase
super(matricula);
}
// se sobreescribe con un modificador de acceso público
public void cambiaMarcha(int marcha) {
if (marcha < 0) {
throw new IllegalArgumentException();
}
else {
super.cambiaMarcha(marcha);
}
}
}
|
[
"unai.delao@gmail.com"
] |
unai.delao@gmail.com
|
5e3cbe964ed10221ae92a084c886ac8bb0008f24
|
5280865d3cb383952eecd712ccc53adf6ff05e59
|
/cameraroll/schemas/REACHABILITY/cameraroll/app/src/main/java/us/koller/cameraroll/ui/EditImageActivity.java
|
b9d777add3085a59d13d0a326f2a8cf044e9af88
|
[
"Apache-2.0"
] |
permissive
|
LordAmit/MuseRepo_Apps
|
f753c686b114f78e1176ff94d5553b8ec7e0411a
|
f0c11783e9b01d5fa40309d5e60438263ddde7b6
|
refs/heads/master
| 2020-04-21T08:25:31.456933
| 2019-08-11T19:48:05
| 2019-08-11T19:48:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 22,440
|
java
|
package us.koller.cameraroll.ui;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.provider.DocumentFile;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
import android.widget.Button;
import android.widget.Toast;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import us.koller.cameraroll.R;
import us.koller.cameraroll.data.Settings;
import us.koller.cameraroll.data.fileOperations.FileOperation;
import us.koller.cameraroll.ui.widget.CropImageView;
import us.koller.cameraroll.util.ExifUtil;
import us.koller.cameraroll.util.MediaType;
import us.koller.cameraroll.util.StorageUtil;
import us.koller.cameraroll.util.Util;
public class EditImageActivity extends AppCompatActivity {
String dataLeAk2698 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2698 = android.util.Log.d("leak-2698", dataLeAk2698);
public static final String IMAGE_PATH = "IMAGE_PATH";
public static final String IMAGE_VIEW_STATE = "IMAGE_VIEW_STATE";
public static final int JPEG_QUALITY = 90;
private String imagePath;
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String dataLeAk2699 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2699 = android.util.Log.d("leak-2699", dataLeAk2699);
setContentView(R.layout.activity_edit_image);
Intent intent = getIntent();
if (intent == null) {
String dataLeAk2700 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2700 = android.util.Log.d("leak-2700", dataLeAk2700);
return;
}
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
String dataLeAk2701 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2701 = android.util.Log.d("leak-2701", dataLeAk2701);
actionBar.setTitle("");
actionBar.setDisplayHomeAsUpEnabled(true);
}
Uri uri = intent.getData();
if (uri == null) {
String dataLeAk2702 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2702 = android.util.Log.d("leak-2702", dataLeAk2702);
finish();
return;
}
String mimeType = MediaType.getMimeType(this, uri);
if (!(MediaType.checkImageMimeType(mimeType) || MediaType.checkRAWMimeType(mimeType))) {
String dataLeAk2703 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2703 = android.util.Log.d("leak-2703", dataLeAk2703);
Toast.makeText(this, R.string.editing_file_format_not_supported, Toast.LENGTH_SHORT).show();
finish();
}
imagePath = intent.getStringExtra(IMAGE_PATH);
final CropImageView imageView = findViewById(R.id.cropImageView);
CropImageView.State state = null;
if (savedInstanceState != null) {
String dataLeAk2704 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2704 = android.util.Log.d("leak-2704", dataLeAk2704);
state = (CropImageView.State) savedInstanceState.getSerializable(IMAGE_VIEW_STATE);
}
imageView.loadImage(uri, state);
final Button doneButton = findViewById(R.id.done_button);
doneButton.setOnClickListener(new View.OnClickListener() {
String dataLeAk2705 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2705 = android.util.Log.d("leak-2705", dataLeAk2705);
@Override
public void onClick(View view) {
String dataLeAk2706 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2706 = android.util.Log.d("leak-2706", dataLeAk2706);
done(view);
}
});
//setting window insets manually
final ViewGroup rootView = findViewById(R.id.root_view);
final View actionArea = findViewById(R.id.action_area);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
String dataLeAk2707 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2707 = android.util.Log.d("leak-2707", dataLeAk2707);
rootView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
String dataLeAk2708 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2708 = android.util.Log.d("leak-2708", dataLeAk2708);
@Override
@RequiresApi(api = Build.VERSION_CODES.KITKAT_WATCH)
public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
String dataLeAk2709 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2709 = android.util.Log.d("leak-2709", dataLeAk2709);
// clear this listener so insets aren't re-applied
rootView.setOnApplyWindowInsetsListener(null);
toolbar.setPadding(toolbar.getPaddingStart() + insets.getSystemWindowInsetLeft(),
toolbar.getPaddingTop() + insets.getSystemWindowInsetTop(),
toolbar.getPaddingEnd() + insets.getSystemWindowInsetRight(),
toolbar.getPaddingBottom());
actionArea.setPadding(actionArea.getPaddingStart() + insets.getSystemWindowInsetLeft(),
actionArea.getPaddingTop(),
actionArea.getPaddingEnd() + insets.getSystemWindowInsetRight(),
actionArea.getPaddingBottom() + insets.getSystemWindowInsetBottom());
imageView.setPadding(imageView.getPaddingStart() + insets.getSystemWindowInsetLeft(),
imageView.getPaddingTop()/* + insets.getSystemWindowInsetTop()*/,
imageView.getPaddingEnd() + insets.getSystemWindowInsetRight(),
imageView.getPaddingBottom()/* + insets.getSystemWindowInsetBottom()*/);
return insets.consumeSystemWindowInsets();
}
});
} else {
String dataLeAk2710 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2710 = android.util.Log.d("leak-2710", dataLeAk2710);
rootView.getViewTreeObserver()
.addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
String dataLeAk2711 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2711 = android.util.Log.d("leak-2711", dataLeAk2711);
@Override
public void onGlobalLayout() {
String dataLeAk2712 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2712 = android.util.Log.d("leak-2712", dataLeAk2712);
rootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
// hacky way of getting window insets on pre-Lollipop
// somewhat works...
int[] screenSize = Util.getScreenSize(EditImageActivity.this);
int[] windowInsets = new int[]{
Math.abs(screenSize[0] - rootView.getLeft()),
Math.abs(screenSize[1] - rootView.getTop()),
Math.abs(screenSize[2] - rootView.getRight()),
Math.abs(screenSize[3] - rootView.getBottom())};
toolbar.setPadding(toolbar.getPaddingStart() + windowInsets[0],
toolbar.getPaddingTop() + windowInsets[1],
toolbar.getPaddingEnd() + windowInsets[2],
toolbar.getPaddingBottom());
actionArea.setPadding(actionArea.getPaddingStart() + windowInsets[0],
actionArea.getPaddingTop(),
actionArea.getPaddingEnd() + windowInsets[2],
actionArea.getPaddingBottom() + windowInsets[3]);
imageView.setPadding(imageView.getPaddingStart() + windowInsets[0],
imageView.getPaddingTop()/* + windowInsets[1]*/,
imageView.getPaddingEnd() + windowInsets[2],
imageView.getPaddingBottom()/* + windowInsets[3]*/);
}
});
}
imageView.getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
String dataLeAk2713 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2713 = android.util.Log.d("leak-2713", dataLeAk2713);
@Override
public void onGlobalLayout() {
String dataLeAk2714 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2714 = android.util.Log.d("leak-2714", dataLeAk2714);
imageView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
imageView.setPadding(imageView.getPaddingStart(),
imageView.getPaddingTop() + toolbar.getHeight(),
imageView.getPaddingEnd(),
imageView.getPaddingBottom() + actionArea.getHeight());
}
});
//needed to achieve transparent navBar
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE);
}
public void done(View v) {
String dataLeAk2715 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2715 = android.util.Log.d("leak-2715", dataLeAk2715);
CropImageView cropImageView = findViewById(R.id.cropImageView);
final ExifUtil.ExifItem[] exifData = ExifUtil.retrieveExifData(this, cropImageView.getImageUri());
cropImageView.getCroppedBitmap(new CropImageView.OnResultListener() {
String dataLeAk2716 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2716 = android.util.Log.d("leak-2716", dataLeAk2716);
@Override
public void onResult(CropImageView.Result result) {
String dataLeAk2717 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2717 = android.util.Log.d("leak-2717", dataLeAk2717);
saveCroppedImage(result.getImageUri(), result.getCroppedBitmap(), exifData);
}
});
}
private void saveCroppedImage(final Uri uri, final Bitmap bitmap, final ExifUtil.ExifItem[] exifData) {
String dataLeAk2718 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2718 = android.util.Log.d("leak-2718", dataLeAk2718);
if (uri == null || bitmap == null) {
String dataLeAk2719 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2719 = android.util.Log.d("leak-2719", dataLeAk2719);
Toast.makeText(EditImageActivity.this, R.string.error, Toast.LENGTH_SHORT).show();
return;
}
AsyncTask.execute(new Runnable() {
String dataLeAk2720 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2720 = android.util.Log.d("leak-2720", dataLeAk2720);
@Override
public void run() {
String dataLeAk2721 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2721 = android.util.Log.d("leak-2721", dataLeAk2721);
try {
String dataLeAk2722 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2722 = android.util.Log.d("leak-2722", dataLeAk2722);
String newPath = null;
OutputStream outputStream;
if (imagePath != null) {
String dataLeAk2723 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2723 = android.util.Log.d("leak-2723", dataLeAk2723);
boolean removableStorage = FileOperation.Util.isOnRemovableStorage(imagePath);
//replace fileExtension with .jpg
int index = imagePath.lastIndexOf(".");
newPath = imagePath.substring(0, index) + ".jpg";
if (!removableStorage) {
String dataLeAk2724 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2724 = android.util.Log.d("leak-2724", dataLeAk2724);
outputStream = new FileOutputStream(newPath);
} else {
String dataLeAk2725 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2725 = android.util.Log.d("leak-2725", dataLeAk2725);
Settings s = Settings.getInstance(getApplicationContext());
Uri treeUri = s.getRemovableStorageTreeUri();
DocumentFile file = StorageUtil.createDocumentFile(EditImageActivity.this,
treeUri, imagePath, "image/jpeg");
if (file != null) {
String dataLeAk2726 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2726 = android.util.Log.d("leak-2726", dataLeAk2726);
outputStream = getContentResolver().openOutputStream(file.getUri());
} else {
String dataLeAk2727 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2727 = android.util.Log.d("leak-2727", dataLeAk2727);
outputStream = null;
}
}
} else {
String dataLeAk2728 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2728 = android.util.Log.d("leak-2728", dataLeAk2728);
try {
String dataLeAk2729 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2729 = android.util.Log.d("leak-2729", dataLeAk2729);
outputStream = getContentResolver().openOutputStream(uri);
} catch (SecurityException e) {
String dataLeAk2730 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2730 = android.util.Log.d("leak-2730", dataLeAk2730);
outputStream = null;
}
}
if (outputStream != null) {
String dataLeAk2731 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2731 = android.util.Log.d("leak-2731", dataLeAk2731);
bitmap.compress(Bitmap.CompressFormat.JPEG, JPEG_QUALITY, outputStream);
outputStream.flush();
outputStream.close();
} else {
String dataLeAk2732 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2732 = android.util.Log.d("leak-2732", dataLeAk2732);
return;
}
//save Exif-Data
if (exifData != null) {
String dataLeAk2733 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2733 = android.util.Log.d("leak-2733", dataLeAk2733);
ExifUtil.saveExifData(newPath, exifData);
}
//scan path
if (imagePath != null) {
String dataLeAk2734 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2734 = android.util.Log.d("leak-2734", dataLeAk2734);
FileOperation.Util.scanPaths(EditImageActivity.this, new String[]{newPath},
new FileOperation.Util.MediaScannerCallback() {
String dataLeAk2735 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2735 = android.util.Log.d("leak-2735", dataLeAk2735);
@Override
public void onAllPathsScanned() {
String dataLeAk2736 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2736 = android.util.Log.d("leak-2736", dataLeAk2736);
Intent intent = new Intent(FileOperation.RESULT_DONE);
LocalBroadcastManager.getInstance(EditImageActivity.this).sendBroadcast(intent);
}
});
}
EditImageActivity.this.runOnUiThread(new Runnable() {
String dataLeAk2737 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2737 = android.util.Log.d("leak-2737", dataLeAk2737);
@Override
public void run() {
String dataLeAk2738 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2738 = android.util.Log.d("leak-2738", dataLeAk2738);
Toast.makeText(EditImageActivity.this, R.string.success, Toast.LENGTH_SHORT).show();
finish();
}
});
} catch (IOException e) {
String dataLeAk2739 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2739 = android.util.Log.d("leak-2739", dataLeAk2739);
e.printStackTrace();
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
String dataLeAk2740 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2740 = android.util.Log.d("leak-2740", dataLeAk2740);
getMenuInflater().inflate(R.menu.image_edit, menu);
MenuItem rotate = menu.findItem(R.id.rotate);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
String dataLeAk2741 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2741 = android.util.Log.d("leak-2741", dataLeAk2741);
AnimatedVectorDrawable avd = (AnimatedVectorDrawable)
ContextCompat.getDrawable(this, R.drawable.ic_rotate_90_avd);
rotate.setIcon(avd);
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
String dataLeAk2742 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2742 = android.util.Log.d("leak-2742", dataLeAk2742);
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
break;
case R.id.rotate:
Drawable d = item.getIcon();
if (d instanceof Animatable && !((Animatable) d).isRunning()) {
String dataLeAk2743 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2743 = android.util.Log.d("leak-2743", dataLeAk2743);
((Animatable) d).start();
}
rotate90Degrees();
break;
case R.id.done:
done(item.getActionView());
break;
case R.id.restore:
CropImageView imageView = findViewById(R.id.cropImageView);
imageView.restore();
break;
default:
break;
}
return super.onOptionsItemSelected(item);
}
private void rotate90Degrees() {
String dataLeAk2744 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2744 = android.util.Log.d("leak-2744", dataLeAk2744);
CropImageView imageView = findViewById(R.id.cropImageView);
imageView.rotate90Degree();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
String dataLeAk2745 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
Object throwawayLeAk2745 = android.util.Log.d("leak-2745", dataLeAk2745);
CropImageView imageView = findViewById(R.id.cropImageView);
outState.putSerializable(IMAGE_VIEW_STATE, imageView.getCropImageViewState());
}
}
|
[
"amitsealami@gmail.com"
] |
amitsealami@gmail.com
|
9fd14b791bb6a68b3d7dd44657b7b59d83e37ee4
|
b4ebefa9d6e08254134942a7ed630db278772626
|
/src/main/java/com/seungmoo/java8to11/parallel_sort/ParallelSort.java
|
09b29a96ef1e83677f74d4ef0f649f711b414e79
|
[] |
no_license
|
dltmdan92/java8to11
|
fb03ed4386ef9f35424402dd5c4626a8b5defdf1
|
000d7428ed56cf24f02ae4ddca54d9f922ebe73b
|
refs/heads/master
| 2023-02-08T14:16:11.233031
| 2021-01-02T12:49:33
| 2021-01-02T12:49:33
| 323,620,517
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,220
|
java
|
package com.seungmoo.java8to11.parallel_sort;
import java.util.Arrays;
import java.util.Random;
import java.util.stream.IntStream;
/**
* 20. 배열 Parallel 정렬
* Arrays.parallelSort()
* • Fork/Join 프레임워크를 사용해서 배열을 병렬로 정렬하는 기능을 제공한다.
*
* 병렬 정렬 알고리듬
* • 배열을 둘로 계속 쪼갠다.
* • 합치면서 정렬한다. (머지소트??)
*
* 경우에 따라 parallelSort와 serialSort의 속도 차이가 다르게 나옴
* 숫자가 커질수록 parallelSort가 느린거 같긴한데...
*/
public class ParallelSort {
public static void run() {
int size = 1500;
int[] numbers = new int[size];
Random random = new Random();
IntStream.range(0, size).forEach(i -> numbers[i] = random.nextInt());
long start = System.nanoTime();
Arrays.sort(numbers);
System.out.println("serial sorting took " + (System.nanoTime() - start));
IntStream.range(0, size).forEach(i -> numbers[i] = random.nextInt());
start = System.nanoTime();
Arrays.parallelSort(numbers);
System.out.println("parallel sorting took " + (System.nanoTime() - start));
}
}
|
[
"seungmoo.lee@lotte.net"
] |
seungmoo.lee@lotte.net
|
e0f8dd7030a1e66c2f3faec4ac686acd86ad2ebd
|
931fa3112e5e2d8d8ac42d6d997eee7a9c10e820
|
/LaunchExample/app/src/androidTest/java/com/example/launchexample/ExampleInstrumentedTest.java
|
ed4dbd8473a0457697506bfbbd033a87e803cf33
|
[] |
no_license
|
MalvernSTEMQQ/ASP
|
29e1698cdcd5534299e0045760025a70892db659
|
397aeb150b2c0ee89a053cd00f237180c90d8ad6
|
refs/heads/master
| 2020-03-28T12:27:50.594099
| 2018-09-11T12:25:24
| 2018-09-11T12:25:24
| 148,301,082
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 754
|
java
|
package com.example.launchexample;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.launchexample", appContext.getPackageName());
}
}
|
[
"MalvernSTEM.QQ@gmail.co"
] |
MalvernSTEM.QQ@gmail.co
|
5de246e6e4494aeac9fbcf4f5d0a23520b139d64
|
26331af0023461a3e9b3653a4db376db1dbbf251
|
/webmagic-dao/src/main/java/com/webmagic/mapper/DataAndCodeMapper.java
|
4db3420a0af49f5481ecf063e484b6259856667c
|
[] |
no_license
|
dfggking/webmagic-module
|
b874ff336ac3c54f33d342f78c10ae1ffbbc0a68
|
a243b84ecd12064bb3fcfdd0fbdb38396d526ca3
|
refs/heads/master
| 2022-12-21T16:06:03.719619
| 2020-06-02T09:27:14
| 2020-06-02T09:27:14
| 154,348,030
| 0
| 1
| null | 2022-12-16T04:31:51
| 2018-10-23T15:00:59
|
Java
|
UTF-8
|
Java
| false
| false
| 341
|
java
|
package com.webmagic.mapper;
import com.webmagic.model.DataAndCode;
import java.util.List;
public interface DataAndCodeMapper {
int deleteByPrimaryKey(String id);
int insert(DataAndCode record);
DataAndCode selectByPrimaryKey(String id);
List<DataAndCode> selectAll();
int updateByPrimaryKey(DataAndCode record);
}
|
[
"835317619@qq.com"
] |
835317619@qq.com
|
37256e4ecf16b24fcc2aa7b091fe91380fbdc219
|
b2bf70794dd226a6ce53c7433d26696eec75ec74
|
/src/br/com/cod3r/cm/Aplicacao.java
|
ef5f28a5d603b18db2b9b7a7a4c02eab256dac07
|
[] |
no_license
|
marciomarquesdesouza/campo-minado
|
ae3c3f610cf3c16b99bba12046daf3cefd9922a0
|
d06e124a6b9db0a7670d3a60cb491dad7f13c7ae
|
refs/heads/master
| 2023-04-12T22:26:42.287908
| 2021-04-22T03:55:12
| 2021-04-22T03:55:12
| 359,034,044
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 279
|
java
|
package br.com.cod3r.cm;
import br.com.cod3r.cm.modelo.Tabuleiro;
import br.com.cod3r.cm.visao.TabuleiroConsole;
public class Aplicacao {
public static void main(String[] args) {
Tabuleiro tabuleiro = new Tabuleiro(6, 6, 6);
new TabuleiroConsole(tabuleiro);
}
}
|
[
"marciomarques.contato@hotmail.com"
] |
marciomarques.contato@hotmail.com
|
5c446a3a726ae48a25e9bdf54d34bbfdfb102567
|
78f7fd54a94c334ec56f27451688858662e1495e
|
/VoterData/src/main/java/com/itgrids/voterdata/service/geo/DistanceChecker.java
|
154826bcdff4228e6c2f15f5d8e4bb64254eb13b
|
[] |
no_license
|
hymanath/PA
|
2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef
|
d166bf434601f0fbe45af02064c94954f6326fd7
|
refs/heads/master
| 2021-09-12T09:06:37.814523
| 2018-04-13T20:13:59
| 2018-04-13T20:13:59
| 129,496,146
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,266
|
java
|
package com.itgrids.voterdata.service.geo;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DistanceChecker {
public static void main(String[] args)
{
DistanceChecker checker = new DistanceChecker();
List<DataVO> data = checker.getData("D:/OneDrive/ITGRIDS/ITDP/geodata.txt");
Date d1 = new Date();
Map<String,Integer> map = checker.getPointsBetewenInADistance(15.713531,79.8240546,data,200);
Date d2 = new Date();
System.out.println(map.size());
System.out.println("Time Taken - "+(d2.getTime()-d1.getTime()));
}
public Map<String,Integer> getPointsBetewenInADistance(Double latitude,Double longitude,List<DataVO> dataList,int length)
{
Map<String,Integer> result = new HashMap<String, Integer>(0);
try{
for(DataVO data : dataList)
{
String houseHoldId = data.getHouseHoldId();
Double distance = DistanceCalculator.distance(latitude,longitude,Double.valueOf(data.getLatitude()),Double.valueOf(data.getLongitude()),"M");
int length2 = distance.intValue();
if(length2 < length)
{
System.out.println(houseHoldId+"\t"+length2);
result.put(houseHoldId,length2);
}
}
}catch(Exception e)
{
e.printStackTrace();
}
return result;
}
public List<DataVO> getData(String filePath)
{
List<DataVO> dataList = new ArrayList<DataVO>(0);
try{
BufferedReader br = new BufferedReader(new FileReader(new File(filePath)));
String line = null;
DataVO dataVO = null;
while((line = br.readLine()) != null)
{
try{
String[] data = line.trim().split("\t");
String houseHoldId = data[0].trim();
String latitude = data[1].trim();
String longitude = data[2].trim();
dataVO = new DataVO();
dataVO.setHouseHoldId(houseHoldId);
dataVO.setLatitude(latitude);
dataVO.setLongitude(longitude);
dataList.add(dataVO);
}catch(Exception e)
{
e.printStackTrace();
}
}
br.close();
}catch(Exception e)
{
e.printStackTrace();
}
return dataList;
}
}
|
[
"itgrids@b17b186f-d863-de11-8533-00e0815b4126"
] |
itgrids@b17b186f-d863-de11-8533-00e0815b4126
|
75ee60542e8e9daa0b43fd5319d153b77fa9a2a7
|
8e8fd1006cf37ec0599003d8bc192a3306a39ec6
|
/acp/acp-packet/src/main/java/pers/acp/packet/iso8583/ISO8583Packet.java
|
6faa752ef26fea7766a264421c9f1f2fd991689b
|
[] |
no_license
|
BobBright/acp
|
40db185e25dc29a111c8daea353325491292a72f
|
10a9b9485feb876701fa5e6304ccc121570db247
|
refs/heads/master
| 2020-03-21T04:18:51.968753
| 2018-06-19T10:58:16
| 2018-06-19T10:58:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 23,218
|
java
|
package pers.acp.packet.iso8583;
import pers.acp.core.log.LogFactory;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
/**
* 简单介绍下ISO8583。
* 这个东西说白了就是一种数据结构。我们定义一种规则把一堆东西放进去,再按照规则
* 把数据正确拿出来。这就是报文的实质。
* <p>
* ISO8583报文的结构是:前面有16字节(128位)位图数据,后面就是数据。
* 报文最多有128个域(字段)。具体的一个报文不会有这么多,一般是几个域。
* 有哪几个就记录在位图中。而且域有定长和变长之分。
* 这些都是事先定义好的,具体可以看我写的properties定义文件.
* <p>
* 位图转化成01字符串就是128个,如果某一位是1,代表这个域有值,然后按照properties定义的规则取值。
* 如果是0,则这个域没有值。
* <p>
* 再说定长和变长。
* 定长域(定长比较好理解,一个字段规定是N位,那么字段值绝对不能超过N位,不足N位就在后面补空格)
* 变长域(变长域最后组装成的效果:例如变长3位,定义var3,这里的3是指长度值占3位,字段值是123456,最后结果就是006123456)
* 注意(变长的长度按照域值得字节长度计算,而不是按照域值字符串长度算!)
* <p>
* 从网上不难找到ISO8583报文的介绍,这里就不多说了。
* 但是具体解析和组装的代码还真不好找,所以本人就写了一个让刚接触ISO8583报文的人更好入门。
* <p>
* <p>
* <p>
* 解析的容器,我使用了Map,具体到工作中,还是要换成其他的容器的。
* 报文定义说明:iso8583.properties
* 例如
* FIELD031 = string,10
* FIELD032 = string,VAR2
* <p>
* FIELD031是定长,长度是10
* FIELD032是变长,长度值占2位,也就是说长度值最大99,也就是域值最大长度99.
*
* @author zhangbin
*/
public class ISO8583Packet {
private static LogFactory log = LogFactory.getInstance(ISO8583Packet.class);
private static String packet_encoding = "UTF-8";//报文编码 UTF-8 GBK
private static Map<String, String> map8583Definition = null;// 8583报文128域定义器
static {
try {
ISO8583FieldProperties iso8583FieldProperties = ISO8583FieldProperties.getInstance();
if (iso8583FieldProperties != null) {
map8583Definition = new HashMap<>();
iso8583FieldProperties.forEach((key, value) -> map8583Definition.put(String.valueOf(key), String.valueOf(value)));
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
/**
* 8583报文初始位图:128位01字符串
*
* @return 位图
*/
private static String getInitBitMap() {
return "10000000" + "00000000" + "00000000" + "00000000"
+ "00000000" + "00000000" + "00000000" + "00000000"
+ "00000000" + "00000000" + "00000000" + "00000000"
+ "00000000" + "00000000" + "00000000" + "00000000";
}
/**
* 组装8583报文
*
* @param filedMap 域值
*/
public static byte[] make8583(TreeMap<String, String> filedMap) {
byte[] whoe8583;
if (filedMap == null) {
return null;
}
try {
String bitMap128 = getInitBitMap();//获取初始化的128位图
//按照8583定义器格式化各个域的内容
Map<String, Object> all = formatValueTo8583(filedMap, bitMap128);
// 获取上送报文内容
whoe8583 = getWhole8583Packet(all);
return whoe8583;
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return null;
}
/**
* 获取完整的8583报文体(128域)
*
* @param all 内容
* @return 字节数组
*/
private static byte[] getWhole8583Packet(Map<String, Object> all) {
if (all == null || all.get("formatedFiledMap") == null || all.get("bitMap128") == null) {
return null;
}
try {
String bitMap128 = (String) all.get("bitMap128");
// 128域位图二进制字符串转16位16进制
byte[] bitmaps = get16BitByteFromStr(bitMap128);
TreeMap pacBody = (TreeMap) all.get("formatedFiledMap");
StringBuilder last128 = new StringBuilder();
Iterator it = pacBody.keySet().iterator();
for (; it.hasNext(); ) {
String key = (String) it.next();
String value = (String) pacBody.get(key);
last128.append(value);
}
byte[] bitContent = last128.toString().getBytes(packet_encoding);//域值
//组装
byte[] package8583;
package8583 = ISO8583Packet.arrayApend(null, bitmaps);
package8583 = ISO8583Packet.arrayApend(package8583, bitContent);
return package8583;
} catch (Exception e) {
log.error(e.getMessage(), e);
return null;
}
}
private static Map<String, Object> formatValueTo8583(TreeMap<String, String> filedMap, String bitMap128) {
Map<String, Object> all = new HashMap<>();
TreeMap<String, String> formatedFiledMap = new TreeMap<>();//格式化结果
if (filedMap != null) {
Iterator it = filedMap.keySet().iterator();
for (; it.hasNext(); ) {
String fieldName = (String) it.next();//例如FIELD005
String fieldValue = filedMap.get(fieldName);//字段值
try {
if (fieldValue == null) {
log.error("报文域 {" + fieldName + "}为空值");
return null;
}
//将域值编码转换,保证报文编码统一
fieldValue = new String(fieldValue.getBytes(packet_encoding), packet_encoding);
// 数据域名称FIELD开头的为128域
if (fieldName.startsWith("FIELD")) {
String fieldNo = fieldName.substring(5, 8);//例如005
// 组二进制位图串
bitMap128 = change16bitMapFlag(fieldNo, bitMap128);
// 获取域定义信息
String[] fieldDef = map8583Definition.get("FIELD" + fieldNo).split(",");
String defLen = fieldDef[1];//长度定义,例20
boolean isFixLen = true;//是否定长判断
if (defLen.startsWith("VAR")) {//变长域
isFixLen = false;
defLen = defLen.substring(3);//获取VAR2后面的2
}
int fieldLen = fieldValue.getBytes(packet_encoding).length;//字段值得实际长度
// 判断是否为变长域
if (!isFixLen) {// 变长域(变长域最后组装成的效果:例如变长3位,定义var3,这里的3是指长度值占3位,字段值是123456,最后结果就是006123456)
int defLen1 = Integer.valueOf(defLen);
if (String.valueOf(fieldLen).length() > (10 * defLen1)) {
log.error("字段" + fieldName + "的数据定义长度的长度为" + defLen + "位,长度不能超过" + (10 * defLen1));
return null;
} else {
//将长度值组装入字段
fieldValue = getVaryLengthValue(fieldValue, defLen1) + fieldValue;
}
} else {//定长域(定长比较好理解,一个字段规定是N位,那么字段值绝对不能超过N位,不足N位就在后面补空格)
int defLen2 = Integer.valueOf(defLen);
if (fieldLen > defLen2) {
log.error("字段" + fieldName + "的数据定义长度为" + defLen + "位,长度不能超过" + defLen);
return null;
} else {
fieldValue = getFixFieldValue(fieldValue, defLen2);//定长处理
}
}
log.info("组装后报文域 {" + fieldName + "}==" + fieldValue + "==,域长度:" + fieldValue.getBytes(packet_encoding).length);
}
// 返回结果赋值
if (filedMap.containsKey(fieldName)) {
if (formatedFiledMap.containsKey(fieldName)) {
formatedFiledMap.remove(fieldName);
}
formatedFiledMap.put(fieldName, fieldValue);
} else {
log.error(fieldName + "配置文件中不存在!");
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}//end for
}
all.put("formatedFiledMap", formatedFiledMap);
all.put("bitMap128", bitMap128);
return all;
}
/**
* 解析8583报文
*
* @param content8583 报文内容
*/
public static Map<String, String> analyze8583(byte[] content8583) {
TreeMap<String, String> filedMap = new TreeMap<>();
try {
// 取位图
byte[] bitMap16byte = new byte[16];
//记录当前位置,从位图后开始遍历取值
int pos = 16;
String bitMap128Str;
if (Integer.toBinaryString(content8583[0] >>> 7).substring(24).equalsIgnoreCase("1")) {
System.arraycopy(content8583, 0, bitMap16byte, 0, 16);
} else {
bitMap16byte = new byte[8];
pos = 8;
System.arraycopy(content8583, 0, bitMap16byte, 0, 8);
}
// 16位图转2进制位图128位字符串
bitMap128Str = get16BitMapStr(bitMap16byte);
// 遍历128位图,取值。注意从FIELD002开始
for (int i = 1; i < bitMap128Str.length(); i++) {
String filedValue;//字段值
String filedName = "FIELD" + getNumThree((i + 1));//FIELD005
if (bitMap128Str.charAt(i) == '1') {
// 获取域定义信息
String[] fieldDef = map8583Definition.get(filedName).split(",");
String defLen = fieldDef[1];//长度定义,例20
boolean isFixLen = true;//是否定长判断
if (defLen.startsWith("VAR")) {//变长域
isFixLen = false;
defLen = defLen.substring(3);//获取VAR2后面的2
}
// 截取该域信息
if (!isFixLen) {//变长域
int defLen1 = Integer.valueOf(defLen);//VAR2后面的2
String realLen1 = new String(content8583, pos, defLen1, packet_encoding);//报文中实际记录域长,例如16,023
int realAllLen = defLen1 + Integer.valueOf(realLen1);//该字段总长度(包括长度值占的长度)
// filedValue = new String(content8583, pos+defLen1, Integer.valueOf(realLen1), packet_encoding);
byte[] filedValueByte = new byte[Integer.valueOf(realLen1)];
System.arraycopy(content8583, pos + defLen1, filedValueByte, 0, filedValueByte.length);
filedValue = new String(filedValueByte, packet_encoding);
pos += realAllLen;//记录当前位置
} else {//定长域
int defLen2 = Integer.valueOf(defLen);//长度值占的位数
filedValue = new String(content8583, pos, defLen2, packet_encoding);
pos += defLen2;//记录当前位置
}
filedMap.put(filedName, filedValue);
}
}//end for
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return filedMap;
}
/**
* 复制字符
*
* @param str 源字符串
* @param count 数量
* @return 目标字符串
*/
private static String strCopy(String str, int count) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < count; i++) {
sb.append(str);
}
return sb.toString();
}
/**
* 将setContent放入set(考虑到数组越界)
*
* @param set 字节数组
* @param setContent 字节数组
* @return 字节数组
*/
private static byte[] setToByte(byte[] set, byte[] setContent) {
byte[] res = new byte[set.length];
if (setContent != null) {
if (set.length >= setContent.length) {
System.arraycopy(setContent, 0, res, 0, setContent.length);
}
}
return res;
}
public static byte[] setToByte(byte[] set, String setContentStr) {
byte[] res = new byte[set.length];
byte[] setContent;
try {
setContent = setContentStr.getBytes(packet_encoding);
res = setToByte(res, setContent);
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(), e);
}
return res;
}
private static String getPacketLen(int len) {
String res;
String lenStr = String.valueOf(len);
int lenC = 4 - lenStr.length();
res = strCopy("0", lenC) + lenStr;
return res;
}
public static String getPacketLen(String lenStr) {
String res = "";
if (lenStr != null) {
res = getPacketLen(Integer.valueOf(lenStr));
}
return res;
}
/**
* 返回a和b的组合,实现累加功能
*
* @param a 字节数组
* @param b 字节数组
* @return 字节数组
*/
private static byte[] arrayApend(byte[] a, byte[] b) {
int a_len = (a == null ? 0 : a.length);
int b_len = (b == null ? 0 : b.length);
byte[] c = new byte[a_len + b_len];
if (a_len == 0 && b_len == 0) {
return null;
} else if (a_len == 0) {
System.arraycopy(b, 0, c, 0, b.length);
} else if (b_len == 0) {
System.arraycopy(a, 0, c, 0, a.length);
} else {
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);
}
return c;
}
/**
* 改变128位图中的标志为1
*
* @param fieldNo 域编号
* @param res res
* @return result
*/
private static String change16bitMapFlag(String fieldNo, String res) {
int indexNo = Integer.parseInt(fieldNo);
res = res.substring(0, indexNo - 1) + "1" + res.substring(indexNo);
return res;
}
/**
* 位图操作
* <p>
* 把16位图的字节数组转化成128位01字符串
*
* @param bitMap16 位图
* @return 字符串
*/
private static String get16BitMapStr(byte[] bitMap16) {
StringBuilder bitMap128 = new StringBuilder();
// 16位图转2进制位图128位字符串
for (byte aBitMap16 : bitMap16) {
int bc = aBitMap16;
bc = (bc < 0) ? (bc + 256) : bc;
String bitnaryStr = Integer.toBinaryString(bc);//二进制字符串
// 左补零,保证是8位
String rightBitnaryStr = strCopy("0", Math.abs(8 - bitnaryStr.length())) + bitnaryStr;//位图二进制字符串
// 先去除多余的零,然后组装128域二进制字符串
bitMap128.append(rightBitnaryStr);
}
return bitMap128.toString();
}
/**
* 位图操作
* <p>
* 把128位01字符串转化成16位图的字节数组
*
* @param str_128 字符串
* @return 字节数组
*/
private static byte[] get16BitByteFromStr(String str_128) {
byte[] bit16 = new byte[16];
try {
if (str_128 == null || str_128.length() != 128) {
return null;
}
// 128域位图二进制字符串转16位16进制
byte[] tmp = str_128.getBytes(packet_encoding);
int weight;//权重
byte[] strout = new byte[128];
int i, j, w = 0;
for (i = 0; i < 16; i++) {
weight = 0x0080;
for (j = 0; j < 8; j++) {
strout[i] += ((tmp[w]) - '0') * weight;
weight /= 2;
w++;
}
bit16[i] = strout[i];
}
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(), e);
}
return bit16;
}
/**
* 从完整的8583报文中获取位图(16字节数组)
*
* @param packet 字节数组
* @return 字节数组
*/
private static byte[] getPacketHeaderMap(byte[] packet) {
byte[] packet_header_map = new byte[16];
if (packet == null || packet.length < 16) {
return null;
}
System.arraycopy(packet, 0, packet_header_map, 0, 16);
return packet_header_map;
}
/**
* 从完整的8583报文中获取16位图,转化成128位的01字符串
*
* @param content8583 字节数组
* @return 字符串
*/
public static String get16BitMapFrom8583Byte(byte[] content8583) {
// 取位图
byte[] bitMap16 = getPacketHeaderMap(content8583);
if (bitMap16 != null) {
// 16位图转2进制位图128位字符串
return get16BitMapStr(bitMap16);
} else {
return null;
}
}
//返回字段号码,例如005
private static String getNumThree(int i) {
String len;
String iStr = String.valueOf(i);
len = strCopy("0", 3 - iStr.length()) + iStr;
return len;
}
/**
* 获取字符串变长值
*
* @param valueStr 值
* @param defLen 例如getFixLengthValue("12345678", 2)返回08
* 例如getFixLengthValue("12345678", 3)返回008
* <p>
* 注意变长长度的计算:
* 长度的判断使用转化后的字节数组长度,因为中文在不同的编码方式下,长度是不同的,GBK是2,UTF-8是3,按字符创长度算就是1.
* 解析报文是按照字节来解析的,所以长度以字节长度为准,防止中文带来乱码。
* <p>
* 比如一个变长域:aa索隆bb,如果按照字符串计算长度那么就是6,最后是06aa索隆bb。
* 这样在解析时按照字节解析长度就乱了,因为按照GBK字节解析,一个汉字占2,按照UTF-8解析,一个汉字占3.
* 所以在计算时必须按照字节长度为准!按照我们设置的UTF-8编码结果就是10aa索隆bb.
* 这样在解析时长度正好是10,也就不会乱了。
* @return 结果
*/
private static String getVaryLengthValue(String valueStr, int defLen) {
return getVaryLengthValue(valueStr, defLen, packet_encoding);
}
private static String getVaryLengthValue(String valueStr, int defLen, String encoding) {
String fixLen = "";
try {
if (valueStr == null) {
return strCopy("0", defLen);
} else {
byte[] valueStrByte;
//这里最好指定编码,不使用平台默认编码
if (encoding == null || encoding.trim().equals("")) {
valueStrByte = valueStr.getBytes();
} else {
valueStrByte = valueStr.getBytes(encoding);
}
//长度的判断使用转化后的字节数组长度,因为中文在不同的编码方式下,长度是不同的,GBK是2,UTF-8是3,按字符创长度算就是1.
//解析报文是按照字节来解析的,所以长度以字节长度为准,防止中文带来乱码
if (valueStrByte.length > (10 * defLen)) {
return null;
} else {
int len = valueStrByte.length;//字段实际长度
String len1 = String.valueOf(len);
fixLen = strCopy("0", (defLen - len1.length())) + len1;
}
}
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(), e);
}
return fixLen;
}
/**
* 将字段值做定长处理,不足定长则在后面补空格
*
* @param valueStr 值
* @param defLen 定义长度
* @return 结果
*/
private static String getFixFieldValue(String valueStr, int defLen) {
return getFixFieldValue(valueStr, defLen, packet_encoding);
}
private static String getFixFieldValue(String valueStr, int defLen, String encoding) {
String fixLen = "";
try {
if (valueStr == null) {
return strCopy(" ", defLen);
} else {
byte[] valueStrByte;
//这里最好指定编码,不使用平台默认编码
if (encoding == null || encoding.trim().equals("")) {
valueStrByte = valueStr.getBytes();
} else {
valueStrByte = valueStr.getBytes(encoding);
}
//长度的判断使用转化后的字节数组长度,因为中文在不同的编码方式下,长度是不同的,GBK是2,UTF-8是3,按字符创长度算就是1.
//解析报文是按照字节来解析的,所以长度以字节长度为准,防止中文带来乱码
if (valueStrByte.length > defLen) {
return null;
} else {
fixLen = valueStr + strCopy(" ", defLen - valueStrByte.length);
}
}
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(), e);
}
return fixLen;
}
public static String getPacket_encoding() {
return packet_encoding;
}
public static void setPacket_encoding(String packet_encoding) {
ISO8583Packet.packet_encoding = packet_encoding;
}
public static Map getMap8583Definition() {
return map8583Definition;
}
public static void setMap8583Definition(Map<String, String> map8583Definition) {
ISO8583Packet.map8583Definition = map8583Definition;
}
}
|
[
"391289241@qq.com"
] |
391289241@qq.com
|
ceaed815cad770e8d1af8cc297ba9ce923a414e7
|
954243429ec23172daeb16d72ee783fa231c9575
|
/src/main/java/dik/library/reactiverepo/AuthorReactiveRepository.java
|
deac4b9b11ee0e111e74b2b007e6dea2d7785aaf
|
[] |
no_license
|
realcorwin/library
|
56549d9c34f339a7637b5993cbbb11a1aa33e308
|
cb67e9cf7b9509721d938f2267814edb920f710b
|
refs/heads/master
| 2020-04-14T18:33:49.310911
| 2019-03-15T22:08:58
| 2019-03-15T22:08:58
| 164,023,990
| 0
| 1
| null | 2019-04-24T17:55:48
| 2019-01-03T21:19:12
|
Java
|
UTF-8
|
Java
| false
| false
| 345
|
java
|
package dik.library.reactiverepo;
import dik.library.model.Author;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import reactor.core.publisher.Mono;
public interface AuthorReactiveRepository extends ReactiveMongoRepository<Author, String>, AuthorReactiveRepositoryCustom {
Mono<Void> deleteById(String id);
}
|
[
"realcorwin@mail.ru"
] |
realcorwin@mail.ru
|
b84e697d2bd9d84b8c3a8b050eade6cecc4ac936
|
4241c98228d7c2b2fbc3c271b2184c9b03c653cb
|
/app/src/test/java/com/example/jsu/lab4a/ExampleUnitTest.java
|
09139d3c6a1d5cc12fee73abe10218057fcfac7a
|
[] |
no_license
|
Mshell0126/CS408-Lab-4A
|
92c589ae70a7f7015fead8d82c5dc3ad3a24b811
|
abe93a48d0285b4dafa1a558b93e5e8714304dc9
|
refs/heads/master
| 2020-04-27T02:45:02.167886
| 2019-03-11T23:24:12
| 2019-03-11T23:24:12
| 174,004,149
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 382
|
java
|
package com.example.jsu.lab4a;
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);
}
}
|
[
"mshell2@stu.jsu.edu"
] |
mshell2@stu.jsu.edu
|
29cf9cd39c7fef0b7791dff1ce4d5e0d6e2f5bb2
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/AsyncHttpClient--async-http-client/eb136417465e13f0ba17c2ae8efdb9a45c22a315/before/NettyTransferListenerTest.java
|
7bd7d6856c035859fc992abe722de7eeb9ecfd40
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,160
|
java
|
/*
* Copyright (c) 2010-2012 Sonatype, Inc. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
package com.ning.http.client.async.netty;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.async.ProviderUtil;
import com.ning.http.client.async.TransferListenerTest;
public class NettyTransferListenerTest extends TransferListenerTest {
@Override
public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {
return ProviderUtil.nettyProvider(config);
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
4949bfd3dbac4984408aeccea45d2284a1bc5dbc
|
6733e296a172655a25ac4fc41f743b42be590d03
|
/src/main/java/in/ols/rest/model/CourseDto.java
|
c8aaa02843e7fd96cb1e702e9293a81bf17a016d
|
[] |
no_license
|
sandeeprgurav/ols-rest-api
|
7b4e15b188c44f188628596944fd22d032dc3b76
|
7e5825c5803cb56b9a643b40f1c689d3b88bde32
|
refs/heads/master
| 2020-09-10T16:58:57.746388
| 2019-12-01T22:20:41
| 2019-12-01T22:20:41
| 221,769,387
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,390
|
java
|
package in.ols.rest.model;
import in.ols.rest.model.BaseModel.Status;
public class CourseDto implements Comparable<CourseDto>{
private String id;
private int serialNumber;
private String userId;
private String name;
private String description;
private String category;
private Status status;
private String enteredBy;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(int serialNumber) {
this.serialNumber = serialNumber;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public String getEnteredBy() {
return enteredBy;
}
public void setEnteredBy(String enteredBy) {
this.enteredBy = enteredBy;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@Override
public int compareTo(CourseDto arg0) {
return 0;
}
}
|
[
"sandeeprgurav@gmail.com"
] |
sandeeprgurav@gmail.com
|
9f7f87f7c7d03c0cd4a48eab376a1def38d38289
|
690e056cfcce18306b86bad14e5df14328c04c6c
|
/src/com/jalor/prize/test.java
|
c08eac03d390ce312c9e396fb060798e72fa2bfc
|
[] |
no_license
|
simon-zm/Jalor
|
3993f42316ba2fa3e9cac14b52ef690c95e7a202
|
8ed6e96a8151463db603307d40d4ac834021d83c
|
refs/heads/master
| 2021-02-19T09:24:22.485699
| 2019-06-20T07:57:07
| 2019-06-20T07:57:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,813
|
java
|
package com.jalor.prize;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @Author liubo
* @Date 2018/12/20 12:23
* @Description: TODO
*/
public class test {
/**
* 给转盘的每个角度赋初始值
*
* @return
*/
private final static List<prize> initDrawList = new ArrayList<prize>() {
{
add(new prize(1, "谢谢参与", 40));
add(new prize(2, "虚拟红包10元", 10));
add(new prize(3, "虚拟红包20元", 16));
add(new prize(4, "加息券0.5%", 15));
add(new prize(5, "京东购物卡", 10));
add(new prize(6, "金士顿(Kingston)128GB U盘", 5));
add(new prize(7, "格兰仕(Galanz)G80F23CN3L-C2K(G2)微波炉/光波炉/烤箱一体机", 3));
add(new prize(9, "科沃斯(Ecovacs)扫地机器人", 1));
}
};
/**
* 生成奖项
*
* @return
*/
public static prize generateAward() {
List<prize> initData = initDrawList;
long result = randomnum(1, 100);
int line = 0;
int temp = 0;
prize returnobj = null;
for (int i = 0; i < initDrawList.size(); i++) {
prize obj2 = initDrawList.get(i);
int c = obj2.getV();
temp = temp + c;
line = 100 - temp;
if (c != 0) {
if (result > line && result <= (line + c)) {
returnobj = obj2;
// 如果大于库存就从新抽奖
// if(returnobj.getId()==20){
// continue;
// }
break;
}
}
}
return returnobj;
}
// 获取2个值之间的随机数
private static long randomnum(int smin, int smax) {
int range = smax - smin;
double rand = Math.random();
return (smin + Math.round(rand * range));
}
public static void main(String[] args) {
prize p = generateAward();
System.out.println(p.getPrize() + new SimpleDateFormat("yyyyMMdd").format(new Date()));
}
}
|
[
"fm103097@163.com"
] |
fm103097@163.com
|
9f62cb7074242e9a3e2806b9784ef8ccf9835812
|
0d1dbe6c4563ca67f9a79c13c49ecce50e3ef060
|
/oto_all/oto/src/main/java/edu/arizona/biosemantics/oto/oto/beans/UserStatisticsBean.java
|
08d5113109b8e3ffddb39a065df1ce6b24462483
|
[] |
no_license
|
rodenhausen/andrew_backup
|
4301876767c0eff6a1fb66b4f4c7d4caf9177368
|
da39edffa08cad6d3ca9bf2f0e047ba4c7732216
|
refs/heads/master
| 2021-01-20T11:30:37.067858
| 2015-03-02T18:22:47
| 2015-03-02T18:22:47
| 31,552,041
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 910
|
java
|
package edu.arizona.biosemantics.oto.oto.beans;
public class UserStatisticsBean {
private int userid;
private String userName;
private int count;
private int count_decidedTerms;
public UserStatisticsBean(int userid, String username, int count) {
this.userid = userid;
this.userName = username;
this.count = count;
}
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getCount_decidedTerms() {
return count_decidedTerms;
}
public void setCount_decidedTerms(int count_decidedTerms) {
this.count_decidedTerms = count_decidedTerms;
}
}
|
[
"stockto2@email.arizona.edu"
] |
stockto2@email.arizona.edu
|
1a6c1a120250b254b3b7163a3cbe4a6e8cccff51
|
112d0d3d69ef5143be577fe45d0fdf2427822098
|
/sistema-facturacion-rest/src/main/java/com/homeoffice/sistema/facturacion/servicios/implementacion/CategoriaServicioImpl.java
|
4573a27976dfdc8cb8a5a62c273844c2dbeb402b
|
[] |
no_license
|
sebasdiaz67/sistema-facturacion-rest
|
3fc899d13307183004b23ea5d2a87a6d1a87ece6
|
c43c33a4f566abfd9d7177e2a5bd7929b104f16d
|
refs/heads/master
| 2022-09-15T19:36:37.448675
| 2020-06-01T04:33:20
| 2020-06-01T04:33:20
| 267,491,938
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,447
|
java
|
package com.homeoffice.sistema.facturacion.servicios.implementacion;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.homeoffice.sistema.facturacion.modelo.entidades.Categoria;
import com.homeoffice.sistema.facturacion.modelo.repositorio.CategoriaRepositorio;
import com.homeoffice.sistema.facturacion.servicios.CategoriaServicio;
/**
* <p>
* Clase que define la clase del servicio categoria
* </p>
*
* @author Sebastian Rosero Diaz
* @fechaCreacion 27/05/2020
* @version 1.0
*
*/
@Service
public class CategoriaServicioImpl implements CategoriaServicio {
@Autowired
private CategoriaRepositorio categoriaRepositorio;
@Override
@Transactional(readOnly = true)
public List<Categoria> buscarTodo() {
return categoriaRepositorio.findAll();
}
@Override
@Transactional(readOnly = true)
public Page<Categoria> buscarTodo(Pageable pageable) {
return categoriaRepositorio.findAll(pageable);
}
@Override
@Transactional(readOnly = true)
public Categoria buscarPorId(Long id) {
return categoriaRepositorio.findById(id).orElse(null);
}
@Override
@Transactional
public Categoria guardar(Categoria categoria) {
return categoriaRepositorio.save(categoria);
}
}
|
[
"sebasdiaz67@gmail.com"
] |
sebasdiaz67@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.