blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba810790ff74f9b72143b86d819e302cf1143913 | 51934a954934c21cae6a8482a6f5e6c3b3bd5c5a | /output/61c6ce5e74154a46801b27a958bb3bbe.java | acde897fe3823fbcc5698b3b3d30393f6523c62c | [
"MIT",
"Apache-2.0"
] | permissive | comprakt/comprakt-fuzz-tests | e8c954d94b4f4615c856fd3108010011610a5f73 | c0082d105d7c54ad31ab4ea461c3b8319358eaaa | refs/heads/master | 2021-09-25T15:29:58.589346 | 2018-10-23T17:33:46 | 2018-10-23T17:33:46 | 154,370,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,181 | java | class vxKvC8PPj7FEot {
public int WLqbg7Q;
public static void orn (String[] x0Qk) throws O6pD7QT8 {
if ( -true.H()) {
int[] pIfxqMHdH2pug;
}
{
boolean[][] nizAYTRXcWO;
int dxlw_rN;
if ( ( this.PShoGqFLhVi9wM).A) return;
r[][] LULi;
void[] Akhck;
int OCNLXs0e;
}
}
public static void AEr9laosO (String[] foGA_L) {
;
void[][][] ls38toqOc;
int[][] kVUl5CFTTPlC;
int CERhsler = -!714[ saZdBuPJTgorg()[ !-onuJmw0zpDH[ -IrnGvzpnz.SNuJR()]]] = ( ---null[ ( -new void[ ( -!-new erOOkld8CDgo().KlQTtj).vtgB].Vxr()).ZRGyIs8()]).__dfZBo8h();
HHm0KDzy_MR sBzWwBky1E = --!-new y()[ !!-null.cLSJ_3mmaWC] = -false.i();
int[][] ZF0;
jCFV2rY__psK3[][][][] CFAqbj = --!!null[ -new ncyF40mHqmpmE()[ true.WvDJLF]] = -false[ ( !-this[ -!-2795.lK2GCyjYq4()]).zQXQ2gPyqtR()];
;
{
int[][] c7i;
while ( -964718155.JecC4vj()) if ( EKNL5aaG9().Rs()) return;
while ( new j3XwzPwPBD7tyU().f) new dU0GXq()[ false.Q1kcLRWsj4Fepr()];
if ( !--false[ -true.ZBS03RTd9EI7]) {
if ( pCNmQ21Bu().HO0ZCLCGgEgZ) return;
}
{
void[][] hJZ6T;
}
}
boolean n;
int bTQ6Oc0wLesu9n;
;
if ( -new FDZBoZTWc51lIL().WG) if ( !XVIirVbgD9SU.X) {
{
boolean wXGJ6edBHY2L;
}
}else return;
boolean[] nnEQFx3pN;
{
;
}
boolean[] r8V3;
while ( -77846321.k()) ;
boolean WvNT6fLABnqCX;
if ( !-!N_zvepuVk_.K2KS7FlMS()) null.GmvAiZ6WvmKq8I();else ;
int V = !true.v() = null.GspR0e5xaDg();
}
public int K;
public static void GVqHp1v9QY (String[] QRRxwZn4Bl) throws QzuBI1twmbQ {
if ( false.WjxMg) return;
if ( !!-!!-new H()[ !32648036.UY]) while ( !false.HzQIn8XLPgNW) if ( ySKEqo().Ae) ;else while ( -false[ -new oHZT()[ -true.OWEBjm4R]]) ;
!null.ljzJ();
void[][][] qfwlRjI59Fvkak;
if ( new sg[ g.tKaF][ !!Z3zhoCXEeLVVR.dO43()]) new int[ !FmjrhCzAJT[ Jf_4K[ -----!false.aFkE]]].JzX2n6pf3a;
boolean I1hYvg_y7ah5SQ;
boolean[][] xtraG3 = -this.YY4LUvPNX0NWO() = !new int[ 49.devI_C2g4h8].bshtiA4hJDZ;
if ( !!!!new void[ 66[ !new Ox().VnmJNWakgOVT()]].iHu) while ( !null.kBWAovoBGAiHj()) -new IayVZGABO0J().b();else while ( --!540048[ !-null.jzvCFZ]) ;
;
{
!-this.l1();
int[] qs2OUNpX;
vXm9YXhkB[] WuGPlHMs3;
if ( new boolean[ false.u0mzBksDzUlxv][ new Kj7wQXFxlN().zOvR5C_bVX5gc]) while ( !-true[ !!new W4MJugW5OX1v().djZe2eD_n]) while ( !null.pO26e0OCo) if ( -new TpegukDITr85e().lXBLhifYq) while ( -!( !-82826539.zL).S()) if ( !!true.UK6nsKPlFhk) ;
if ( true.JL6tZUNreK) while ( true[ null.EZUdUkuk6T_VO]) return;
boolean[] IGVt6F9QqT;
boolean _9hh;
while ( !-CLUk.y4n7rqmwYLAK37()) if ( --this[ -!wo8()[ this[ false.c2af1bZ5()]]]) !!-( qYC0zIAggh().R7DGyyP2Ul).xEt9jGdcR();
void[][][][] cvuY;
return;
void[][][][] g4gG;
void[][][] zGvUDWx0dIfXv;
iFmaCil.KHSSNZ;
CdMIKuD4sqr.xrFBNNYj20mz();
boolean ce1ykl5AJ5;
;
;
return;
}
int[] pvWZIaS3xt = true[ 58.Hw0hJB()];
void XDvnTx;
{
{
void[] b9tQPz;
}
Qdek6jTDgdA PM0JZND8Hka;
hk1i lpqOb01ah;
if ( --( !this[ --!!new UR3()[ new iT3().CwHGTWFW04E()]]).nNlnW2o) -this.b4BMOG();
boolean[] ESM_Q02zq0IK;
while ( true.DHaL()) ;
if ( ( true.jx3_wLzR)._jeNfElD()) while ( false.KVFT1lBTMk) {
return;
}
if ( Wn5aW()[ -AUHUR[ true.fdwtPwGI29dP()]]) if ( ( !!true.yAvDF).G1d6JL7V) return;
}
}
public static void IDR (String[] kEHx) throws pAY {
boolean[] hXUxBWDp4aefi;
boolean C2e911pShQj = L2Dem1WSSSFC().mNIVMv4;
boolean[][][] Js2 = !!-this.ITcNiYq;
int fTqxj = xeweeW1X11gSn9().dgvm() = --!-false.YR_bp();
--false.YVXlB0_oX();
FzLDMT[][] axSolKzorOTqk_ = -X4w().rLAau_znI08G2c;
;
int kD = ( --( 1640062.EWu8QIxlDPTkU).qrK9Dea4oi)[ J1gr_fBvNuqDbg().tPBG()] = new fGe7_MX0Ch6z[ !-true.JCUQ][ -!!( 312[ !this[ !---!!new vkDq[ --!-CaPEe0Jlr[ true.RHf4OSZJfJ1x]].iSYVvJS1GF()]])[ --false.dCgOmnLvs9UkLV()]];
boolean zSlyUXU = new void[ false[ true.Ocex]][ -new boolean[ !false.y2j0tYeznIPvJ()].z];
NDBnj vSghbDoO;
{
if ( V.VMi4PFypA) !!new int[ ( new yZXF()[ new I4e9WEt().EcKwf]).ZL4itkaMyi7vs4()][ !!new void[ ( TPtK5Amu.Y7q2kFboO)[ HqGk_8[ 3085.z0M8O0edXmy]]].FNCo()];
int[][] Sj4ss4zYz8rF3o;
int XPfx6q5;
void[][][][] Ys7xGWD;
void[][] ik;
boolean[][] Ezpi4hBFGN;
return;
}
void[] g;
boolean _;
while ( !null.fb()) ;
void[][][] Ym = Vg()[ -hTgZ().cD82HjOaC5T];
boolean[][][][][] Mi;
ZEkd[] xXYoICN;
;
}
public int O2jDvkR6dA () {
while ( this[ -!true.gksbUOjo]) while ( -true.ukP3EP7o()) while ( new rty().OO5g) return;
if ( !25262.T7C4VK4) if ( null.yj5W1oETYMIak) {
q6XMkCM8j43VZ yJHSnq2M6IS;
}else if ( !false.facY9VH2) while ( ZK_0_H2().QRmp1) {
void[][][] PuM7Q5nbaSk_;
}
boolean wg7FwNJB;
!false[ !-false.H6PC()];
}
}
class OhJOKHSbWaG3 {
public static void K1YAvunOR (String[] dxY0Zy) throws uI6kJ_Fxs5zR {
boolean[][] R = !-( -new int[ !false.gfHJHsV]._m6Ya8fuEy3Uja())[ YdZ_sZ4L3q().ZDF14yqsTU()] = new uBufp0PB5K_e().iQjd3Oh;
int SaQ_fhW;
V6mVw i723G = --_6FEP.M4Y7OoD7l4jT5 = this.NEkPrSQJVxsZ;
void[] n1K5;
void[] jtY3h3C5QSz = wOvtqB2Z3jYJp().OmbPvcaEEOVR = false.nPrHONJuLMq5();
{
void QIf;
uC6NEz7r[][][][][][][] vUlg_;
void[] EMMtVUi6mdT6;
void YJKCZ4oRLx;
while ( 49.BfmUbM6095S) return;
void N;
while ( M.xn()) if ( --7.jccqC2y6ngK7HP) while ( 797534948[ -xgX()[ true.aQHcJQBRKxbZN]]) {
P2hdBt[][] FBzbwqTa9pOX;
}
mAk eQVwTYy8Q;
}
;
{
void[][][][] SrMcRPTc4Rw;
void[] opw;
int[] TDF7FAI;
void gW0SuOEQKBX;
while ( null.D()) return;
{
UUEgBe jvUTJIZaYyxrX;
}
return;
return;
boolean _300b;
boolean zuOkjg;
}
boolean PhM5IK_Hk8;
void tmtaAgBe;
void vPU8m7d = !new vZ8JxEdPI()[ this.hZk()];
boolean GWu4QjqCxP;
return -!!true.zddTxgbHRiG;
}
public aEKqk0u[] aB () throws roXQCpD {
boolean[][] goj61ZrnUgIpM = !C3L277yKdskf.Vprgeqgkj = -!GNsNCWe().uYo_kKdlNah4F;
;
qjd XS_rebdsNxbf6C;
int jmH26RD6;
-!!new ykej61LvNn().mJzicPHFSbFA();
;
void dyp01OjL7dB = ( -VTGis()[ -!( !40540.zPaNuZdHGPOeju).BFRkz8R0hLS()]).w;
}
public boolean[][][][][][][][][][] Kr6TMYPex;
public int[][][][][][][][] IHd8IA4Zk8vu;
public static void q6v7Lkg6H (String[] olsGb) throws GTdiYkj23k {
if ( -63.AB6Y) while ( !!( Qgm.em()).vsBNfX()) while ( false.VCevzm07()) return;else while ( !!false.Oil_T23Fy) ;
q84bQ60VXIwQ[] smybdRa = ( null.iMIoRl7la).gprRrd();
return !-!false.dHh;
void[][][] xL7iHYI82xaV;
if ( Jk6P33d5.NUYWlZ()) if ( false[ --false.ip()]) if ( -OZ.spHOcDo7w6()) return;
int jXH = this.jWJkxyW335();
int[] hSJnDPcP28TDC;
boolean[][][] uwPQaUAQEOo;
if ( -new oJ4().OENZd) {
while ( -!( !this.Ga2XK)[ lJXQ().zBZTC5()]) {
return;
}
}
;
int[] I0U07NYb;
boolean aNv75DjF1mI3pC;
}
public GTyYer0duJ[] goF3ad (IljIX1kfIyJedE EtUenZ0fspT, boolean VxAHzj9vsH5, void[][] m_sZ1w_kN) {
new ph().yX05O2GPYyHq();
return null.U_mUOGZXerUjXb;
;
;
void UN8Pe4w_8p;
DVMyKFeCiT GBUymnKawyzKA = !---Ndlq9().c56G;
void neHbyKqqNG = -!0546861[ !false.eomU4h1VAAA4()];
q3qmxt[] JtnDSohfm6utCq;
{
void[] yOYm3Y2IMSKhN;
;
return;
if ( !false.chM_NriJJIl) {
return;
}
int[] XwG7smcI8TQam;
OFUfOr hPMDOpc;
;
{
return;
}
-null.TgwoXg;
{
{
boolean[][] ElTWQMCrCWhCr;
}
}
boolean[][] SwjgXkgGBw;
;
if ( ( null[ true[ IopZzpAoUWeM.TvsAGDbkm()]]).tneHg()) {
void[][][][] HIL9nHvH2sF;
}
;
}
return new EAupkUB4OpUMzd().Q0();
}
public void[] TRuYXXUb () throws JewuEPkif {
{
if ( KNKiAObgMZL5ho().WT()) while ( new eL[ false[ -new Wa().mmoJfW()]].p_tO_yJ()) !this.m4V9O5();
boolean[] FB;
;
void AKT;
boolean[] vv8;
int uLDBn7X;
if ( new B1Ir6p().gaJ1Hp4Y) if ( --true.oGSd8xYHs1Vd) while ( !!!--false.g05NG_FcL()) ;
if ( null.h()) ;
null.yuZl8C_MVX();
kvid8b_hNF os5Vb07ccZbz;
while ( new ppulae().KD()) while ( !true.Cx()) e9RFalXt.s14wuziFKfaJ();
while ( !( --false.oPy).NSTgceJFYm) {
return;
}
int[][][][] dmEx9oN;
if ( 3194868[ 946131.BH9z]) ;
void[] iR;
}
int[][][] MBL = -( !new Akm3Eu7Pcv().Up9PQmG4W57jW()).qCeSWiv();
if ( -( this.AeY).e6W38Anq_9tpy) return;
void[] iCDk6RAH9p6ie1;
return;
}
public ibWJHrZY zXealbw;
public void EpcV6W1k (boolean UT2vpSXqQq, boolean[][] NeG4M, int[][][] AooQc6, int pe6yb, OR9pk[] zTX7J) {
if ( -this.K0F8V()) while ( kWkfQMqIS().UTkgOdzuBIID) while ( -( ( true[ new weDf().Onuq8jKwCmxdyU]).g).bw97()) ;else return;
while ( !-new boolean[ 85149.YcylZyZBnU8Ax].jyCtfPb) {
return;
}
!new tlV4rvaBMlE().lcDcptRc;
boolean F42bZA46;
pnmGmCim qgY6aOFuk1f7 = -!!-new ZP().ByULLIHAhet() = -pYrs[ new dMfAfkyFz().o()];
while ( false.VArAWXF3B1) f0S_.Z;
new Xw0_adv().D1muRX;
while ( -false.z3MvNbVjzdM3Yb()) ;
{
!-this.m_ZctAPqAM;
}
KuZzm_[] BFwfD;
}
public static void KJKKPBw (String[] kHm) {
return null[ new q()[ new BkBxPrOYu4O2_C().xmyOhm()]];
;
;
void EqRq_TmN = true[ !true.zv()];
while ( false.UlLT9fBR()) ;
if ( !53417.B6c7bvPG90T()) while ( this.FCo) null.ybj6QcgN4o;else ;
}
public int[] ngA687Y7cOkBE () {
if ( -true.c7hnce1()) if ( ( false[ !!!!false.uQnR7DGEaN])[ null.oT()]) return;
{
boolean[] s786AHcG;
boolean[] xOmfwRpR;
}
{
wCewXZWrf ifNgQ;
if ( L9Y5zL3e[ false.iy5gyYn9()]) return;
zaqdLfZg4JTS6l DwSWBlw4;
-!!!!!-true.sFkpzg();
int jBhiX60ojRUCqC;
{
boolean[][] lu;
}
;
int[][][] VDAFb7eNrLDSvo;
if ( -new xEpNQ3SDNP()[ true.W2UTnzNa()]) ;
j4Z3x saMKOf;
if ( -new sQ5wBKuG().lYu1BoZq2()) if ( !!-84038714.cED9OFQCq) {
void[] UuA3g5taXEVRcY;
}
Ix7MO5HFhldd[] ACHe7gN5Ax;
}
int sa7Nqa3LSL10_c;
}
public z1_FjqHTW[][] h3YoZq;
public Cg_7[][][] P;
public int[] tbDEv99V;
public JFziqv[][][][][] ifsj4v9;
}
| [
"[email protected]"
] | |
c3bdc5944adbd7b9d3e7c719a98117fd1627dd52 | 14e8ed13c240b1447aec617539a362aa36322dff | /hcrp_web/src/main/java/com/hcis/hcrp/cms/site/dao/CmsSiteDao.java | 48958ed528df0cda613478141e45c7378c0f6a63 | [] | no_license | hongchentang/mvn-hong | e21600607c1a9f276e1095833e5e74d58d25100f | 32571fa424e1bb013e79777908ec40084a6f8a10 | refs/heads/master | 2022-07-12T05:55:19.771891 | 2020-04-20T03:48:40 | 2020-04-20T03:48:40 | 256,177,812 | 0 | 0 | null | 2022-06-25T07:30:42 | 2020-04-16T10:07:44 | Java | UTF-8 | Java | false | false | 1,013 | java | package com.hcis.hcrp.cms.site.dao;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.hcis.ipanther.core.persistence.dao.MyBatisDao;
import com.hcis.hcrp.cms.site.entity.CmsSite;
@Repository("cmsSiteDao")
public class CmsSiteDao extends MyBatisDao{
public CmsSite selectFirstSite() {
return (CmsSite) this.selectForVO(namespace+".selectFirstSite");
}
public CmsSite selectFirstByRoles(Map<String, Object> map) {
return (CmsSite) this.selectForVO(namespace+".selectFirstSite",map);
}
public int deleteMainSite(CmsSite cmsSite) {
return this.update(namespace+".deleteMainSite",cmsSite);
}
public CmsSite selectMainSite() {
return (CmsSite) this.selectForVO(namespace+".selectMainSite");
}
public int selectHaveSourcePath(String sourcePath) {
return this.selectForInt(namespace+".selectHaveSourcePath",sourcePath);
}
public CmsSite selectFirstSite(Map<String, Object> map) {
return (CmsSite) this.selectForVO(namespace+".selectFirstSite",map);
}
} | [
"[email protected]"
] | |
ffecf1810113b4235b5cad3493194061880f6783 | 73346e3bbc1da866a4eb67968fa5bc49938a4d2b | /cacapalavra/src/test/java/br/com/ifsp/cacapalavra/modelo/ArquivoTest.java | aa2480f98f8e5db00465dc9f350fd1a4281958ed | [] | no_license | allima/isfpcacapalavra | 6012fe63c0159ddf9bda2fa75fec2123e2064963 | fadf983734e6f67d678837b59f05160ad6bca9d0 | refs/heads/master | 2021-01-17T15:17:23.199637 | 2015-02-13T19:32:07 | 2015-02-13T19:32:16 | 30,661,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java | package br.com.ifsp.cacapalavra.modelo;
import org.junit.Test;
public class ArquivoTest {
@Test
public void test() {
//fail("Not yet implemented");
}
}
| [
"[email protected]"
] | |
8c12f3531a4712476ec0a3eb7425d308f199282b | 2e3ef35731ae78c18f808f50f2395025c731212f | /src/main/java/com/hys/spring4demo/mybatis/TestMapper.java | 6276c659ac35444f4d129bb13560dfd29753f627 | [] | no_license | raduihys/spring4-demo | 8c0e049d4c03e565ae862e43a4106e839103d808 | 383b45bfd9dd1570aa898f1d2e8f814570af1dc4 | refs/heads/master | 2021-01-19T01:32:45.296174 | 2017-11-16T01:42:47 | 2017-11-16T01:42:47 | 65,177,791 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.hys.spring4demo.mybatis;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import com.bt.qq.common.mybatis.Mapper;
@Mapper(db="test")
public interface TestMapper {
@Delete("DELETE FROM mybatis_test1")
boolean deleteAll();
@Insert("INSERT INTO mybatis_test1(id,intCol1,strCol1) VALUES(${id},${intCol1},#{strCol1})")
void insert(@Param("id")int id,@Param("intCol1") int intCol1,@Param("strCol1") String strCol1);
}
| [
"[email protected]"
] | |
0e1f50fbac8711f66d6fa42c3bcf66832311f44d | 53e1530d418dcda795cd140db4d736a65695f37b | /IdeaProjects/src/part2/chapter29/StreamDemo.java | 0715cbe60279fcca61ebf1b5285298eb6bbfcf0f | [] | no_license | Zed180881/Zed_repo | a03bac736e3c61c0bea61b2f81624c4bc604870b | 6e9499e7ec3cfa9dc11f9d7a92221522c56b5f61 | refs/heads/master | 2020-04-05T18:57:47.596468 | 2016-11-02T07:51:30 | 2016-11-02T07:51:30 | 52,864,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,508 | java | package part2.chapter29;
import java.util.ArrayList;
import java.util.Optional;
import java.util.stream.Stream;
class StreamDemo {
public static void main(String[] args) {
ArrayList<Integer> myList = new ArrayList<>();
myList.add(7);
myList.add(18);
myList.add(10);
myList.add(24);
myList.add(17);
myList.add(5);
System.out.println("Source list: " + myList);
Stream<Integer> myStream = myList.stream();
Optional<Integer> minVal = myStream.min(Integer::compare);
if (minVal.isPresent())
System.out.println("Min value: " + minVal.get());
myStream = myList.stream();
Optional<Integer> maxVal = myStream.max(Integer::compare);
if (maxVal.isPresent())
System.out.println("Max value: " + maxVal.get());
Stream<Integer> sortedStream = myList.stream().sorted();
System.out.print("Sorted Stream: ");
sortedStream.forEach(n -> System.out.print(n + " "));
System.out.println();
Stream<Integer> oddVals = myList.stream().sorted().filter(n -> (n % 2) == 1);
System.out.print("Odd values: ");
oddVals.forEach(n -> System.out.print(n + " "));
System.out.println();
oddVals = myList.stream().sorted().filter(n -> (n % 2) == 1).filter(n -> (n > 5));
System.out.print("Odd values greater than 5: ");
oddVals.forEach(n -> System.out.print(n + " "));
System.out.println();
}
}
| [
"[email protected]"
] | |
d2c3d26c2950e96aecca1260fe3a0d4c136e0546 | 060b4b8b5f42c45fe3002137fd737f1da5b0009d | /src/main/java/com/tony/server/controller/upload/UploadController.java | e8f06da59a98f2e2173c33f7ee1df40f82447879 | [] | no_license | tonypark0403/spring-mybatis | b31fe819db5ba7b455194a2e260befbf218a67e1 | 8678c86ffba7a193797c45c24783cc42ee58d32c | refs/heads/master | 2020-04-27T03:58:20.837979 | 2019-03-14T01:56:12 | 2019-03-14T01:56:12 | 174,039,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,674 | java | package com.tony.server.controller.upload;
import java.io.File;
import java.util.UUID;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class UploadController {
private static final Logger logger = LoggerFactory.getLogger(UploadController.class);
@Resource(name = "uploadPath")
String uploadPath;
@RequestMapping(value = "/upload/uploadForm", method = RequestMethod.GET)
public void uploadForm() {
// "upload/uploadForm";
}
@RequestMapping(value = "/upload/uploadForm", method = RequestMethod.POST)
public ModelAndView uploadForm(MultipartFile file, ModelAndView mav) throws Exception {
logger.info("Filename: " + file.getOriginalFilename());
String savedName = file.getOriginalFilename();
logger.info("Filesize: " + file.getSize());
logger.info("Content type: " + file.getContentType());
savedName = uploadFile(savedName, file.getBytes());
mav.setViewName("upload/uploadResult");
mav.addObject("savedName", savedName);
return mav;
}
String uploadFile(String originalName, byte[] fileData) throws Exception {
// Universal Unique IDentifier
UUID uid = UUID.randomUUID();
String savedName = uid.toString() + "_" + originalName;
File target = new File(uploadPath, savedName);
FileCopyUtils.copy(fileData, target);
return savedName;
}
}
| [
"[email protected]"
] | |
1f67c2ab85f2349b902e142f5e3df40dfd23c77f | 877b6d945bf0f5a174004d02b9534d905e74af92 | /ArStation/src/main/java/com/funoble/myarstation/socket/protocol/MBNotifyPlayAnimationTwo.java | 3fd3b1ebfdb3b7c8fa146f912127259d00be5913 | [] | no_license | Hengle/arstation | 47906e828c2a39f638bd7599e6c999f49524061c | e5550072cfd381372770eba457002e1ea4c8b564 | refs/heads/master | 2020-07-17T06:58:06.861077 | 2017-07-26T12:56:22 | 2017-07-26T12:56:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,314 | java | /*******************************************************************************
* Copyright (C) Inc.All Rights Reserved.
* FileName: MBReqDing.java
* Description:
* History:
* 版本号 作者 日期 简要介绍相关操作
* 1.0 cole 2012-5-24 上午11:05:42
*******************************************************************************/
package com.funoble.myarstation.socket.protocol;
import java.nio.ByteBuffer;
public class MBNotifyPlayAnimationTwo implements MsgPara {
//pak名称|起始位置类型(0---位置 1---坐标)|位置【X坐标】|0【Y坐标】
//|结束位置类型(0---位置 1---坐标)|位置【X坐标】|0【Y坐标】|开始动画ID|开始动画动作|结束动画ID|结束动画动作
public String szAnimDes; //
/**
* construct
*/
public MBNotifyPlayAnimationTwo() {
szAnimDes = "";
}
/*
* @see com.funoble.lyingdice.socket.protocol.MsgPara#Encode(byte[], short)
*/
@Override
public int Encode(byte[] aOutBuffer, short aOutLength) {
if(aOutBuffer == null || aOutLength <= 0) {
return -1;
}
ByteBuffer Temp = ByteBuffer.wrap(aOutBuffer);
int shLength = 2;
shLength += aOutLength;
Temp.position(shLength);
Temp.putShort((short) szAnimDes.getBytes().length);
if(szAnimDes.length() > 0) {
Temp.put(szAnimDes.getBytes());
}
shLength = Temp.position();
shLength -= aOutLength;
Temp.putShort(aOutLength, (short) shLength);
return Temp.position();
}
/*
* @see com.funoble.lyingdice.socket.protocol.MsgPara#Decode(byte[], short)
*/
@Override
public int Decode(byte[] aInBuffer, short aInLength) {
if(aInBuffer == null || aInLength <= 0) {
return -1;
}
ByteBuffer Temp = ByteBuffer.allocate(aInBuffer.length + 2);
Temp.put(aInBuffer);
Temp.position(aInLength);
int shLength = 0;
shLength = Temp.getShort();
if(shLength > aInBuffer.length - aInLength) {
return -1;
}
int len = Temp.getShort();
if(len > 0 ) {
byte[] data = new byte[len];
Temp.get(data);
szAnimDes = new String(data);
data = null;
}
return Temp.position();
}
/*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "MBNotifyPlayAnimationTwo [szAnimDes=" + szAnimDes + "]";
}
}
| [
"[email protected]"
] | |
3ebedbf9c3a70bfb17c48e4e188e192379274411 | 11ed50703657e86b63b94a46e5e1aae4d8ef2ce6 | /Auction/src/com/dx/dao/ManagerDao.java | f120ff64b3556a923853a8896be96a5b1540a624 | [] | no_license | sxshanxin/bishe | f924044011b7be7ab18717792d9cb5c8cadb37d4 | 9a909c5f4ac4ce333b946966705eb5d9d0657fa9 | refs/heads/master | 2020-03-28T01:30:54.578909 | 2018-09-06T07:31:24 | 2018-09-06T07:31:24 | 147,510,399 | 0 | 0 | null | 2018-09-06T07:34:30 | 2018-09-05T11:56:19 | Java | UTF-8 | Java | false | false | 333 | java | package com.dx.dao;
import java.util.List;
import com.dx.entity.Manager;
public interface ManagerDao {
public Manager findByLoginm(String mname,String mpsw);
public boolean insertManager(Manager manager);
public boolean findByMname(String mname);
public List<Manager> findManagers();
public boolean delManager(String sid);
}
| [
"[email protected]"
] | |
7465c15be61eb4c7e08ccf6938f7d7e521d09168 | bcc8f7ae9fa638cc3a154544bad1dafcd67de548 | /src/com/richitec/donkey/conference/message/ActorMessage.java | 48583dfbab2b638ff06fa9dffc86350ba0bd9ae7 | [] | no_license | imeeting/donkey | e0cf4bc311194e7513a62c5786d27cfcffe34c15 | a983d9d141155d31f0855c29a3313c8be8a3a78c | refs/heads/master | 2021-01-23T09:52:41.526000 | 2012-11-30T08:48:37 | 2012-11-30T08:48:37 | 4,922,695 | 0 | 1 | null | 2012-11-30T08:48:32 | 2012-07-06T09:55:35 | JavaScript | UTF-8 | Java | false | false | 7,820 | java | package com.richitec.donkey.conference.message;
import java.io.IOException;
import javax.servlet.sip.SipApplicationSession;
import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipServletResponse;
import javax.servlet.sip.SipSession;
import com.richitec.donkey.conference.actor.AttendeeActor;
import com.richitec.donkey.conference.actor.ConferenceActor;
public class ActorMessage {
public static CmdDestroyConference destroyConference = new CmdDestroyConference();
public static EvtConferenceCreateSuccess createConferenceSuccess = new EvtConferenceCreateSuccess();
public static EvtConferenceCreateError createConferenceError = new EvtConferenceCreateError();
public static EvtControlChannelTerminated controlChannelTerminated = new EvtControlChannelTerminated();
public static EvtControlChannelExpired controlChannelExpired = new EvtControlChannelExpired();
public static class CmdCreateConference {
private String deleteWhen;
public CmdCreateConference(String deleteWhen) {
this.deleteWhen = deleteWhen;
}
public String getDeleteWhen(){
return this.deleteWhen;
}
}
public static class CmdDestroyConference {
public String getMethod(){
return "destroy";
}
}
private static class CmdMessage {
private String sipUri;
private String method;
public CmdMessage(String method, String sipUri) {
this.method = method;
this.sipUri = sipUri;
}
public String getSipUri(){
return this.sipUri;
}
public String getMethod(){
return this.method;
}
}
public static class CmdJoinConference extends CmdMessage {
public CmdJoinConference(String method, String sipUri) {
super(method, sipUri);
}
}
public static class CmdUnjoinConference extends CmdMessage {
public CmdUnjoinConference(String method, String sipUri) {
super(method, sipUri);
}
}
public static class CmdMuteAttendee extends CmdMessage{
private String conn;
public CmdMuteAttendee(String sipUri) {
super("mute", sipUri);
}
public void setConn(String conn){
this.conn = conn;
}
public String getConn(){
return this.conn;
}
}
public static class CmdUnmuteAttendee extends CmdMessage {
private String conn;
public CmdUnmuteAttendee(String sipUri) {
super("unmute", sipUri);
}
public void setConn(String conn){
this.conn = conn;
}
public String getConn(){
return this.conn;
}
}
public static class EvtAttendeeCallInConference {
private SipApplicationSession sipAppSession;
private SipSession userSession;
private SipSession mediaServerSession;
private String sipUri;
private String conn;
public EvtAttendeeCallInConference(SipApplicationSession sipAppSession,
SipSession userSession, SipSession mediaServerSession,
String sipUri, String conn){
this.sipAppSession = sipAppSession;
this.userSession = userSession;
this.mediaServerSession = mediaServerSession;
this.sipUri = sipUri;
this.conn = conn;
}
public SipApplicationSession getSipAppSession(){
return this.sipAppSession;
}
public SipSession getUserSession() {
return this.userSession;
}
public SipSession getMediaServerSession() {
return this.mediaServerSession;
}
public String getSipUri(){
return this.sipUri;
}
public String getConn(){
return this.conn;
}
public void bye(){
SipServletRequest byeMediaServer = mediaServerSession.createRequest("BYE");
try {
byeMediaServer.send();
} catch (IOException e) {
e.printStackTrace();
}
SipServletRequest byeAttendee = userSession.createRequest("BYE");
try {
byeAttendee.send();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 如果电话呼入会议时,该会议的状态不是Created,则向AttendeeActor发送该消息。
*/
public static class ErrConferenceStatusConflict {
private ConferenceActor.State state;
public ErrConferenceStatusConflict(ConferenceActor.State state){
this.state = state;
}
public String getState(){
return this.state.name();
}
}
public static class ErrAttendeeStatusConflict {
private AttendeeActor.AttendeeState state;
private String sipUri;
private String method;
public ErrAttendeeStatusConflict(String method, String sipUri, AttendeeActor.AttendeeState state){
this.method = method;
this.sipUri = sipUri;
this.state = state;
}
public String getMethod() {
return this.method;
}
public String getSipUri() {
return this.sipUri;
}
public String getState(){
return this.state.name();
}
}
/**
*
* Control Channel Messages
*/
public static class CreateControlChannelComplete {
private int status;
public CreateControlChannelComplete(int status) {
this.status = status;
}
public int getStatus(){
return this.status;
}
}
public static class EvtConferenceCreateSuccess {
}
public static class EvtConferenceCreateError {
}
public static class ControlChannelInfoRequest {
private SipServletRequest request;
public ControlChannelInfoRequest(SipServletRequest request) {
this.request = request;
}
public SipServletRequest getRequest(){
return this.request;
}
}
public static class ControlChannelInfoResponse {
private SipServletResponse response;
public ControlChannelInfoResponse(SipServletResponse response) {
this.response = response;
}
public SipServletResponse getResponse(){
return this.response;
}
}
public static class EvtControlChannelTerminated {
}
public static class EvtControlChannelExpired {
}
/**
* B2BUASipServlet related
*
* @author huuguanghui
*
*/
private static class SipResponse {
private SipServletResponse response;
public SipResponse(SipServletResponse response){
this.response = response;
}
public SipServletResponse getResponse(){
return this.response;
}
}
public static class SipProvisionalResponse extends SipResponse {
public SipProvisionalResponse(SipServletResponse response) {
super(response);
}
}
public static class SipSuccessResponse extends SipResponse {
public SipSuccessResponse(SipServletResponse response) {
super(response);
}
}
public static class SipErrorResponse extends SipResponse {
public SipErrorResponse(SipServletResponse response) {
super(response);
}
}
public static class SipByeRequest {
private SipSession session;
public SipByeRequest(SipSession session){
this.session = session;
}
public SipSession getSipSession(){
return this.session;
}
}
public static class EvtAttendeeCallEstablished {
private String conn;
private String sipUri;
public EvtAttendeeCallEstablished(String sipUri, String conn) {
this.sipUri = sipUri;
this.conn = conn;
}
public String getConn(){
return this.conn;
}
public String getSipUri() {
return this.sipUri;
}
}
public static class EvtAttendeeCallFailed {
private int status;
private String sipUri;
public EvtAttendeeCallFailed(String sipUri, int status) {
this.sipUri = sipUri;
this.status = status;
}
public int getStatus(){
return this.status;
}
public String getSipUri(){
return this.sipUri;
}
}
public static class EvtAttendeeCallTerminated {
private String sipUri;
public EvtAttendeeCallTerminated(String sipUri) {
this.sipUri = sipUri;
}
public String getSipUri(){
return this.sipUri;
}
}
public static class EvtMediaServerCallFailed extends EvtAttendeeCallFailed {
public EvtMediaServerCallFailed(String sipUri, int status) {
super(sipUri, status);
}
}
public static class SipSessionReadyToInvalidate {
private SipSession session;
public SipSessionReadyToInvalidate(SipSession session){
this.session = session;
}
public SipSession getSipSession(){
return this.session;
}
}
}
| [
"[email protected]"
] | |
6889b56ab574d44870c9c67df1cfa6f167ad2e17 | f441063b2edd8931c6fafd038584a2c4b5309935 | /Lab-1-Questionnaire/app/src/androidTest/java/com/example/lab1questionnaire/ExampleInstrumentedTest.java | e1f53fe3f2389e4ef9b2ec21132880d88695794c | [] | no_license | ICS-Brandon/SEG3125 | 5ae49cdbe3de6830f2f57531aea041f16f021eaa | 8d4dff0f8c741f64db024c64cdf2372e6ca2ba6d | refs/heads/master | 2020-12-14T04:16:52.956503 | 2020-04-02T20:52:20 | 2020-04-02T20:52:20 | 234,636,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package com.example.lab1questionnaire;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.lab1questionnaire", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
6659fd0452a54a7420927bd40858c366ce8d3e8e | d84fb60595312136aeb1069baad585da325c218d | /HuaShanApp/app/src/main/java/com/karazam/huashanapp/manage/main/view/fragment/ManageFragment.java | 28cec100356bcb1f7f946e28de423998bd30fc49 | [] | no_license | awplying12/huashanApp | d6a72b248c94a65e882385edf92231552214340c | 86bd908ec2f82fc030a9d83238144a943461c842 | refs/heads/master | 2021-01-11T00:21:10.870110 | 2017-02-10T11:27:06 | 2017-02-10T11:27:06 | 70,544,770 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,459 | java | package com.karazam.huashanapp.manage.main.view.fragment;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.example.utils.base.BaseFragment;
import com.example.utils.custom.RefreshRecyclerView;
import com.example.utils.custom.WrapContentLinearLayoutManager;
import com.karazam.huashanapp.HuaShanApplication;
import com.karazam.huashanapp.R;
import com.karazam.huashanapp.databinding.FragmentManageBinding;
import com.karazam.huashanapp.main.Bean.HotProjects;
import com.karazam.huashanapp.manage.main.model.databinding.ManageEntity;
import com.karazam.huashanapp.manage.main.model.databinding.Project;
import com.karazam.huashanapp.manage.main.view.ManageView;
import com.karazam.huashanapp.manage.main.view.view.ContentAdapter;
import com.karazam.huashanapp.main.adapter.TitleBarAdapter;
import com.karazam.huashanapp.manage.main.viewmodel.ManageViewModel;
import com.karazam.huashanapp.manage.main.viewmodel.ManageViewModelImpl;
import com.ogaclejapan.rx.binding.Rx;
import com.ogaclejapan.rx.binding.RxView;
import java.util.ArrayList;
/**
* Created by Administrator on 2016/10/11.
*/
public class ManageFragment extends BaseFragment implements ManageView,SwipeRefreshLayout.OnRefreshListener{
private View view;
private FragmentManageBinding binding;
private ManageEntity entity = new ManageEntity();
private ManageViewModel mModel;
private RecyclerView titlebar_rl;
private TitleBarAdapter titlebarAdapter;
private SwipeRefreshLayout mSwipeLayout;
private RefreshRecyclerView content_rl;
private ContentAdapter adapter;
private String type = "guarantee";
private static int page = 1;
private ImageView faile_img;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_manage,container,false);
view = binding.getRoot();
mModel = new ManageViewModelImpl(entity,this,getContext(),getActivity());
binding.setHandler(mModel);
binding.setEntity(entity);
initView();
setTitlebBar();
setRefreshRecyclerView();
initRefresh();
return view;
}
/**
* 初始化View
*/
private void initView() {
titlebar_rl = (RecyclerView) getView(R.id.manage_titlebar_rl,view);
LinearLayoutManager lm = new LinearLayoutManager(getActivity(),LinearLayoutManager.HORIZONTAL,false);
titlebar_rl.setLayoutManager(lm);
// faile_img = (ImageView) getView(R.id.faile_img);
mSwipeLayout = (SwipeRefreshLayout) getView(R.id.manage_sl,view);
mSwipeLayout.setOnRefreshListener(this);
mSwipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light,
android.R.color.holo_orange_light, android.R.color.holo_red_light);
content_rl = (RefreshRecyclerView) getView(R.id.content_rl,view);
content_rl.setSwl_pl(mSwipeLayout);
}
/**
* 设置标题栏
*/
private void setTitlebBar() {
ArrayList<String> list = new ArrayList<>();
list.add("产融贷");
list.add("优企宝");
list.add("保理贷");
// list.add("债权转让");
titlebarAdapter = new TitleBarAdapter(list,getContext(),17);
titlebar_rl.setAdapter(titlebarAdapter);
titlebarAdapter.setmOnItemClickListener(new TitleBarAdapter.onItemClickListener() {
@Override
public void onItemClick(View view, int position) {
onItem(position);
}
});
}
public void setCurrentItem(int position){
titlebarAdapter.setCurrentItem(position);
onItem(position);
}
private void onItem(int position){
switch (position){
case 0: //产融货
type = "guarantee";
break;
case 1: //优企宝
type = "mortgage";
break;
case 2: //保理贷
type = "credit";
break;
// case 3: //债权转让
// break;
default:
break;
}
Refresh();
}
private void initRefresh() {
Refresh();
RxView.of(content_rl).bind(HuaShanApplication.refreshManage, new Rx.Action<RefreshRecyclerView, String>() {
@Override
public void call(RefreshRecyclerView target, String s) {
if(s.equals("Refresh")||s.equals("getManage")){
Refresh();
}
}
});
}
/**
* SwipeRefreshLayout配合RecyclerView
* 实现下拉刷新和上拉加载更多以及没有数据的显示
*
*/
private void setRefreshRecyclerView() {
// mSwipeLayout.addView();
WrapContentLinearLayoutManager layoutManager = new WrapContentLinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false){
@Override
protected int getExtraLayoutSpace(RecyclerView.State state) {
return 6000;
}
};
content_rl.setLayoutManager(layoutManager);
ArrayList<HotProjects> list = new ArrayList<>();
// list.add(new HotProjects());
// list.add(new HotProjects());
// list.add(new HotProjects());
// list.add(new HotProjects());
// list.add(new HotProjects());
adapter = new ContentAdapter(getContext(),list,getActivity());
content_rl.setAdapter(adapter);
// adapter.setmOnItemClickListener(new BidingAdapter.onItemClickListener() {
// @Override
// public void onItemClick(View view, int position) {
// showToast("点击 Item"+position);
// }
// });
}
@Override
public void onRefresh() {
// showToast("onRefresh Down");
Refresh();
}
/**
* 刷新数据
*/
private void Refresh(){
page = 1;
mModel.getManageData(type,page);
}
/**
* 添加数据
*/
private void addData(){
if(page >mModel.allpage){
showToast("到最后一页了!");
return;
}
mModel.getManageData(type,page);
}
/**
* 获取数据成功
*/
@Override
public void getManageDataSuccess(ArrayList<HotProjects> datas) {
mSwipeLayout.setRefreshing(false);
if(content_rl.getVisibility() != View.VISIBLE){
content_rl.setVisibility(View.VISIBLE);
}
if(page == 1){
adapter.setmData(datas);
adapter.notifyDataSetChanged();
}else {
ArrayList<HotProjects> data = adapter.getmData();
data.addAll(datas);
adapter.setmData(data);
adapter.notifyDataSetChanged();
}
// if(page >= mModel.allpage){
// return;
// }
page ++;
}
/**
* 获取数据失败
* @param e
*/
@Override
public void getManageDataFaile(String e) {
mSwipeLayout.setRefreshing(false);
if(content_rl.getVisibility() == View.VISIBLE ){
content_rl.setVisibility(View.GONE);
}
// else {
// showToast("获取数据失败");
// }
}
/**
* 获取数据故障
* @param e
*/
@Override
public void getManageDataError(Throwable e) {
mSwipeLayout.setRefreshing(false);
if(content_rl.getVisibility() == View.VISIBLE ){
content_rl.setVisibility(View.GONE);
}
// else {
// showToast("获取数据失败");
// }
}
@Override
public void onStart() {
super.onStart();
content_rl.setOnRefreshListener(new RefreshRecyclerView.OnRefreshListener() {
@Override
public void onRefreshUp() {
addData();
}
});
}
}
| [
"[email protected]"
] | |
dae0657b27d3a152289c4075433ad998df2ccc5f | 81b6b2911cd8bcfd171d67c907351c818e6f02aa | /XRay/src/main/java/com/jbesu/mc/xray/App.java | 8bc51b8f07e4c0aceae32220e8947b2d42785954 | [
"MIT"
] | permissive | forewing/mc-xray | 06445399c82922b51571a516680d551215a8f7b7 | 128172211608a270168cf2fc71c9d6fca190063a | refs/heads/master | 2023-02-22T17:09:04.302694 | 2021-01-18T14:29:26 | 2021-01-18T14:29:26 | 330,657,764 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,684 | java | package com.jbesu.mc.xray;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import com.jbesu.mc.xray.command.CommandXRay;
import com.jbesu.mc.xray.player.PlayerInfo;
import com.jbesu.mc.xray.tasks.BlockTask;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class App extends JavaPlugin {
private Map<UUID, PlayerInfo> playerInfoMap;
private Set<String> targetBlocks;
public App() {
playerInfoMap = new HashMap<>();
}
public Set<String> getTargetBlocks() {
if (targetBlocks == null) {
targetBlocks = new HashSet<>();
for (String block : getConfig().getStringList("target")) {
targetBlocks.add(block);
}
}
return targetBlocks;
}
@Override
public void onEnable() {
this.getCommand("xray").setExecutor(new CommandXRay(this));
initConfig();
}
private void initConfig() {
FileConfiguration config = getConfig();
config.addDefault("mode", "block");
config.addDefault("range", 2);
List<String> defaultTarget = new ArrayList<>();
defaultTarget.add("AIR");
defaultTarget.add("COAL_ORE");
defaultTarget.add("REDSTONE_ORE");
defaultTarget.add("IRON_ORE");
defaultTarget.add("GOLD_ORE");
defaultTarget.add("DIAMOND_ORE");
defaultTarget.add("LAPIS_ORE");
defaultTarget.add("EMERALD_ORE");
defaultTarget.add("NETHER_GOLD_ORE");
defaultTarget.add("NETHER_QUARTZ_ORE");
defaultTarget.add("ANCIENT_DEBRIS");
defaultTarget.add("WATER");
defaultTarget.add("LAVA");
defaultTarget.add("BEDROCK");
config.addDefault("target", defaultTarget);
config.options().copyDefaults(true);
saveDefaultConfig();
}
public PlayerInfo getPlayerInfo(Player player) {
return playerInfoMap.computeIfAbsent(player.getUniqueId(), f -> new PlayerInfo(player.getUniqueId()));
}
public void removePlayerInfo(Player player) {
playerInfoMap.remove(player.getUniqueId());
}
public void startXRay(Player player) {
PlayerInfo playerInfo = getPlayerInfo(player);
playerInfo.setTask(new BlockTask(this, player));
playerInfo.getTask().start();
}
public void stopXRay(Player player) {
PlayerInfo playerInfo = getPlayerInfo(player);
playerInfo.getTask().stop();
getPlayerInfo(player).setTask(null);
}
}
| [
"[email protected]"
] | |
0aea2ab87ee80858a06ff36ed998a8f60dc14c44 | 886d59dcc67c3c3416eed11ead6655f89152c8da | /W3Schools/app/src/main/java/com/example/w3schools/MainActivity.java | 34bb0e87ae49c8936e56bdc5ee9d557eb4b71cbe | [] | no_license | Gopi3614/W3Schools | 980ce64049c25b10b4918cf82aad65a85be8a281 | bf3bbe50ae0f2d13616e98a34b5c24d95f27910d | refs/heads/main | 2023-04-12T06:58:22.295924 | 2021-05-02T16:51:20 | 2021-05-02T16:51:20 | 363,699,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,300 | java | package com.example.w3schools;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DownloadManager;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
WebView webView = findViewById(R.id.webview);
webView.loadUrl("https://www.w3schools.com");
webView.getSettings().setJavaScriptEnabled(true);
//webView.isHardwareAccelerated();
webView.getSettings().setLoadsImagesAutomatically(true);
webView.setWebViewClient(new WebViewClient());
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
DownloadManager.Request myRequest = new DownloadManager.Request(Uri.parse(url));
myRequest.allowScanningByMediaScanner();
myRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager Mymanager = (DownloadManager)getApplicationContext().getSystemService(DOWNLOAD_SERVICE);
Mymanager.enqueue(myRequest);
Toast.makeText(getApplicationContext(),"File is Downloading...",Toast.LENGTH_LONG).show();
}
});
webView.setOnKeyListener((View.OnKeyListener) (v, keyCode, event) -> {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (webView.canGoBack()) {
webView.goBack();
//return true;
}
return MainActivity.super.onKeyDown(keyCode, event);
}
}
return true;
});
}
} | [
"[email protected]"
] | |
81f63156b71f5e8cf65585aaf2afb531f8600944 | b400427d70d048312edd91c09e4818b64107b639 | /app/src/main/java/model/LastPosition.java | cb304698a44792780f243a496bdfc81f50d548e0 | [] | no_license | ksandyasa/mtrack-android | 4c464d2f810aae42c7d7459d784591f87484bea7 | c5bbb506e1058db04dd5af1081076bda169fdc40 | refs/heads/master | 2021-01-23T14:14:42.056269 | 2017-09-07T02:12:27 | 2017-09-07T02:12:27 | 102,679,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,761 | java | package model;
/**
* Created by Andy on 5/23/2016.
*/
public class LastPosition {
private String asset_id;
private String asset_code;
private String timestamp;
private String status_code;
private String input_mask;
private String phone_number;
private String distance;
private String address;
private String latitude;
private String longitude;
private String heading;
private String speed;
private String speed_violation;
private String geofence_point;
private String geofence_route;
private String duration;
public LastPosition() {
}
public LastPosition(String ai, String ac, String ts, String sc, String im, String pn, String dist, String add, String lat,
String lng, String head, String spd, String sv, String gp, String gr) {
this.asset_id = ai;
this.asset_code = ac;
this.timestamp = ts;
this.status_code = sc;
this.input_mask = im;
this.phone_number = pn;
this.distance = dist;
this.address = add;
this.latitude = lat;
this.longitude = lng;
this.heading = head;
this.speed = spd;
this.speed_violation = sv;
this.geofence_point = gp;
this.geofence_route = gr;
}
public void setAssetId(String ai) {
this.asset_id = ai;
}
public void setAssetCode(String ac) {
this.asset_code = ac;
}
public void setTimestamp(String ts) {
this.timestamp = ts;
}
public void setStatusCode(String sc) {
this.status_code = sc;
}
public void setInputMask(String im) {
this.input_mask = im;
}
public void setPhoneNumber(String pn) {
this.phone_number = pn;
}
public void setDistance(String dist) {
this.distance = dist;
}
public void setAddress(String add) {
this.address = add;
}
public void setHeading(String head) {
this.heading = head;
}
public void setLatitude(String lat) {
this.latitude = lat;
}
public void setLongitude(String lng) {
this.longitude = lng;
}
public void setSpeed(String spd) {
this.speed = spd;
}
public void setSpeedViolation(String sv) {
this.speed_violation = sv;
}
public void setGeofencePoint(String gp) {
this.geofence_point = gp;
}
public void setGeofenceRoute(String gr) {
this.geofence_route = gr;
}
public void setDuration(String dr) {
this.duration = dr;
}
public String getAssetId() {
return this.asset_id;
}
public String getAssetCode() {
return this.asset_code;
}
public String getTimestamp() {
return this.timestamp;
}
public String getStatusCode() {
return this.status_code;
}
public String getInputMask() {
return this.input_mask;
}
public String getPhoneNumber() {
return this.phone_number;
}
public String getDistance() {
return this.distance;
}
public String getAddress() {
return this.address;
}
public String getLatitude() {
return this.latitude;
}
public String getLongitude() {
return this.longitude;
}
public String getHeading() {
return this.heading;
}
public String getSpeed() {
return this.speed;
}
public String getSpeedViolation() {
return this.speed_violation;
}
public String getGeofencePoint() {
return this.geofence_point;
}
public String getGeofenceRoute() {
return this.geofence_route;
}
public String getDuration() {
return this.duration;
}
}
| [
"[email protected]"
] | |
e24594186a76cde8e54fb9f2e96117e6f0b02f83 | 13d0d6e5b5d4471952d4a7a1c7a4900d5323953c | /taglib/feilong-taglib-display/src/test/java/com/feilong/taglib/display/pager/BasePagerTest.java | a8ff1a4b79f0d65adfe740c291d0d9bc28af361f | [] | no_license | qq122343779/feilong-platform | 3c55867391620eb1283ca95c2aa30ea1bc156b1c | 5824b20445747ecd6e730c5a11c120d4e9f9838a | refs/heads/master | 2021-01-18T11:50:57.837512 | 2014-12-03T06:55:59 | 2014-12-03T06:55:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,859 | java | /*
* Copyright (C) 2008 feilong ([email protected])
*
* 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.feilong.taglib.display.pager;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.feilong.commons.core.enumeration.CharsetType;
import com.feilong.taglib.display.pager.command.PagerConstants;
import com.feilong.taglib.display.pager.command.PagerParams;
/**
* The Class BasePagerTest.
*
* @author <a href="mailto:[email protected]">feilong</a>
* @version 1.0.7 2014年5月24日 下午11:50:17
* @since 1.0.7
*/
public abstract class BasePagerTest{
/** The Constant log. */
@SuppressWarnings("unused")
private static final Logger log = LoggerFactory.getLogger(BasePagerTest.class);
// Locale.ENGLISH;
/** The locale. */
private Locale locale = Locale.SIMPLIFIED_CHINESE;
/** The debug is not parse vm. */
boolean debugIsNotParseVM = false;
/**
* Gets the pager params.
*
* @return the pager params
*/
protected PagerParams getPagerParams(){
int count = 1024;
int currentPageNo = -1;
int pageSize = 10;
int maxIndexPages = 8;
String skin = PagerConstants.DEFAULT_SKIN;
// String pageUrl = "http://localhost:8888/pager.htm?a=b&b=c&d=a&name=jinxin";
String pageUrl = "http://item.blanja.com/items/search?oneNav=1190&priceTo=&twoNav=101706&priceFrom=100&pageNo=1&keyWords=Samsung";
// String pageUrl = "http://localhost:8888/pager.htm";
// pageUrl =
// "http://www.underarmour.cn/cmens-bottoms-pant/t-b-f-a-c-s-fLoose-p-g-e-i-o.htm?'\"--></style></script><script>netsparker(0x0000E1)</script>=";
String pageParamName = "pageNo";
String vmPath = PagerConstants.DEFAULT_TEMPLATE_IN_CLASSPATH;
// log.debug("===================================================");
PagerParams pagerParams = new PagerParams(count, pageUrl);
pagerParams.setCurrentPageNo(currentPageNo);
pagerParams.setPageSize(pageSize);
pagerParams.setMaxIndexPages(maxIndexPages);
pagerParams.setSkin(skin);
pagerParams.setPageParamName(pageParamName);
pagerParams.setVmPath(vmPath);
pagerParams.setCharsetType(CharsetType.UTF8);
pagerParams.setDebugIsNotParseVM(debugIsNotParseVM);
pagerParams.setLocale(locale);
return pagerParams;
}
} | [
"[email protected]"
] | |
4217319cf00f3e52199f79dff47b953d321f9e77 | 9a9f93532adb7a26307270a0f6876e24658117cd | /app/src/main/java/com/video/newqu/view/widget/ClickAnimationmageView.java | 95c4fab4c93f35654e4b2f96c88e595b9aaa4e60 | [] | no_license | jinkailong888/Video | fda7c0606eff676ca6672000c620fd8832af43d6 | 4513c2de0380b09896d9f2d5a5ff1c16f80854ec | refs/heads/master | 2020-04-24T08:55:37.866468 | 2018-04-28T09:20:59 | 2018-04-28T09:20:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,424 | java | package com.video.newqu.view.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;
/**
* [email protected]
* 2017/9/13 16:36
* 点击有动画效果的ImageView
*/
public class ClickAnimationmageView extends ImageView {
private static String TAG = "EffectsButton";
private boolean clickable = true;
private ScaleAnimation upAnimation = createUpAnim();
private OnClickListener mOnClickListener;
private boolean shouldAbortAnim;
private int preX;
private int preY;
private int[] locationOnScreen;
private Animation.AnimationListener animationListener = new Animation.AnimationListener() {
public void onAnimationEnd(Animation paramAnonymousAnimation) {
//setSelected(!isSelected());
clearAnimation();
//Log.d(TAG, "onAnimationEnd: ");
if (mOnClickListener != null) {
mOnClickListener.onClickView(ClickAnimationmageView.this);
}
}
public void onAnimationRepeat(Animation paramAnonymousAnimation) {}
public void onAnimationStart(Animation paramAnonymousAnimation) {}
};
public ClickAnimationmageView(Context paramContext) {
this(paramContext, null);
}
public ClickAnimationmageView(Context paramContext, AttributeSet paramAttributeSet) {
this(paramContext, paramAttributeSet, 0);
}
public ClickAnimationmageView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
super(paramContext, paramAttributeSet, paramInt);
upAnimation.setAnimationListener(this.animationListener);
locationOnScreen = new int[2];
}
private ScaleAnimation createUpAnim() {
ScaleAnimation localScaleAnimation = new ScaleAnimation(1.2F, 1.0F, 1.2F, 1.0F, 1, 0.5F, 1, 0.5F);
localScaleAnimation.setDuration(50L);
localScaleAnimation.setFillEnabled(true);
localScaleAnimation.setFillEnabled(false);
localScaleAnimation.setFillAfter(true);
return localScaleAnimation;
}
private ScaleAnimation createDownAnim() {
ScaleAnimation localScaleAnimation = new ScaleAnimation(1.0F, 1.2F, 1.0F, 1.2F, 1, 0.5F, 1, 0.5F);
localScaleAnimation.setDuration(50L);
localScaleAnimation.setFillEnabled(true);
localScaleAnimation.setFillBefore(false);
localScaleAnimation.setFillAfter(true);
return localScaleAnimation;
}
public boolean onTouchEvent(MotionEvent motionEvent) {
super.onTouchEvent(motionEvent);
if (!this.clickable) {
return false;
}
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
clearAnimation();
startAnimation(createDownAnim());
this.shouldAbortAnim = false;
getLocationOnScreen(this.locationOnScreen);
preX = (this.locationOnScreen[0] + getWidth() / 2);
preY = (this.locationOnScreen[1] + getHeight() / 2);
}
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
clearAnimation();
if (!this.shouldAbortAnim) {
startAnimation(this.upAnimation);
}
this.shouldAbortAnim = false;
}
else if (motionEvent.getAction() == MotionEvent.ACTION_CANCEL) {
clearAnimation();
startAnimation(createUpAnim());
this.shouldAbortAnim = false;
}
else if ((motionEvent.getAction() == MotionEvent.ACTION_MOVE) && (!this.shouldAbortAnim) && (!checkPos(motionEvent.getRawX(), motionEvent.getRawY()))) {
this.shouldAbortAnim = true;
clearAnimation();
startAnimation(createUpAnim());
}
return true;
}
boolean checkPos(float rawX, float rawY) {
rawX = Math.abs(rawX - this.preX);
rawY = Math.abs(rawY - this.preY);
return (rawX <= getWidth() / 2) && (rawY <= getHeight() / 2);
}
public void setClickable(boolean clickable) {
this.clickable = clickable;
}
public void setOnClickListener(OnClickListener parama) {
this.mOnClickListener = parama;
}
public interface OnClickListener {
void onClickView(ClickAnimationmageView view);
}
}
| [
"[email protected]"
] | |
5bf83b5d22860cecb828c530b3761a38c7aa5457 | bf48f398ef150bccfb874139d29141f046606323 | /src/test/java/org/zerock/persistence/JDBCTests.java | 91e9ea0cedf25a71ec5e19a6ca8042aeb1901e89 | [] | no_license | akinux1004/page705 | 7cda41f8ae2cd51a1fefef64c3677d8d5ec73671 | 76c1f8851846d792af346f4e50b35a9c62a65825 | refs/heads/master | 2023-01-19T14:08:38.269685 | 2020-11-18T11:51:18 | 2020-11-18T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 581 | java | package org.zerock.persistence;
import java.sql.Connection;
import java.sql.DriverManager;
import org.junit.Test;
import lombok.extern.log4j.Log4j;
@Log4j
public class JDBCTests {
static {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch(Exception e) {
e.printStackTrace();
}
}
@Test
public void testConnection() {
try(Connection con = DriverManager.getConnection("jdbc:orcle:thin:@localhost:1521:orcl", "book_ex", "book_ex")){
log.info(con);
} catch(Exception e) {
log.info(e.getMessage());
}
}
}
| [
"[email protected]"
] | |
b3f85330909f3ef538783b11d91ccf04ae41fb03 | ed75c5192566767adf61a83b19bafcef41a60e9b | /app/src/test/java/com/zhc/KM/ExampleUnitTest.java | 6d60a5e6ef5c99533a1163b2ad6a34397cd5ab5a | [] | no_license | bczhc/KM | 2bc0a5aa2cff13a24905ddca74517758d8a18a94 | 392d37de522495ab2cc007b381b108fcb075c878 | refs/heads/master | 2022-01-13T08:29:18.817985 | 2019-05-01T05:11:54 | 2019-05-01T05:11:54 | 183,476,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package com.zhc.KM;
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);
}
} | [
"[email protected]"
] | |
5216130e19b9b45f301d535768e803175eebf121 | 420cb9e2c7d42b7613ace92eeef4daad29d1afdd | /src/main/java/com/example/spring/boot/rest/service/DmServiceImpl.java | 47fe99bfe87ed65ebe6c131d9dd1f1096208d2c2 | [] | no_license | nandpoot23/SpringBootAspectWebService | 4403551ea6727f336cc4bb3ff592f320f39bb265 | 7c82a895f25516e530e49a5ac71fb8d02ab26241 | refs/heads/master | 2021-01-15T19:04:59.841842 | 2017-08-09T12:41:51 | 2017-08-09T12:41:51 | 99,682,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,536 | java | package com.example.spring.boot.rest.service;
import java.util.List;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.example.spring.boot.rest.handler.SelectAllDmCustomerHandler;
import com.example.spring.boot.rest.handler.SingleSelectDmCustomerHandler;
import com.example.spring.boot.rest.types.EmpAddress;
import com.example.spring.boot.rest.types.EmpConfigIdentifier;
import com.example.spring.boot.rest.types.EmpDetails;
/**
* @author mlahariya
* @version 1.0, Dec 2016
*/
@Component("DmServiceImpl")
public class DmServiceImpl implements DmServiceInterface {
private static org.slf4j.Logger LOG = LoggerFactory.getLogger(DmServiceImpl.class);
@Autowired
private SingleSelectDmCustomerHandler singleSelectDmCustomerHandler;
@Autowired
private SelectAllDmCustomerHandler selectAllDmCustomerHandler;
@Override
public EmpDetails queryEmpConfigs(EmpConfigIdentifier id) {
if (id != null) {
LOG.debug("MyServiceImpl::queryEmpConfigs id : " + id.getId());
}
return singleSelectDmCustomerHandler.queryEmpConfigs(id);
}
@Override
public List<EmpDetails> selectAllEmpAllData(EmpAddress empAddr) {
if (empAddr.getAddress() != null) {
LOG.debug("MyServiceImpl::selectAllEmpAllData address of your sector : " + empAddr.getAddress());
}
return selectAllDmCustomerHandler.selectAllEmpAllData(empAddr);
}
}
| [
"[email protected]"
] | |
68db334b235a2dfa5ebdeb39fdbcbe73e59f6539 | fae82924cc0ad05790567385b736008362964beb | /14-security-spring/exercise/blog-application-extend/src/main/java/com/example/blogapplicationextend/model/bean/AppRole.java | fa513eb488b374c940808d3903c395496945de61 | [] | no_license | hauhp94/C0321G1_HuynhPhuocHau_Module4 | 4167b6ab0b28fe7387f79018eca2d37c79e87dcc | d636275a934876ea578dad8e7537e10be01f489a | refs/heads/master | 2023-07-03T21:52:13.330991 | 2021-08-12T17:25:20 | 2021-08-12T17:25:20 | 385,274,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package com.example.blogapplicationextend.model.bean;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
@Entity
@Getter
@Setter
@NoArgsConstructor
@Table(name = "App_Role", //
uniqueConstraints = { //
@UniqueConstraint(name = "APP_ROLE_UK", columnNames = "Role_Name") })
public class AppRole {
@Id
@GeneratedValue
@Column(name = "Role_Id", nullable = false)
private Long roleId;
@Column(name = "Role_Name", length = 30, nullable = false)
private String roleName;
} | [
"[email protected]"
] | |
f049a09f5c4f8b34b515dfb460872323ba30aec6 | 07496eea8b4ab50ca4c8eb6fe00320bfebca6a80 | /src/ua/artcode/week2/day2/_03CreateAndFillArrayBackwards.java | 719229e6fc6a9839bb13b5a74778737a92cb9290 | [] | no_license | presly808/ACB17 | d2308a41d2701dee7d6df94ce32e397f414ce40e | 79f9a20e85dfb0966391156ef185ccda48a398fd | refs/heads/master | 2021-01-20T20:15:48.104992 | 2016-07-11T07:20:23 | 2016-07-11T07:20:23 | 62,028,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package ua.artcode.week2.day2;
import ua.artcode.utils.ArrayUtils;
/**
* Created by gorobec on 03.07.16.
*/
public class _03CreateAndFillArrayBackwards {
public static void main(String[] args) {
// create and fill array 15 -> 0
int size = 16;
int[] arr = ArrayUtils.createAndFillArrayBackward(size);
/*new int[size];
for (int i = 0; i < arr.length; i++) {
arr[i] = size - i - 1;
}*/
/*size--;
for (int i = 0; i < arr.length; i++, size--) {
arr[i] = size;
}*/
/*for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i] + " ");
}
System.out.println();*/
ArrayUtils.printArray(arr);
}
}
| [
"[email protected]"
] | |
278a754498ef81733523ab4639052b829d0ff9a1 | b5153be915d94d1232a4fdebf1464b50809c361a | /src/main/java/com/amazonaws/services/ec2/model/DescribeAddressesRequest.java | e038f3bb018e9eff308f34a4321bf6907214e9ac | [
"Apache-2.0"
] | permissive | KonishchevDmitry/aws-sdk-for-java | c68f0ee7751f624eeae24224056db73e0a00a093 | 6f8b2f9a3cd659946db523275ba1dd55b90c6238 | refs/heads/master | 2021-01-18T05:24:52.275578 | 2010-05-31T06:20:22 | 2010-05-31T06:20:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,297 | java | /*
* Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import com.amazonaws.AmazonWebServiceRequest;
/**
* <p>
* A request to describe a user's available Elasitc IPs.
* </p>
*/
public class DescribeAddressesRequest extends AmazonWebServiceRequest {
/**
* The optional list of Elastic IP addresses to describe.
*/
private java.util.List<String> publicIps;
/**
* The optional list of Elastic IP addresses to describe.
*
* @return The optional list of Elastic IP addresses to describe.
*/
public java.util.List<String> getPublicIps() {
if (publicIps == null) {
publicIps = new java.util.ArrayList<String>();
}
return publicIps;
}
/**
* The optional list of Elastic IP addresses to describe.
*
* @param publicIps The optional list of Elastic IP addresses to describe.
*/
public void setPublicIps(java.util.Collection<String> publicIps) {
java.util.List<String> publicIpsCopy = new java.util.ArrayList<String>();
if (publicIps != null) {
publicIpsCopy.addAll(publicIps);
}
this.publicIps = publicIpsCopy;
}
/**
* The optional list of Elastic IP addresses to describe.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param publicIps The optional list of Elastic IP addresses to describe.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public DescribeAddressesRequest withPublicIps(String... publicIps) {
for (String value : publicIps) {
getPublicIps().add(value);
}
return this;
}
/**
* The optional list of Elastic IP addresses to describe.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param publicIps The optional list of Elastic IP addresses to describe.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public DescribeAddressesRequest withPublicIps(java.util.Collection<String> publicIps) {
java.util.List<String> publicIpsCopy = new java.util.ArrayList<String>();
if (publicIps != null) {
publicIpsCopy.addAll(publicIps);
}
this.publicIps = publicIpsCopy;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("PublicIps: " + publicIps + ", ");
sb.append("}");
return sb.toString();
}
}
| [
"[email protected]"
] | |
a2f89e543e05295a8caa7b6e67c065f70584ee76 | d4987a5a3ecef263da0415ce3f7d19e2c930ecec | /app/src/main/java/com/zj/mqtt/ui/device/DeviceSettingActivity.java | 68ce94e7c0b7c06a9b33043414ad31bb2f8137ac | [] | no_license | dashuizhu/MQTT | 9bd72eb0b4bafecfb9f98ececd12761be6d10c2b | f1f0872522a2d7e43e90e4fbe8723321670b4cb0 | refs/heads/master | 2021-07-08T01:07:08.928765 | 2020-07-12T14:54:19 | 2020-07-12T14:56:37 | 146,264,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,988 | java | package com.zj.mqtt.ui.device;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.person.commonlib.view.HeaderView;
import com.zj.mqtt.R;
import com.zj.mqtt.bean.device.DeviceBean;
import com.zj.mqtt.constant.AppString;
import com.zj.mqtt.database.DeviceDao;
import com.zj.mqtt.ui.BaseActivity;
import com.zj.mqtt.view.InputNameDialog;
import com.zj.mqtt.view.MyItemView;
import com.zj.mqtt.view.PlaceDialog;
/**
* 设备设置
*
* @author zhuj 2018/9/5 下午6:40
*/
public class DeviceSettingActivity extends BaseActivity {
@BindView(R.id.headerView) HeaderView mHeaderView;
@BindView(R.id.item_name) MyItemView mItemName;
@BindView(R.id.item_place) MyItemView mItemPlace;
@BindView(R.id.item_info) MyItemView mItemInfo;
private DeviceBean mDeviceBean;
InputNameDialog mNameDialog;
PlaceDialog mPlaceDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_device_setting);
ButterKnife.bind(this);
initViews();
}
private void initViews() {
mDeviceBean = getIntent().getParcelableExtra(AppString.KEY_BEAN);
mItemPlace.setTextContent(mDeviceBean.getPlace());
mItemName.setTextContent(mDeviceBean.getName());
}
@OnClick(R.id.layout_header_right)
public void onRightClick() {
String name = mItemName.getTextContent();
String place = mItemPlace.getTextContent();
mDeviceBean.setName(name);
mDeviceBean.setPlace(place);
DeviceDao.saveOrUpdate(mDeviceBean);
getApp().updateDevice(mDeviceBean.getDeviceMac(), name, place);
setResult(RESULT_OK);
finish();
}
@OnClick(R.id.layout_header_back)
public void onFinishClick() {
finish();
}
@OnClick(R.id.btn_delete)
public void onDelete() {
DeviceDao.delete(mDeviceBean);
getApp().removeDevice(mDeviceBean.getDeviceMac());
Intent intent = new Intent();
intent.putExtra(AppString.KEY_DELETE, true);
setResult(RESULT_OK, intent);
finish();
}
@OnClick(R.id.item_name)
public void onViewNameClicked() {
if (mNameDialog == null) {
mNameDialog = new InputNameDialog(this, getString(R.string.label_device_name),
mDeviceBean.getName());
mNameDialog.setOnOkClickListener(new InputNameDialog.OnOkClickListener() {
@Override
public void clickCancel() {
}
@Override
public void clickConfirm(String str) {
if (TextUtils.isEmpty(str.trim())) {
showToast(R.string.toast_input_empty);
return;
}
mItemName.setTextContent(str);
mNameDialog.dismiss();
}
});
} else {
mNameDialog.setContent(mItemName.getTextContent());
}
mNameDialog.show();
}
@OnClick(R.id.item_place)
public void onViewPlaceClicked() {
if (mPlaceDialog == null) {
mPlaceDialog = new PlaceDialog(this, mDeviceBean.getPlace());
mPlaceDialog.setOnOkClickListener(new PlaceDialog.OnOkClickListener() {
@Override
public void clickConfirm(String str) {
mItemPlace.setTextContent(str);
}
});
} else {
mPlaceDialog.setContent(mItemPlace.getTextContent());
}
mPlaceDialog.show();
}
@OnClick(R.id.item_info)
public void onDeviceInfoClicked() {
Intent intent = new Intent(this, DeviceInfoActivity.class);
intent.putExtra(AppString.KEY_BEAN, mDeviceBean);
startActivity(intent);
}
}
| [
"[email protected]"
] | |
d216ef8d53746dfdc58f238c9e27afbc421c2193 | 8140184a7b07bf348b8b66647f0a24ae7db30c73 | /Lab1/Strategy/src/strategy/Check.java | 891f73fed33abfa4cc2516e186530c8bf24af0cc | [] | no_license | RemonShehata/ITI-Design-Patterns-Tasks | 42f9761bf30ca7d993832af0bba82190f9f76837 | e6e36e7e268eb0c2a8147cca6a9432cea85b6d09 | refs/heads/master | 2020-12-26T09:15:15.097223 | 2020-02-01T17:59:40 | 2020-02-01T17:59:40 | 237,461,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | 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 strategy;
/**
*
* @author remon
*/
public class Check implements PaymentStrategy{
@Override
public void pay(float amount) {
System.out.println("Pay using Check (" + amount + ")");
}
}
| [
"[email protected]"
] | |
5fc7a195d4581f960ee9e71320a308b5111a3fea | 57caa5c517ae23a0ac8a62e2d8dfde771660dd4b | /app/src/androidTest/java/cn/com/tianyudg/coordinatorlayoutdemo/ExampleInstrumentedTest.java | 581b5dbd1ba31566858feb3672a37d938f4f04e8 | [] | no_license | zhizhongbiao/CoordinatorLayoutDemo | 18c9f286a5bec6c33ccd7f1ba4ebc203c0204fc8 | 3d15ed49da62d6aeb1f318794fdd838528eaa7aa | refs/heads/master | 2021-05-10T15:21:55.958469 | 2018-01-23T03:00:43 | 2018-01-23T03:00:43 | 118,549,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 778 | java | package cn.com.tianyudg.coordinatorlayoutdemo;
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("cn.com.tianyudg.coordinatorlayoutdemo", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
5c14140ae0903592d310446ca90b922bec5edecb | a55b85b6dd6a4ebf856b3fd80c9a424da2cd12bd | /ors/src/main/java/org/marketcetera/ors/history/ReportPersistenceException.java | 37e354f01c08de2a15e0a27669e1cc961bed3abe | [] | no_license | jeffreymu/marketcetera-2.2.0-16652 | a384a42b2e404bcc6140119dd2c6d297d466596c | 81cdd34979492f839233552432f80b3606d0349f | refs/heads/master | 2021-12-02T11:18:01.399940 | 2013-08-09T14:36:21 | 2013-08-09T14:36:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package org.marketcetera.ors.history;
import org.marketcetera.util.misc.ClassVersion;
import org.marketcetera.util.except.I18NException;
import org.marketcetera.util.log.I18NBoundMessage;
/* $License$ */
/**
* ReportPersistenceException
*
* @author [email protected]
* @version $Id: ReportPersistenceException.java 16154 2012-07-14 16:34:05Z colin $
* @since 1.0.0
*/
@ClassVersion("$Id: ReportPersistenceException.java 16154 2012-07-14 16:34:05Z colin $")
public class ReportPersistenceException extends I18NException {
/**
* Create an instance.
*
* @param cause the underlying cause.
* @param message the error message.
*/
public ReportPersistenceException(Throwable cause, I18NBoundMessage message) {
super(cause, message);
}
private static final long serialVersionUID = 1L;
}
| [
"[email protected]"
] | |
4de08d3a853bf730b72c2846664123dad3d5c9ce | 58bddff7318e0dd3a3dd1c837ba1913b475a8f57 | /src/main/java/com/small/missionboard/util/RedisUtils.java | d76bcafbfbf00b4ebd7bdcc5b1668f25ee9253b3 | [] | no_license | yan42685/mission-board | 795a8b0ae67d021ee90ee0e5d6d74c7f12b498b9 | 1514a067de44037b13ea971324e832f16794a20c | refs/heads/dev | 2022-10-23T15:22:16.727496 | 2020-05-31T05:47:33 | 2020-05-31T05:47:33 | 254,113,268 | 0 | 0 | null | 2020-04-19T11:03:22 | 2020-04-08T14:36:54 | Java | UTF-8 | Java | false | false | 3,599 | java | package com.small.missionboard.util;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.CollectionUtils;
import java.util.concurrent.TimeUnit;
/**
* 方便操作缓存
*/
public class RedisUtils {
// 静态注入bean
private static RedisTemplate<String, String> redisTemplate = SpringContextUtils
.getBean("redisTemplate", RedisTemplate.class);
/**
* 指定缓存失效时间 (秒)
*/
public static Boolean expire(String key, Long time) {
try {
if (time > 0) {
redisTemplate.expire(key, time, TimeUnit.SECONDS);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
* @return 时间(秒) 返回0代表为永久有效 失效时间为负数,说明该主键未设置失效时间(失效时间默认为-1)
*/
public static Long getExpire(String key) {
return redisTemplate.getExpire(key, TimeUnit.SECONDS);
}
/**
* 判断key是否存在
*/
public static Boolean hasKey(String key) {
if (key == null) {
return null;
}
return redisTemplate.hasKey(key);
}
/**
* 删除缓存
*
* @param key 可以传一个值 或多个
*/
@SuppressWarnings("unchecked")
public static void del(String... key) {
if (key != null && key.length > 0) {
if (key.length == 1) {
redisTemplate.delete(key[0]);
} else {
redisTemplate.delete(CollectionUtils.arrayToList(key));
}
}
}
/**
* 默认获取字符串类型缓存
*/
public static String get(String key) {
String result = null;
try {
String json = redisTemplate.opsForValue().get(key);
result = json == null ? null : JsonUtils.json2Object(json, String.class);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return result;
}
/**
* 获取指定类型的缓存
*/
public static <T> T get(String key, Class<T> objClass) {
T result = null;
try {
String json = redisTemplate.opsForValue().get(key);
result = json == null ? null : JsonUtils.json2Object(json, objClass);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return result;
}
/**
* 以JSON格式放入缓存
*/
public static boolean set(String key, Object value) {
try {
redisTemplate.opsForValue().set(key, JsonUtils.object2Json(value));
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 放入缓存并设置时间
*
* @param key 键
* @param value 值
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
*/
public static boolean set(String key, Object value, Long time) {
try {
if (time > 0) {
redisTemplate.opsForValue().set(key, JsonUtils.object2Json(value), time, TimeUnit.SECONDS);
} else {
set(key, value);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
}
| [
"[email protected]"
] | |
b90fb9e701c5678dfbfe1b940bac3dfb06814452 | eb2d5b7111fc34c811b479083bb304058709d2f6 | /app/src/main/java/com/zsml/textbannerview/utils/StatusBarUtil.java | bc70330cec43a4c4ef00c549c81df5b30c44a8f5 | [
"Apache-2.0"
] | permissive | my11712/TextBannerViewNew | e61f72d636f47c01ec58d21c625b18fdc504fa36 | 5556aa32a54f4503ac88605eac60b9b731f78f9b | refs/heads/master | 2020-04-13T08:00:23.173375 | 2018-12-26T05:05:28 | 2018-12-26T05:05:28 | 163,069,378 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,479 | java | package com.zsml.textbannerview.utils;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.support.annotation.FloatRange;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.regex.Pattern;
@SuppressWarnings("unused")
public class StatusBarUtil {
public static int DEFAULT_COLOR = 0;
public static float DEFAULT_ALPHA = 0;//Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? 0.2f : 0.3f;
public static final int MIN_API = 19;
//<editor-fold desc="沉侵">
public static void immersive(Activity activity) {
immersive(activity, DEFAULT_COLOR, DEFAULT_ALPHA);
}
public static void immersive(Activity activity, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
immersive(activity.getWindow(), color, alpha);
}
public static void immersive(Activity activity, int color) {
immersive(activity.getWindow(), color, 1f);
}
public static void immersive(Window window) {
immersive(window, DEFAULT_COLOR, DEFAULT_ALPHA);
}
public static void immersive(Window window, int color) {
immersive(window, color, 1f);
}
public static void immersive(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
if (Build.VERSION.SDK_INT >= 21) {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(mixtureColor(color, alpha));
int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
window.getDecorView().setSystemUiVisibility(systemUiVisibility);
} else if (Build.VERSION.SDK_INT >= 19) {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
setTranslucentView((ViewGroup) window.getDecorView(), color, alpha);
} else if (Build.VERSION.SDK_INT >= MIN_API && Build.VERSION.SDK_INT > 16) {
int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
window.getDecorView().setSystemUiVisibility(systemUiVisibility);
}
}
//</editor-fold>
//<editor-fold desc="DarkMode">
public static void darkMode(Activity activity, boolean dark) {
if (isFlyme4Later()) {
darkModeForFlyme4(activity.getWindow(), dark);
} else if (isMIUI6Later()) {
darkModeForMIUI6(activity.getWindow(), dark);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
darkModeForM(activity.getWindow(), dark);
}
}
/** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */
public static void darkMode(Activity activity) {
darkMode(activity.getWindow(), DEFAULT_COLOR, DEFAULT_ALPHA);
}
public static void darkMode(Activity activity, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
darkMode(activity.getWindow(), color, alpha);
}
/** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */
public static void darkMode(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
if (isFlyme4Later()) {
darkModeForFlyme4(window, true);
immersive(window,color,alpha);
} else if (isMIUI6Later()) {
darkModeForMIUI6(window, true);
immersive(window,color,alpha);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
darkModeForM(window, true);
immersive(window, color, alpha);
} else if (Build.VERSION.SDK_INT >= 19) {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
setTranslucentView((ViewGroup) window.getDecorView(), color, alpha);
} else {
immersive(window, color, alpha);
}
// if (Build.VERSION.SDK_INT >= 21) {
// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// window.setStatusBarColor(Color.TRANSPARENT);
// } else if (Build.VERSION.SDK_INT >= 19) {
// window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// }
// setTranslucentView((ViewGroup) window.getDecorView(), color, alpha);
}
//------------------------->
/** android 6.0设置字体颜色 */
@RequiresApi(Build.VERSION_CODES.M)
private static void darkModeForM(Window window, boolean dark) {
// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// window.setStatusBarColor(Color.TRANSPARENT);
int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
if (dark) {
systemUiVisibility |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
} else {
systemUiVisibility &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
}
window.getDecorView().setSystemUiVisibility(systemUiVisibility);
}
/**
* 设置Flyme4+的darkMode,darkMode时候字体颜色及icon变黑
* http://open-wiki.flyme.cn/index.php?title=Flyme%E7%B3%BB%E7%BB%9FAPI
*/
public static boolean darkModeForFlyme4(Window window, boolean dark) {
boolean result = false;
if (window != null) {
try {
WindowManager.LayoutParams e = window.getAttributes();
Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON");
Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags");
darkFlag.setAccessible(true);
meizuFlags.setAccessible(true);
int bit = darkFlag.getInt(null);
int value = meizuFlags.getInt(e);
if (dark) {
value |= bit;
} else {
value &= ~bit;
}
meizuFlags.setInt(e, value);
window.setAttributes(e);
result = true;
} catch (Exception var8) {
Log.e("StatusBar", "darkIcon: failed");
}
}
return result;
}
/**
* 设置MIUI6+的状态栏是否为darkMode,darkMode时候字体颜色及icon变黑
* http://dev.xiaomi.com/doc/p=4769/
*/
public static boolean darkModeForMIUI6(Window window, boolean darkmode) {
Class<? extends Window> clazz = window.getClass();
try {
int darkModeFlag = 0;
Class<?> layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams");
Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE");
darkModeFlag = field.getInt(layoutParams);
Method extraFlagField = clazz.getMethod("setExtraFlags", int.class, int.class);
extraFlagField.invoke(window, darkmode ? darkModeFlag : 0, darkModeFlag);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/** 判断是否Flyme4以上 */
public static boolean isFlyme4Later() {
return Build.FINGERPRINT.contains("Flyme_OS_4")
|| Build.VERSION.INCREMENTAL.contains("Flyme_OS_4")
|| Pattern.compile("Flyme OS [4|5]", Pattern.CASE_INSENSITIVE).matcher(Build.DISPLAY).find();
}
/** 判断是否为MIUI6以上 */
public static boolean isMIUI6Later() {
try {
Class<?> clz = Class.forName("android.os.SystemProperties");
Method mtd = clz.getMethod("get", String.class);
String val = (String) mtd.invoke(null, "ro.miui.ui.version.name");
val = val.replaceAll("[vV]", "");
int version = Integer.parseInt(val);
return version >= 6;
} catch (Exception e) {
return false;
}
}
//</editor-fold>
/** 增加View的paddingTop,增加的值为状态栏高度 */
public static void setPadding(Context context, View view) {
if (Build.VERSION.SDK_INT >= MIN_API) {
view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context),
view.getPaddingRight(), view.getPaddingBottom());
}
}
/** 增加View的paddingTop,增加的值为状态栏高度 (智能判断,并设置高度)*/
public static void setPaddingSmart(Context context, View view) {
if (Build.VERSION.SDK_INT >= MIN_API) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
if (lp != null && lp.height > 0) {
lp.height += getStatusBarHeight(context);//增高
}
view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context),
view.getPaddingRight(), view.getPaddingBottom());
}
}
/** 增加View的高度以及paddingTop,增加的值为状态栏高度.一般是在沉浸式全屏给ToolBar用的 */
public static void setHeightAndPadding(Context context, View view) {
if (Build.VERSION.SDK_INT >= MIN_API) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
lp.height += getStatusBarHeight(context);//增高
view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context),
view.getPaddingRight(), view.getPaddingBottom());
}
}
/** 增加View上边距(MarginTop)一般是给高度为 WARP_CONTENT 的小控件用的*/
public static void setMargin(Context context, View view) {
if (Build.VERSION.SDK_INT >= MIN_API) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
if (lp instanceof ViewGroup.MarginLayoutParams) {
((ViewGroup.MarginLayoutParams) lp).topMargin += getStatusBarHeight(context);//增高
}
view.setLayoutParams(lp);
}
}
/**
* 创建假的透明栏
*/
public static void setTranslucentView(ViewGroup container, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
if (Build.VERSION.SDK_INT >= 19) {
int mixtureColor = mixtureColor(color, alpha);
View translucentView = container.findViewById(android.R.id.custom);
if (translucentView == null && mixtureColor != 0) {
translucentView = new View(container.getContext());
translucentView.setId(android.R.id.custom);
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(container.getContext()));
container.addView(translucentView, lp);
}
if (translucentView != null) {
translucentView.setBackgroundColor(mixtureColor);
}
}
}
public static int mixtureColor(int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
int a = (color & 0xff000000) == 0 ? 0xff : color >>> 24;
return (color & 0x00ffffff) | (((int) (a * alpha)) << 24);
}
/** 获取状态栏高度 */
public static int getStatusBarHeight(Context context) {
int result = 24;
int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resId > 0) {
result = context.getResources().getDimensionPixelSize(resId);
} else {
result = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
result, Resources.getSystem().getDisplayMetrics());
}
return result;
}
}
| [
"[email protected]"
] | |
af14d2d5a5b9490ae12a022348d88d518df5c75b | b7ac80392339ad44466578f40b1ea1b03d81acae | /outstagram-login/src/main/java/com/project/outstagram/OutstagramLoginServerApplication.java | 79371da691810bde66abbc93827eaa5a2c4d4093 | [] | no_license | DaeAkin/outstagram | 660d00bb88d843aa510d93b47acaa3174ba94275 | 4422283e11c4dd3250505227ff72453d1a0391b2 | refs/heads/master | 2020-09-25T12:04:14.234990 | 2020-07-07T13:02:14 | 2020-07-07T13:02:14 | 226,001,513 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,857 | java | package com.project.outstagram;
import brave.sampler.Sampler;
import com.project.outstagram.global.utils.UserContextInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoRestTemplateFactory;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.web.client.RestTemplate;
import java.util.Collections;
import java.util.List;
@SpringBootApplication
@EnableJpaAuditing
@EnableJpaRepositories
@RefreshScope
@EnableEurekaClient
@EnableCircuitBreaker
@EnableResourceServer
//kafka https://yfkwon.tistory.com/26
@EnableBinding(Sink.class)
public class OutstagramLoginServerApplication {
public static void main(String[] args) {
SpringApplication.run(OutstagramLoginServerApplication.class, args);
}
@StreamListener(Sink.INPUT)
/** 메소드이름이 handle로 시작해야 작동함 */
public void handle(String s) {
System.out.println("왜 안와!!");
System.out.println("카프카에서 보낸 메세지 : " + s);
}
@Bean
public Sampler defaultSampler() {
// return new AlwaysSampler();
return Sampler.ALWAYS_SAMPLE;
}
//TODO WebFlux로 교체 예정
// @LoadBalanced
// @Bean
// public RestTemplate getRestTemplate() {
// return new RestTemplate();
// }
@Bean
public OAuth2RestTemplate restTemplate(UserInfoRestTemplateFactory factory) {
return factory.getUserInfoRestTemplate();
}
@Primary
@Bean
public RestTemplate getCustomRestTemplate() {
RestTemplate template = new RestTemplate();
List interceptors = template.getInterceptors();
if (interceptors == null) {
template.setInterceptors(Collections.singletonList(new UserContextInterceptor()));
} else {
interceptors.add(new UserContextInterceptor());
template.setInterceptors(interceptors);
}
return template;
}
}
| [
"[email protected]"
] | |
595eb4b1a43315a3bf3425471f8a149488d1c8a0 | c6bec449ff2060d668efa2c2e188324951240c1f | /src/ua/nure/tur/db/dao/ReviewDAO.java | 967d47249de377ed8297c30c8481622e4cae9d25 | [] | no_license | Dmitriytur/project | 2a18d9521ffae3eaba474d26085fc911d542a163 | aa977e320db7691e251b77560a628b8af50708d7 | refs/heads/master | 2021-07-03T17:32:34.897737 | 2017-09-22T01:49:56 | 2017-09-22T01:49:56 | 103,834,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package ua.nure.tur.db.dao;
import ua.nure.tur.entities.Review;
import ua.nure.tur.exceptions.DataAccessException;
import java.util.List;
public interface ReviewDAO {
List<Review> findForPeriodical(Long id) throws DataAccessException;
void create(Review review) throws DataAccessException;
int getAmountForPeriodical(long periodicalId);
}
| [
"[email protected]"
] | |
d541cc0a0faed61c640e5c63992ec2c4e87c9509 | eca4a253fe0eba19f60d28363b10c433c57ab7a1 | /server/openjacob.engine/java/de/tif/jacob/core/model/Searchconstraint.java | ac611eae51ca577841a4a85635ca05b147fcfe5c | [] | no_license | freegroup/Open-jACOB | 632f20575092516f449591bf6f251772f599e5fc | 84f0a6af83876bd21c453132ca6f98a46609f1f4 | refs/heads/master | 2021-01-10T11:08:03.604819 | 2015-05-25T10:25:49 | 2015-05-25T10:25:49 | 36,183,560 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,182 | java | /**************************************************************************
* Project : jacob.admin
* Date : Mon Nov 16 16:19:57 EET 2009
*
* THIS IS A GENERATED FILE - DO NOT CHANGE!
*
*************************************************************************/
package de.tif.jacob.core.model;
import de.tif.jacob.core.Context;
import de.tif.jacob.core.data.IDataAccessor;
import de.tif.jacob.core.data.IDataTableRecord;
import de.tif.jacob.core.data.IDataTransaction;
/**
*
*
* Condition: <b></b>
* DB table: <b>searchconstraint</b>
*
**/
public final class Searchconstraint
{
private Searchconstraint(){}
// the name of the table alias
public final static String NAME = "searchconstraint";
// All field names of the table alias "searchconstraint"
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>LONG</b><br>
**/
public final static String pkey = "pkey";
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>TEXT</b><br>
**/
public final static String applicationname = "applicationname";
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>TEXT</b><br>
**/
public final static String applicationversion = "applicationversion";
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>LONGTEXT</b><br>
**/
public final static String definition = "definition";
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>TEXT</b><br>
**/
public final static String ownerid = "ownerid";
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>TEXT</b><br>
**/
public final static String name = "name";
/**
* <br>
* <br>
* required: <b>true</b><br>
* type: <b>TIMESTAMP</b><br>
**/
public final static String created = "created";
/**
* <br>
* <br>
* required: <b>false</b><br>
* type: <b>TIMESTAMP</b><br>
**/
public final static String lastusage = "lastUsage";
/**
* Create a new Record within the current DataAccessor of the Context with a new transaction
**/
public static IDataTableRecord newRecord(Context context) throws Exception
{
return newRecord(context,context.getDataAccessor().newTransaction());
}
/**
* Create a new Record within the current DataAccessor of the Context and the handsover
* transaction.
**/
public static IDataTableRecord newRecord(Context context, IDataTransaction trans) throws Exception
{
return newRecord(context.getDataAccessor(),trans);
}
/**
* Create a new Record within the hands over DataAccessor and a new transaction.
**/
public static IDataTableRecord newRecord(IDataAccessor acc) throws Exception
{
return acc.getTable(NAME).newRecord(acc.newTransaction());
}
/**
* Create a new Record within the hands over DataAccessor and transaction.
**/
public static IDataTableRecord newRecord(IDataAccessor acc, IDataTransaction trans) throws Exception
{
return acc.getTable(NAME).newRecord(trans);
}
} | [
"[email protected]"
] | |
3ed96d249d628347f8c4a19be2f2f3dbe33990f4 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_7576f88566a7ac2836a63027a42a57986142ad38/Activator/3_7576f88566a7ac2836a63027a42a57986142ad38_Activator_t.java | f46c331db4f3d5be13a421706081e26d2a8a6539 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,528 | java | /*******************************************************************************
* Copyright (c) 2008, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.tm.internal.tcf.cdt.ui;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.tm.tcf.protocol.Protocol;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.eclipse.tm.tcf.cdt.ui";
private static Activator plugin;
private static TCFBreakpointStatusListener bp_status_listener;
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
EvaluationContextManager.startup();
Protocol.invokeLater(new Runnable() {
public void run() {
if (bp_status_listener == null) bp_status_listener = new TCFBreakpointStatusListener();
}
});
}
public void stop(BundleContext context) throws Exception {
Protocol.invokeAndWait(new Runnable() {
public void run() {
if (bp_status_listener != null) {
bp_status_listener.dispose();
bp_status_listener = null;
}
}
});
plugin = null;
super.stop(context);
}
public static Activator getDefault() {
return plugin;
}
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
public static void log(Throwable e) {
log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, e.getMessage(), e));
}
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
}
public static IWorkbenchPage getActivePage() {
IWorkbenchWindow w = getActiveWorkbenchWindow();
if (w != null) return w.getActivePage();
return null;
}
public static Shell getActiveWorkbenchShell() {
IWorkbenchWindow window = getActiveWorkbenchWindow();
if (window != null) return window.getShell();
return null;
}
public static void errorDialog(String message, IStatus status) {
log(status);
Shell shell = getActiveWorkbenchShell();
if (shell == null) return;
ErrorDialog.openError(shell, "Error", message, status);
}
public static void errorDialog(String message, Throwable t) {
log(t);
Shell shell = getActiveWorkbenchShell();
if (shell == null) return;
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, 1, t.getMessage(), null);
ErrorDialog.openError(shell, "Error", message, status);
}
}
| [
"[email protected]"
] | |
a48d42bb7b72e60362513c89c77c88d04e24fa17 | 1b36819121a38f48887107a84e0d5e9315493237 | /dmz-inward-test/src/test/java/dmztest/nioserver/src/org/sse/server/Queue.java | a0e2896e4eb11703e17a816456ab06dbb653c932 | [] | no_license | dreamming/dmz-inward- | b74dc6dafe49806a1d2f85f8c6f621fdc3d81216 | 59d21aff412246112691e345a829212a1c5218b5 | refs/heads/master | 2021-05-23T05:51:04.644522 | 2018-08-13T12:36:28 | 2018-08-13T12:36:28 | 94,977,075 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package dmztest.nioserver.src.org.sse.server;
import java.util.LinkedList;
/**
* @author tcowan
*/
public class Queue extends LinkedList {
private int waitingThreads = 0;
public synchronized void insert(Object obj) {
addLast(obj);
notify();
}
public synchronized Object remove() {
if (isEmpty()) {
try {
waitingThreads++;
wait();
} catch (InterruptedException e) {
Thread.interrupted();
}
waitingThreads--;
}
return removeFirst();
}
public boolean isEmpty() {
return (size() - waitingThreads <= 0);
}
} | [
"[email protected]"
] | |
aa2ebb62173fa5a68aba4feabba2ab2173d20a1b | 914a24f6713f204adac6bfd239110cf9c84371cf | /src/main/java/com/zhwk022/ftp/test/SHA256File.java | 6f46370055313c4c461868080d468bd266304e34 | [] | no_license | zhwk022/filebackup | 53dfcb37ab0589b2e633ce49110f46db15f92cc9 | f32467b917d7f90afd3f927ddb51f3d8aedc8d4b | refs/heads/master | 2020-03-13T10:25:18.509242 | 2018-08-20T08:37:16 | 2018-08-20T08:37:16 | 131,083,256 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,317 | java | package com.zhwk022.ftp.test;
import java.io.*;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.util.Properties;
public class SHA256File {
static String official_checksum = "23d5686ffe489e5a1af95253b153ce9d6f933e5dbabe14c494631234697a0e08";
public static void OnEncFile() {
System.out.println("Getting file...");
// File file = new File("F:\\BaiduNetdiskDownload\\最后一战bl.zip");
File file = new File("J:\\ftp2test\\tools_r25.2.3-windows111111.zip");
if (file.exists()) {
System.out.println("File got.");
} else {
System.err.println("File not got.");
}
System.out.print("Calculating SHA-256 checksum......");
String fileSHA256 = getFileSHA256(file);
System.out.println("File's SHA-256 checksum is: ");
System.out.println(fileSHA256);
System.out.println(official_checksum + " --- the official checksum");
if (official_checksum.equals(fileSHA256)) {
System.out.println("SHA-256 checksums are the same.");
} else {
System.err.println("SHA-256 checksums differ!!!!");
}
}
private static String getFileSHA256(File file) {
if (!file.isFile()) {
System.err.println("not file");
return null;
}
MessageDigest digest = null;
FileInputStream in = null;
byte buffer[] = new byte[1024];
int len;
try {
digest = MessageDigest.getInstance("SHA-256");
in = new FileInputStream(file);
while ((len = in.read(buffer, 0, 1024)) != -1) {
digest.update(buffer, 0, len);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
return null;
}
BigInteger bigInt = new BigInteger(1, digest.digest());
return bigInt.toString(16);
}
public static void main(String[] args) {
// OnEncFile();
if(args.length<1){
System.out.println("参数的个数必须等于1");
}
File file = new File(args[0]);
if(!file.exists()){
System.out.println("文件不存在");
}
String fileSHA256 = getFileSHA256(file);
System.out.println("success:"+fileSHA256);
}
public static void generateSHA256PropertiesFile(File dir) {
Properties properties = new Properties();
for(File file: dir.listFiles()){
if(file.isFile()){
System.out.println("Calculating SHA-256 checksum......");
properties.put(file.getName(),getFileSHA256(file));
System.out.println("Calculating SHA-256 checksum end");
}
}
BufferedWriter writer = null;
try {
String filePath = QuartzJdbcTest.FILECHECKSUMFILE;
writer = new BufferedWriter (new OutputStreamWriter (new FileOutputStream(filePath),"UTF-8"));
properties.store(writer, "filename=checksum");
}catch (Exception e){
throw new RuntimeException(e);
}finally {
if(writer!=null){
try {
writer.close();
}catch (Exception e){
}
}
}
}
} | [
"[email protected]"
] | |
03d63d02301825b6496a04d805bfe0c3c96569fb | f0b78c5f8f04a38c8329d35497ed99b94c328fec | /liferay-training/modules/salesforce/salesforce-api/src/main/java/com/liferay/salesforce/service/SalesforceAccountLocalService.java | 5980ee528a34ed655856c561210dc687dc62b7a7 | [] | no_license | dimplekoticha/workspace | 1d7087be8edfb3c8b571dafd459dec99073af574 | 958e73e25e11e5dc8a69173ae76653f51f9e716c | refs/heads/master | 2020-04-02T05:47:04.266750 | 2016-09-23T19:59:55 | 2016-09-23T19:59:55 | 65,832,974 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,302 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library 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 Lesser General Public License for more
* details.
*/
package com.liferay.salesforce.service;
import aQute.bnd.annotation.ProviderType;
import com.liferay.portal.kernel.dao.orm.ObjectNotFoundException;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.messaging.MessageBatch;
import com.liferay.portal.kernel.service.BaseLocalService;
import com.liferay.portal.kernel.transaction.Isolation;
import com.liferay.portal.kernel.transaction.Propagation;
import com.liferay.portal.kernel.transaction.Transactional;
import java.util.List;
/**
* Provides the local service interface for SalesforceAccount. Methods of this
* service will not have security checks based on the propagated JAAS
* credentials because this service can only be accessed from within the same
* VM.
*
* @author Brian Wing Shun Chan
* @see SalesforceAccountLocalServiceUtil
* @see com.liferay.salesforce.service.base.SalesforceAccountLocalServiceBaseImpl
* @see com.liferay.salesforce.service.impl.SalesforceAccountLocalServiceImpl
* @generated
*/
@ProviderType
@Transactional(isolation = Isolation.PORTAL, rollbackFor = {
PortalException.class, SystemException.class})
public interface SalesforceAccountLocalService extends BaseLocalService {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this interface directly. Always use {@link SalesforceAccountLocalServiceUtil} to access the salesforce account local service. Add custom service methods to {@link com.liferay.salesforce.service.impl.SalesforceAccountLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public MessageBatch getAccountsByName(long companyId,
java.lang.String name, List<java.lang.String> fieldNames, long ownerId)
throws SystemException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public MessageBatch getAccountsByOwnerId(long companyId,
java.lang.String ownerId, List<java.lang.String> fieldNames,
long ownerID) throws ObjectNotFoundException, SystemException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public MessageBatch getAccountsByUserName(long companyId,
java.lang.String userName, List<java.lang.String> fieldNames,
long ownerId) throws ObjectNotFoundException, SystemException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public MessageBatch getFields(long companyId, long ownerId)
throws SystemException;
/**
* Returns the OSGi service identifier.
*
* @return the OSGi service identifier
*/
public java.lang.String getOSGiServiceIdentifier();
} | [
"[email protected]"
] | |
7369913a970d439d7884fc6185011e6376434e7c | 3fb0961c123d0259a8fc54c82f89ed5cb5948a1e | /src/main/java/com/imitee/bleadv/lib/base/AdvertiseType.java | b650dfb47a3417669db84bf6a8763d18df6a3c83 | [
"MIT"
] | permissive | ve3344/BleAdvertisement | c41c10fd2ea50194f4d7cf7f254e41e8405680f4 | d1093d2e2521c0487ff3542fd3517367fa4ec7b9 | refs/heads/master | 2023-03-24T04:14:28.783289 | 2021-03-26T01:23:37 | 2021-03-26T01:23:37 | 262,993,340 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package com.imitee.bleadv.lib.base;
public enum AdvertiseType {
BROADCAST("broadcast"),
PERIPHERAL("peripheral")
;
private String value;
public String getValue() {
return value;
}
AdvertiseType(String value) {
this.value = value;
}
}
| [
"[email protected]"
] | |
b3bba8fc7824c21c44920d5dd55b0bd23a8cbdac | cf8870973bf6d1c818df1fabd81efa3949fc0999 | /src/main/java/br/com/centralerrors/user/service/impl/UserService.java | 585efac05543aee4f312b1586d025600ca332e1a | [] | no_license | marcelosoliveira/projeto-central-erros | d9428b778f213887ba2919bd63c89f520a8110fe | 69ddf33dd0c447052574104f8bd6217c23623cda | refs/heads/master | 2023-06-05T07:56:16.862942 | 2021-06-25T20:19:26 | 2021-06-25T20:19:26 | 354,385,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,830 | java | package br.com.centralerrors.user.service.impl;
import br.com.centralerrors.user.repository.UserRepository;
import br.com.centralerrors.user.service.interfaces.UserServiceInterface;
import br.com.centralerrors.user.model.User;
import lombok.AllArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
@AllArgsConstructor
public class UserService implements UserDetailsService, UserServiceInterface {
private UserRepository userRepository;
@Override
public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException {
User user = Optional.ofNullable(this.userRepository.findByUserName(userName))
.orElseThrow(() -> new UsernameNotFoundException("Usuario inexistente ou senha invalida"));
List<GrantedAuthority> authorityListAdmin = AuthorityUtils.createAuthorityList(
"ROLE_USER", "ROLE_ADMIN");
List<GrantedAuthority> authorityListUser = AuthorityUtils.createAuthorityList(
"ROLE_USER");
return new org.springframework.security.core.userdetails.User(
user.getUserName(), user.getPassword(), user.getIsAdmin() ? authorityListAdmin
: authorityListUser);
}
@Override
public String passwordCrypto(String password) {
return new BCryptPasswordEncoder().encode(password);
}
}
| [
"[email protected]"
] | |
1df11bdd73e1eacdd611e9d73fbec79f6487c2d0 | 6253283b67c01a0d7395e38aeeea65e06f62504b | /decompile/app/Mms/src/main/java/com/google/common/util/concurrent/Striped$SmallLazyStriped.java | 47b94c93f50c19e9eb5151eca26c889fb2c8fa9e | [] | no_license | sufadi/decompile-hw | 2e0457a0a7ade103908a6a41757923a791248215 | 4c3efd95f3e997b44dd4ceec506de6164192eca3 | refs/heads/master | 2023-03-15T15:56:03.968086 | 2017-11-08T03:29:10 | 2017-11-08T03:29:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package com.google.common.util.concurrent;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.util.concurrent.Striped.PowerOfTwoStriped;
@VisibleForTesting
class Striped$SmallLazyStriped<L> extends PowerOfTwoStriped<L> {
}
| [
"[email protected]"
] | |
3a564e38aace834517d275530feafeb3dc71b66b | cbbe9f674af56de5d4a3b79e008a9029c5730c02 | /src/edu/uconn/newclientmodel/Height.java | c7e3167f29459c140b3bce9f2ead8aae309e23c4 | [] | no_license | TylerWilliamsEH/CSE2102 | 44a2d307245023dc76e02f925977f53d4b0093c7 | f242e7760617a13001a92bde3fc2551ac678fb20 | refs/heads/master | 2016-09-06T08:26:54.162147 | 2013-10-13T22:59:41 | 2013-10-13T22:59:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package edu.uconn.newclientmodel;
import edu.uconn.common.MyTimeStamp;
public class Height {
protected String heightValue = "";
protected String when = "";
protected MyTimeStamp heightDayandTime;
public Height() {
};
public String getHeightValue() {
return heightValue;
}
public void setHeightValue(String heightValue) {
this.heightValue = heightValue;
}
public String getWhen() {
return when;
}
public void setWhen(String when) {
this.when = when;
}
public void setheightDayandTime(MyTimeStamp heightDayandTime) {
this.heightDayandTime = heightDayandTime;
}
public MyTimeStamp getheightDayandTime() {
return heightDayandTime;
}
public String toString() {
return heightValue;
}
}
| [
"[email protected]"
] | |
f54d1d898addf96295bb2268b461a03c9d187b10 | db97163ee30dd5f7d3f1e8f4bf83aea7e3e50d7b | /App_for_App/App/src/main/java/com/GravityDailyHorscope/LayOutone.java | 592186e70a8f85da503540291767714f2759fcc7 | [] | no_license | rahulyhg/Astro-5 | f41a74835b9cf9698aa53f9770cb3fde5ba08936 | 793a9a5a533aa01237e6d09a962dfe3e69af40a2 | refs/heads/master | 2021-05-30T23:32:59.558494 | 2016-02-10T20:30:10 | 2016-02-10T20:30:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package com.GravityDailyHorscope;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
public class LayOutone extends Fragment{
Button share1;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.tab_fragment_1, container, false);
}
}
| [
"[email protected]"
] | |
0f147fc07608fe396fdb5a7b923480f0badab55f | 6db5dd98c5a6f505b0f7be0a18786a0c58a1829d | /genie-agent/src/main/java/com/netflix/genie/agent/cli/GenieAgentRunnner.java | 4d14059ca33238ee58169c214222331638d825f2 | [
"Apache-2.0"
] | permissive | zmyer/genie | d817f8715b135fa20e9a438082de7cf856c578c8 | 2f17f28f6e9b20f78af4abae44f5723f7de17375 | refs/heads/master | 2021-04-27T08:39:30.161566 | 2018-09-08T14:45:14 | 2018-09-08T14:45:14 | 122,494,637 | 0 | 0 | null | 2018-02-22T15:07:28 | 2018-02-22T15:07:28 | null | UTF-8 | Java | false | false | 3,726 | java | /*
*
* Copyright 2018 Netflix, Inc.
*
* 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.netflix.genie.agent.cli;
import com.beust.jcommander.ParameterException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.Set;
/**
* Main entry point for execution after the application is initialized.
*
* @author mprimi
* @since 4.0.0
*/
@Slf4j
@Component
public class GenieAgentRunnner implements CommandLineRunner, ExitCodeGenerator {
private final ArgumentParser argumentParser;
private final CommandFactory commandFactory;
private ExitCode exitCode = ExitCode.INIT_FAIL;
GenieAgentRunnner(
final ArgumentParser argumentParser,
final CommandFactory commandFactory
) {
this.argumentParser = argumentParser;
this.commandFactory = commandFactory;
}
@Override
public void run(final String... args) throws Exception {
try {
internalRun(args);
} catch (final Throwable t) {
final Throwable userConsoleException = t.getCause() != null ? t.getCause() : t;
UserConsole.getLogger().error(
"Command execution failed: {}",
userConsoleException.getMessage(),
userConsoleException
);
UserConsole.getLogger().info("Full execution log file: {}", UserConsole.getLogFilePath());
log.info("Command execution failed", t);
}
}
private void internalRun(final String[] args) {
log.info("Parsing arguments...");
log.debug("Arguments: {}", Arrays.toString(args));
exitCode = ExitCode.INVALID_ARGS;
try {
argumentParser.parse(args);
} catch (ParameterException e) {
throw new IllegalArgumentException("Failed to parse arguments: " + e.getMessage(), e);
}
final String commandName = argumentParser.getSelectedCommand();
final Set<String> availableCommands = argumentParser.getCommandNames();
final String availableCommandsString = Arrays.toString(availableCommands.toArray());
if (commandName == null) {
throw new IllegalArgumentException("No command selected -- commands available: " + availableCommandsString);
} else if (!availableCommands.contains(commandName)) {
throw new IllegalArgumentException("Invalid command -- commands available: " + availableCommandsString);
}
UserConsole.getLogger().info("Initializing command {}", commandName);
log.info("Initializing command: {}", commandName);
exitCode = ExitCode.COMMAND_INIT_FAIL;
final AgentCommand command = commandFactory.get(commandName);
exitCode = ExitCode.EXEC_FAIL;
command.run();
exitCode = ExitCode.SUCCESS;
}
@Override
public int getExitCode() {
UserConsole.getLogger().info("Terminating with code: {} ({})", exitCode.getCode(), exitCode.getMessage());
return exitCode.getCode();
}
}
| [
"[email protected]"
] | |
c3998953aa6432084380d93b70ba5b6990e04b65 | 225114fc3fbc5f3d9da747ee63a5b9938ebac838 | /Generics - Exercise/09. Custom List Iterator/src/Main.java | 144bf49dfe69123c7e2083244460fdd85b2623e2 | [] | no_license | boyanLakev/JAVA-Advance-september-2019 | abfb214da6c0924a2969edb59cb72610de9378bf | 1d8263e2df23ac1df97341c36effd3830e35bfb1 | refs/heads/master | 2020-07-30T07:33:35.828033 | 2019-10-31T09:23:26 | 2019-10-31T09:23:26 | 210,136,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,481 | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
CustomList<String> list = new CustomList<>();
String line = scanner.nextLine();
while (!"END".equals(line)) {
String[] tokens = line.split("\\s+");
switch (tokens[0]) {
case "Sort":
list.sort();
break;
case "Add":
list.add(tokens[1]);
break;
case "Remove":
list.remove(Integer.parseInt(tokens[1]));
break;
case "Contains":
System.out.println(list.contains(tokens[1]));
break;
case "Swap":
list.swap(Integer.parseInt(tokens[1]),
Integer.parseInt(tokens[2]));
break;
case "Greater":
System.out.println(list.countGreaterThan(tokens[1]));
break;
case "Max":
System.out.println(list.getMax());
break;
case "Min":
System.out.println(list.getMin());
break;
case "Print":
list.print();
break;
}
line = scanner.nextLine();
}
}
}
| [
"[email protected]"
] | |
210041fffd520e78573e5a5699f9e344a515a885 | f4ad7a1ccda2633c5cbdf30768e07220bc5a1523 | /SpringBoot/springboot-08-shrio/shiro-springboot/src/main/java/com/komorebi/service/UserService.java | ae8a37254767c27663070c8e9c2945c314a79dbc | [] | no_license | judelawlee/JavaWeb | ff967be69c98d560b30ec7c2be7bed86c6a6c2d8 | 9f7eb06aeb0a4c6cd4cb9a0902ef9c46c501ee47 | refs/heads/master | 2023-05-14T13:37:47.136035 | 2021-06-02T00:31:52 | 2021-06-02T00:31:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package com.komorebi.service;
import com.komorebi.pojo.User;
public interface UserService {
public User queryUserByName(String name);
}
| [
"[email protected]"
] | |
4d66edab5fff191308e56d8914312adda997ee29 | 5bdc3f7fe0430b4c344e0c71d2ef557ad7a5a9a3 | /app/src/main/java/hdo/com/andzq/adapter/RepairsListAdapter.java | 05b267a4ae2d6a6e132db433a2a3f2d0225999c8 | [] | no_license | WT2020/AndZQ | 08cbb6d7ec5a69b6d753b610973dbc6e13bec5e7 | e1f14010818b5e621340b8d1444fd00848d74928 | refs/heads/master | 2020-03-26T19:44:47.318515 | 2018-08-19T07:56:03 | 2018-08-19T07:56:03 | 145,283,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,245 | java | package hdo.com.andzq.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import hdo.com.andzq.R;
import hdo.com.andzq.bean.MyRepairsListBean;
import hdo.com.andzq.utils.LogUtils;
import hdo.com.andzq.utils.TimeUtils;
import hdo.com.andzq.utils.ToastUtils;
/**
* description 新建查询Adapter
* author 陈锐
* version 1.0
* created 2017/4/5
* modified by 邓杰 增加显示数据 2017/4/21
*/
public class RepairsListAdapter extends RecyclerView.Adapter<RepairsListAdapter.ViewHolder> {
private OnRecyclerItemClick mOnRecyclerItemClick;
private Context mContext;
/**
* 数据源
*/
private List<MyRepairsListBean.MyRepairBean> list;
public RepairsListAdapter(Context ctx, OnRecyclerItemClick mOnRecyclerItemClick) {
mContext = ctx;
this.mOnRecyclerItemClick = mOnRecyclerItemClick;
list = new ArrayList<>();
}
public List<MyRepairsListBean.MyRepairBean> getList() {
return list;
}
public void setList(List<MyRepairsListBean.MyRepairBean> list) {
this.list = list;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.item_repairs_list, parent, false);
return new RepairsListAdapter.ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.setData(position);
holder.itemView.setOnClickListener(v -> {
if (mOnRecyclerItemClick != null) {
mOnRecyclerItemClick.onItemClick(position);
}
});
}
@Override
public int getItemCount() {
return list.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
TextView tvTime, tvType, tvState;
ViewHolder(View itemView) {
super(itemView);
tvTime = (TextView) itemView.findViewById(R.id.tv_repairs_time);
tvType = (TextView) itemView.findViewById(R.id.tv_repairs_type);
tvState = (TextView) itemView.findViewById(R.id.tv_deal_state);
}
public void setData(int position) {
if (list != null && list.size() != 0) {
MyRepairsListBean.MyRepairBean bean = list.get(position);
//设置的申请时间
tvTime.setText(TimeUtils.Long2Time(bean.getApplyTime()));
tvType.setText(mContext.getResources().getStringArray(R.array.description_presuppose)[Integer
.parseInt(bean.getType())]);
tvState.setText(getState(bean.getRstate()));//维修状态
} else {
Toast.makeText(mContext, "暂无数据", Toast.LENGTH_SHORT).show();
}
}
}
private String getState(int state) {
return mContext.getResources().getStringArray(R.array.repairs_state)[state];
}
public interface OnRecyclerItemClick {
void onItemClick(int position);
}
}
| [
"[email protected]"
] | |
a59069c88bfb514cbd6ae7535b68fd8fea2a6b3d | e211a963916b15ab9aaaa1ec7c1b5a7f332f89dc | /bridge/src/main/java/com/klay/bridge/VayneQ.java | f802d57af3620a717edc1061688cf62779a7808d | [] | no_license | 673679842/Klay-java-design-pattern | f320b842ea5b819792e4d3069ce641f5033206b2 | 675f8368a22185aa0205187cc4cb19ec4752646c | refs/heads/master | 2020-04-10T04:21:18.657747 | 2018-12-17T03:07:53 | 2018-12-17T03:07:53 | 160,795,881 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 165 | java | package com.klay.bridge;
public class VayneQ implements SkillQ {
@Override
public void play() {
System.out.println("my Q is 闪避突袭");
}
}
| [
"[email protected]"
] | |
3473790615ec2eb44104f59447621be5ca818611 | 52a0908222e29022d487087d9158241f2b627502 | /src/main/java/com/yunos/rbac/service/auth/AuthService.java | 7d87b278a0b708287b7ef1afe793f89a9e7b2d90 | [] | no_license | Domain711/rbac | 51a04664c58c00d2545e066abc82651a1bc12b6e | 3ccd976067e49fa79069ef595bed4f0c15cd273a | refs/heads/master | 2020-04-24T18:35:16.391669 | 2019-03-04T00:06:52 | 2019-03-04T00:06:52 | 172,184,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 787 | java | package com.yunos.rbac.service.auth;
import com.yunos.rbac.entity.role.RoleEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 权限管理service
*/
public interface AuthService {
/**
* 查询需要授权的角色
*
* @return
*/
List<RoleEntity> queryAllRole(Integer page);
/**
* 获取已有权限
*
* @param roleId
* @return
*/
long[] queryExistsPerm(Integer roleId);
/**
* 保存权限信息
*
* @param permission
* @return
*/
int saveRolePermAuth(@Param("roleId") Long roleId, @Param("permission") String permission);
/**
* 删除角色原有权限
*
* @param roleId
* @return
*/
int delRolePermAuth(Long roleId);
}
| [
"[email protected]"
] | |
5eb51f92ef53ef85853b2ad6c46e2b8071a70fc8 | 7d53d903c7955459b63380480f173317ddabb102 | /src/com/thunisoft/sswy/mobile/util/CollectionUtils.java | c7e587aba35b86f040d01d9ea013ed7157b9a2dd | [] | no_license | piaoxue85/helloyy2 | 94dc611fad74c0514babd2bd3d44c3f5c3b1023f | c6990d929b3cb1ff0b67f4f7f71e5dbd17cfeba9 | refs/heads/master | 2023-03-15T15:57:21.266363 | 2016-03-30T02:58:37 | 2016-03-30T02:58:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package com.thunisoft.sswy.mobile.util;
import java.util.Collection;
/**
*
* @author wuxm
*
*/
public class CollectionUtils {
/**
*
* @param coll
* @return
*/
public static boolean isEmpty(@SuppressWarnings("rawtypes") Collection coll) {
return (coll == null || coll.isEmpty());
}
/**
*
* @param coll
* @return
*/
public static boolean isNotEmpty(@SuppressWarnings("rawtypes") Collection coll) {
return !isEmpty(coll);
}
}
| [
"[email protected]"
] | |
4f05fb54f08e39396bb21086b90a6bfc8e61f81e | 056dc76d11f63051cb4135ab4a5991ae5baddf4d | /app/src/main/java/com/task/dawadoz/forecast/rest/syncControllers/AccountGeneral.java | 902c7c9b750184569b0ad4ce7e842f99b5b636d4 | [] | no_license | n4nabil/WeatherApi | cf014f0cfc32fb2e9ea6096f996ace5c79ee5dc2 | d69466b89829728ffd07dff6838860f330770f92 | refs/heads/master | 2020-04-07T05:39:01.836133 | 2018-11-19T10:01:25 | 2018-11-19T10:01:25 | 158,104,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,525 | java | package com.task.dawadoz.forecast.rest.syncControllers;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.ContentResolver;
import android.content.Context;
import android.os.Bundle;
import android.widget.Toast;
import com.task.dawadoz.forecast.localDataProvider.provider.SampleContentProvider;
public final class AccountGeneral {
/**
* This is the type of account we are using. i.e. we can specify our app or apps
* to have different types, such as 'read-only', 'sync-only', & 'admin'.
*/
private static final String ACCOUNT_TYPE = "com.example.syncaccount";
/**
* This is the name that appears in the Android 'Accounts' settings.
*/
private static final String ACCOUNT_NAME = "Example Sync";
/**
* Gets the standard sync account for our app.
* @return {@link Account}
*/
public static Account getAccount() {
return new Account(ACCOUNT_NAME, ACCOUNT_TYPE);
}
/**
* Creates the standard sync account for our app.
* @param c {@link Context}
*/
public static void createSyncAccount(Context c) {
// Flag to determine if this is a new account or not
boolean created = false;
// Get an account and the account manager
Account account = getAccount();
AccountManager manager = (AccountManager)c.getSystemService(Context.ACCOUNT_SERVICE);
// Attempt to explicitly create the account with no password or extra data
if (manager.addAccountExplicitly(account, null, null)) {
final String AUTHORITY = SampleContentProvider.AUTHORITY;
final long SYNC_FREQUENCY = 60 * 60; // 1 hour (seconds)
// Inform the system that this account supports sync
ContentResolver.setIsSyncable(account, AUTHORITY, 1);
// Inform the system that this account is eligible for auto sync when the network is up
ContentResolver.setSyncAutomatically(account, AUTHORITY, true);
// Recommend a schedule for automatic synchronization. The system may modify this based
// on other scheduled syncs and network utilization.
ContentResolver.addPeriodicSync(account, AUTHORITY, new Bundle(), SYNC_FREQUENCY);
created = true;
}
// Force a sync if the account was just created
if (created) {
Toast.makeText(c, "Created", Toast.LENGTH_SHORT).show();
SyncAdapter.performSync();
}
}
}
| [
"[email protected]"
] | |
8ee0a1a8ccfd4e274590d72ce889392d099cd039 | b97bc0706448623a59a7f11d07e4a151173b7378 | /src/main/java/radian/tcmis/server7/client/swa/servlets/SWAScannerUpload.java | 0207f21f1ed5f86ad7a2682df7ee44f2ea387dc7 | [] | no_license | zafrul-ust/tcmISDev | 576a93e2cbb35a8ffd275fdbdd73c1f9161040b5 | 71418732e5465bb52a0079c7e7e7cec423a1d3ed | refs/heads/master | 2022-12-21T15:46:19.801950 | 2020-02-07T21:22:50 | 2020-02-07T21:22:50 | 241,601,201 | 0 | 0 | null | 2022-12-13T19:29:34 | 2020-02-19T11:08:43 | Java | UTF-8 | Java | false | false | 1,178 | java | package radian.tcmis.server7.client.swa.servlets;
/**
* Title: Your Product Name
* Description: Your description
* Copyright: Copyright (c) 1998
* Company: Your Company
* @author Your Name
* @version
*/
import radian.tcmis.server7.share.helpers.*;
import radian.tcmis.server7.share.servlets.*;
import radian.tcmis.server7.client.swa.dbObjs.*;
import radian.tcmis.server7.client.swa.helpers.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class SWAScannerUpload extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
SWATcmISDBModel db = null;
try {
//db = new SWATcmISDBModel();
db = new SWATcmISDBModel("SWA",(String)request.getHeader("logon-version"));
ScannerUpload obj = new ScannerUpload((ServerResourceBundle) new SWAServerResourceBundle(),db);
obj.doPost(request,response);
} catch (Exception e){
e.printStackTrace();
} finally {
db.close();
}
}
} | [
"[email protected]"
] | |
0463c2f97780811fc3159559c0fc0aca77bf7e90 | c0b37a664fde6a57ae61c4af635e6dea28d7905e | /Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/com/google/android/gms/internal/clearcut/zzaz.java | 33039a5eb9d4369df82711b49124d070b6578e9f | [] | no_license | joshkmartinez/Grades | a21ce8ede1371b9a7af11c4011e965f603c43291 | 53760e47f808780d06c4fbc2f74028a2db8e2942 | refs/heads/master | 2023-01-30T13:23:07.129566 | 2020-12-07T18:20:46 | 2020-12-07T18:20:46 | 131,549,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,510 | java | package com.google.android.gms.internal.clearcut;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
final class zzaz extends zzav<Boolean> implements zzcn<Boolean>, RandomAccess {
private static final zzaz zzfg;
private int size;
private boolean[] zzfh;
static {
zzav com_google_android_gms_internal_clearcut_zzaz = new zzaz();
zzfg = com_google_android_gms_internal_clearcut_zzaz;
com_google_android_gms_internal_clearcut_zzaz.zzv();
}
zzaz() {
this(new boolean[10], 0);
}
private zzaz(boolean[] zArr, int i) {
this.zzfh = zArr;
this.size = i;
}
private final void zza(int i, boolean z) {
zzw();
if (i < 0 || i > this.size) {
throw new IndexOutOfBoundsException(zzh(i));
}
if (this.size < this.zzfh.length) {
System.arraycopy(this.zzfh, i, this.zzfh, i + 1, this.size - i);
} else {
Object obj = new boolean[(((this.size * 3) / 2) + 1)];
System.arraycopy(this.zzfh, 0, obj, 0, i);
System.arraycopy(this.zzfh, i, obj, i + 1, this.size - i);
this.zzfh = obj;
}
this.zzfh[i] = z;
this.size++;
this.modCount++;
}
private final void zzg(int i) {
if (i < 0 || i >= this.size) {
throw new IndexOutOfBoundsException(zzh(i));
}
}
private final String zzh(int i) {
int i2 = this.size;
StringBuilder stringBuilder = new StringBuilder(35);
stringBuilder.append("Index:");
stringBuilder.append(i);
stringBuilder.append(", Size:");
stringBuilder.append(i2);
return stringBuilder.toString();
}
public final /* synthetic */ void add(int i, Object obj) {
zza(i, ((Boolean) obj).booleanValue());
}
public final boolean addAll(Collection<? extends Boolean> collection) {
zzw();
zzci.checkNotNull(collection);
if (!(collection instanceof zzaz)) {
return super.addAll(collection);
}
zzaz com_google_android_gms_internal_clearcut_zzaz = (zzaz) collection;
if (com_google_android_gms_internal_clearcut_zzaz.size == 0) {
return false;
}
if (Integer.MAX_VALUE - this.size >= com_google_android_gms_internal_clearcut_zzaz.size) {
int i = this.size + com_google_android_gms_internal_clearcut_zzaz.size;
if (i > this.zzfh.length) {
this.zzfh = Arrays.copyOf(this.zzfh, i);
}
System.arraycopy(com_google_android_gms_internal_clearcut_zzaz.zzfh, 0, this.zzfh, this.size, com_google_android_gms_internal_clearcut_zzaz.size);
this.size = i;
this.modCount++;
return true;
}
throw new OutOfMemoryError();
}
public final void addBoolean(boolean z) {
zza(this.size, z);
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof zzaz)) {
return super.equals(obj);
}
zzaz com_google_android_gms_internal_clearcut_zzaz = (zzaz) obj;
if (this.size != com_google_android_gms_internal_clearcut_zzaz.size) {
return false;
}
boolean[] zArr = com_google_android_gms_internal_clearcut_zzaz.zzfh;
for (int i = 0; i < this.size; i++) {
if (this.zzfh[i] != zArr[i]) {
return false;
}
}
return true;
}
public final /* synthetic */ Object get(int i) {
zzg(i);
return Boolean.valueOf(this.zzfh[i]);
}
public final int hashCode() {
int i = 1;
for (int i2 = 0; i2 < this.size; i2++) {
i = (i * 31) + zzci.zzc(this.zzfh[i2]);
}
return i;
}
public final /* synthetic */ Object remove(int i) {
zzw();
zzg(i);
boolean z = this.zzfh[i];
if (i < this.size - 1) {
System.arraycopy(this.zzfh, i + 1, this.zzfh, i, this.size - i);
}
this.size--;
this.modCount++;
return Boolean.valueOf(z);
}
public final boolean remove(Object obj) {
zzw();
for (int i = 0; i < this.size; i++) {
if (obj.equals(Boolean.valueOf(this.zzfh[i]))) {
System.arraycopy(this.zzfh, i + 1, this.zzfh, i, this.size - i);
this.size--;
this.modCount++;
return true;
}
}
return false;
}
protected final void removeRange(int i, int i2) {
zzw();
if (i2 >= i) {
System.arraycopy(this.zzfh, i2, this.zzfh, i, this.size - i2);
this.size -= i2 - i;
this.modCount++;
return;
}
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
public final /* synthetic */ Object set(int i, Object obj) {
boolean booleanValue = ((Boolean) obj).booleanValue();
zzw();
zzg(i);
boolean z = this.zzfh[i];
this.zzfh[i] = booleanValue;
return Boolean.valueOf(z);
}
public final int size() {
return this.size;
}
public final /* synthetic */ zzcn zzi(int i) {
if (i >= this.size) {
return new zzaz(Arrays.copyOf(this.zzfh, i), this.size);
}
throw new IllegalArgumentException();
}
}
| [
"[email protected]"
] | |
e25728404574a1ba43474677a6f3782b06e3ae23 | 9030e4a286aeca0dbcca0f6c2caa2587a8a4988c | /src/com/zcib/filter/LoginFilter.java | 5201d0118e739961af4765c0eb7662a298dd77cd | [] | no_license | Hadoop-cpu/shop | f46554cbdbf8f386c096ac6d929d7b1651859e06 | 61d341ed4acaf1c637067cbfe86ff41b970d1694 | refs/heads/master | 2022-11-17T06:06:12.707826 | 2020-07-13T13:21:53 | 2020-07-13T13:21:53 | 279,304,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,663 | java | package com.zcib.filter;
import java.io.IOException;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.zcib.domain.User;
@WebFilter(dispatcherTypes = {
DispatcherType.REQUEST,
DispatcherType.FORWARD
}
, urlPatterns = { "/home/*", "/person/*" }, servletNames = { "AddressServlet" })
public class LoginFilter implements Filter {
public LoginFilter() {
}
public void destroy() {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
/*
* 对会员登录进行登录
* 1.获取Session
* 2.获取User对象
* 3.User对象为空,去登录
* 4.不为空,放行
* */
//1.获取Session
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
HttpSession session = req.getSession();
//2.获取User对象
User user = (User) session.getAttribute("user");
//3.User对象为空,去登录
if(user == null){
// session.setAttribute("msg", "请登录后再操作!");
res.sendRedirect(req.getContextPath()+"/login.jsp");
}else{
chain.doFilter(request, response);//4.不为空,放行
}
}
public void init(FilterConfig fConfig) throws ServletException {
}
}
| [
"[email protected]"
] | |
cc66b3302b73a13ed52323245169436d94766481 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/ss/sls/extn/dm/SS_SLS_EXTN_4830_LDM.java | b723c3171bf5df49718b4934acd05b8531f96791 | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 3,999 | java | /***************************************************************************************************
* 파일명 : .java
* 기능 :
* 작성일자 :
* 작성자 : 심정보
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.ss.sls.extn.dm;
import java.sql.*;
import oracle.jdbc.driver.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.ss.sls.extn.ds.*;
import chosun.ciis.ss.sls.extn.rec.*;
/**
*
*/
public class SS_SLS_EXTN_4830_LDM extends somo.framework.db.BaseDM implements java.io.Serializable{
public String bocd;
public String valmm;
public SS_SLS_EXTN_4830_LDM(){}
public SS_SLS_EXTN_4830_LDM(String bocd, String valmm){
this.bocd = bocd;
this.valmm = valmm;
}
public void setBocd(String bocd){
this.bocd = bocd;
}
public void setValmm(String valmm){
this.valmm = valmm;
}
public String getBocd(){
return this.bocd;
}
public String getValmm(){
return this.valmm;
}
public String getSQL(){
return "{ call CRMSAL_COM.SP_SS_SLS_EXTN_4830_L(? ,? ,? ,? ,?) }";
}
public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{
SS_SLS_EXTN_4830_LDM dm = (SS_SLS_EXTN_4830_LDM)bdm;
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.registerOutParameter(2, Types.VARCHAR);
cstmt.setString(3, dm.bocd);
cstmt.setString(4, dm.valmm);
cstmt.registerOutParameter(5, OracleTypes.CURSOR);
}
public BaseDataSet createDataSetObject(){
return new chosun.ciis.ss.sls.extn.ds.SS_SLS_EXTN_4830_LDataSet();
}
public void print(){
System.out.println("SQL = " + this.getSQL());
System.out.println("bocd = [" + getBocd() + "]");
System.out.println("valmm = [" + getValmm() + "]");
}
}
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오.
String bocd = req.getParameter("bocd");
if( bocd == null){
System.out.println(this.toString+" : bocd is null" );
}else{
System.out.println(this.toString+" : bocd is "+bocd );
}
String valmm = req.getParameter("valmm");
if( valmm == null){
System.out.println(this.toString+" : valmm is null" );
}else{
System.out.println(this.toString+" : valmm is "+valmm );
}
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리시 사용하십시오.
String bocd = Util.checkString(req.getParameter("bocd"));
String valmm = Util.checkString(req.getParameter("valmm"));
----------------------------------------------------------------------------------------------------*//*----------------------------------------------------------------------------------------------------
Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오.
String bocd = Util.Uni2Ksc(Util.checkString(req.getParameter("bocd")));
String valmm = Util.Uni2Ksc(Util.checkString(req.getParameter("valmm")));
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DM 파일의 변수를 설정시 사용하십시오.
dm.setBocd(bocd);
dm.setValmm(valmm);
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Thu May 26 14:55:06 KST 2016 */ | [
"[email protected]"
] | |
f8cdda10990e9bd4de5835071e902d72a55d5f5f | d00ea6603e9bc0486098411d54d1652807278059 | /r3-activity/src/com/jfixby/r3/ui/red/activity/raster/RedTileInfo.java | 00c3cd9725774dec8a016c6d74f9efa69e103967 | [
"Apache-2.0"
] | permissive | JFixby/R3Red | 792e56bde7bd1b9c2715626eda18afd004b431cb | 5924b89b28c69bc695e601524402afcda9023fb6 | refs/heads/master | 2020-12-02T22:21:00.190273 | 2017-07-21T11:12:41 | 2017-07-21T11:12:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,111 | java |
package com.jfixby.r3.ui.red.activity.raster;
import com.jfixby.r3.api.activity.raster.Raster;
import com.jfixby.scarabei.api.floatn.Float2;
import com.jfixby.scarabei.api.geometry.Geometry;
import com.jfixby.scarabei.api.geometry.Rectangle;
import com.jfixby.scarabei.api.math.Angle;
import com.jfixby.scarabei.api.math.FloatMath;
public class RedTileInfo {
public Raster raster;
public double top_left_x;
public double top_left_y;
public double bottom_right_x;
public double bottom_right_y;
final Float2 tmpA = Geometry.newFloat2();
final Float2 tmpB = Geometry.newFloat2();
final Float2 tmpC = Geometry.newFloat2();
final Float2 tmpD = Geometry.newFloat2();
@Override
public String toString () {
return "RedTileInfo [top_left_x=" + top_left_x + ", top_left_y=" + top_left_y + ", bottom_left_x=" + bottom_right_x
+ ", bottom_left_y=" + bottom_right_y + ", raster=" + raster + "]";
}
final RedTileInfo tile = this;
// boolean need_update = !false;
final void update (final Rectangle shape, final Angle angle) {
// if (!need_update) {
// return;
// }
final Raster raster = tile.raster;
final Rectangle tile_shape = raster.shape();
this.tmpA.setXY(tile.top_left_x, tile.top_left_y);
this.tmpB.setXY(tile.bottom_right_x, tile.top_left_y);
this.tmpC.setXY(tile.bottom_right_x, tile.bottom_right_y);
this.tmpD.setXY(tile.top_left_x, tile.bottom_right_y);
shape.toAbsolute(this.tmpA);
shape.toAbsolute(this.tmpB);
// shape.toAbsolute(tmpC);
shape.toAbsolute(this.tmpD);
final double distance_AB = FloatMath.component().distance(this.tmpA.getX(), this.tmpA.getY(), this.tmpB.getX(),
this.tmpB.getY());
final double distance_AD = FloatMath.component().distance(this.tmpA.getX(), this.tmpA.getY(), this.tmpD.getX(),
this.tmpD.getY());
tile_shape.setOriginRelative(0, 0);
// tile_shape.setOriginRelative(0, 0);
// tile_shape.getPosition().getX();
tile_shape.setWidth(distance_AB);
tile_shape.setHeight(distance_AD);
tile_shape.setPosition(tmpA);
tile_shape.setRotation(angle);
}
}
| [
"[email protected]"
] | |
7be4e410ce8c5f26d5d103486b7cbe5572dd995f | ad8bee4ff8566e02a6956d57d02997f69861b6e6 | /src/main/java/com/example/demo/service/AreaService.java | e507c69f1f553dc9aa3e5b112ce307753f1ca7b9 | [] | no_license | 1303110335/spring-demo2 | 530ff580f1a04eae816acb51378563582d00f216 | b5c84f03050c8cc932ee05c4dfc71bcd307d4bba | refs/heads/master | 2020-03-14T22:45:09.061379 | 2018-05-02T09:25:57 | 2018-05-02T09:25:57 | 131,828,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package com.example.demo.service;
import java.util.List;
import com.example.demo.entity.Area;
public interface AreaService {
List<Area> getAreaList();
Area getAreaById(int areaId);
boolean addArea(Area area);
boolean modifyArea(Area area);
boolean deleteArea(int areaId);
}
| [
"[email protected]"
] | |
0035ff673ce7c3015d12fa834e41d141e05662c7 | 34481cb8ebcd076eff9dfc7b51c5d9b58275cef4 | /src/main/java/org/bian/dto/BQProductionExchangeInputModel.java | c3ce8895be29f85e7a242dd27f0d1962174fdf4f | [
"Apache-2.0"
] | permissive | bianapis/sd-product-deployment-v2 | 9aed0dd5e630b5d86130dc71d092e4c64ca67c24 | a63b36a5ac11bf5b1be6ba2e5c5cae9c58a79e14 | refs/heads/master | 2020-07-22T20:04:05.814302 | 2019-09-12T10:46:59 | 2019-09-12T10:46:59 | 207,312,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,106 | java | package org.bian.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.bian.dto.CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest;
import javax.validation.Valid;
/**
* BQProductionExchangeInputModel
*/
public class BQProductionExchangeInputModel {
private String productOrServiceDeploymentProjectInstanceReference = null;
private String productionInstanceReference = null;
private Object productionExchangeActionTaskRecord = null;
private CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest productionExchangeActionRequest = null;
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the parent Product Or Service Deployment Project instance
* @return productOrServiceDeploymentProjectInstanceReference
**/
public String getProductOrServiceDeploymentProjectInstanceReference() {
return productOrServiceDeploymentProjectInstanceReference;
}
public void setProductOrServiceDeploymentProjectInstanceReference(String productOrServiceDeploymentProjectInstanceReference) {
this.productOrServiceDeploymentProjectInstanceReference = productOrServiceDeploymentProjectInstanceReference;
}
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the Production instance
* @return productionInstanceReference
**/
public String getProductionInstanceReference() {
return productionInstanceReference;
}
public void setProductionInstanceReference(String productionInstanceReference) {
this.productionInstanceReference = productionInstanceReference;
}
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The exchange service call consolidated processing record
* @return productionExchangeActionTaskRecord
**/
public Object getProductionExchangeActionTaskRecord() {
return productionExchangeActionTaskRecord;
}
public void setProductionExchangeActionTaskRecord(Object productionExchangeActionTaskRecord) {
this.productionExchangeActionTaskRecord = productionExchangeActionTaskRecord;
}
/**
* Get productionExchangeActionRequest
* @return productionExchangeActionRequest
**/
public CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest getProductionExchangeActionRequest() {
return productionExchangeActionRequest;
}
public void setProductionExchangeActionRequest(CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest productionExchangeActionRequest) {
this.productionExchangeActionRequest = productionExchangeActionRequest;
}
}
| [
"[email protected]"
] | |
e47c6511892258339d2e79759ba96e905ef787a8 | 12cde4336475f7001061f494cc14fae753a4171b | /quiz/src/quiz28/StringQuiz03.java | 8f9d449dfeed6b54c0ad3d5fc8d8ac774674a631 | [] | no_license | ahn1205/java | bed9adb521ee3eeaad1ab7dcd2db3b0873aa8c72 | c638a17bc9c697f260d227254c73bc54fd5d12a2 | refs/heads/master | 2022-09-18T03:58:19.162734 | 2020-06-03T07:09:07 | 2020-06-03T07:09:07 | 269,015,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package quiz28;
public class StringQuiz03 {
public static void main(String[] args) {
}
public static String palindrome(String word) {
// word = word.replace(" ", "");
// for(int i = 0; i < word.length() / 2 ; i++) {
//
// if(word.charAt(i) != word.charAt( word.length() -1 -i ) ) {
// return "회문이 아닙니다";
// }
// }
// return "회문 입니다";
word = word.replace(" ", "");
StringBuffer sb = new StringBuffer(word);
if(sb.reverse().toString().equals(word) ) {
return "회문입니다";
} else {
return "회문이 아닙니다";
}
}
}
| [
"[email protected]"
] | |
96a49e25749bbbd32cc860fbcdaa8a98b720a03c | cedd2ed85d2008877295a1e13dfe0666c5256d85 | /PrsonForm.java | e8a9b318f6fbd54d176a7569ddf1fb497ee6fc39 | [] | no_license | amiraliarab/final | 0f0d24a4668346de3cf98d0fccdd9ac4e71d2b63 | 640e09f6a32f23c1860f7feed3c88c139f8b40b7 | refs/heads/master | 2020-12-26T11:53:56.159679 | 2020-01-31T19:28:22 | 2020-01-31T19:28:22 | 237,500,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,664 | java | package Package;
public class PrsonForm extends javax.swing.JFrame {
static String name;
static String family;
static void main(String n, String f) {
name = n;
family = f;
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
PrsonForm obj = new PrsonForm();
obj.setLocationRelativeTo(null);
obj.setVisible(true);
}
});
}
public PrsonForm() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jButton1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jButton1.setText("کتاب");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});
jButton2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jButton2.setText("امانات");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
}
});
jButton3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jButton3.setText("کارکنان");
jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton3MouseClicked(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jButton3)
.addGap(74, 74, 74)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 82, Short.MAX_VALUE)
.addComponent(jButton1)
.addGap(59, 59, 59))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jButton3))
.addContainerGap(222, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
BookMang.main(name,family);
}//GEN-LAST:event_jButton1MouseClicked
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
FormAmanat.main(name,family);
}//GEN-LAST:event_jButton2MouseClicked
private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
PrsonForm o =new PrsonForm();
o.setVisible(true);
}//GEN-LAST:event_jButton3MouseClicked
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new PrsonForm().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
becc8c2e7c1d690c1daf20d172c1e0cf76873779 | e239edb8051dda997034abdb05d4baaae29a92ed | /projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/AsSet.java | f75c2d50feb6821d25337bd639a4cb298026dbc3 | [
"Apache-2.0"
] | permissive | rsr-at-mindtwin/batfish | fe59603adcbbe0e0e61afa5593e5677d1ce09454 | cdc6753810cccfd3d20f4532984b17086f1cd581 | refs/heads/master | 2023-08-27T15:08:53.994169 | 2021-09-25T01:22:22 | 2021-09-25T01:22:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,250 | java | package org.batfish.datamodel;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Ordering;
import com.google.common.primitives.Longs;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Iterator;
import java.util.SortedSet;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import org.apache.commons.lang3.StringUtils;
/** An immutable class representing a set of AS numbers. */
@ParametersAreNonnullByDefault
public class AsSet implements Serializable, Comparable<AsSet> {
// Soft values: let it be garbage collected in times of pressure.
// Maximum size 2^16: Just some upper bound on cache size, well less than GiB.
// (8 bytes seems smallest possible entry (set(long)), would be 1 MiB total).
private static final LoadingCache<AsSet, AsSet> CACHE =
Caffeine.newBuilder().softValues().maximumSize(1 << 16).build(x -> x);
private static final String PROP_ASNS = "asns";
private static final String PROP_CONFEDERATION = "confederation";
private final long[] _value;
private final boolean _confederation;
private AsSet(long[] value, boolean confederation) {
Arrays.sort(value);
_value = value;
_confederation = confederation;
}
/** Create a new empty {@link AsSet}. */
public static AsSet empty() {
return of();
}
/** Create a new {@link AsSet} that is for a single ASN. */
public static AsSet of(long value) {
return of(new long[] {value});
}
/**
* Create a new {@link AsSet} that is an immutable copy of {@code value}.
*
* <p>Note: this {@link AsSet} will take ownership of the given {@code long[]}.
*/
public static AsSet of(long... value) {
AsSet set = new AsSet(value, false);
return CACHE.get(set);
}
/** Create a new empty confederation {@link AsSet}. */
public static AsSet confedEmpty() {
return confed();
}
/** Create a new confederation {@link AsSet} that is an immutable copy of {@code value}. */
public static AsSet confed(long... value) {
AsSet set = new AsSet(value, true);
return CACHE.get(set);
}
@JsonCreator
private static AsSet jsonCreator(
// Keep backwards compatibility in deserialization
@Nullable JsonNode data) {
if (data == null) {
return AsSet.empty();
}
if (data.isArray()) {
// Old array format: treat as regular as set
return AsSet.of(getValues(data));
} else if (data.isObject()) {
JsonNode propConfed = data.get(PROP_CONFEDERATION);
if (propConfed == null || !propConfed.asBoolean(Boolean.FALSE)) {
return AsSet.of(getValues(data.get(PROP_ASNS)));
} else {
return AsSet.confed(getValues(data.get(PROP_ASNS)));
}
} else {
throw new IllegalArgumentException(String.format("Cannot deserialize %s", AsSet.class));
}
}
/** Convert JsonNode to an array of longs */
private static long[] getValues(JsonNode data) {
long[] values = new long[data.size()];
int i = 0;
Iterator<JsonNode> iterator = data.elements();
while (iterator.hasNext()) {
JsonNode v = iterator.next();
assert v.isNumber();
values[i++] = v.asLong();
}
return values;
}
@Override
public int compareTo(AsSet o) {
return Longs.lexicographicalComparator().compare(_value, o._value);
}
public boolean containsAs(long asn) {
for (long l : _value) {
if (l == asn) {
return true;
}
}
return false;
}
@Override
public boolean equals(@Nullable Object o) {
if (o == this) {
return true;
} else if (!(o instanceof AsSet)) {
return false;
}
return Arrays.equals(_value, ((AsSet) o)._value)
&& _confederation == ((AsSet) o)._confederation;
}
/** Expensive. */
@VisibleForTesting
@JsonProperty(PROP_ASNS)
public SortedSet<Long> getAsns() {
return Arrays.stream(_value)
.boxed()
.collect(ImmutableSortedSet.toImmutableSortedSet(Ordering.natural()));
}
@Override
public int hashCode() {
return Arrays.hashCode(_value) * 31 + Boolean.hashCode(_confederation);
}
@JsonIgnore
public boolean isEmpty() {
return size() == 0;
}
/** Returns true if this AsSet is of type {@code AS_CONFED_SEQUENCE} or {@code AS_CONFED_SET} */
@JsonProperty(PROP_CONFEDERATION)
public boolean isConfederationAsSet() {
return _confederation;
}
/** Returns a new {@link AsSet} that consists of this set with any private ASNs removed. */
public AsSet removePrivateAs() {
return AsSet.of(Arrays.stream(_value).filter(asn -> !AsPath.isPrivateAs(asn)).toArray());
}
public int size() {
return _value.length;
}
@Override
public String toString() {
if (_value.length == 1) {
return Long.toString(_value[0]);
}
return "{" + StringUtils.join(_value, ',') + "}";
}
}
| [
"[email protected]"
] | |
fa167b36e5bb00bda0935a215fca377ce429c4f0 | 47d37c1904fb1cc5232cd12909fd41600471c2a2 | /app/src/main/java/com/devsaidur/saidur/playnearnadmin/ui/allusers/Account.java | aac9ce94e97821b63af31562d4f8c54599197f50 | [] | no_license | SaidurRahmanfuad/Playnearnadmin | b6c01aafbafa156909ddd717a339005ef95bc1b4 | a78a606d3d9742a61920260f8b6ad7ea1b4923cd | refs/heads/master | 2023-08-03T10:25:38.957986 | 2021-09-13T07:43:24 | 2021-09-13T07:43:24 | 405,878,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 643 | java | package com.devsaidur.saidur.playnearnadmin.ui.allusers;
public class Account {
String current_bal;
String wallet_bal;
public Account(String current_bal, String wallet_bal) {
this.current_bal = current_bal;
this.wallet_bal = wallet_bal;
}
public Account() {
}
public String getCurrent_bal() {
return current_bal;
}
public void setCurrent_bal(String current_bal) {
this.current_bal = current_bal;
}
public String getWallet_bal() {
return wallet_bal;
}
public void setWallet_bal(String wallet_bal) {
this.wallet_bal = wallet_bal;
}
}
| [
"[email protected]"
] | |
6df14143551a79aac294877bb3745c2d51059844 | 519b53b6252afe41b81c93fef2c22480cbfb1123 | /Tree/BinaryTreeLongestConsecutiveSequence.java | 3ed030adf7e9a09f1b5d0affd03ac325fa88ea09 | [] | no_license | AtefeMsb/LeetCode | 66a489363a010beb80624e5d01331dc52c7ac2a9 | 95a686c028784c265d2dfde623cc58fb93a71c92 | refs/heads/master | 2022-07-11T09:44:04.816623 | 2022-06-08T19:35:20 | 2022-06-08T19:35:20 | 211,967,972 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 966 | java | /**
* preorder DFS
* O(n)
*/
class Solution {
public int longestConsecutive(TreeNode root) {
// to save the max length through all the recursive calls
int[] max = new int[1];
dfs(root, max, 0, 0);
return max[0];
}
public void dfs(TreeNode root, int[] max, int curLength, int target) {
// reach a leaf and need to return
if (root == null) {
return;
}
// if we found the next piece in sequence, add 1 to curLength
if (root.val == target) {
curLength++;
// if we DID NOT find the next piece in sequence, reset the curLength to 1
} else {
curLength = 1;
}
// update the max with the new curLength
max[0] = Math.max(max[0], curLength);
dfs(root.left, max, curLength, root.val + 1);
dfs(root.right, max, curLength, root.val + 1);
}
} | [
"[email protected]"
] | |
58c361db9e809c104d772836858fe230542ceae6 | f96f9bc3bf2aa39512dad20e5afc3ce43d5f61b4 | /src/main/java/net/renfei/repository/entity/PostsDOExample.java | 61024d439e998fb3ca6d31cf6a946d90b55f490a | [
"Apache-2.0"
] | permissive | khm915/www.renfei.net | 89f3ab8e9ab9479c726a9280995870222b9b41ce | 28801c55fa31f64c56cfe550652a17997d2fd205 | refs/heads/master | 2023-03-25T07:38:07.499291 | 2021-03-24T06:36:24 | 2021-03-24T06:37:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 34,266 | java | package net.renfei.repository.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PostsDOExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PostsDOExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCategoryIdIsNull() {
addCriterion("category_id is null");
return (Criteria) this;
}
public Criteria andCategoryIdIsNotNull() {
addCriterion("category_id is not null");
return (Criteria) this;
}
public Criteria andCategoryIdEqualTo(Long value) {
addCriterion("category_id =", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotEqualTo(Long value) {
addCriterion("category_id <>", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThan(Long value) {
addCriterion("category_id >", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) {
addCriterion("category_id >=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThan(Long value) {
addCriterion("category_id <", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThanOrEqualTo(Long value) {
addCriterion("category_id <=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdIn(List<Long> values) {
addCriterion("category_id in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotIn(List<Long> values) {
addCriterion("category_id not in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdBetween(Long value1, Long value2) {
addCriterion("category_id between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotBetween(Long value1, Long value2) {
addCriterion("category_id not between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andIsOriginalIsNull() {
addCriterion("is_original is null");
return (Criteria) this;
}
public Criteria andIsOriginalIsNotNull() {
addCriterion("is_original is not null");
return (Criteria) this;
}
public Criteria andIsOriginalEqualTo(Boolean value) {
addCriterion("is_original =", value, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalNotEqualTo(Boolean value) {
addCriterion("is_original <>", value, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalGreaterThan(Boolean value) {
addCriterion("is_original >", value, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_original >=", value, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalLessThan(Boolean value) {
addCriterion("is_original <", value, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalLessThanOrEqualTo(Boolean value) {
addCriterion("is_original <=", value, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalIn(List<Boolean> values) {
addCriterion("is_original in", values, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalNotIn(List<Boolean> values) {
addCriterion("is_original not in", values, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalBetween(Boolean value1, Boolean value2) {
addCriterion("is_original between", value1, value2, "isOriginal");
return (Criteria) this;
}
public Criteria andIsOriginalNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_original not between", value1, value2, "isOriginal");
return (Criteria) this;
}
public Criteria andViewsIsNull() {
addCriterion("views is null");
return (Criteria) this;
}
public Criteria andViewsIsNotNull() {
addCriterion("views is not null");
return (Criteria) this;
}
public Criteria andViewsEqualTo(Long value) {
addCriterion("views =", value, "views");
return (Criteria) this;
}
public Criteria andViewsNotEqualTo(Long value) {
addCriterion("views <>", value, "views");
return (Criteria) this;
}
public Criteria andViewsGreaterThan(Long value) {
addCriterion("views >", value, "views");
return (Criteria) this;
}
public Criteria andViewsGreaterThanOrEqualTo(Long value) {
addCriterion("views >=", value, "views");
return (Criteria) this;
}
public Criteria andViewsLessThan(Long value) {
addCriterion("views <", value, "views");
return (Criteria) this;
}
public Criteria andViewsLessThanOrEqualTo(Long value) {
addCriterion("views <=", value, "views");
return (Criteria) this;
}
public Criteria andViewsIn(List<Long> values) {
addCriterion("views in", values, "views");
return (Criteria) this;
}
public Criteria andViewsNotIn(List<Long> values) {
addCriterion("views not in", values, "views");
return (Criteria) this;
}
public Criteria andViewsBetween(Long value1, Long value2) {
addCriterion("views between", value1, value2, "views");
return (Criteria) this;
}
public Criteria andViewsNotBetween(Long value1, Long value2) {
addCriterion("views not between", value1, value2, "views");
return (Criteria) this;
}
public Criteria andThumbsUpIsNull() {
addCriterion("thumbs_up is null");
return (Criteria) this;
}
public Criteria andThumbsUpIsNotNull() {
addCriterion("thumbs_up is not null");
return (Criteria) this;
}
public Criteria andThumbsUpEqualTo(Long value) {
addCriterion("thumbs_up =", value, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpNotEqualTo(Long value) {
addCriterion("thumbs_up <>", value, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpGreaterThan(Long value) {
addCriterion("thumbs_up >", value, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpGreaterThanOrEqualTo(Long value) {
addCriterion("thumbs_up >=", value, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpLessThan(Long value) {
addCriterion("thumbs_up <", value, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpLessThanOrEqualTo(Long value) {
addCriterion("thumbs_up <=", value, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpIn(List<Long> values) {
addCriterion("thumbs_up in", values, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpNotIn(List<Long> values) {
addCriterion("thumbs_up not in", values, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpBetween(Long value1, Long value2) {
addCriterion("thumbs_up between", value1, value2, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsUpNotBetween(Long value1, Long value2) {
addCriterion("thumbs_up not between", value1, value2, "thumbsUp");
return (Criteria) this;
}
public Criteria andThumbsDownIsNull() {
addCriterion("thumbs_down is null");
return (Criteria) this;
}
public Criteria andThumbsDownIsNotNull() {
addCriterion("thumbs_down is not null");
return (Criteria) this;
}
public Criteria andThumbsDownEqualTo(Long value) {
addCriterion("thumbs_down =", value, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownNotEqualTo(Long value) {
addCriterion("thumbs_down <>", value, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownGreaterThan(Long value) {
addCriterion("thumbs_down >", value, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownGreaterThanOrEqualTo(Long value) {
addCriterion("thumbs_down >=", value, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownLessThan(Long value) {
addCriterion("thumbs_down <", value, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownLessThanOrEqualTo(Long value) {
addCriterion("thumbs_down <=", value, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownIn(List<Long> values) {
addCriterion("thumbs_down in", values, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownNotIn(List<Long> values) {
addCriterion("thumbs_down not in", values, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownBetween(Long value1, Long value2) {
addCriterion("thumbs_down between", value1, value2, "thumbsDown");
return (Criteria) this;
}
public Criteria andThumbsDownNotBetween(Long value1, Long value2) {
addCriterion("thumbs_down not between", value1, value2, "thumbsDown");
return (Criteria) this;
}
public Criteria andReleaseTimeIsNull() {
addCriterion("release_time is null");
return (Criteria) this;
}
public Criteria andReleaseTimeIsNotNull() {
addCriterion("release_time is not null");
return (Criteria) this;
}
public Criteria andReleaseTimeEqualTo(Date value) {
addCriterion("release_time =", value, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeNotEqualTo(Date value) {
addCriterion("release_time <>", value, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeGreaterThan(Date value) {
addCriterion("release_time >", value, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeGreaterThanOrEqualTo(Date value) {
addCriterion("release_time >=", value, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeLessThan(Date value) {
addCriterion("release_time <", value, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeLessThanOrEqualTo(Date value) {
addCriterion("release_time <=", value, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeIn(List<Date> values) {
addCriterion("release_time in", values, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeNotIn(List<Date> values) {
addCriterion("release_time not in", values, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeBetween(Date value1, Date value2) {
addCriterion("release_time between", value1, value2, "releaseTime");
return (Criteria) this;
}
public Criteria andReleaseTimeNotBetween(Date value1, Date value2) {
addCriterion("release_time not between", value1, value2, "releaseTime");
return (Criteria) this;
}
public Criteria andAddTimeIsNull() {
addCriterion("add_time is null");
return (Criteria) this;
}
public Criteria andAddTimeIsNotNull() {
addCriterion("add_time is not null");
return (Criteria) this;
}
public Criteria andAddTimeEqualTo(Date value) {
addCriterion("add_time =", value, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeNotEqualTo(Date value) {
addCriterion("add_time <>", value, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeGreaterThan(Date value) {
addCriterion("add_time >", value, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeGreaterThanOrEqualTo(Date value) {
addCriterion("add_time >=", value, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeLessThan(Date value) {
addCriterion("add_time <", value, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeLessThanOrEqualTo(Date value) {
addCriterion("add_time <=", value, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeIn(List<Date> values) {
addCriterion("add_time in", values, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeNotIn(List<Date> values) {
addCriterion("add_time not in", values, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeBetween(Date value1, Date value2) {
addCriterion("add_time between", value1, value2, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeNotBetween(Date value1, Date value2) {
addCriterion("add_time not between", value1, value2, "addTime");
return (Criteria) this;
}
public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null");
return (Criteria) this;
}
public Criteria andIsDeleteIsNotNull() {
addCriterion("is_delete is not null");
return (Criteria) this;
}
public Criteria andIsDeleteEqualTo(Boolean value) {
addCriterion("is_delete =", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotEqualTo(Boolean value) {
addCriterion("is_delete <>", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThan(Boolean value) {
addCriterion("is_delete >", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_delete >=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThan(Boolean value) {
addCriterion("is_delete <", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThanOrEqualTo(Boolean value) {
addCriterion("is_delete <=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteIn(List<Boolean> values) {
addCriterion("is_delete in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotIn(List<Boolean> values) {
addCriterion("is_delete not in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteBetween(Boolean value1, Boolean value2) {
addCriterion("is_delete between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_delete not between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsCommentIsNull() {
addCriterion("is_comment is null");
return (Criteria) this;
}
public Criteria andIsCommentIsNotNull() {
addCriterion("is_comment is not null");
return (Criteria) this;
}
public Criteria andIsCommentEqualTo(Boolean value) {
addCriterion("is_comment =", value, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentNotEqualTo(Boolean value) {
addCriterion("is_comment <>", value, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentGreaterThan(Boolean value) {
addCriterion("is_comment >", value, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_comment >=", value, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentLessThan(Boolean value) {
addCriterion("is_comment <", value, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentLessThanOrEqualTo(Boolean value) {
addCriterion("is_comment <=", value, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentIn(List<Boolean> values) {
addCriterion("is_comment in", values, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentNotIn(List<Boolean> values) {
addCriterion("is_comment not in", values, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentBetween(Boolean value1, Boolean value2) {
addCriterion("is_comment between", value1, value2, "isComment");
return (Criteria) this;
}
public Criteria andIsCommentNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_comment not between", value1, value2, "isComment");
return (Criteria) this;
}
public Criteria andAvgViewsIsNull() {
addCriterion("avg_views is null");
return (Criteria) this;
}
public Criteria andAvgViewsIsNotNull() {
addCriterion("avg_views is not null");
return (Criteria) this;
}
public Criteria andAvgViewsEqualTo(Double value) {
addCriterion("avg_views =", value, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsNotEqualTo(Double value) {
addCriterion("avg_views <>", value, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsGreaterThan(Double value) {
addCriterion("avg_views >", value, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsGreaterThanOrEqualTo(Double value) {
addCriterion("avg_views >=", value, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsLessThan(Double value) {
addCriterion("avg_views <", value, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsLessThanOrEqualTo(Double value) {
addCriterion("avg_views <=", value, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsIn(List<Double> values) {
addCriterion("avg_views in", values, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsNotIn(List<Double> values) {
addCriterion("avg_views not in", values, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsBetween(Double value1, Double value2) {
addCriterion("avg_views between", value1, value2, "avgViews");
return (Criteria) this;
}
public Criteria andAvgViewsNotBetween(Double value1, Double value2) {
addCriterion("avg_views not between", value1, value2, "avgViews");
return (Criteria) this;
}
public Criteria andAvgCommentIsNull() {
addCriterion("avg_comment is null");
return (Criteria) this;
}
public Criteria andAvgCommentIsNotNull() {
addCriterion("avg_comment is not null");
return (Criteria) this;
}
public Criteria andAvgCommentEqualTo(Double value) {
addCriterion("avg_comment =", value, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentNotEqualTo(Double value) {
addCriterion("avg_comment <>", value, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentGreaterThan(Double value) {
addCriterion("avg_comment >", value, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentGreaterThanOrEqualTo(Double value) {
addCriterion("avg_comment >=", value, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentLessThan(Double value) {
addCriterion("avg_comment <", value, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentLessThanOrEqualTo(Double value) {
addCriterion("avg_comment <=", value, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentIn(List<Double> values) {
addCriterion("avg_comment in", values, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentNotIn(List<Double> values) {
addCriterion("avg_comment not in", values, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentBetween(Double value1, Double value2) {
addCriterion("avg_comment between", value1, value2, "avgComment");
return (Criteria) this;
}
public Criteria andAvgCommentNotBetween(Double value1, Double value2) {
addCriterion("avg_comment not between", value1, value2, "avgComment");
return (Criteria) this;
}
public Criteria andPageRankIsNull() {
addCriterion("page_rank is null");
return (Criteria) this;
}
public Criteria andPageRankIsNotNull() {
addCriterion("page_rank is not null");
return (Criteria) this;
}
public Criteria andPageRankEqualTo(Double value) {
addCriterion("page_rank =", value, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankNotEqualTo(Double value) {
addCriterion("page_rank <>", value, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankGreaterThan(Double value) {
addCriterion("page_rank >", value, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankGreaterThanOrEqualTo(Double value) {
addCriterion("page_rank >=", value, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankLessThan(Double value) {
addCriterion("page_rank <", value, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankLessThanOrEqualTo(Double value) {
addCriterion("page_rank <=", value, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankIn(List<Double> values) {
addCriterion("page_rank in", values, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankNotIn(List<Double> values) {
addCriterion("page_rank not in", values, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankBetween(Double value1, Double value2) {
addCriterion("page_rank between", value1, value2, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankNotBetween(Double value1, Double value2) {
addCriterion("page_rank not between", value1, value2, "pageRank");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeIsNull() {
addCriterion("page_rank_update_time is null");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeIsNotNull() {
addCriterion("page_rank_update_time is not null");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeEqualTo(Date value) {
addCriterion("page_rank_update_time =", value, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeNotEqualTo(Date value) {
addCriterion("page_rank_update_time <>", value, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeGreaterThan(Date value) {
addCriterion("page_rank_update_time >", value, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("page_rank_update_time >=", value, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeLessThan(Date value) {
addCriterion("page_rank_update_time <", value, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("page_rank_update_time <=", value, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeIn(List<Date> values) {
addCriterion("page_rank_update_time in", values, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeNotIn(List<Date> values) {
addCriterion("page_rank_update_time not in", values, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeBetween(Date value1, Date value2) {
addCriterion("page_rank_update_time between", value1, value2, "pageRankUpdateTime");
return (Criteria) this;
}
public Criteria andPageRankUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("page_rank_update_time not between", value1, value2, "pageRankUpdateTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"[email protected]"
] | |
08c65fc815c1624e0902e78198adb2a43f477bfc | 9d36edf3310c3e9aac935d1a3b24426dce502fe9 | /src/main/java/cn/sola97/bot/livenotification/commands/channel/ShowCmd.java | 13c982af1e70756da79f61cbb483cde70b083b42 | [] | no_license | sola97/LiveNotificationBot | ec9de787dc24175d400beafa786cc560cb6f42c5 | a78adcc46cc079d6d447f88a5b6be22e519c93a8 | refs/heads/master | 2022-09-18T15:23:45.992809 | 2019-07-05T14:20:51 | 2019-07-05T14:20:51 | 184,382,560 | 1 | 1 | null | 2022-09-01T23:06:11 | 2019-05-01T07:23:54 | Java | UTF-8 | Java | false | false | 27,057 | java | package cn.sola97.bot.livenotification.commands.channel;
import static cn.sola97.bot.livenotification.BotConfig.*;
import com.jagrosh.jdautilities.command.CommandEvent;
import com.jagrosh.jdautilities.commons.waiter.EventWaiter;
import com.jagrosh.jdautilities.menu.Menu;
import cn.sola97.bot.livenotification.Bot;
import cn.sola97.bot.livenotification.commands.ChannelCommand;
import cn.sola97.bot.livenotification.utils.ParseUtil;
import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.MessageBuilder;
import net.dv8tion.jda.core.entities.*;
import net.dv8tion.jda.core.events.message.GenericMessageEvent;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import net.dv8tion.jda.core.events.message.react.MessageReactionAddEvent;
import net.dv8tion.jda.core.exceptions.PermissionException;
import net.dv8tion.jda.core.requests.RestAction;
import net.dv8tion.jda.core.utils.Checks;
import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Consumer;
public class ShowCmd extends ChannelCommand {
private final Paginator.Builder builder;
public ShowCmd(Bot bot) {
super(bot);
this.name = "show";
this.help = "subscribe a streamer on TextChannel ";
this.arguments = "[pagenum]";
this.aliases = new String[]{"list", "ls"};
builder = new Paginator.Builder()
.setColumns(1)
.setFinalAction(m -> {
try {
m.clearReactions().queue();
} catch (PermissionException ignore) {
}
})
.setText("")
.waitOnSinglePage(true)
.setBot(bot)
.setEventWaiter(bot.getWaiter())
.setTimeout(1, TimeUnit.MINUTES);
}
@Override
protected void execute(CommandEvent event) {
int pagenum = 1;
try {
pagenum = Integer.parseInt(event.getArgs());
} catch (NumberFormatException ignore) {
}
// use Unirest to poll an API
List<EmbedBuilder> items = bot.getObManager().getObserversEmbedBuilderByChannelId(event.getChannel().getId());
if (items.isEmpty()) {
event.reply("您还没有订阅");
return;
}
builder.setItems(items)
.setColor(event.getSelfMember().getColor())
.setUsers(event.getAuthor());
builder.build().paginate(event.getChannel(), pagenum);
}
}
//魔改 com.jagrosh.jdautilities.menu.Paginator
class Paginator extends Menu {
private final BiFunction<Integer, Integer, Color> color;
private final BiFunction<Integer, Integer, String> text;
private final int columns;
private final int itemsPerPage;
private final boolean showPageNumbers;
private final boolean numberItems;
private final List<EmbedBuilder> embedBuilders;
private final int pages;
private final Consumer<Message> finalAction;
private final boolean waitOnSinglePage;
private final int bulkSkipNumber;
private final boolean wrapPageEnds;
private final String leftText;
private final String rightText;
private final Bot bot;
private final boolean allowTextInput;
Paginator(EventWaiter waiter, Set<User> users, Set<Role> roles, long timeout, TimeUnit unit, BiFunction<Integer, Integer, Color> color, BiFunction<Integer, Integer, String> text, Consumer<Message> finalAction, int columns, int itemsPerPage, boolean showPageNumbers, boolean numberItems, List<EmbedBuilder> items, boolean waitOnSinglePage, int bulkSkipNumber, boolean wrapPageEnds, String leftText, String rightText, boolean allowTextInput, Bot bot) {
super(waiter, users, roles, timeout, unit);
this.bot = bot;
this.color = color;
this.text = text;
this.columns = columns;
this.itemsPerPage = itemsPerPage;
this.showPageNumbers = showPageNumbers;
this.numberItems = numberItems;
this.embedBuilders = items;
this.pages = (int) Math.ceil((double) this.embedBuilders.size() / (double) itemsPerPage);
this.finalAction = finalAction;
this.waitOnSinglePage = waitOnSinglePage;
this.bulkSkipNumber = bulkSkipNumber;
this.wrapPageEnds = wrapPageEnds;
this.leftText = leftText;
this.rightText = rightText;
this.allowTextInput = allowTextInput;
}
public void display(MessageChannel channel) {
this.paginate((MessageChannel) channel, 1);
}
public void display(Message message) {
this.paginate((Message) message, 1);
}
public void paginate(MessageChannel channel, int pageNum) {
if (pageNum < 1) {
pageNum = 1;
} else if (pageNum > this.pages) {
pageNum = this.pages;
}
Message msg = this.renderPageLoading(pageNum);
this.initialize(channel.sendMessage(msg), pageNum);
}
public void paginate(Message message, int pageNum) {
if (pageNum < 1) {
pageNum = 1;
} else if (pageNum > this.pages) {
pageNum = this.pages;
}
Message msg = this.renderPage(pageNum);
this.initialize(message.editMessage(msg), pageNum);
}
private void initialize(RestAction<Message> action, int pageNum) {
action.queue((m) -> {
if (this.pages > 1) {
if (this.bulkSkipNumber > 1) {
m.addReaction(BIG_LEFT).queue();
}
m.addReaction(LEFT).queue();
m.addReaction(STOP).queue();
if (this.bulkSkipNumber > 1) {
m.addReaction(RIGHT).queue();
}
m.addReaction(this.bulkSkipNumber > 1 ? BIG_RIGHT : RIGHT).queue();
m.addReaction(SUBSCRIBE).queue();
m.addReaction(UNSUBSCRIBE).queue();
m.addReaction(MENTION).queue();
m.addReaction(REMOVE_MENTION).queue();
m.addReaction(CHANGE_MENTION_LEVEL).queue();
m.addReaction(CHANGE_MSG_LEVEL).queue();
m.addReaction(DELETE).queue((v) -> {
m.editMessage(renderPage(pageNum)).queue();
this.pagination(m, pageNum);
}, (t) -> {
m.editMessage(renderPage(pageNum)).queue();
this.pagination(m, pageNum);
});
} else if (this.waitOnSinglePage) {
m.addReaction(STOP).queue();
m.addReaction(SUBSCRIBE).queue();
m.addReaction(UNSUBSCRIBE).queue();
m.addReaction(MENTION).queue();
m.addReaction(REMOVE_MENTION).queue();
m.addReaction(CHANGE_MENTION_LEVEL).queue();
m.addReaction(CHANGE_MSG_LEVEL).queue();
m.addReaction(DELETE).queue((v) -> {
m.editMessage(renderPage(pageNum)).queue();
this.paginationWithoutTextInput(m, pageNum);
}, (t) -> {
m.editMessage(renderPage(pageNum)).queue();
this.paginationWithoutTextInput(m, pageNum);
});
} else {
this.finalAction.accept(m);
}
});
}
private void pagination(Message message, int pageNum) {
if (!this.allowTextInput && (this.leftText == null || this.rightText == null)) {
this.paginationWithoutTextInput(message, pageNum);
} else {
this.paginationWithTextInput(message, pageNum);
}
}
private void paginationWithTextInput(Message message, int pageNum) {
this.waiter.waitForEvent(GenericMessageEvent.class, (event) -> {
if (event instanceof MessageReactionAddEvent) {
return this.checkReaction((MessageReactionAddEvent) event, message.getIdLong());
} else {
if (event instanceof MessageReceivedEvent) {
MessageReceivedEvent mre = (MessageReceivedEvent) event;
if (!mre.getChannel().equals(message.getChannel())) {
return false;
}
String rawContent = mre.getMessage().getContentRaw().trim();
if (this.leftText != null && this.rightText != null && (rawContent.equalsIgnoreCase(this.leftText) || rawContent.equalsIgnoreCase(this.rightText))) {
return this.isValidUser(mre.getAuthor(), mre.getGuild());
}
if (this.allowTextInput) {
try {
int i = Integer.parseInt(rawContent);
if (1 <= i && i <= this.pages && i != pageNum) {
return this.isValidUser(mre.getAuthor(), mre.getGuild());
}
} catch (NumberFormatException var7) {
}
}
}
return false;
}
}, (event) -> {
if (event instanceof MessageReactionAddEvent) {
this.handleMessageReactionAddAction((MessageReactionAddEvent) event, message, pageNum);
} else {
MessageReceivedEvent mre = (MessageReceivedEvent) event;
String rawContent = mre.getMessage().getContentRaw().trim();
int targetPage;
if (this.leftText == null || !rawContent.equalsIgnoreCase(this.leftText) || 1 >= pageNum && !this.wrapPageEnds) {
if (this.rightText == null || !rawContent.equalsIgnoreCase(this.rightText) || pageNum >= this.pages && !this.wrapPageEnds) {
targetPage = Integer.parseInt(rawContent);
} else {
targetPage = pageNum + 1 > this.pages && this.wrapPageEnds ? 1 : pageNum + 1;
}
} else {
targetPage = pageNum - 1 < 1 && this.wrapPageEnds ? this.pages : pageNum - 1;
}
message.editMessage(this.renderPage(targetPage)).queue((m) -> {
this.pagination(m, targetPage);
});
mre.getMessage().delete().queue((v) -> {
}, (t) -> {
});
}
}, this.timeout, this.unit, () -> {
this.finalAction.accept(message);
});
}
private void paginationWithoutTextInput(Message message, int pageNum) {
this.waiter.waitForEvent(MessageReactionAddEvent.class, (event) -> {
return this.checkReaction(event, message.getIdLong());
}, (event) -> {
this.handleMessageReactionAddAction(event, message, pageNum);
}, this.timeout, this.unit, () -> {
this.finalAction.accept(message);
});
}
private boolean checkReaction(MessageReactionAddEvent event, long messageId) {
if (event.getMessageIdLong() != messageId) {
return false;
} else {
String emoji = event.getReactionEmote().getName();
switch (emoji) {
case BIG_RIGHT:
case BIG_LEFT:
return this.bulkSkipNumber > 1 && this.isValidUser(event.getUser(), event.getGuild());
case LEFT:
case RIGHT:
case STOP:
case SUBSCRIBE:
case UNSUBSCRIBE:
case MENTION:
case DELETE:
case REMOVE_MENTION:
case CHANGE_MENTION_LEVEL:
case CHANGE_MSG_LEVEL:
return this.isValidUser(event.getUser(), event.getGuild());
default:
return false;
}
}
}
private void handleMessageReactionAddAction(MessageReactionAddEvent event, Message message, int pageNum) {
int newPageNum = pageNum;
int i;
String url1 = Optional.ofNullable(embedBuilders.get(pageNum - 1).build()).map(MessageEmbed::getAuthor).map(MessageEmbed.AuthorInfo::getUrl).orElse("");
String[] args = ParseUtil.parseUrl(url1);
String emoji = event.getReaction().getReactionEmote().getName();
switch (emoji) {
case LEFT:
if (pageNum == 1 && this.wrapPageEnds) {
newPageNum = this.pages + 1;
}
if (newPageNum > 1) {
--newPageNum;
}
break;
case RIGHT:
if (pageNum == this.pages && this.wrapPageEnds) {
newPageNum = 0;
}
if (newPageNum < this.pages) {
++newPageNum;
}
break;
case BIG_LEFT:
if (pageNum > 1 || this.wrapPageEnds) {
for (i = 1; (newPageNum > 1 || this.wrapPageEnds) && i < this.bulkSkipNumber; ++i) {
if (newPageNum == 1 && this.wrapPageEnds) {
newPageNum = this.pages + 1;
}
--newPageNum;
}
}
break;
case BIG_RIGHT:
if (pageNum < this.pages || this.wrapPageEnds) {
for (i = 1; (newPageNum < this.pages || this.wrapPageEnds) && i < this.bulkSkipNumber; ++i) {
if (newPageNum == this.pages && this.wrapPageEnds) {
newPageNum = 0;
}
++newPageNum;
}
}
break;
case SUBSCRIBE:
if (args.length == 2) {
switch (bot.getObManager().subscribe(event.getChannel().getId(), args[0], args[1])) {
case SUCCESSED:
EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll();
embedBuilders.set(pageNum - 1, mb);
break;
case ALREADY_SUBSCRIBED:
break;
case INVALID_USER:
event.getChannel().sendMessage("订阅的用户**" + args[0] + "@" + args[1] + "**不存在").queue();
case FAILED:
event.getChannel().sendMessage("订阅**" + args[0] + "@" + args[1] + "**失败").queue();
break;
default:
event.getChannel().sendMessage("订阅**" + args[0] + "@" + args[1] + "**结果未知").queue();
}
}
break;
case UNSUBSCRIBE:
if (args.length == 2)
switch (bot.getObManager().unsubscribe(event.getChannel().getId(), args[0], args[1])) {
case SUCCESSED:
EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll();
embedBuilders.set(pageNum - 1, mb);
break;
case ALREADY_UNSUBSCRIBED:
break;
case FAILED:
event.getChannel().sendMessage("取消订阅**" + args[0] + "@" + args[1] + "**失败").queue();
break;
default:
event.getChannel().sendMessage("取消订阅**" + args[0] + "@" + args[1] + "**结果未知").queue();
}
break;
case DELETE:
if (args.length == 2)
switch (bot.getObManager().deleteObserver(event.getChannel().getId(), args[0], args[1])) {
case SUCCESSED:
embedBuilders.set(newPageNum - 1, new EmbedBuilder().setDescription("deleted").addBlankField(false).addBlankField(false));
break;
case ALREADY_DELETED:
break;
case FAILED:
event.getChannel().sendMessage("删除**" + args[0] + "@" + args[1] + "**失败").queue();
break;
default:
event.getChannel().sendMessage("删除**" + args[0] + "@" + args[1] + "**结果未知").queue();
}
break;
case MENTION:
if (args.length == 2)
switch (bot.getObManager().addMention(event.getChannel().getId(), args[0], args[1], event.getUser().getAsMention())) {
case SUCCESSED:
EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll();
embedBuilders.set(pageNum - 1, mb);
break;
case OBSERVER_NOT_FOUND:
event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**没有找到直播间").queue();
break;
case ALREADY_EXISTS_MENTIONS:
break;
default:
event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**结果未知").queue();
}
break;
case REMOVE_MENTION:
if (args.length == 2)
switch (bot.getObManager().removeMention(event.getChannel().getId(), args[0], args[1], event.getUser().getAsMention())) {
case SUCCESSED:
EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll();
embedBuilders.set(pageNum - 1, mb);
break;
case OBSERVER_NOT_FOUND:
event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**没有找到直播间").queue();
break;
case ALREADY_REMOVED_MENTIONS:
break;
default:
event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**结果未知").queue();
}
break;
case CHANGE_MENTION_LEVEL:
if(args.length==2)
switch (bot.getObManager().changeMentionLevel(event.getChannel().getId(), args[0], args[1])){
case SUCCESSED:
EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll();
embedBuilders.set(pageNum - 1, mb);
break;
case OBSERVER_NOT_FOUND:
event.getChannel().sendMessage("要设置@提醒等级的**" + args[0] + "@" + args[1] + "**直播间不存在").queue();
break;
default:
event.getChannel().sendMessage("设置提醒等级结果未知").queue();
break;
}
break;
case CHANGE_MSG_LEVEL:
if(args.length==2)
switch (bot.getObManager().changeMessageLevel(event.getChannel().getId(), args[0], args[1])){
case SUCCESSED:
EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll();
embedBuilders.set(pageNum - 1, mb);
break;
case OBSERVER_NOT_FOUND:
event.getChannel().sendMessage("要设置订阅等级的**" + args[0] + "@" + args[1] + "**直播间不存在").queue();
break;
default:
event.getChannel().sendMessage("设置订阅等级结果未知").queue();
break;
}
break;
case STOP:
this.finalAction.accept(message);
return;
}
try {
event.getReaction().removeReaction(event.getUser()).queue();
} catch (PermissionException var8) {
}
int finalNewPageNum = newPageNum;
message.editMessage(this.renderPage(newPageNum)).queue((m) -> {
this.pagination(m, finalNewPageNum);
});
}
private Message renderPage(int pageNum) {
MessageBuilder mbuilder = new MessageBuilder();
EmbedBuilder emb = embedBuilders.get(pageNum - 1);
mbuilder.setEmbed(emb.build());
mbuilder.setContent("Page " + pageNum + "/" + this.pages);
return mbuilder.build();
}
private Message renderPageLoading(int pageNum) {
MessageBuilder mbuilder = new MessageBuilder();
EmbedBuilder emb = embedBuilders.get(pageNum - 1);
mbuilder.setEmbed(emb.build());
mbuilder.setContent("\uD83D\uDEABLoading...");
return mbuilder.build();
}
public static class Builder extends com.jagrosh.jdautilities.menu.Menu.Builder<Paginator.Builder, Paginator> {
private BiFunction<Integer, Integer, Color> color = (page, pages) -> {
return null;
};
private BiFunction<Integer, Integer, String> text = (page, pages) -> {
return null;
};
private Consumer<Message> finalAction = (m) -> {
m.delete().queue();
};
private int columns = 1;
private int itemsPerPage = 1;
private boolean showPageNumbers = true;
private boolean numberItems = false;
private boolean waitOnSinglePage = false;
private int bulkSkipNumber = 1;
private boolean wrapPageEnds = false;
private String textToLeft = null;
private String textToRight = null;
private boolean allowTextInput = false;
private Bot bot;
private final List<EmbedBuilder> embedBuilders = new ArrayList<>();
public Builder() {
}
public Paginator build() {
Checks.check(this.waiter != null, "Must set an EventWaiter");
Checks.check(!this.embedBuilders.isEmpty(), "Must include at least one item to paginate");
return new Paginator(this.waiter, this.users, this.roles, this.timeout, this.unit, this.color, this.text, this.finalAction, this.columns, this.itemsPerPage, this.showPageNumbers, this.numberItems, this.embedBuilders, this.waitOnSinglePage, this.bulkSkipNumber, this.wrapPageEnds, this.textToLeft, this.textToRight, this.allowTextInput, this.bot);
}
public Paginator.Builder setColor(Color color) {
this.color = (i0, i1) -> {
return color;
};
return this;
}
public Paginator.Builder setColor(BiFunction<Integer, Integer, Color> colorBiFunction) {
this.color = colorBiFunction;
return this;
}
public Paginator.Builder setText(String text) {
this.text = (i0, i1) -> {
return text;
};
return this;
}
public Paginator.Builder setText(BiFunction<Integer, Integer, String> textBiFunction) {
this.text = textBiFunction;
return this;
}
public Paginator.Builder setBot(Bot bot) {
this.bot = bot;
return this;
}
public Paginator.Builder setFinalAction(Consumer<Message> finalAction) {
this.finalAction = finalAction;
return this;
}
public Paginator.Builder setColumns(int columns) {
if (columns >= 1 && columns <= 3) {
this.columns = columns;
return this;
} else {
throw new IllegalArgumentException("Only 1, 2, or 3 columns are supported");
}
}
public Paginator.Builder setItemsPerPage(int num) {
throw new UnsupportedOperationException("只能显示一页");
}
public Paginator.Builder useNumberedItems(boolean number) {
this.numberItems = number;
return this;
}
public Paginator.Builder waitOnSinglePage(boolean wait) {
this.waitOnSinglePage = wait;
return this;
}
public Paginator.Builder clearItems() {
this.embedBuilders.clear();
return this;
}
public Paginator.Builder addItems(List<EmbedBuilder> items) {
this.embedBuilders.addAll(items);
return this;
}
public Paginator.Builder setItems(List<EmbedBuilder> items) {
this.embedBuilders.clear();
this.embedBuilders.addAll(items);
return this;
}
public Paginator.Builder setBulkSkipNumber(int bulkSkipNumber) {
this.bulkSkipNumber = Math.max(bulkSkipNumber, 1);
return this;
}
public Paginator.Builder wrapPageEnds(boolean wrapPageEnds) {
this.wrapPageEnds = wrapPageEnds;
return this;
}
public Paginator.Builder allowTextInput(boolean allowTextInput) {
this.allowTextInput = allowTextInput;
return this;
}
public Paginator.Builder setLeftRightText(String left, String right) {
if (left != null && right != null) {
this.textToLeft = left;
this.textToRight = right;
} else {
this.textToLeft = null;
this.textToRight = null;
}
return this;
}
}
}
| [
"[email protected]"
] | |
d454fd5724815d6b51522c0ea6160acf61aa20c4 | 0ad97ad8013d56b8c8d249e3f9f45ea5338f5a65 | /src/test/java/com/twitty/TwittyServerApplicationTests.java | 03a2f4ba02135aa42cd41ff850b86dce98bf661e | [] | no_license | jiaguofang/twitty-server | 8e5325f398c02b0f9530400d4f1bf2ff8b849cd6 | 9b915079e583d924f2f0306be12a7c79353fa8b5 | refs/heads/master | 2021-01-24T19:10:32.917671 | 2016-11-11T21:01:27 | 2016-11-11T21:01:27 | 73,433,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.twitty;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class TwittyServerApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
a3f19e1c9ef331445e469f14bd9cb91548fd8c5b | 9ffea92d95afee2f6e6fb21afaa8dd2aba6348d1 | /src/main/java/org/futuredev/workbench/math/RelevantSearch.java | a22235aaee6e514cbbec217ccaeee9805e86cee6 | [] | no_license | ImDeJay/Workbench | 81ba74fc6943978f6160572947918f2eb2edb0c4 | e28ba88e8284e811de61221e219d5b9229238c5d | refs/heads/master | 2021-01-20T16:35:09.670772 | 2014-01-14T00:35:47 | 2014-01-14T00:35:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,462 | java | package org.futuredev.workbench.math;
import java.util.Arrays;
import java.util.List;
/**
* A very basic relevancy booster for the QWERTY keyboard.
*
* For example, "block-craft" and "block-shift"
* both have a Levenshtein distance of 3 from "block-swfrt",
* but the user probably wants "block-shift", not "block-craft".
*
* @author afistofirony
*/
public class RelevantSearch {
public RelevantSearch (String input, String... possibilities) {
this (input, Arrays.asList(possibilities));
}
public RelevantSearch (String input, List<String> possibilities) {
}
private int relevancy (String original, String a) {
int dist = 0;
Levenshtein lev = new Levenshtein(original.toLowerCase(), a.toLowerCase());
if (lev.getDistance() == 0)
return 0;
for (int i = 0; i < original.length() && i < a.length(); ++i) {
Alphabet at = Alphabet.match(a.charAt(i));
Alphabet or = Alphabet.match(original.charAt(i));
if (at != or)
dist += or.getDistance(at);
}
return 0;
}
enum Alphabet {
A ('a', 'A', 1, 2), B ('b', 'B', 5, 3), C ('c', 'C', 3, 3),
D ('d', 'D', 3, 2), E ('e', 'E', 3, 1), F ('f', 'F', 4, 2),
G ('g', 'G', 5, 2), H ('h', 'H', 6, 2), I ('i', 'I', 8, 1),
J ('j', 'J', 7, 2), K ('k', 'K', 8, 2), L ('l', 'L', 9, 2),
M ('m', 'M', 7, 3), N ('n', 'N', 6, 3), O ('o', 'O', 9, 1),
P ('p', 'P', 10, 1), Q ('q', 'Q', 1, 1), R ('r', 'R', 4, 1),
S ('s', 'S', 2, 2), T ('t', 'T', 5, 1), U ('u', 'U', 7, 1),
V ('v', 'V', 4, 3), W ('w', 'W', 2, 1), X ('x', 'X', 2, 3),
Y ('y', 'Y', 6, 1), Z ('z', 'Z', 1, 3);
final char lowercase, uppercase;
final int x, y;
Alphabet (char lc, char uc, int x, int y) {
this.lowercase = lc;
this.uppercase = uc;
this.x = x;
this.y = y;
}
public static Alphabet match (char value) {
for (Alphabet a : Alphabet.values())
if (a.lowercase == value || a.uppercase == value)
return a;
return null;
}
public double getDistance (Alphabet other) {
return Math.abs(Math.sqrt(x + y) - Math.sqrt(other.x - other.y));
}
public double getDistance (char other) {
return getDistance(match(other));
}
}
} | [
"[email protected]"
] | |
1368e63b7f01526c5c423e28c169d1db11cc26f0 | 9e4b875853b5e71bb9c3d2346b6d7b5607d6a337 | /app/src/main/java/com/mofanstore/base/BaseFragment.java | 548ed8b20c60cff34e6f12ca2e8c2022c8c12e7b | [] | no_license | RenVeCf/mofanstore | 18dcbce28c8b75445e965432f40148cc60d8902b | b69fec648451494c79e5eaed64875e8852cf9842 | refs/heads/master | 2020-08-03T13:18:42.860680 | 2019-09-30T03:10:55 | 2019-09-30T03:10:55 | 211,765,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,287 | java | package com.mofanstore.base;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.mofanstore.R;
import butterknife.ButterKnife;
public abstract class BaseFragment extends Fragment {
/***封装toast对象**/
private static Toast toast;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(intiLayout(),null);
ButterKnife.inject(this, view);
return view;
}
/**
* 绑定布局
* @return
*/
protected abstract int intiLayout();
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initView();
}
/**
* 初始化组件
*/
protected abstract void initView();
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
initData();
}
/**
* 设置数据等逻辑代码
*/
protected abstract void initData();
/**
* 显示长toast
* @param msg
*/
public void toastLong(String msg){
View layout = LayoutInflater.from(getActivity()).inflate(R.layout.activity_toast, null);
TextView nam_tos = (TextView) layout.findViewById(R.id.nam_tos);
nam_tos.setText(msg);
if (toast == null) {
//context.getApplicationContext()取代context也是为了防止内存泄露
toast = new Toast(this.getActivity());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_SHORT);
toast.setView(layout);
toast.show();
} else {
toast.setView(layout);
toast.show();
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.reset(this);
}
}
| [
"[email protected]"
] | |
629a5b246d4ba25703dc4dd44f472e9f6fcc4f73 | 2a662cfdf91e0cded6b9d272cbcea8a2d4377d4c | /Matrix Client/src/main/java/com/jagex/Exception_Sub2.java | 00d81e3199cdf040a38b7f40bd4e21f16dab3fbe | [] | no_license | primnoprotogen/718_RS_Build | 38293df71eb08d0cc64bce5e19cc64b46172463a | 84ddd7138d8ea7dede51814e62868696932ec303 | refs/heads/master | 2023-04-04T04:21:25.263022 | 2021-04-20T22:17:11 | 2021-04-20T22:17:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package com.jagex;/* Exception_Sub2 - Decompiled by JODE
* Visit http://jode.sourceforge.net/
*/
public class Exception_Sub2 extends Exception {
public Exception_Sub2(String string) {
super(string);
}
public static int method274(byte i) {
try {
return Class118.anInt1401 * 332512427;
} catch (RuntimeException runtimeexception) {
throw Class346.method4175(runtimeexception, new StringBuilder()
.append("aet.s(").append(')').toString());
}
}
}
| [
"[email protected]"
] | |
bc62f328bdafcb91dfc71bc35474d294afdab502 | 6891eb2524b57128a17fd5bc0a0cfd0f485048c4 | /src/com/mcxtzhang/Chapter4/TestInt2Char.java | b39c23dbadee72eaebe6f31af985175d826974c7 | [
"MIT"
] | permissive | mcxtzhang/TJ-notes | d6a0594405ff5ffea0ea7b2c505300e47a25fe12 | 9454937b53403c70007ba9e0d32c3df61da8bac3 | refs/heads/master | 2020-05-23T08:01:53.213842 | 2019-01-22T09:39:44 | 2019-01-22T09:39:44 | 80,487,759 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 491 | java | package com.mcxtzhang.Chapter4;
/**
* Created by Administrator on 17-2-1.
*/
public class TestInt2Char {
public static void main(String[] arg) {
System.out.println('a');
System.out.println((char) 'a');
System.out.println((int) 'a');
System.out.println('a' + 26);
System.out.println((char) ('a' + 26));
System.out.println((int) 'a' + 26);
// a
// a
// 97
// 123
// {
// 123
}
}
| [
"[email protected]"
] | |
8810baf7d57e5e76162bdbecf24e095c40945561 | c6417ed9b83e7008b20c892d20884b1edb2bab0b | /src/main/java/com/ninjasparrow/app/repository/AuthorityRepository.java | 224de8fe5d37561c1cb8d099d57572ca963be0dd | [] | no_license | prayatna-jain/ninjasparrow | 7808f6b5bf340bcbc08339150f77ca0ddd948250 | 38e62d68c66b115f3493ac008addc519dff00677 | refs/heads/main | 2023-05-14T06:46:48.346004 | 2021-06-13T13:40:18 | 2021-06-13T13:40:18 | 376,509,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package com.ninjasparrow.app.repository;
import com.ninjasparrow.app.domain.Authority;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Spring Data JPA repository for the {@link Authority} entity.
*/
public interface AuthorityRepository extends JpaRepository<Authority, String> {}
| [
"[email protected]"
] | |
04161f1645644865ad6cfac95ccb99d92a7c5431 | 90eb7a131e5b3dc79e2d1e1baeed171684ef6a22 | /sources/p298d/p299a/p300a/p301a/p303y0/p391i/p398z/C7277h.java | 933f52b9f2e1cf607b6bfc61563101587d6e2f46 | [] | no_license | shalviraj/greenlens | 1c6608dca75ec204e85fba3171995628d2ee8961 | fe9f9b5a3ef4a18f91e12d3925e09745c51bf081 | refs/heads/main | 2023-04-20T13:50:14.619773 | 2021-04-26T15:45:11 | 2021-04-26T15:45:11 | 361,799,768 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,151 | java | package p298d.p299a.p300a.p301a.p303y0.p391i.p398z;
import java.util.Collection;
import java.util.Set;
import p298d.p299a.p300a.p301a.p303y0.p304b.C6207k0;
import p298d.p299a.p300a.p301a.p303y0.p304b.C6232q0;
import p298d.p299a.p300a.p301a.p303y0.p312c.p313a.C6257b;
import p298d.p299a.p300a.p301a.p303y0.p331f.C6717d;
import p298d.p334t.C6800r;
import p298d.p344x.p345b.C6862l;
import p298d.p344x.p346c.C6888i;
import p298d.p344x.p346c.C6890k;
/* renamed from: d.a.a.a.y0.i.z.h */
public interface C7277h extends C7282j {
/* renamed from: a */
public static final C7278a f14517a = C7278a.f14518a;
/* renamed from: d.a.a.a.y0.i.z.h$a */
public static final class C7278a {
/* renamed from: a */
public static final /* synthetic */ C7278a f14518a = new C7278a();
/* renamed from: b */
public static final C6862l<C6717d, Boolean> f14519b = C7279a.f14520g;
/* renamed from: d.a.a.a.y0.i.z.h$a$a */
public static final class C7279a extends C6890k implements C6862l<C6717d, Boolean> {
/* renamed from: g */
public static final C7279a f14520g = new C7279a();
public C7279a() {
super(1);
}
public Object invoke(Object obj) {
C6888i.m12438e((C6717d) obj, "it");
return Boolean.TRUE;
}
}
}
/* renamed from: d.a.a.a.y0.i.z.h$b */
public static final class C7280b extends C7281i {
/* renamed from: b */
public static final C7280b f14521b = new C7280b();
public Set<C6717d> getClassifierNames() {
return C6800r.f13715g;
}
public Set<C6717d> getFunctionNames() {
return C6800r.f13715g;
}
public Set<C6717d> getVariableNames() {
return C6800r.f13715g;
}
}
Set<C6717d> getClassifierNames();
Collection<? extends C6232q0> getContributedFunctions(C6717d dVar, C6257b bVar);
Collection<? extends C6207k0> getContributedVariables(C6717d dVar, C6257b bVar);
Set<C6717d> getFunctionNames();
Set<C6717d> getVariableNames();
}
| [
"[email protected]"
] | |
21dbe6647a970afad1b06929d747ba0ffca84c6d | d34361986f820a1316da9d0443643d1cb7996c52 | /SGUWEB/src/ENTIDAD/cargoC.java | 8b76ab0e3f4403aa0e040e891718a5aaeb0e1d1b | [] | no_license | michellOlano/SGUWEB | 40cb65bc6074845bb94c04b8634ef9b37eb53fb2 | fd0343fa30ea88452acddd9ff0a8d9fd38510a56 | refs/heads/master | 2021-05-15T17:01:07.120656 | 2017-10-19T15:34:19 | 2017-10-19T15:34:19 | 107,563,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java |
package ENTIDAD;
import java.io.Serializable;
public class cargoC implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int cargo;
private String descripcion;
private String abreviatura;
private int estadoRegistro;
public cargoC() {
// TODO Auto-generated constructor stub
}
public cargoC( int cargo, String descripcion, String abreviatura, int estadoRegistro) {
this.cargo=cargo;
this.descripcion=descripcion;
this.abreviatura= abreviatura;
this.estadoRegistro=estadoRegistro;
}
public int getCargo() {
return cargo;
}
public void setCargo(int cargo) {
this.cargo = cargo;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public String getAbreviatura() {
return abreviatura;
}
public void setAbreviatura(String abreviatura) {
this.abreviatura = abreviatura;
}
public int getEstadoRegistro() {
return estadoRegistro;
}
public void setEstadoRegistro(int estadoRegistro) {
this.estadoRegistro = estadoRegistro;
}
}
| [
"michell@michell-PC"
] | michell@michell-PC |
3490b12d57aeb7cacabf3d21586f4965dc6daf89 | 793de554237f32ac8fde405b9cfdadf420e00953 | /frontend/Danbi/app/src/main/java/com/example/juhyang/danbi_watering_test/Weather_WeatherToday.java | 2e46a7b4c46a9ef2391d1e9841d4701549d9f337 | [] | no_license | danbi0518/danbi | 1385ab29e760770d2e804fb2005fed3f24fa2721 | 64a64b825edad1a1ae5f7d04c6c979b04b0c6897 | refs/heads/master | 2021-01-10T12:47:53.325647 | 2016-02-20T02:14:46 | 2016-02-20T02:14:46 | 52,131,621 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,837 | java | package com.example.juhyang.danbi_watering_test;
/**
* Created by JuHyang on 2016-02-16.
*/
public class Weather_WeatherToday {
int lat;
int ion;
int temprature;
int cloudy;
int rain;
int snow;
int humidity;
double windSpeed;
String city;
String windDeg;
String mainWeather;
public void setLat(int lat) {
this.lat = lat;
}
public void setIon(int ion) {
this.ion = ion;
}
public void setTemprature(int t) {
this.temprature = t;
}
public void setCloudy(int cloudy) {
this.cloudy = cloudy;
}
public void setCity(String city) {
this.city = city;
}
public void setRain(int rain) {
this.rain = rain;
}
public void setHumidity(int humidity) {
this.humidity = humidity;
}
public void setWindSpeed(double windSpeed) {
this.windSpeed = windSpeed;
}
public void setWindDeg(String windDeg) {
this.windDeg = windDeg;
}
public void setMainWeather(String mainWeather){
this.mainWeather = mainWeather;
}
public void setSnow(int snow){
this.snow = snow;
}
public int getLat() {
return lat;
}
public int getIon() {
return ion;
}
public int getTemprature() {
return temprature;
}
public int getCloudy() {
return cloudy;
}
public String getCity() {
return city;
}
public int getRain() {
return rain;
}
public int getHumidity() {
return humidity;
}
public double getWindSpeed() {
return windSpeed;
}
public String getWindDeg() {
return windDeg;
}
public String getMainWeather(){
return mainWeather;
}
public int getSnow(){
return snow;
}
} | [
"[email protected]"
] | |
6f6d619c12cc8d938cf2717914fb42e41bdf084d | 2336276c546c94c7ca201a74b8592566e72fb292 | /question4.java | a4e0293e4209e4e0ff8f2008f43b80599c9257d1 | [] | no_license | shriya111/java-programming-1 | 87dea31db7b1ed12a5b206ce7d120de37f8201e1 | 978a861b4ef82bfbc9f2d173dd467a8e742644f5 | refs/heads/master | 2022-12-03T06:10:59.095729 | 2020-08-16T18:12:28 | 2020-08-16T18:12:28 | 287,689,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 808 | java | package pro;
import java.util.*;
class Circle{
private double radius = 1.0;
private String color = "red";
double area;
Circle(){
}
Circle(double tempradius){
radius = tempradius;
}
public double getRadius(){
return radius;
}
public double getArea(){
return (Math.PI*radius*radius);
}
}
class assignment4{
public static void main(String[] args) {
Circle circle = new Circle();
Circle circle1 = new Circle(5.0);
System.out.println("Default Radius:" + circle.getRadius());
System.out.println(("Default Area:"+ circle.getArea()));
System.out.println("User Given Radius:" + circle1.getRadius());
System.out.println("User Given Area:" + circle1.getArea());
}
} | [
"[email protected]"
] | |
8bd4f0cdd0407e341f0ab192e3e9f13d902cb686 | 0dc7b5884df384709a2704a8bd7995058f039a4b | /tesuto-drools-services/tesuto-drools-common/src/main/java/org/ccctc/common/droolscommon/model/EngineDTO.java | 64963fb677ae73400d90ab128764c56f43d66e3d | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"EPL-1.0"
] | permissive | apereo-tesuto/tesuto | b1672fc2ebbd4b5d4647ee15e3e4285c8e3dc0be | 90ed26311b1baa15cd90d67bb55e7d4c613bdc53 | refs/heads/master | 2021-10-08T01:02:49.098929 | 2021-09-24T21:22:52 | 2021-09-24T21:22:52 | 218,090,150 | 4 | 3 | Apache-2.0 | 2021-09-24T21:22:53 | 2019-10-28T16:08:04 | null | UTF-8 | Java | false | false | 4,554 | java | /*******************************************************************************
* Copyright © 2019 by California Community Colleges Chancellor's Office
*
* 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.ccctc.common.droolscommon.model;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
public class EngineDTO {
private String artifactId;
private Set<String> categories;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm a z")
private Date created;
private String dataSource;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm a z")
private Date edited;
private Set<String> events;
private String groupId;
private String name;
private String status;
private String version;
public void adjustValuesForStorage() {
name = StringUtils.isBlank(name) ? null : name;
dataSource = StringUtils.isBlank(dataSource) ? null : dataSource;
groupId = StringUtils.isBlank(groupId) ? null : groupId;
artifactId = StringUtils.isBlank(artifactId) ? null : artifactId;
version = StringUtils.isBlank(version) ? null : version;
status = StringUtils.isBlank(status) ? null : status;
}
public void adjustValuesForUI() {
name = name == null ? "" : name;
dataSource = dataSource == null ? "" : dataSource;
groupId = groupId == null ? "" : groupId;
artifactId = artifactId == null ? "" : artifactId;
version = version == null ? "" : version;
status = status == null ? "" : status;
categories = categories == null ?new HashSet<String>() : categories;
events = events == null ?new HashSet<String>() : events;
}
public String getArtifactId() {
return artifactId;
}
public Set<String> getCategories() {
return categories;
}
public Date getCreated() {
return this.created;
}
public String getDataSource() {
return dataSource;
}
public Date getEdited() {
return this.edited;
}
public Set<String> getEvents() {
return events;
}
public String getGroupId() {
return groupId;
}
public String getName() {
return name;
}
public String getStatus() {
return status;
}
public String getVersion() {
return version;
}
public EngineDTO setArtifactId(String artifactId) {
this.artifactId = artifactId;
return this;
}
public void setCategories(Set<String> categories) {
this.categories = categories;
}
public void setCreated(Date created) {
this.created = created;
}
public EngineDTO setDataSource(String dataSource) {
this.dataSource = dataSource;
return this;
}
public void setEdited(Date edited) {
this.edited = edited;
}
public void setEvents(Set<String> events) {
this.events = events;
}
public EngineDTO setGroupId(String groupId) {
this.groupId = groupId;
return this;
}
public EngineDTO setName(String name) {
this.name = name;
return this;
}
public void setStatus(String status) {
this.status = status;
}
public EngineDTO setVersion(String version) {
this.version = version;
return this;
}
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("name:[" + name + "]")
.append(", dataSource:[" + dataSource + "]")
.append(", groupId:[" + groupId + "]")
.append(", artifactId:[" + artifactId + "]")
.append(", version:[" + version + "]")
.append(", status:[" + status + "]");
return buf.toString();
}
}
| [
"[email protected]"
] | |
0c217cd5017b15eb120265c80ffcbf5d2a0adb53 | a937fca0fd7e8ea0414c7a8d724aabef8b15aa9d | /src/Controllers/Controller.java | 6f3e3ac331ec52b960f1f694534d4720db3a8c29 | [] | no_license | Fregoneti/Bot_Alertas | c30f41ffcf9bda477ca96ef1fad828775f8f6a3e | 5b27c0bf647f44dc555f56aabc2a778d90b0c3b9 | refs/heads/master | 2023-04-19T11:34:42.096421 | 2021-05-14T07:49:42 | 2021-05-14T07:49:42 | 367,289,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,385 | java | package Controllers;
import Dao.alertaDao;
import Model.Alerta;
import Utils.ConDB;
import Utils.email;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Calendar;
import java.util.List;
public class Controller {
private static final String USER_NAME = "comunicacion.rioma"; // GMail user name (just the part before "@gmail.com")
private static final String PASSWORD = "Emete01rioma"; // GMail password
private static String articulo;
public static void controlar() throws SQLException, ClassNotFoundException {
Connection con = ConDB.getCon();
Calendar c = Calendar.getInstance();
List<Alerta> alertaDia = alertaDao.getTodasAlertasDia(con);
List<Alerta> alertaMes = alertaDao.getTodasAlertasMes(con);
// List<Alerta> alertaAno = alertaDao.getTodasAlertasAno(con);
//1 DE TODOS LOS MESES
if (5 == (c.get(Calendar.DAY_OF_MONTH))) {
System.out.println("Entro en day");
for (int i = 0; i < alertaDia.size(); i++) {
stock(alertaMes.get(i));
oferta(alertaMes.get(i));
}
}
//LUNES
if (5 == (c.get(Calendar.DAY_OF_WEEK))) {
for (int i = 0; i <= alertaDia.size(); i++) {
stock(alertaDia.get(i));
oferta(alertaDia.get(i));
}
}
}
public static void stock(Alerta a) {
double existencias = 0;
Statement stmt;
ResultSet rs;
String subject = "Alerta de Stock";
String body;
String[] correo;
try {
String consulta = "select xexistencia from imp.pl_existalm where xempresa_id = '" + a.getEmpresaID() + "' and xarticulo_id = '" + a.getArticulo_id() + "' and xalmacen_id = '" + a.getAlmacenID() + "'";
stmt = ConDB.getCon().createStatement();
rs = stmt.executeQuery(consulta);
//INICIO DE INSERCIÓN FILAS
while (rs.next()) {
existencias = rs.getDouble(1);
}
} catch (SQLException | ClassNotFoundException ignored) {
}
articulo = "";
try {
String consulta = "select xdescripcion from imp.pl_articulos where xarticulo_id= '" + a.getArticulo_id() + "'";
stmt = ConDB.getCon().createStatement();
rs = stmt.executeQuery(consulta);
//INICIO DE INSERCIÓN FILAS
while (rs.next()) {
articulo = rs.getString(1);
}
} catch (SQLException | ClassNotFoundException ignored) {
}
switch (a.getCondicion()) {
case ">":
if (a.getCantidad() > existencias) {
body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por debajo de lo especificado '" + a.getCantidad() + "'";
correo = new String[]{a.getEmailTo()};
email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body);
System.out.println("ENVIADO EMAIL");
}
break;
case "<":
if (a.getCantidad() < existencias) {
correo = new String[]{a.getEmailTo()};
body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por encima de lo especificado '" + a.getCantidad() + "'";
email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body);
System.out.println("ENVIADO EMAIL");
}
break;
case ">=":
if (a.getCantidad() >= existencias) {
correo = new String[]{a.getEmailTo()};
body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por debajo o igual de lo especificado '" + a.getCantidad() + "'";
email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body);
System.out.println("ENVIADO EMAIL");
}
break;
case "<=":
if (a.getCantidad() <= existencias) {
correo = new String[]{a.getEmailTo()};
body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por encima o igual de lo especificado '" + a.getCantidad() + "'";
email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body);
System.out.println("ENVIADO EMAIL");
}
break;
}
}
public static void oferta(Alerta a) {
String oferta = "";
Statement stmt;
ResultSet rs;
String subject = "Alerta de Oferta";
String body;
String[] correo;
try {
String consulta = "select p856_cod_abc from imp.pl_articulos where xempresa_id = '" + a.getEmpresaID() + "' and xarticulo_id = '" + a.getArticulo_id() + "'";
stmt = ConDB.getCon().createStatement();
rs = stmt.executeQuery(consulta);
//INICIO DE INSERCIÓN FILAS
while (rs.next()) {
oferta = rs.getString(1);
}
} catch (SQLException | ClassNotFoundException ignored) {
}
articulo = "";
try {
String consulta = "select xdescripcion from imp.pl_articulos where xarticulo_id= '" + a.getArticulo_id() + "'";
stmt = ConDB.getCon().createStatement();
rs = stmt.executeQuery(consulta);
//INICIO DE INSERCIÓN FILAS
while (rs.next()) {
articulo = rs.getString(1);
}
} catch (SQLException | ClassNotFoundException ignored) {
}
switch (oferta) {
case "O":
case "DO":
case "EO":
body = "El articulo " + articulo + " con ID " + a.getArticulo_id() + "está en oferta ";
correo = new String[]{a.getEmailTo()};
email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body);
System.out.println("ENVIADO EMAIL");
break;
}
}
} | [
"[email protected]"
] | |
e1a9c0a572cae936f897d9d33d135db6a9056f6c | edc6c677d5256fe1d4fb2b4617269829f8b5774c | /Stylrite/src/main/java/com/dao/GRNDao.java | b0021ae981732400637081f8ed2a272c8da1061a | [] | no_license | janhaveen/st1 | 12192ac7b149b197dbb53c761849d8d2ad6b0097 | 3606c56505de7ba5ecd6a4268370ce3ea4d6f294 | refs/heads/master | 2022-12-28T04:15:02.868127 | 2019-09-14T14:09:44 | 2019-09-14T14:09:44 | 208,449,442 | 0 | 0 | null | 2022-12-16T08:16:01 | 2019-09-14T14:08:52 | JavaScript | UTF-8 | Java | false | false | 481 | java | package com.dao;
import java.util.List;
import com.pojo.CreateBarCode;
import com.pojo.GRN;
import com.pojo.Order;
import com.pojo.Product;
import com.pojo.GRNItem;
public interface GRNDao
{
public boolean addNewProduct(Product product);
public boolean addNewGRNProduct(GRN grn);
public boolean addNewGRNItem(GRNItem grnItem);
public boolean addNewBarcode(CreateBarCode cBarCode);
public List getAllGRNList();
public List getProductBasedBarcodeList(String grnId);
}
| [
"[email protected]"
] | |
3434388edd25cbe083488c1b69e16eb26d8a1828 | db90da9d516ff4e406a5084be8e09ee813cddd2e | /src/main/java/com/demo/leetcode/回溯算法/Solution988.java | b722887c6835b2acf51b2c54bb1ad45391b833f8 | [] | no_license | goog00/my-algorithm-exercise | 106d7beace94c02ea44dda83a5d716a5198a563c | f5c4e762859826836f80373ace4d30cc0ebde13c | refs/heads/master | 2022-11-22T10:11:51.214353 | 2020-07-09T09:54:42 | 2020-07-09T09:54:42 | 276,077,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,865 | java | package com.demo.leetcode.回溯算法;
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution988 {
static String ans = "~";
public static String smallestFromLeaf(TreeNode root) {
dfs(root,new StringBuilder());
return ans;
}
private static void dfs(TreeNode root,StringBuilder sb){
if(root == null){
return;
}
//数字直接转字符
sb.append((char)('a' + root.val));
if(root.left == null && root.right == null){
//第一次反转sb,获取从叶子节点到根节点顺序的字符串
sb.reverse();
String str = sb.toString();
//第二次反转sb,是把字符串的顺序变更回来,以便下次回溯时使用
sb.reverse();
if(str.compareTo(ans) < 0){
ans = str;
}
}
dfs(root.left,sb);
dfs(root.right,sb);
//回溯,重置状态
sb.deleteCharAt(sb.length()-1);
}
public static void main(String[] args) {
// [0,1,2,3,4,3,4]
//[25,1,3,1,3,0,2]
TreeNode treeNode25 = new TreeNode(25);
TreeNode treeNode1 = new TreeNode(1);
TreeNode treeNode3 = new TreeNode(3);
TreeNode treeNode1_ = new TreeNode(1);
TreeNode treeNode3_ = new TreeNode(3);
TreeNode treeNode0 = new TreeNode(0);
TreeNode treeNode2 = new TreeNode(2);
treeNode25.left = treeNode1;
treeNode25.right = treeNode3;
treeNode1.left = treeNode1_;
treeNode1.right = treeNode3_;
treeNode3.left = treeNode0;
treeNode3.right = treeNode2;
String k = smallestFromLeaf(treeNode25);
System.out.println(k);
}
} | [
"[email protected]"
] | |
4b26ba45eabe4a823457dca7eb76091e3c27c3a8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/20/20_a7d9c7c39a69c160d336e5377e969ed8b379474c/DetectorJDialog/20_a7d9c7c39a69c160d336e5377e969ed8b379474c_DetectorJDialog_s.java | da503d455fb3ac072cad7812242d6659366e24a2 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,140 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* DetectorJDialog.java
*
* Created on Feb 14, 2011, 9:48:28 AM
*/
package org.micromanager.conf;
import java.lang.reflect.InvocationTargetException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
/**
*
* @author karlhoover
*/
public class DetectorJDialog extends javax.swing.JDialog {
public boolean CancelRequest(){
return cancelRequest_;
}
public void ProgressText(final String t){
detectionTextPane_.setText(t);
}
public String ProgressText(){
return detectionTextPane_.getText();
}
private boolean cancelRequest_;
/** Creates new form DetectorJDialog */
public DetectorJDialog(java.awt.Dialog parent, boolean modal) {
super(parent, modal);
initComponents();
cancelRequest_ = false;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
cancelButton_ = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
detectionTextPane_ = new javax.swing.JTextPane();
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});
cancelButton_.setText("Cancel");
cancelButton_.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButton_ActionPerformed(evt);
}
});
jScrollPane2.setViewportView(detectionTextPane_);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(cancelButton_)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 156, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(17, 17, 17)
.add(cancelButton_)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void cancelButton_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButton_ActionPerformed
System.out.print("cancelButton_ActionPerformed");
cancelRequest_ = true;
}//GEN-LAST:event_cancelButton_ActionPerformed
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
cancelRequest_ = false;
}//GEN-LAST:event_formComponentShown
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelButton_;
private javax.swing.JTextPane detectionTextPane_;
private javax.swing.JScrollPane jScrollPane2;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
bec4872b2c246ca0f9e6e9f0321f82c6d08483a7 | 6d60a8adbfdc498a28f3e3fef70366581aa0c5fd | /codebase/selected/1611093.java | 7318f2eea068377328321b08d021767d3d84284c | [] | no_license | rayhan-ferdous/code2vec | 14268adaf9022d140a47a88129634398cd23cf8f | c8ca68a7a1053d0d09087b14d4c79a189ac0cf00 | refs/heads/master | 2022-03-09T08:40:18.035781 | 2022-02-27T23:57:44 | 2022-02-27T23:57:44 | 140,347,552 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,716 | java | package uk.org.toot.midi.sequence;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;
import java.util.Hashtable;
import javax.sound.midi.Track;
import javax.sound.midi.MidiEvent;
import javax.sound.midi.MidiMessage;
import javax.sound.midi.InvalidMidiDataException;
import uk.org.toot.midi.message.PitchMsg;
import uk.org.toot.midi.sequence.edit.Transposable;
import uk.org.toot.midi.sequence.edit.CutPasteable;
import uk.org.toot.swingui.midiui.MidiColor;
import static uk.org.toot.midi.message.MetaMsg.*;
import static uk.org.toot.midi.message.NoteMsg.*;
import static uk.org.toot.midi.misc.Controller.BANK_SELECT;
public class MidiTrack extends BasicTrack implements Transposable, CutPasteable {
/** @supplierCardinality 1 */
protected MidiSequence sequence;
private int program = -1;
private int bank = -1;
private int channel = -1;
private Hashtable<Object, Object> properties;
private PropertyChangeSupport propertyChangeSupport;
public MidiTrack(Track track, MidiSequence sequence) {
super(track);
this.sequence = sequence;
parse();
updateHue(getTrackName());
}
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
public MidiSequence getSequence() {
return sequence;
}
public PropertyChangeSupport getPropertyChangeSupport() {
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);
}
return propertyChangeSupport;
}
public boolean add(MidiEvent event) {
if (super.add(event)) {
parseEvent(event);
return true;
}
return false;
}
private long delayTicks = 0L;
public long getDelayTicks() {
return delayTicks;
}
public void setDelayTicks(long ticks) {
delayTicks = ticks;
}
public MidiEvent get(int index) {
MidiEvent event = super.get(index);
if (delayTicks == 0) return event;
return new MidiEvent(event.getMessage(), event.getTick() + delayTicks);
}
public boolean isDrumTrack() {
return channel == (10 - 1) || channel == (11 - 1);
}
public boolean isMarkerTrack() {
return getTrackName().equals("Marker");
}
public String propertyName(int type) {
switch(type) {
case TEXT:
return "text";
case COPYRIGHT:
return "copyright";
case TRACK_NAME:
return "trackName";
case INSTRUMENT_NAME:
return "instrumentName";
case LYRIC:
return "lyric";
case MARKER:
return "marker";
case CUE_POINT:
return "cuepoint";
case DEVICE_NAME:
return "deviceName";
}
return null;
}
protected void setMetaName(int type, String name) throws InvalidMidiDataException {
String oldName = getMetaName(type);
super.setMetaName(type, name);
getPropertyChangeSupport().firePropertyChange(propertyName(type), oldName, name);
}
public void setTrackName(String name) throws InvalidMidiDataException {
updateHue(name);
super.setTrackName(name);
}
protected void updateHue(String name) {
float hue = isDrumTrack() ? MidiColor.getDrumHue(name) : MidiColor.getPitchedHue(name);
putClientProperty("Hue", new Float(hue));
}
public String getProgramName() {
return "prg. " + program;
}
public int getProgram() {
return this.program;
}
protected MidiEvent getFirstProgramEvent() {
for (int i = 0; i < size() - 1; i++) {
MidiEvent event = get(i);
MidiMessage msg = event.getMessage();
if (isChannel(msg)) {
if (getCommand(msg) == PROGRAM_CHANGE) {
return event;
}
}
}
return null;
}
public void setProgram(int prg) {
if (prg == program) return;
MidiMessage m;
try {
MidiEvent e = getFirstProgramEvent();
if (e != null) {
m = e.getMessage();
setData1(m, prg);
remove(e);
add(e);
} else {
m = createChannel(PROGRAM_CHANGE, channel, prg, 0);
add(new MidiEvent(m, 0));
}
int oldProgram = program;
program = prg;
getPropertyChangeSupport().firePropertyChange("Program", new Integer(oldProgram), new Integer(program));
} catch (InvalidMidiDataException ex) {
ex.printStackTrace();
}
}
public int getBank() {
return bank;
}
protected MidiEvent getFirstBankEvent() {
for (int i = 0; i < size() - 1; i++) {
MidiEvent event = get(i);
MidiMessage msg = event.getMessage();
if (isChannel(msg)) {
if (getCommand(msg) == CONTROL_CHANGE && getData1(msg) == BANK_SELECT) {
return event;
}
}
}
return null;
}
public void setBank(int bank) {
if (bank == this.bank) return;
MidiMessage m;
try {
MidiEvent e = getFirstBankEvent();
if (e != null) {
m = e.getMessage();
setData2(m, bank);
} else {
m = createChannel(CONTROL_CHANGE, channel, BANK_SELECT, bank);
add(new MidiEvent(m, 0));
MidiEvent pce = getFirstProgramEvent();
if (pce != null) {
remove(pce);
add(pce);
}
}
int oldBank = this.bank;
this.bank = bank;
getPropertyChangeSupport().firePropertyChange("Bank", new Integer(oldBank), new Integer(bank));
} catch (InvalidMidiDataException ex) {
ex.printStackTrace();
}
}
public int getChannel() {
return channel;
}
public void changeChannel(int channel) {
for (int i = 0; i < size(); i++) {
try {
MidiEvent ev = get(i);
MidiMessage msg = ev.getMessage();
if (isChannel(msg)) {
int cmd = getCommand(msg);
switch(cmd) {
case CHANNEL_PRESSURE:
case CONTROL_CHANGE:
case NOTE_OFF:
case NOTE_ON:
case PITCH_BEND:
case POLY_PRESSURE:
case PROGRAM_CHANGE:
setChannel(msg, channel);
break;
}
} else if (isMeta(msg)) {
byte[] bytes = getData(msg);
if (getType(msg) == CHANNEL_PREFIX) {
bytes[0] = (byte) channel;
setData(msg, bytes, bytes.length);
}
}
} catch (InvalidMidiDataException ex) {
ex.printStackTrace();
}
}
}
public boolean cut() {
sequence.deleteTrack(this.getTrack());
return true;
}
public boolean paste() {
sequence.addTrack(this);
return true;
}
public boolean transpose(int semitones) {
for (int i = 0; i < size(); i++) {
try {
MidiMessage msg = get(i).getMessage();
if (isPitch(msg)) {
PitchMsg.transpose(msg, semitones);
}
} catch (InvalidMidiDataException ex) {
ex.printStackTrace();
}
}
return true;
}
public List<MidiNote> getMatches(long startTick, int hiValue, long endTick, int loValue) {
return getMatches((long) 0, startTick, hiValue, endTick, loValue);
}
public List<MidiNote> getMatches(long offsetTicks, long startTick, int hiValue, long endTick, int loValue) {
ArrayList<MidiNote> matches = new ArrayList<MidiNote>();
for (int i = 0; i < size(); i++) {
MidiEvent on = get(i);
if (on.getTick() < (startTick - offsetTicks)) continue;
if (on.getTick() > endTick) break;
MidiMessage msg = on.getMessage();
if (isNote(msg)) {
if (isOn(msg)) {
int note = getPitch(msg);
if ((loValue != -1 && note < loValue) || (hiValue != -1 && note > hiValue)) {
continue;
}
for (int j = 1 + i; j < size(); j++) {
MidiEvent off = get(j);
MidiMessage m = off.getMessage();
if (!isNote(m)) continue;
if (!isOff(m)) continue;
if (getPitch(m) != note) continue;
if (off.getTick() < startTick) break;
matches.add(new MidiNote(on, off));
break;
}
}
}
}
return matches;
}
protected void parse() {
for (int i = 0; i < size(); i++) {
parseEvent(get(i));
}
}
protected void parseEvent(MidiEvent ev) {
MidiMessage msg = ev.getMessage();
if (isChannel(msg)) {
int chan = uk.org.toot.midi.message.NoteMsg.getChannel(msg);
if (this.channel < 0) {
this.channel = chan;
} else if (this.channel != chan) {
System.err.println("Track " + getTrackName() + " has more than 1 channel!");
}
switch(getCommand(msg)) {
case PROGRAM_CHANGE:
program = getData1(msg);
break;
case CONTROL_CHANGE:
if (BANK_SELECT == getData1(msg)) {
bank = getData2(msg);
}
break;
}
}
}
public Hashtable<Object, Object> getProperties() {
if (properties == null) {
properties = new Hashtable<Object, Object>();
}
return properties;
}
public final Object getClientProperty(Object key) {
return getProperties().get(key);
}
public void putClientProperty(Object key, Object value) {
getProperties().put(key, value);
}
}
| [
"[email protected]"
] | |
c1561c61ecfa548572e19e32ef16eec95625e725 | df6d22421164340a3c29bb5bce015c9cefbda4f3 | /src/hyFlow/edu/vt/rt/hyflow/benchmark/tm/bst2/$HY$_Proxy_Node.java | 5211430d0e7be1346f5920de680419146b6c3e85 | [] | no_license | junwhan/open_nesting | 07926e351634eadc4115c138728df470c096aee9 | 65df45f7d878b6fbb83e2b8437616f83a45452a4 | refs/heads/master | 2020-04-21T00:59:02.286663 | 2014-01-02T02:47:32 | 2014-01-02T02:47:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,343 | java | package edu.vt.rt.hyflow.benchmark.tm.bst2;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import aleph.comm.Address;
import aleph.dir.DirectoryManager;
import edu.vt.rt.hyflow.HyFlow;
import edu.vt.rt.hyflow.core.dir.control.ControlFlowDirectory;
import edu.vt.rt.hyflow.core.tm.control.ControlContext;
import edu.vt.rt.hyflow.util.io.Logger;
import edu.vt.rt.hyflow.util.network.Network;
public class $HY$_Proxy_Node implements $HY$_INode{
private static final long serialVersionUID = 1L;
DirectoryManager locator;
public $HY$_Proxy_Node() throws RemoteException{
Logger.debug("Creating PROXY");
((ControlFlowDirectory)HyFlow.getLocator()).addProxy(this);
// Install Secrutiy Manager
if (System.getSecurityManager() == null)
System.setSecurityManager ( new RMISecurityManager() );
// Create objects registery
int port = Network.getInstance().getPort()+1000;
Registry registry = null;
try {
Logger.debug("Reg: " + port);
registry = LocateRegistry.createRegistry(port);
} catch (RemoteException e) {
e.printStackTrace();
}
// Remove old registered object
try {
UnicastRemoteObject.unexportObject(this, true);
} catch (Exception e) {
Logger.error("RMI unexporting");
}
$HY$_INode stub = ($HY$_INode) UnicastRemoteObject.exportObject(this, 0);
// Bind the remote object's stub in the registry
registry.rebind(Node.class.getName(), stub);
Logger.debug("RMI stub inited");
locator = HyFlow.getLocator();
}
@Override
public void setRightChild(Object id, ControlContext context, String rightId){
Address caller = ((ControlContext)context).getLastExecuter();
Network.linkDelay(true, caller);
ControlContext.getNeighbors(context.getContextId()).add(caller);
((Node)locator.open(context, id, "w")).setRightChild(rightId, context);
}
@Override
public String getRightChild(Object id, ControlContext context){
Address caller = ((ControlContext)context).getLastExecuter();
Network.linkDelay(true, caller);
ControlContext.getNeighbors(context.getContextId()).add(caller);
return ((Node)locator.open(context, id, "r")).getRightChild(context);
}
@Override
public void setLeftChild(Object id, ControlContext context, String leftId){
Address caller = ((ControlContext)context).getLastExecuter();
Network.linkDelay(true, caller);
ControlContext.getNeighbors(context.getContextId()).add(caller);
((Node)locator.open(context, id, "w")).setLeftChild(leftId, context);
}
@Override
public String getLeftChild(Object id, ControlContext context){
Address caller = ((ControlContext)context).getLastExecuter();
Network.linkDelay(true, caller);
ControlContext.getNeighbors(context.getContextId()).add(caller);
return ((Node)locator.open(context, id, "r")).getLeftChild(context);
}
@Override
public Integer getValue(Object id, ControlContext context){
Address caller = ((ControlContext)context).getLastExecuter();
Network.linkDelay(true, caller);
ControlContext.getNeighbors(context.getContextId()).add(caller);
return ((Node)locator.open(context, id, "r")).getValue(context);
}
}
| [
"jkim@gojkim"
] | jkim@gojkim |
7232337c80026cfd2e1414dac881cd0f77eb25e1 | fb043628c7244036a16fdd444860ec4bba56b42d | /app/src/main/java/com/cyanbirds/momo/entity/ApkInfo.java | c5399f1c88be58ecf95f98ad8c1e865e7de5d4c0 | [] | no_license | wybilold1999/MOProject | 0827d50bf3f8a0bf0b8b608a115c4ffae71f0cc7 | cad2ee4d0c773eb239c608a578d64f27b6832223 | refs/heads/master | 2021-01-21T10:19:00.589451 | 2017-09-28T07:43:12 | 2017-09-28T07:43:12 | 91,684,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.cyanbirds.momo.entity;
import java.io.Serializable;
/**
* 作者:wangyb
* 时间:2016/9/27 15:01
* 描述:
*/
public class ApkInfo implements Serializable {
/**apk名字**/
public String apkName;
/**apk大小**/
public String apkSize;
/**apk价格**/
public String apkPrice;
/**apk介绍**/
public String apkIntroduce;
/**apk图片地址**/
public String apkImgUrl;
/**apk下载地址**/
public String apkUrl;
}
| [
"[email protected]"
] | |
bab4f8ac6aa19030d23210b44d344a906dc43b76 | 91d6e8e7200b9973fc4468f648ff43324529ca61 | /src/saxparser/SaxParserController.java | e577db18c978aab2780e454c31e610ef0f99cda6 | [] | no_license | awwilhelm/javasax | 59674f5ab42bc617b3971fc6bd63f16e8b01ec8a | 59d8b7ff32c315c2f61002753886d7544f8daad0 | refs/heads/master | 2021-01-25T14:09:44.173875 | 2018-03-03T03:39:19 | 2018-03-03T03:39:19 | 123,655,895 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,287 | 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 saxparser;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TextArea;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
/**
*
* @author LeBorg
*/
public class SaxParserController implements Initializable {
@FXML
private TextArea textArea;
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
void printNodes(Nodes nodes)
{
for(int i = 0; i < nodes.getNodes().size(); i++) {
//System.out.println(nodes.getNodes().get(i).getContent() + " " + nodes.getNodes().get(i).getIndentationCount());
System.out.println(tabs(nodes.getNodes().get(i).getIndentationCount()) + nodes.getNodes().get(i).getContent());
}
}
String tabs(int count) {
String start="";
for(int i=0; i< count; i++) {
start += "\t";
}
return start;
}
@FXML
private void handleOpen(ActionEvent event) {
FileChooser fileChooser = new FileChooser();
File file = fileChooser.showOpenDialog(textArea.getScene().getWindow());
if (file != null) {
try
{
Nodes nodes = NodeBuilder.load(file);
for(int i = 0; i < nodes.getNodes().size(); i++) {
//System.out.println(nodes.getNodes().get(i).getContent() + " " + nodes.getNodes().get(i).getIndentationCount());
textArea.appendText(tabs(nodes.getNodes().get(i).getIndentationCount()) + nodes.getNodes().get(i).getContent() + "\n");
}
// Course course = NodeBuilder.load(file);
// ArrayList<Student> students = course.getStudents();
// for (Student student : students) {
// textArea.appendText(Integer.toString(student.getId()) + "\n");
// textArea.appendText(student.getPawprint() + "\n");
// textArea.appendText(student.getFirstName() + "\n");
// textArea.appendText(student.getLastName() + "\n");
// textArea.appendText(Double.toString(student.getGrade()) + "\n");
// textArea.appendText("-------------------------\n");
// }
} catch (Exception ex) {
displayExceptionAlert("Exception parsing XML file.", ex);
}
}
}
@FXML
private void handleAbout(ActionEvent event) {
displayAboutAlert();
}
private void displayAboutAlert() {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("About");
alert.setHeaderText("XML DOM Parser Example");
alert.setContentText("This application was developed by Dale Musser for CS4330 at the University of Missouri.");
TextArea textArea = new TextArea("This example illustrates how to parse XML using the DOM.");
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(textArea, 0, 0);
alert.getDialogPane().setExpandableContent(expContent);
alert.showAndWait();
}
private void displayExceptionAlert(String message, Exception ex) {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Exception Dialog");
alert.setHeaderText("Exception!");
alert.setContentText(message);
// Create expandable Exception.
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String exceptionText = sw.toString();
Label label = new Label("The exception stacktrace was:");
TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);
GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(label, 0, 0);
expContent.add(textArea, 0, 1);
// Set expandable Exception into the dialog pane.
alert.getDialogPane().setExpandableContent(expContent);
alert.showAndWait();
}
}
| [
"[email protected]"
] | |
042098b812ed75ac0d25d5ed4add05e85c9e15ee | db2c49a189e13554e73713ed2a69ca887a2ad9f0 | /org.orbit.component.runtime/src/org/orbit/component/runtime/tier4/missioncontrol/service/MissionControlService.java | 6e2c3990031ada25de0c93cf46d2e277658a0e84 | [] | no_license | EngineerBarsik/dev | fa501b6ff58e0b6b263d54d6e85c6d69a323f612 | 81715414de121e1d7cead7d4066d626b095816d6 | refs/heads/master | 2023-02-11T01:20:29.217287 | 2021-01-08T01:14:21 | 2021-01-08T01:14:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 985 | java | package org.orbit.component.runtime.tier4.missioncontrol.service;
import java.util.List;
import org.orbit.component.runtime.model.missioncontrol.Mission;
import org.origin.common.jdbc.ConnectionProvider;
import org.origin.common.rest.server.ServerException;
import org.origin.common.service.AccessTokenProvider;
import org.origin.common.service.IWebService;
/**
*
* @author <a href="mailto:[email protected]">Yang Yang</a>
*
*/
public interface MissionControlService extends IWebService, ConnectionProvider, AccessTokenProvider {
List<Mission> getMissions(String typeId) throws ServerException;
Mission getMission(String typeId, String name) throws ServerException;
Mission createMission(String typeId, String name) throws ServerException;
boolean startMission(String typeId, String name) throws ServerException;
boolean stopMission(String typeId, String name) throws ServerException;
boolean deleteMission(String typeId, String name) throws ServerException;
}
| [
"[email protected]"
] | |
71c05115b5076b9be0b3411e07c1496ee17c068f | 39813f3f72913172d1d68f9b4b4009368f027294 | /java8/src/main/java/dev/o1c/modern/chacha20/ChaCha20.java | 2d2a582d27da7df545feee2bf69b4e0b0805bdae | [
"ISC"
] | permissive | rucko24/o1c | 88282ebcfa01b0472e92017975a9701b188515a3 | b180abdb23906c5666b8a27c4e9b4cbe5f0cecae | refs/heads/main | 2023-02-10T01:29:34.487308 | 2021-01-04T05:06:52 | 2021-01-04T05:06:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,158 | java | /*
* ISC License
*
* Copyright (c) 2021, Matt Sicker
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* SPDX-License-Identifier: ISC
*/
package dev.o1c.modern.chacha20;
class ChaCha20 {
/**
* Performs an in-place ChaCha20 permutation on the provided state array.
*
* @param state length 16 array of internal state decoded from a little endian byte array
*/
static void permute(int[] state) {
for (int i = 0; i < 10; i++) {
columnRound(state);
diagonalRound(state);
}
}
private static void columnRound(int[] state) {
quarterRound(state, 0, 4, 8, 12);
quarterRound(state, 1, 5, 9, 13);
quarterRound(state, 2, 6, 10, 14);
quarterRound(state, 3, 7, 11, 15);
}
private static void diagonalRound(int[] state) {
quarterRound(state, 0, 5, 10, 15);
quarterRound(state, 1, 6, 11, 12);
quarterRound(state, 2, 7, 8, 13);
quarterRound(state, 3, 4, 9, 14);
}
private static void quarterRound(int[] state, int a, int b, int c, int d) {
state[a] += state[b];
state[d] = Integer.rotateLeft(state[d] ^ state[a], 16);
state[c] += state[d];
state[b] = Integer.rotateLeft(state[b] ^ state[c], 12);
state[a] += state[b];
state[d] = Integer.rotateLeft(state[d] ^ state[a], 8);
state[c] += state[d];
state[b] = Integer.rotateLeft(state[b] ^ state[c], 7);
}
}
| [
"[email protected]"
] | |
94dc7ef09a32bb005fe2a5686f02b5b07d88a418 | d6abcce54cefbf6fbc46110649167d6c7cb8935d | /Client/tutorial/java/src/FileSystemService.java | 2a9b73932f255e279e23d7754140ddea8da077eb | [
"Zlib",
"MIT",
"FSFAP",
"Apache-2.0"
] | permissive | daniarherikurniawan/File_System_on_Apache_Thrift | e37a591f257a4602b3284333d18a51a11e27a26e | 6c4772e15b9ef0d48ca673cbc34f1176d759f78e | refs/heads/master | 2021-01-24T09:50:42.715914 | 2016-10-06T07:26:58 | 2016-10-06T07:26:58 | 70,125,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 135,387 | java | /**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package file_system_viewer;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-06")
public class FileSystemService {
public interface Iface {
public String DIR(String path) throws org.apache.thrift.TException;
public String CREATEDIR(String path, String nama_dir) throws org.apache.thrift.TException;
public String GETFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException;
public String PUTFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void DIR(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void CREATEDIR(String path, String nama_dir, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void GETFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void PUTFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public String DIR(String path) throws org.apache.thrift.TException
{
send_DIR(path);
return recv_DIR();
}
public void send_DIR(String path) throws org.apache.thrift.TException
{
DIR_args args = new DIR_args();
args.setPath(path);
sendBase("DIR", args);
}
public String recv_DIR() throws org.apache.thrift.TException
{
DIR_result result = new DIR_result();
receiveBase(result, "DIR");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DIR failed: unknown result");
}
public String CREATEDIR(String path, String nama_dir) throws org.apache.thrift.TException
{
send_CREATEDIR(path, nama_dir);
return recv_CREATEDIR();
}
public void send_CREATEDIR(String path, String nama_dir) throws org.apache.thrift.TException
{
CREATEDIR_args args = new CREATEDIR_args();
args.setPath(path);
args.setNama_dir(nama_dir);
sendBase("CREATEDIR", args);
}
public String recv_CREATEDIR() throws org.apache.thrift.TException
{
CREATEDIR_result result = new CREATEDIR_result();
receiveBase(result, "CREATEDIR");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CREATEDIR failed: unknown result");
}
public String GETFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException
{
send_GETFILE(path, nama_file, path_lokal);
return recv_GETFILE();
}
public void send_GETFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException
{
GETFILE_args args = new GETFILE_args();
args.setPath(path);
args.setNama_file(nama_file);
args.setPath_lokal(path_lokal);
sendBase("GETFILE", args);
}
public String recv_GETFILE() throws org.apache.thrift.TException
{
GETFILE_result result = new GETFILE_result();
receiveBase(result, "GETFILE");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GETFILE failed: unknown result");
}
public String PUTFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException
{
send_PUTFILE(path, nama_file, path_lokal);
return recv_PUTFILE();
}
public void send_PUTFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException
{
PUTFILE_args args = new PUTFILE_args();
args.setPath(path);
args.setNama_file(nama_file);
args.setPath_lokal(path_lokal);
sendBase("PUTFILE", args);
}
public String recv_PUTFILE() throws org.apache.thrift.TException
{
PUTFILE_result result = new PUTFILE_result();
receiveBase(result, "PUTFILE");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "PUTFILE failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void DIR(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
DIR_call method_call = new DIR_call(path, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class DIR_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
public DIR_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("DIR", org.apache.thrift.protocol.TMessageType.CALL, 0));
DIR_args args = new DIR_args();
args.setPath(path);
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_DIR();
}
}
public void CREATEDIR(String path, String nama_dir, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
CREATEDIR_call method_call = new CREATEDIR_call(path, nama_dir, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class CREATEDIR_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private String nama_dir;
public CREATEDIR_call(String path, String nama_dir, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.nama_dir = nama_dir;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CREATEDIR", org.apache.thrift.protocol.TMessageType.CALL, 0));
CREATEDIR_args args = new CREATEDIR_args();
args.setPath(path);
args.setNama_dir(nama_dir);
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_CREATEDIR();
}
}
public void GETFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
GETFILE_call method_call = new GETFILE_call(path, nama_file, path_lokal, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class GETFILE_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private String nama_file;
private String path_lokal;
public GETFILE_call(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.nama_file = nama_file;
this.path_lokal = path_lokal;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GETFILE", org.apache.thrift.protocol.TMessageType.CALL, 0));
GETFILE_args args = new GETFILE_args();
args.setPath(path);
args.setNama_file(nama_file);
args.setPath_lokal(path_lokal);
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_GETFILE();
}
}
public void PUTFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
PUTFILE_call method_call = new PUTFILE_call(path, nama_file, path_lokal, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class PUTFILE_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private String nama_file;
private String path_lokal;
public PUTFILE_call(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.nama_file = nama_file;
this.path_lokal = path_lokal;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("PUTFILE", org.apache.thrift.protocol.TMessageType.CALL, 0));
PUTFILE_args args = new PUTFILE_args();
args.setPath(path);
args.setNama_file(nama_file);
args.setPath_lokal(path_lokal);
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_PUTFILE();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("DIR", new DIR());
processMap.put("CREATEDIR", new CREATEDIR());
processMap.put("GETFILE", new GETFILE());
processMap.put("PUTFILE", new PUTFILE());
return processMap;
}
public static class DIR<I extends Iface> extends org.apache.thrift.ProcessFunction<I, DIR_args> {
public DIR() {
super("DIR");
}
public DIR_args getEmptyArgsInstance() {
return new DIR_args();
}
protected boolean isOneway() {
return false;
}
public DIR_result getResult(I iface, DIR_args args) throws org.apache.thrift.TException {
DIR_result result = new DIR_result();
result.success = iface.DIR(args.path);
return result;
}
}
public static class CREATEDIR<I extends Iface> extends org.apache.thrift.ProcessFunction<I, CREATEDIR_args> {
public CREATEDIR() {
super("CREATEDIR");
}
public CREATEDIR_args getEmptyArgsInstance() {
return new CREATEDIR_args();
}
protected boolean isOneway() {
return false;
}
public CREATEDIR_result getResult(I iface, CREATEDIR_args args) throws org.apache.thrift.TException {
CREATEDIR_result result = new CREATEDIR_result();
result.success = iface.CREATEDIR(args.path, args.nama_dir);
return result;
}
}
public static class GETFILE<I extends Iface> extends org.apache.thrift.ProcessFunction<I, GETFILE_args> {
public GETFILE() {
super("GETFILE");
}
public GETFILE_args getEmptyArgsInstance() {
return new GETFILE_args();
}
protected boolean isOneway() {
return false;
}
public GETFILE_result getResult(I iface, GETFILE_args args) throws org.apache.thrift.TException {
GETFILE_result result = new GETFILE_result();
result.success = iface.GETFILE(args.path, args.nama_file, args.path_lokal);
return result;
}
}
public static class PUTFILE<I extends Iface> extends org.apache.thrift.ProcessFunction<I, PUTFILE_args> {
public PUTFILE() {
super("PUTFILE");
}
public PUTFILE_args getEmptyArgsInstance() {
return new PUTFILE_args();
}
protected boolean isOneway() {
return false;
}
public PUTFILE_result getResult(I iface, PUTFILE_args args) throws org.apache.thrift.TException {
PUTFILE_result result = new PUTFILE_result();
result.success = iface.PUTFILE(args.path, args.nama_file, args.path_lokal);
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
processMap.put("DIR", new DIR());
processMap.put("CREATEDIR", new CREATEDIR());
processMap.put("GETFILE", new GETFILE());
processMap.put("PUTFILE", new PUTFILE());
return processMap;
}
public static class DIR<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, DIR_args, String> {
public DIR() {
super("DIR");
}
public DIR_args getEmptyArgsInstance() {
return new DIR_args();
}
public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<String>() {
public void onComplete(String o) {
DIR_result result = new DIR_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
DIR_result result = new DIR_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, DIR_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
iface.DIR(args.path,resultHandler);
}
}
public static class CREATEDIR<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, CREATEDIR_args, String> {
public CREATEDIR() {
super("CREATEDIR");
}
public CREATEDIR_args getEmptyArgsInstance() {
return new CREATEDIR_args();
}
public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<String>() {
public void onComplete(String o) {
CREATEDIR_result result = new CREATEDIR_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
CREATEDIR_result result = new CREATEDIR_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, CREATEDIR_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
iface.CREATEDIR(args.path, args.nama_dir,resultHandler);
}
}
public static class GETFILE<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, GETFILE_args, String> {
public GETFILE() {
super("GETFILE");
}
public GETFILE_args getEmptyArgsInstance() {
return new GETFILE_args();
}
public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<String>() {
public void onComplete(String o) {
GETFILE_result result = new GETFILE_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
GETFILE_result result = new GETFILE_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, GETFILE_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
iface.GETFILE(args.path, args.nama_file, args.path_lokal,resultHandler);
}
}
public static class PUTFILE<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, PUTFILE_args, String> {
public PUTFILE() {
super("PUTFILE");
}
public PUTFILE_args getEmptyArgsInstance() {
return new PUTFILE_args();
}
public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<String>() {
public void onComplete(String o) {
PUTFILE_result result = new PUTFILE_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
PUTFILE_result result = new PUTFILE_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, PUTFILE_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
iface.PUTFILE(args.path, args.nama_file, args.path_lokal,resultHandler);
}
}
}
public static class DIR_args implements org.apache.thrift.TBase<DIR_args, DIR_args._Fields>, java.io.Serializable, Cloneable, Comparable<DIR_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DIR_args");
private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new DIR_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new DIR_argsTupleSchemeFactory());
}
public String path; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PATH((short)1, "path");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PATH
return PATH;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DIR_args.class, metaDataMap);
}
public DIR_args() {
}
public DIR_args(
String path)
{
this();
this.path = path;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public DIR_args(DIR_args other) {
if (other.isSetPath()) {
this.path = other.path;
}
}
public DIR_args deepCopy() {
return new DIR_args(this);
}
@Override
public void clear() {
this.path = null;
}
public String getPath() {
return this.path;
}
public DIR_args setPath(String path) {
this.path = path;
return this;
}
public void unsetPath() {
this.path = null;
}
/** Returns true if field path is set (has been assigned a value) and false otherwise */
public boolean isSetPath() {
return this.path != null;
}
public void setPathIsSet(boolean value) {
if (!value) {
this.path = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PATH:
if (value == null) {
unsetPath();
} else {
setPath((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PATH:
return getPath();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PATH:
return isSetPath();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof DIR_args)
return this.equals((DIR_args)that);
return false;
}
public boolean equals(DIR_args that) {
if (that == null)
return false;
boolean this_present_path = true && this.isSetPath();
boolean that_present_path = true && that.isSetPath();
if (this_present_path || that_present_path) {
if (!(this_present_path && that_present_path))
return false;
if (!this.path.equals(that.path))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_path = true && (isSetPath());
list.add(present_path);
if (present_path)
list.add(path);
return list.hashCode();
}
@Override
public int compareTo(DIR_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPath()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("DIR_args(");
boolean first = true;
sb.append("path:");
if (this.path == null) {
sb.append("null");
} else {
sb.append(this.path);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class DIR_argsStandardSchemeFactory implements SchemeFactory {
public DIR_argsStandardScheme getScheme() {
return new DIR_argsStandardScheme();
}
}
private static class DIR_argsStandardScheme extends StandardScheme<DIR_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, DIR_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, DIR_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.path != null) {
oprot.writeFieldBegin(PATH_FIELD_DESC);
oprot.writeString(struct.path);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class DIR_argsTupleSchemeFactory implements SchemeFactory {
public DIR_argsTupleScheme getScheme() {
return new DIR_argsTupleScheme();
}
}
private static class DIR_argsTupleScheme extends TupleScheme<DIR_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DIR_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPath()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetPath()) {
oprot.writeString(struct.path);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, DIR_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
}
}
}
}
public static class DIR_result implements org.apache.thrift.TBase<DIR_result, DIR_result._Fields>, java.io.Serializable, Cloneable, Comparable<DIR_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DIR_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new DIR_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new DIR_resultTupleSchemeFactory());
}
public String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DIR_result.class, metaDataMap);
}
public DIR_result() {
}
public DIR_result(
String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public DIR_result(DIR_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public DIR_result deepCopy() {
return new DIR_result(this);
}
@Override
public void clear() {
this.success = null;
}
public String getSuccess() {
return this.success;
}
public DIR_result setSuccess(String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof DIR_result)
return this.equals((DIR_result)that);
return false;
}
public boolean equals(DIR_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(DIR_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("DIR_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class DIR_resultStandardSchemeFactory implements SchemeFactory {
public DIR_resultStandardScheme getScheme() {
return new DIR_resultStandardScheme();
}
}
private static class DIR_resultStandardScheme extends StandardScheme<DIR_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, DIR_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, DIR_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class DIR_resultTupleSchemeFactory implements SchemeFactory {
public DIR_resultTupleScheme getScheme() {
return new DIR_resultTupleScheme();
}
}
private static class DIR_resultTupleScheme extends TupleScheme<DIR_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DIR_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, DIR_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
}
public static class CREATEDIR_args implements org.apache.thrift.TBase<CREATEDIR_args, CREATEDIR_args._Fields>, java.io.Serializable, Cloneable, Comparable<CREATEDIR_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CREATEDIR_args");
private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField NAMA_DIR_FIELD_DESC = new org.apache.thrift.protocol.TField("nama_dir", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new CREATEDIR_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new CREATEDIR_argsTupleSchemeFactory());
}
public String path; // required
public String nama_dir; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PATH((short)1, "path"),
NAMA_DIR((short)2, "nama_dir");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PATH
return PATH;
case 2: // NAMA_DIR
return NAMA_DIR;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NAMA_DIR, new org.apache.thrift.meta_data.FieldMetaData("nama_dir", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CREATEDIR_args.class, metaDataMap);
}
public CREATEDIR_args() {
}
public CREATEDIR_args(
String path,
String nama_dir)
{
this();
this.path = path;
this.nama_dir = nama_dir;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public CREATEDIR_args(CREATEDIR_args other) {
if (other.isSetPath()) {
this.path = other.path;
}
if (other.isSetNama_dir()) {
this.nama_dir = other.nama_dir;
}
}
public CREATEDIR_args deepCopy() {
return new CREATEDIR_args(this);
}
@Override
public void clear() {
this.path = null;
this.nama_dir = null;
}
public String getPath() {
return this.path;
}
public CREATEDIR_args setPath(String path) {
this.path = path;
return this;
}
public void unsetPath() {
this.path = null;
}
/** Returns true if field path is set (has been assigned a value) and false otherwise */
public boolean isSetPath() {
return this.path != null;
}
public void setPathIsSet(boolean value) {
if (!value) {
this.path = null;
}
}
public String getNama_dir() {
return this.nama_dir;
}
public CREATEDIR_args setNama_dir(String nama_dir) {
this.nama_dir = nama_dir;
return this;
}
public void unsetNama_dir() {
this.nama_dir = null;
}
/** Returns true if field nama_dir is set (has been assigned a value) and false otherwise */
public boolean isSetNama_dir() {
return this.nama_dir != null;
}
public void setNama_dirIsSet(boolean value) {
if (!value) {
this.nama_dir = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PATH:
if (value == null) {
unsetPath();
} else {
setPath((String)value);
}
break;
case NAMA_DIR:
if (value == null) {
unsetNama_dir();
} else {
setNama_dir((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PATH:
return getPath();
case NAMA_DIR:
return getNama_dir();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PATH:
return isSetPath();
case NAMA_DIR:
return isSetNama_dir();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CREATEDIR_args)
return this.equals((CREATEDIR_args)that);
return false;
}
public boolean equals(CREATEDIR_args that) {
if (that == null)
return false;
boolean this_present_path = true && this.isSetPath();
boolean that_present_path = true && that.isSetPath();
if (this_present_path || that_present_path) {
if (!(this_present_path && that_present_path))
return false;
if (!this.path.equals(that.path))
return false;
}
boolean this_present_nama_dir = true && this.isSetNama_dir();
boolean that_present_nama_dir = true && that.isSetNama_dir();
if (this_present_nama_dir || that_present_nama_dir) {
if (!(this_present_nama_dir && that_present_nama_dir))
return false;
if (!this.nama_dir.equals(that.nama_dir))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_path = true && (isSetPath());
list.add(present_path);
if (present_path)
list.add(path);
boolean present_nama_dir = true && (isSetNama_dir());
list.add(present_nama_dir);
if (present_nama_dir)
list.add(nama_dir);
return list.hashCode();
}
@Override
public int compareTo(CREATEDIR_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPath()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNama_dir()).compareTo(other.isSetNama_dir());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNama_dir()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nama_dir, other.nama_dir);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("CREATEDIR_args(");
boolean first = true;
sb.append("path:");
if (this.path == null) {
sb.append("null");
} else {
sb.append(this.path);
}
first = false;
if (!first) sb.append(", ");
sb.append("nama_dir:");
if (this.nama_dir == null) {
sb.append("null");
} else {
sb.append(this.nama_dir);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class CREATEDIR_argsStandardSchemeFactory implements SchemeFactory {
public CREATEDIR_argsStandardScheme getScheme() {
return new CREATEDIR_argsStandardScheme();
}
}
private static class CREATEDIR_argsStandardScheme extends StandardScheme<CREATEDIR_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, CREATEDIR_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // NAMA_DIR
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.nama_dir = iprot.readString();
struct.setNama_dirIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, CREATEDIR_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.path != null) {
oprot.writeFieldBegin(PATH_FIELD_DESC);
oprot.writeString(struct.path);
oprot.writeFieldEnd();
}
if (struct.nama_dir != null) {
oprot.writeFieldBegin(NAMA_DIR_FIELD_DESC);
oprot.writeString(struct.nama_dir);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class CREATEDIR_argsTupleSchemeFactory implements SchemeFactory {
public CREATEDIR_argsTupleScheme getScheme() {
return new CREATEDIR_argsTupleScheme();
}
}
private static class CREATEDIR_argsTupleScheme extends TupleScheme<CREATEDIR_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPath()) {
optionals.set(0);
}
if (struct.isSetNama_dir()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPath()) {
oprot.writeString(struct.path);
}
if (struct.isSetNama_dir()) {
oprot.writeString(struct.nama_dir);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
}
if (incoming.get(1)) {
struct.nama_dir = iprot.readString();
struct.setNama_dirIsSet(true);
}
}
}
}
public static class CREATEDIR_result implements org.apache.thrift.TBase<CREATEDIR_result, CREATEDIR_result._Fields>, java.io.Serializable, Cloneable, Comparable<CREATEDIR_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CREATEDIR_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new CREATEDIR_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new CREATEDIR_resultTupleSchemeFactory());
}
public String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CREATEDIR_result.class, metaDataMap);
}
public CREATEDIR_result() {
}
public CREATEDIR_result(
String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public CREATEDIR_result(CREATEDIR_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public CREATEDIR_result deepCopy() {
return new CREATEDIR_result(this);
}
@Override
public void clear() {
this.success = null;
}
public String getSuccess() {
return this.success;
}
public CREATEDIR_result setSuccess(String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CREATEDIR_result)
return this.equals((CREATEDIR_result)that);
return false;
}
public boolean equals(CREATEDIR_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(CREATEDIR_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("CREATEDIR_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class CREATEDIR_resultStandardSchemeFactory implements SchemeFactory {
public CREATEDIR_resultStandardScheme getScheme() {
return new CREATEDIR_resultStandardScheme();
}
}
private static class CREATEDIR_resultStandardScheme extends StandardScheme<CREATEDIR_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, CREATEDIR_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, CREATEDIR_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class CREATEDIR_resultTupleSchemeFactory implements SchemeFactory {
public CREATEDIR_resultTupleScheme getScheme() {
return new CREATEDIR_resultTupleScheme();
}
}
private static class CREATEDIR_resultTupleScheme extends TupleScheme<CREATEDIR_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
}
public static class GETFILE_args implements org.apache.thrift.TBase<GETFILE_args, GETFILE_args._Fields>, java.io.Serializable, Cloneable, Comparable<GETFILE_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GETFILE_args");
private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField NAMA_FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("nama_file", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PATH_LOKAL_FIELD_DESC = new org.apache.thrift.protocol.TField("path_lokal", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new GETFILE_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new GETFILE_argsTupleSchemeFactory());
}
public String path; // required
public String nama_file; // required
public String path_lokal; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PATH((short)1, "path"),
NAMA_FILE((short)2, "nama_file"),
PATH_LOKAL((short)3, "path_lokal");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PATH
return PATH;
case 2: // NAMA_FILE
return NAMA_FILE;
case 3: // PATH_LOKAL
return PATH_LOKAL;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NAMA_FILE, new org.apache.thrift.meta_data.FieldMetaData("nama_file", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PATH_LOKAL, new org.apache.thrift.meta_data.FieldMetaData("path_lokal", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GETFILE_args.class, metaDataMap);
}
public GETFILE_args() {
}
public GETFILE_args(
String path,
String nama_file,
String path_lokal)
{
this();
this.path = path;
this.nama_file = nama_file;
this.path_lokal = path_lokal;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public GETFILE_args(GETFILE_args other) {
if (other.isSetPath()) {
this.path = other.path;
}
if (other.isSetNama_file()) {
this.nama_file = other.nama_file;
}
if (other.isSetPath_lokal()) {
this.path_lokal = other.path_lokal;
}
}
public GETFILE_args deepCopy() {
return new GETFILE_args(this);
}
@Override
public void clear() {
this.path = null;
this.nama_file = null;
this.path_lokal = null;
}
public String getPath() {
return this.path;
}
public GETFILE_args setPath(String path) {
this.path = path;
return this;
}
public void unsetPath() {
this.path = null;
}
/** Returns true if field path is set (has been assigned a value) and false otherwise */
public boolean isSetPath() {
return this.path != null;
}
public void setPathIsSet(boolean value) {
if (!value) {
this.path = null;
}
}
public String getNama_file() {
return this.nama_file;
}
public GETFILE_args setNama_file(String nama_file) {
this.nama_file = nama_file;
return this;
}
public void unsetNama_file() {
this.nama_file = null;
}
/** Returns true if field nama_file is set (has been assigned a value) and false otherwise */
public boolean isSetNama_file() {
return this.nama_file != null;
}
public void setNama_fileIsSet(boolean value) {
if (!value) {
this.nama_file = null;
}
}
public String getPath_lokal() {
return this.path_lokal;
}
public GETFILE_args setPath_lokal(String path_lokal) {
this.path_lokal = path_lokal;
return this;
}
public void unsetPath_lokal() {
this.path_lokal = null;
}
/** Returns true if field path_lokal is set (has been assigned a value) and false otherwise */
public boolean isSetPath_lokal() {
return this.path_lokal != null;
}
public void setPath_lokalIsSet(boolean value) {
if (!value) {
this.path_lokal = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PATH:
if (value == null) {
unsetPath();
} else {
setPath((String)value);
}
break;
case NAMA_FILE:
if (value == null) {
unsetNama_file();
} else {
setNama_file((String)value);
}
break;
case PATH_LOKAL:
if (value == null) {
unsetPath_lokal();
} else {
setPath_lokal((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PATH:
return getPath();
case NAMA_FILE:
return getNama_file();
case PATH_LOKAL:
return getPath_lokal();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PATH:
return isSetPath();
case NAMA_FILE:
return isSetNama_file();
case PATH_LOKAL:
return isSetPath_lokal();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof GETFILE_args)
return this.equals((GETFILE_args)that);
return false;
}
public boolean equals(GETFILE_args that) {
if (that == null)
return false;
boolean this_present_path = true && this.isSetPath();
boolean that_present_path = true && that.isSetPath();
if (this_present_path || that_present_path) {
if (!(this_present_path && that_present_path))
return false;
if (!this.path.equals(that.path))
return false;
}
boolean this_present_nama_file = true && this.isSetNama_file();
boolean that_present_nama_file = true && that.isSetNama_file();
if (this_present_nama_file || that_present_nama_file) {
if (!(this_present_nama_file && that_present_nama_file))
return false;
if (!this.nama_file.equals(that.nama_file))
return false;
}
boolean this_present_path_lokal = true && this.isSetPath_lokal();
boolean that_present_path_lokal = true && that.isSetPath_lokal();
if (this_present_path_lokal || that_present_path_lokal) {
if (!(this_present_path_lokal && that_present_path_lokal))
return false;
if (!this.path_lokal.equals(that.path_lokal))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_path = true && (isSetPath());
list.add(present_path);
if (present_path)
list.add(path);
boolean present_nama_file = true && (isSetNama_file());
list.add(present_nama_file);
if (present_nama_file)
list.add(nama_file);
boolean present_path_lokal = true && (isSetPath_lokal());
list.add(present_path_lokal);
if (present_path_lokal)
list.add(path_lokal);
return list.hashCode();
}
@Override
public int compareTo(GETFILE_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPath()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNama_file()).compareTo(other.isSetNama_file());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNama_file()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nama_file, other.nama_file);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPath_lokal()).compareTo(other.isSetPath_lokal());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPath_lokal()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path_lokal, other.path_lokal);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("GETFILE_args(");
boolean first = true;
sb.append("path:");
if (this.path == null) {
sb.append("null");
} else {
sb.append(this.path);
}
first = false;
if (!first) sb.append(", ");
sb.append("nama_file:");
if (this.nama_file == null) {
sb.append("null");
} else {
sb.append(this.nama_file);
}
first = false;
if (!first) sb.append(", ");
sb.append("path_lokal:");
if (this.path_lokal == null) {
sb.append("null");
} else {
sb.append(this.path_lokal);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class GETFILE_argsStandardSchemeFactory implements SchemeFactory {
public GETFILE_argsStandardScheme getScheme() {
return new GETFILE_argsStandardScheme();
}
}
private static class GETFILE_argsStandardScheme extends StandardScheme<GETFILE_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, GETFILE_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // NAMA_FILE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.nama_file = iprot.readString();
struct.setNama_fileIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // PATH_LOKAL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.path_lokal = iprot.readString();
struct.setPath_lokalIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, GETFILE_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.path != null) {
oprot.writeFieldBegin(PATH_FIELD_DESC);
oprot.writeString(struct.path);
oprot.writeFieldEnd();
}
if (struct.nama_file != null) {
oprot.writeFieldBegin(NAMA_FILE_FIELD_DESC);
oprot.writeString(struct.nama_file);
oprot.writeFieldEnd();
}
if (struct.path_lokal != null) {
oprot.writeFieldBegin(PATH_LOKAL_FIELD_DESC);
oprot.writeString(struct.path_lokal);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class GETFILE_argsTupleSchemeFactory implements SchemeFactory {
public GETFILE_argsTupleScheme getScheme() {
return new GETFILE_argsTupleScheme();
}
}
private static class GETFILE_argsTupleScheme extends TupleScheme<GETFILE_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, GETFILE_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPath()) {
optionals.set(0);
}
if (struct.isSetNama_file()) {
optionals.set(1);
}
if (struct.isSetPath_lokal()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetPath()) {
oprot.writeString(struct.path);
}
if (struct.isSetNama_file()) {
oprot.writeString(struct.nama_file);
}
if (struct.isSetPath_lokal()) {
oprot.writeString(struct.path_lokal);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, GETFILE_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
}
if (incoming.get(1)) {
struct.nama_file = iprot.readString();
struct.setNama_fileIsSet(true);
}
if (incoming.get(2)) {
struct.path_lokal = iprot.readString();
struct.setPath_lokalIsSet(true);
}
}
}
}
public static class GETFILE_result implements org.apache.thrift.TBase<GETFILE_result, GETFILE_result._Fields>, java.io.Serializable, Cloneable, Comparable<GETFILE_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GETFILE_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new GETFILE_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new GETFILE_resultTupleSchemeFactory());
}
public String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GETFILE_result.class, metaDataMap);
}
public GETFILE_result() {
}
public GETFILE_result(
String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public GETFILE_result(GETFILE_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public GETFILE_result deepCopy() {
return new GETFILE_result(this);
}
@Override
public void clear() {
this.success = null;
}
public String getSuccess() {
return this.success;
}
public GETFILE_result setSuccess(String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof GETFILE_result)
return this.equals((GETFILE_result)that);
return false;
}
public boolean equals(GETFILE_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(GETFILE_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("GETFILE_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class GETFILE_resultStandardSchemeFactory implements SchemeFactory {
public GETFILE_resultStandardScheme getScheme() {
return new GETFILE_resultStandardScheme();
}
}
private static class GETFILE_resultStandardScheme extends StandardScheme<GETFILE_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, GETFILE_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, GETFILE_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class GETFILE_resultTupleSchemeFactory implements SchemeFactory {
public GETFILE_resultTupleScheme getScheme() {
return new GETFILE_resultTupleScheme();
}
}
private static class GETFILE_resultTupleScheme extends TupleScheme<GETFILE_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, GETFILE_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, GETFILE_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
}
public static class PUTFILE_args implements org.apache.thrift.TBase<PUTFILE_args, PUTFILE_args._Fields>, java.io.Serializable, Cloneable, Comparable<PUTFILE_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PUTFILE_args");
private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField NAMA_FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("nama_file", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PATH_LOKAL_FIELD_DESC = new org.apache.thrift.protocol.TField("path_lokal", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new PUTFILE_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new PUTFILE_argsTupleSchemeFactory());
}
public String path; // required
public String nama_file; // required
public String path_lokal; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PATH((short)1, "path"),
NAMA_FILE((short)2, "nama_file"),
PATH_LOKAL((short)3, "path_lokal");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PATH
return PATH;
case 2: // NAMA_FILE
return NAMA_FILE;
case 3: // PATH_LOKAL
return PATH_LOKAL;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NAMA_FILE, new org.apache.thrift.meta_data.FieldMetaData("nama_file", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PATH_LOKAL, new org.apache.thrift.meta_data.FieldMetaData("path_lokal", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PUTFILE_args.class, metaDataMap);
}
public PUTFILE_args() {
}
public PUTFILE_args(
String path,
String nama_file,
String path_lokal)
{
this();
this.path = path;
this.nama_file = nama_file;
this.path_lokal = path_lokal;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public PUTFILE_args(PUTFILE_args other) {
if (other.isSetPath()) {
this.path = other.path;
}
if (other.isSetNama_file()) {
this.nama_file = other.nama_file;
}
if (other.isSetPath_lokal()) {
this.path_lokal = other.path_lokal;
}
}
public PUTFILE_args deepCopy() {
return new PUTFILE_args(this);
}
@Override
public void clear() {
this.path = null;
this.nama_file = null;
this.path_lokal = null;
}
public String getPath() {
return this.path;
}
public PUTFILE_args setPath(String path) {
this.path = path;
return this;
}
public void unsetPath() {
this.path = null;
}
/** Returns true if field path is set (has been assigned a value) and false otherwise */
public boolean isSetPath() {
return this.path != null;
}
public void setPathIsSet(boolean value) {
if (!value) {
this.path = null;
}
}
public String getNama_file() {
return this.nama_file;
}
public PUTFILE_args setNama_file(String nama_file) {
this.nama_file = nama_file;
return this;
}
public void unsetNama_file() {
this.nama_file = null;
}
/** Returns true if field nama_file is set (has been assigned a value) and false otherwise */
public boolean isSetNama_file() {
return this.nama_file != null;
}
public void setNama_fileIsSet(boolean value) {
if (!value) {
this.nama_file = null;
}
}
public String getPath_lokal() {
return this.path_lokal;
}
public PUTFILE_args setPath_lokal(String path_lokal) {
this.path_lokal = path_lokal;
return this;
}
public void unsetPath_lokal() {
this.path_lokal = null;
}
/** Returns true if field path_lokal is set (has been assigned a value) and false otherwise */
public boolean isSetPath_lokal() {
return this.path_lokal != null;
}
public void setPath_lokalIsSet(boolean value) {
if (!value) {
this.path_lokal = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PATH:
if (value == null) {
unsetPath();
} else {
setPath((String)value);
}
break;
case NAMA_FILE:
if (value == null) {
unsetNama_file();
} else {
setNama_file((String)value);
}
break;
case PATH_LOKAL:
if (value == null) {
unsetPath_lokal();
} else {
setPath_lokal((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PATH:
return getPath();
case NAMA_FILE:
return getNama_file();
case PATH_LOKAL:
return getPath_lokal();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PATH:
return isSetPath();
case NAMA_FILE:
return isSetNama_file();
case PATH_LOKAL:
return isSetPath_lokal();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof PUTFILE_args)
return this.equals((PUTFILE_args)that);
return false;
}
public boolean equals(PUTFILE_args that) {
if (that == null)
return false;
boolean this_present_path = true && this.isSetPath();
boolean that_present_path = true && that.isSetPath();
if (this_present_path || that_present_path) {
if (!(this_present_path && that_present_path))
return false;
if (!this.path.equals(that.path))
return false;
}
boolean this_present_nama_file = true && this.isSetNama_file();
boolean that_present_nama_file = true && that.isSetNama_file();
if (this_present_nama_file || that_present_nama_file) {
if (!(this_present_nama_file && that_present_nama_file))
return false;
if (!this.nama_file.equals(that.nama_file))
return false;
}
boolean this_present_path_lokal = true && this.isSetPath_lokal();
boolean that_present_path_lokal = true && that.isSetPath_lokal();
if (this_present_path_lokal || that_present_path_lokal) {
if (!(this_present_path_lokal && that_present_path_lokal))
return false;
if (!this.path_lokal.equals(that.path_lokal))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_path = true && (isSetPath());
list.add(present_path);
if (present_path)
list.add(path);
boolean present_nama_file = true && (isSetNama_file());
list.add(present_nama_file);
if (present_nama_file)
list.add(nama_file);
boolean present_path_lokal = true && (isSetPath_lokal());
list.add(present_path_lokal);
if (present_path_lokal)
list.add(path_lokal);
return list.hashCode();
}
@Override
public int compareTo(PUTFILE_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPath()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNama_file()).compareTo(other.isSetNama_file());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNama_file()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nama_file, other.nama_file);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPath_lokal()).compareTo(other.isSetPath_lokal());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPath_lokal()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path_lokal, other.path_lokal);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("PUTFILE_args(");
boolean first = true;
sb.append("path:");
if (this.path == null) {
sb.append("null");
} else {
sb.append(this.path);
}
first = false;
if (!first) sb.append(", ");
sb.append("nama_file:");
if (this.nama_file == null) {
sb.append("null");
} else {
sb.append(this.nama_file);
}
first = false;
if (!first) sb.append(", ");
sb.append("path_lokal:");
if (this.path_lokal == null) {
sb.append("null");
} else {
sb.append(this.path_lokal);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class PUTFILE_argsStandardSchemeFactory implements SchemeFactory {
public PUTFILE_argsStandardScheme getScheme() {
return new PUTFILE_argsStandardScheme();
}
}
private static class PUTFILE_argsStandardScheme extends StandardScheme<PUTFILE_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, PUTFILE_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // NAMA_FILE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.nama_file = iprot.readString();
struct.setNama_fileIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // PATH_LOKAL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.path_lokal = iprot.readString();
struct.setPath_lokalIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, PUTFILE_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.path != null) {
oprot.writeFieldBegin(PATH_FIELD_DESC);
oprot.writeString(struct.path);
oprot.writeFieldEnd();
}
if (struct.nama_file != null) {
oprot.writeFieldBegin(NAMA_FILE_FIELD_DESC);
oprot.writeString(struct.nama_file);
oprot.writeFieldEnd();
}
if (struct.path_lokal != null) {
oprot.writeFieldBegin(PATH_LOKAL_FIELD_DESC);
oprot.writeString(struct.path_lokal);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class PUTFILE_argsTupleSchemeFactory implements SchemeFactory {
public PUTFILE_argsTupleScheme getScheme() {
return new PUTFILE_argsTupleScheme();
}
}
private static class PUTFILE_argsTupleScheme extends TupleScheme<PUTFILE_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, PUTFILE_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPath()) {
optionals.set(0);
}
if (struct.isSetNama_file()) {
optionals.set(1);
}
if (struct.isSetPath_lokal()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetPath()) {
oprot.writeString(struct.path);
}
if (struct.isSetNama_file()) {
oprot.writeString(struct.nama_file);
}
if (struct.isSetPath_lokal()) {
oprot.writeString(struct.path_lokal);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, PUTFILE_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.path = iprot.readString();
struct.setPathIsSet(true);
}
if (incoming.get(1)) {
struct.nama_file = iprot.readString();
struct.setNama_fileIsSet(true);
}
if (incoming.get(2)) {
struct.path_lokal = iprot.readString();
struct.setPath_lokalIsSet(true);
}
}
}
}
public static class PUTFILE_result implements org.apache.thrift.TBase<PUTFILE_result, PUTFILE_result._Fields>, java.io.Serializable, Cloneable, Comparable<PUTFILE_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PUTFILE_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new PUTFILE_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new PUTFILE_resultTupleSchemeFactory());
}
public String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PUTFILE_result.class, metaDataMap);
}
public PUTFILE_result() {
}
public PUTFILE_result(
String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public PUTFILE_result(PUTFILE_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public PUTFILE_result deepCopy() {
return new PUTFILE_result(this);
}
@Override
public void clear() {
this.success = null;
}
public String getSuccess() {
return this.success;
}
public PUTFILE_result setSuccess(String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof PUTFILE_result)
return this.equals((PUTFILE_result)that);
return false;
}
public boolean equals(PUTFILE_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(PUTFILE_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("PUTFILE_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class PUTFILE_resultStandardSchemeFactory implements SchemeFactory {
public PUTFILE_resultStandardScheme getScheme() {
return new PUTFILE_resultStandardScheme();
}
}
private static class PUTFILE_resultStandardScheme extends StandardScheme<PUTFILE_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, PUTFILE_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, PUTFILE_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class PUTFILE_resultTupleSchemeFactory implements SchemeFactory {
public PUTFILE_resultTupleScheme getScheme() {
return new PUTFILE_resultTupleScheme();
}
}
private static class PUTFILE_resultTupleScheme extends TupleScheme<PUTFILE_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, PUTFILE_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, PUTFILE_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
}
}
| [
"[email protected]"
] | |
cb7b4f8f98c21b9697dc75c9d7ad9beef5824a8b | 5ddb95f31c66aee1d4d6db8af28e4cd016e845c9 | /security-browser/src/main/java/com/asule/security/BrowserSecurityConfig.java | 400264f0bb483f51b3c7fe19ac2268d6a97e0051 | [] | no_license | ausle/mysecurity | b5868ec2bed0da66e6dfb650a01849873562ad57 | 2c31496f3d967147500687b917c2def13ee8a917 | refs/heads/master | 2020-03-28T02:51:40.257177 | 2018-09-06T02:09:31 | 2018-09-06T02:09:31 | 147,601,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,064 | java | package com.asule.security;
import com.asule.security.authenticate.mobile.SmsCodeAuthenticationSecurityConfig;
import com.asule.security.handler.AsuleAuthenticationFailureHandler;
import com.asule.security.handler.AsuleAuthenticationSuccessHandler;
import com.asule.security.properties.BaseProperties;
import com.asule.security.validate.filter.ValidateCodeFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl;
import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository;
import org.springframework.social.security.SpringSocialConfigurer;
import javax.sql.DataSource;
@Configuration
public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter{
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private BaseProperties baseProperties;
@Autowired
private AsuleAuthenticationSuccessHandler successHandler;
@Autowired
private AsuleAuthenticationFailureHandler failureHandler;
@Autowired
private ValidateCodeFilter validateCodeFilter;
@Autowired
private DataSource dataSource;
@Autowired
private SmsCodeAuthenticationSecurityConfig smsCodeAuthenticationSecurityConfig;
@Autowired
private SpringSocialConfigurer springSocialConfigurer;
// 配置tokenRepository
@Bean
public PersistentTokenRepository persistentTokenRepository() {
JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
tokenRepository.setDataSource(dataSource);
//会自动创建一张表来记录 token和username
return tokenRepository;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
//loginPage指定登录页面,loginProcessingUrl指定登录提交的表单要经过UsernamePasswordAuthenticationFilter过滤器处理
http.formLogin().loginPage("/authentication/require").loginProcessingUrl("/authentication/form")
//验证通过和验证失败处理的handler
.successHandler(successHandler).failureHandler(failureHandler)
.and()
//配置记住我功能。
.rememberMe()
.tokenRepository(persistentTokenRepository())//配置tokenRepository
.tokenValiditySeconds(baseProperties.getBrowser().getRememberMeSeconds())//记住我的时间
.userDetailsService(userDetailsService)//根据用户名获取用户信息需要的userDetail实现
.and()
.addFilterBefore(validateCodeFilter,UsernamePasswordAuthenticationFilter.class)
.userDetailsService(userDetailsService)
.authorizeRequests()
.antMatchers(
SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_FORM,
SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_MOBILE,
SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX+"/*",
SecurityConstants.DEFAULT_LOGIN_URL,
baseProperties.getBrowser().getLoginPage()).permitAll()//指定页面不需要认证
.anyRequest().authenticated()//任何请求都需要认证
.and()
.csrf().disable()//csrf失效
.apply(smsCodeAuthenticationSecurityConfig)//往后添加一个smsCode配置
.and()
.apply(springSocialConfigurer);//开启SocialAuthenticationFilter过滤器
}
}
| [
"[email protected]"
] | |
ae4cef5c6465be80f5249819747cfa009e9ea33a | 45ec8fbb45734eb30a45a31d43a8a0f7b3a8e07a | /RehearsalAssistant/src/urbanstew/RehearsalAssistant/RehearsalActivity.java | 9dbd3f3b9379400913fd58d08b99283d8897f134 | [] | no_license | TomkeyZhang/RehearsalAssistant | 75fc6601ace032ebe3ae723b634df9caae173996 | 45148d38b6cfe0b023dd040e81811f4527a4f5df | refs/heads/master | 2020-12-25T18:19:51.445675 | 2013-08-06T12:21:25 | 2013-08-06T12:21:25 | 11,923,268 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package urbanstew.RehearsalAssistant;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
public class RehearsalActivity extends Activity
{
public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
mSettingsMenuItem = menu.add(R.string.settings).setIcon(android.R.drawable.ic_menu_preferences);
return true;
}
public boolean onOptionsItemSelected(MenuItem item)
{
if(item == mSettingsMenuItem)
{
startActivity(new Intent(getApplication(), SettingsActivity.class));
return true;
}
else
return false;
}
public void onPlaybackStarted()
{
}
protected MenuItem mSettingsMenuItem;
} | [
"[email protected]"
] | |
1551d064c6a85ed43fc225a0bafa50b5359f2d0c | ae6b96cc42b1af55a44156a220feaa7698b58fea | /RestDocCore/src/main/java/cn/willingxyz/restdoc/core/parse/impl/JavaTypeInspector.java | ea3f12041ac8ffe3d6d0b15b42f67eee6027fe40 | [] | no_license | zt1820057934/RestDoc | 836c310c78458b54500d2a4d899a828ed7fc6634 | 7791fb816177e50c16756713041c5886e9dd86a6 | refs/heads/master | 2022-02-18T04:17:18.849814 | 2019-09-20T01:03:41 | 2019-09-20T01:14:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,304 | java | package cn.willingxyz.restdoc.core.parse.impl;
import cn.willingxyz.restdoc.core.parse.ITypeInspector;
import lombok.var;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URL;
import java.time.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
/**
* 判断java基本库中的类型。
* 该类应该放在最后一个做判断
*/
public class JavaTypeInspector implements ITypeInspector {
private List<Class> _simpleClass = new ArrayList<Class>(){{
add(Boolean.class);
add(Byte.class);
add(Short.class);
add(Integer.class);
add(Long.class);
add(Double.class);
add(Float.class);
add(Character.class);
add(CharSequence.class);
add(Enum.class);
add(Number.class);
add(URI.class);
add(URL.class);
add(Locale.class);
// 日期处理
add(Date.class);
add(LocalDateTime.class);
add(LocalDate.class);
add(LocalTime.class);
add(Year.class);
add(YearMonth.class);
add(MonthDay.class);
add(Instant.class);
}};
@Override
public boolean isSimpleType(Type type) {
if (type instanceof Class)
{
var clazz = (Class)type;
for (var simpleClass : _simpleClass)
{
if (simpleClass.isAssignableFrom(clazz))
return true;
}
if (clazz.isPrimitive()) {
return true;
}
}
else if (type instanceof ParameterizedType)
{
return isSimpleType(((ParameterizedType) type).getRawType());
}
return false;
}
@Override
public boolean isCollection(Type type) {
if (type instanceof Class)
{
var clazz = (Class)type;
if (clazz.isArray()) {
return true;
}
if (List.class.isAssignableFrom(clazz)) {
return true;
}
}
else if (type instanceof ParameterizedType)
{
return isCollection(((ParameterizedType) type).getRawType());
}
return false;
}
@Override
public Type getCollectionComponentType(Type type) {
if (!isCollection(type))
throw new RuntimeException(type.getTypeName() + " is not collection");
if (type instanceof Class)
{
var clazz = (Class)type;
if (clazz.isArray())
{
return clazz.getComponentType();
}
if (List.class.isAssignableFrom(clazz))
{
}
}
else if (type instanceof ParameterizedType)
{
var parameterizedType = (ParameterizedType)type;
if (List.class.isAssignableFrom((Class<?>) parameterizedType.getRawType())) {
return parameterizedType.getActualTypeArguments()[0];
}
}
return Object.class;
}
@Override
public boolean isSupport(Type type) {
return true;
}
}
| [
"[email protected]"
] | |
9959a81042bf111dd24c85626a2f5de7ae77b6aa | 02e02d55532d6295b0110e3acdfc31b933d1099d | /ep-bva/src/main/java/training360/epbva/EpBvaApplication.java | 6fe2c0103b8ee48e88d0deb57232b18a92a9d090 | [] | no_license | Training360/almira | 5c73a3adb06552dce6623a37cbd1c84c9d36239c | b3a52ac5b7b2023835b3b77fa57ab3c0a7548a7f | refs/heads/master | 2022-12-03T17:42:46.860169 | 2020-10-08T08:48:44 | 2020-10-08T08:48:44 | 110,721,995 | 1 | 0 | null | 2022-11-16T08:56:04 | 2017-11-14T17:23:32 | Rich Text Format | UTF-8 | Java | false | false | 2,928 | java | package training360.epbva;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import training360.epbva.api.credit.CreditAssessmentEndpoint;
import training360.epbva.api.triangle.TriangleEndpoint;
import javax.xml.ws.Endpoint;
import java.util.ArrayList;
import java.util.List;
@SpringBootApplication
@RestController
@RequestMapping("/api/")
public class EpBvaApplication {
public static void main(String[] args) {
SpringApplication.run(EpBvaApplication.class, args);
}
@Autowired
private Bus bus;
@RequestMapping("/triangle")
public TriangleAnswer triangle(@RequestBody Triangle triangle) {
TriangleDecision triangleDecision = new TriangleDecision();
List<String> errors = triangleDecision.validate(triangle.getA(), triangle.getB(), triangle.getC());
if (!errors.isEmpty()) {
return TriangleAnswer.error(errors);
}
else {
return TriangleAnswer.typeOf(triangleDecision.calculateType(triangle.getA(), triangle.getB(), triangle.getC()));
}
}
@RequestMapping("/credit-assessment")
public CreditAssessmentAnswer creditAssessment(@RequestBody CreditAssessmentRequest creditAssessmentRequest) {
CreditAssessment creditAssessment = new CreditAssessment();
List<String> errors = new ArrayList<>();
creditAssessment.isNumber(creditAssessmentRequest.getMortgage(), "jelzáloghitel összege", errors);
creditAssessment.isNumber(creditAssessmentRequest.getValueOfTheProperty(), "ingatlan értéke", errors);
if (!errors.isEmpty()) {
return CreditAssessmentAnswer.error(errors);
}
int mortgage = Integer.parseInt(creditAssessmentRequest.getMortgage());
int valueOfProperty = Integer.parseInt(creditAssessmentRequest.getValueOfTheProperty());
creditAssessment.validate(mortgage, valueOfProperty, errors);
if (!errors.isEmpty()) {
return CreditAssessmentAnswer.error(errors);
}
return CreditAssessmentAnswer.workflowTypeOf(creditAssessment.calculateWorkflowType(mortgage, valueOfProperty));
}
@Bean
public Endpoint triangleEndpointEndpoint(TriangleEndpoint triangleEndpoint) {
EndpointImpl endpoint = new EndpointImpl(bus, triangleEndpoint);
endpoint.publish("/triangle");
return endpoint;
}
@Bean
public Endpoint creditAssessmentEndpointEndpoint(CreditAssessmentEndpoint creditAssessmentEndpoint) {
EndpointImpl endpoint = new EndpointImpl(bus, creditAssessmentEndpoint);
endpoint.publish("/credit-assessment");
return endpoint;
}
}
| [
"[email protected]"
] | |
66b14661ae6797a53f464524fdd794be60267fc2 | 4276b9d050ea4640f93fcb19b4a8d9a8951a195d | /src/main/java/course/api/topics/Topic.java | bce48955cbacc151a724614f2aafa184b1c8b8c3 | [] | no_license | Abhishek55041/course.api | 9af69888eeac1721c2758ca69b233ef6d45271db | 6ac9474247c1198c15989d836f44f2805848a828 | refs/heads/master | 2021-04-06T06:24:22.757339 | 2018-03-15T01:14:33 | 2018-03-15T01:14:33 | 125,293,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package course.api.topics;
public class Topic {
private String id;
private String name;
private String description;
public Topic() {
}
public Topic(String id, String name, String description) {
super();
this.id = id;
this.name = name;
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
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;
}
}
| [
"[email protected]"
] | |
a27cfd8ff8f4e5cde39c9edeab62e5778dd4130e | cf8cf3b9a4a63977f8989481a8edc14d5becfd97 | /kmeans/src/kmeans/centers.java | d5f197719633881b473ecb321479e10909af2e2b | [] | no_license | pandaww/BIgData | 4cc50f63f2d1806fd580911da1505aedeb696ec0 | f978219b136f82a77b5c5ebe1909529b577364fc | refs/heads/master | 2022-01-17T15:33:41.509918 | 2019-06-30T09:06:16 | 2019-06-30T09:06:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,339 | java | package kmeans;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
import java.io.IOException;
import java.util.ArrayList;
/**
* MapReduce开发WordCount应用程序
* */
public class centers {
static int k = 4;
/**
*
* Map:读取输入的文件
* */
static ArrayList<ArrayList<Double>> center = new ArrayList<ArrayList<Double>>();
public static class MyMapper extends Mapper<Object, Text, IntWritable, Text> {
@Override
protected void map(Object key, Text value, Context context) throws IOException, InterruptedException {
context.write(new IntWritable(1), value);
}
}
/**
* Reduce
* */
public static class MyReducer extends Reducer<IntWritable, Text, Text, Text> {
public double getDistance(ArrayList<Double> fileds)
{
double minDistance = 99999999;
for(int i=0;i<k;i++){
double currentDistance = 0;
for(int j=1;j<fileds.size();j++)
{
double centerPoint = center.get(i).get(j);
double filed = fileds.get(j);
currentDistance += (centerPoint-filed)*(centerPoint-filed);
}
currentDistance = Math.sqrt(currentDistance);
//循环找出距离该记录最接近的中心点的ID
if(currentDistance<minDistance){
minDistance = currentDistance;
}
}
return minDistance;
}
@Override
protected void reduce(IntWritable key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
//用于累加的变量
if(center.size()==0)
{
for(Text val : values)
{
context.write(null,val);
String temp = val.toString();
String strs[] = temp.split(",");
ArrayList<Double> t = new ArrayList<Double>();
for(int i=0;i<strs.length;i++)
{
t.add(Double.parseDouble(strs[i]));
}
center.add(t);
context.write(null, val);
break;
}
return;
}
else
{
Text out = null;
ArrayList<Double> r =new ArrayList<Double>();
for(Text val : values)
{
String temp = val.toString();
String strs[] = temp.split(",");
ArrayList<Double> t = new ArrayList<Double>();
double current = 9999999;
double now = 0;
for(int i=0;i<strs.length;i++)
{
t.add(Double.parseDouble(strs[i]));
}
now = getDistance(t);
if(now>current)
{
r = t;
current = now;
out = val;
}
}
center.add(r);
context.write(null, out);
}
}
}
/**
* 定义Driver类
* */
public static void main(String[] args) throws Exception {
//获取配置信息
/*BasicConfigurator.configure(); */
int count = 0;
while(count!=k)
{
count ++;
Configuration configuration = new Configuration();
configuration.set("fs.defaultFS", "hdfs://localhost:9000");
String[] otherArgs = new GenericOptionsParser(configuration , args).getRemainingArgs();
if(otherArgs.length != 2) {
System.err.println("Usage:wordcount <in> <out>");
System.exit(2);
}
//创建job并且命名
Job job = Job.getInstance(configuration, "centers");
//1.设置job运行的类
job.setJarByClass(centers.class);
// FileInputFormat.setInputPaths(job, new Path(args[0]));
//2.设置Map和reduce类
job.setMapperClass(MyMapper.class);
job.setReducerClass(MyReducer.class);
//3.设置输入输出的文件目录
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]+count));
//4.设置输出结果的key和value类型
job.setMapOutputKeyClass(IntWritable.class);
job.setMapOutputValueClass(Text.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
//5.提交job等待运行结果,并在客户端显示运行信息
job.waitForCompletion(true);
//结束程序
/*
for(int i=0;i<center.size();i++)
{
for(int j=0;j<center.get(i).size();j++)
{
System.out.print(center.get(i).get(j)+" ");
}
System.out.println();
} */
}
System.exit(0);
}
}
| [
"[email protected]"
] | |
d836d2424b30a80c8b3490116886febbbfe9987e | dcba15e74ec5e808840169399b5e8e32b81dd600 | /app/src/main/java/app/lerner2/projects/my/lerner4/GameMech.java | 00e4e3b709a923dcc0fe1da2a1f118d529297e05 | [] | no_license | heizer23/Atoms | ff9a8660cb265b8d425661c9945346ef6ef8311f | f2837b8ce66d0d3c3935a765dae58d315eee7f3c | refs/heads/master | 2020-05-30T18:20:26.320327 | 2019-07-28T15:45:52 | 2019-07-28T15:45:52 | 189,894,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 221 | java | package app.lerner2.projects.my.lerner4;
public class GameMech {
long tagesPunkte = 0;
public GameMech(){
tagesPunkte = 12;
}
public long getTagesPunkte() {
return tagesPunkte;
}
}
| [
"[email protected]"
] | |
cdcd9d4f11dce3c48e46b66dad5d629f3f0d9eda | 440728e853fb55f6c3b947dc811a1417c986fec2 | /Game/src/test/java/com/bbz/sanguo/net/GameServerTest.java | 9701e17341dc4540574ba9ded61d1ddc8b1b9537 | [] | no_license | babizhu/MachineSanGuo | fcfba60d1c9676edc2f6805fae8ca436e918219a | e9801fdabc37e1d3c21c609b1fe4028bb8361b4f | refs/heads/master | 2016-09-06T04:10:44.302097 | 2014-12-31T10:18:03 | 2014-12-31T10:18:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package com.bbz.sanguo.net;
import com.bbz.sanguo.lanch.ServerCfg;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import org.junit.Test;
public class GameServerTest{
@Test
public void testDispatcherChange() throws Exception{
EventLoopGroup worker = new NioEventLoopGroup();
Bootstrap bootstrap = new Bootstrap();
try {
bootstrap.group( worker );
bootstrap.channel( NioSocketChannel.class );
// bootstrap.channel( OioSocketChannel.class );
bootstrap.handler( new GameClientInitializer() );
Channel channel = bootstrap.connect( "localhost", ServerCfg.PORT ).sync().channel();
GameClientHandler handler = channel.pipeline().get( GameClientHandler.class );
for( int i = 0; i < 1; i++ ) {
handler.missionShow();
handler.login( "bbz", "pass" );
handler.missionShow();
handler.login( "bbz", "pass" );
}
} catch( Exception e ) {
e.printStackTrace();
} finally {
Thread.sleep( 1000000 );
worker.shutdownGracefully();
}
}
} | [
"[email protected]"
] | |
316b389f2060c9dd217ad5b894c3ed2ea837875d | edda911f5e5bcf90c04d4a8da8b9ad2819f31b82 | /src/test/java/com/jenkinsci/plugins/badge/dsl/CreateSummaryStepTest.java | 1f750f33c3bb4533d270630facddf09e3030ac3f | [] | no_license | MarkEWaite/badge-plugin | 474c0e400dd25bb8a2de59bcf78b0087699d9c8b | 9812262d2440a5f7de0509d7ced449aca30a9ee9 | refs/heads/master | 2023-09-04T11:32:32.743212 | 2023-08-27T13:04:23 | 2023-08-27T13:04:23 | 212,605,552 | 0 | 0 | null | 2022-11-07T02:02:11 | 2019-10-03T14:50:06 | Java | UTF-8 | Java | false | false | 4,708 | java | /*
* The MIT License
*
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Serban Iordache
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.jenkinsci.plugins.badge.dsl;
import com.jenkinsci.plugins.badge.action.BadgeSummaryAction;
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.junit.Test;
import java.util.List;
import static java.util.UUID.randomUUID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class CreateSummaryStepTest extends AbstractBadgeTest {
@Test
public void createSummary_plain() throws Exception {
String text = randomUUID().toString();
BadgeSummaryAction action = createSummary("summary.appendText('" + text + "')");
assertEquals(text, action.getText());
}
@Test
public void createSummary_html_unescaped() throws Exception {
String text = randomUUID().toString();
BadgeSummaryAction action = createSummary("summary.appendText('<ul><li>" + text + "</li></ul>', false)");
assertEquals("<ul><li>" + text + "</li></ul>", action.getText());
}
@Test
public void createSummary_html_unescaped_remove_script() throws Exception {
String text = randomUUID().toString();
String html = "<ul><li>" + text + "</li></ul><script>alert(\"exploit!\");</script>";
BadgeSummaryAction action = createSummary("summary.appendText('" + html + "', false);");
assertEquals("<ul><li>" + text + "</li></ul>", action.getText());
assertEquals(html, action.getRawText());
}
@Test
public void createSummary_html_escaped() throws Exception {
String text = randomUUID().toString();
BadgeSummaryAction action = createSummary("summary.appendText('<ul><li>" + text + "</li></ul>', true)");
assertEquals("<ul><li>" + text + "</li></ul>", action.getText());
}
@Test
public void createSummary_all() throws Exception {
String text = randomUUID().toString();
BadgeSummaryAction action = createSummary("summary.appendText('" + text + "', false, true, true, 'grey')");
assertEquals("<b><i>" + text + "</i></b>", action.getText());
}
private BadgeSummaryAction createSummary(String script) throws Exception {
String icon = randomUUID().toString();
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("def summary = createSummary(\"" + icon + "\")\n" + script, true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
List<BadgeSummaryAction> summaryActions = b.getActions(BadgeSummaryAction.class);
assertEquals(1, summaryActions.size());
BadgeSummaryAction action = summaryActions.get(0);
assertTrue(action.getIconPath().endsWith(icon));
return action;
}
@Test
public void createSummary_with_text() throws Exception {
String icon = randomUUID().toString();
String text = randomUUID().toString();
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("def summary = createSummary(icon:\"" + icon + "\", text:\"" + text + "\")", true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
List<BadgeSummaryAction> summaryActions = b.getActions(BadgeSummaryAction.class);
assertEquals(1, summaryActions.size());
BadgeSummaryAction action = summaryActions.get(0);
assertTrue(action.getIconPath().endsWith(icon));
assertEquals(text, action.getText());
}
} | [
"[email protected]"
] | |
0bd94f345cc5cdca370a8882d0d6b607c5a27a9f | bd3592781efb4b4bb9fb46c48d46680d76917d5b | /src/SameTree.java | 7698c5f9410ac32533276d595c01144be1fd9036 | [] | no_license | ChunChung/Leetcode | e7efefd108da53b09aa66295b1cfcfc974ccd5a2 | b7c78fe3730ba9fb5c2ad98264129314c543ce2a | refs/heads/master | 2021-01-18T23:22:18.538481 | 2018-10-25T15:51:17 | 2018-10-25T15:51:17 | 23,938,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 690 | java | public class SameTree {
public static boolean isSameTree(TreeNode p, TreeNode q) {
if(p == null && q == null)
return true;
else if (p == null)
return false;
else if (q == null)
return false;
if(p.val == q.val) {
return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
}
return false;
}
static public void main(String argv[]) {
TreeNode firstnode = new TreeNode(3);
TreeNode second = new TreeNode(2);
firstnode.left = second;
second.left = new TreeNode(5);
second.right = new TreeNode(2);
if(isSameTree(firstnode, firstnode.left))
System.out.println("True");
}
} | [
"[email protected]"
] | |
c944228f4d311b90eed3982c6d17229655197818 | 1490356148dd33654cf861c21a145dd7e63754d9 | /src/main/java/com/JMS/JmsApplication.java | 045f0f9a789d2140ba400c520e479b4e944dd5be | [] | no_license | ElviraHoward/JMS | 9807d858f32bc402a1f287007e3dde3d1d79e7d0 | ddba01ef5431c52e3085be3d89c64e2a2d6eec38 | refs/heads/master | 2020-03-16T01:22:05.721549 | 2018-06-04T09:28:02 | 2018-06-04T09:28:02 | 132,438,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,995 | java | package com.JMS;
import com.JMS.jms.*;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter;
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.jms.support.converter.MappingJackson2MessageConverter;
import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.jms.support.converter.MessageType;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.view.xslt.XsltView;
import org.springframework.web.servlet.view.xslt.XsltViewResolver;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Properties;
@EnableJms
@SpringBootApplication
public class JmsApplication {
@Bean
public ViewResolver getXLTViewResolver() {
final XsltViewResolver xsltViewResolver = new XsltViewResolver();
xsltViewResolver.setOrder(1);
xsltViewResolver.setSourceKey("xmlSource");
xsltViewResolver.setViewClass(XsltView.class);
xsltViewResolver.setViewNames("lists");
xsltViewResolver.setPrefix("/WEB-INF/xslt/");
xsltViewResolver.setSuffix(".xsl");
return xsltViewResolver;
}
@Bean
public CustomObjectMapper customObjectMapper() {
return new CustomObjectMapper();
}
@Bean
public MappingJackson2HttpMessageConverter customJackson2HttpMessageConverter() {
return new MappingJackson2HttpMessageConverter(customObjectMapper());
}
@Bean
public JmsListenerContainerFactory<?> myFactory(ConnectionFactory connectionFactory,
DefaultJmsListenerContainerFactoryConfigurer configurer) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
// This provides all boot's default to this factory, including the message converter
configurer.configure(factory, connectionFactory);
// You could still override some of Boot's default if necessary.
return factory;
}
@Bean // Serialize message content to json using TextMessage
public MessageConverter jacksonJmsMessageConverter() {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
@Bean
public ActiveMQConnectionFactory amqConnectionFactory() {
return new ActiveMQConnectionFactory("tcp://localhost:61616");
}
@Bean
public CachingConnectionFactory connectionFactory() {
final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(amqConnectionFactory());
cachingConnectionFactory.setSessionCacheSize(10);
return cachingConnectionFactory;
}
@Bean
public ReceiveMessage getJmsDbMessageReceiver() {
return new ReceiveMessage();
}
@Bean
public SMTPReceiver getJmsSMTPMessageReceiver() {
return new SMTPReceiver();
}
@Bean
public ActiveMQTopic destination() {
return new ActiveMQTopic("jms.topic");
}
@NotNull
private DefaultMessageListenerContainer getDefaultMessageListenerContainer(final ConnectionFactory connectionFactory, final Destination destination) {
final DefaultMessageListenerContainer defaultMessageListenerContainer = new DefaultMessageListenerContainer();
defaultMessageListenerContainer.setConnectionFactory(connectionFactory);
defaultMessageListenerContainer.setDestination(destination);
return defaultMessageListenerContainer;
}
@Bean(name = "dbListenerContainer")
@Autowired
public DefaultMessageListenerContainer dbListenerContainer(final ConnectionFactory connectionFactory, final Destination destination) {
final DefaultMessageListenerContainer defaultMessageListenerContainer = getDefaultMessageListenerContainer(connectionFactory, destination);
defaultMessageListenerContainer.setMessageListener(getJmsDbMessageReceiver());
return defaultMessageListenerContainer;
}
@Bean(name = "emailListenerContainer")
@Autowired
public DefaultMessageListenerContainer emailListenerContainer(final ConnectionFactory connectionFactory, final Destination destination) {
final DefaultMessageListenerContainer defaultMessageListenerContainer = getDefaultMessageListenerContainer(connectionFactory, destination);
defaultMessageListenerContainer.setMessageListener(getJmsSMTPMessageReceiver());
return defaultMessageListenerContainer;
}
@Bean
@Autowired
public JmsTemplate jmsTemplate(final ConnectionFactory connectionFactory, final Destination destination) {
final JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);
jmsTemplate.setDefaultDestination(destination);
return jmsTemplate;
}
@Bean
public JavaMailSender getJavaMailSender() {
final JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost("smtp.gmail.com");
mailSender.setPort(587);
mailSender.setUsername("[email protected]");
mailSender.setPassword("password");
final Properties props = mailSender.getJavaMailProperties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.debug", "true");
return mailSender;
}
@Bean
public SimpleMailMessage templateChangesMessage() {
final SimpleMailMessage message = new SimpleMailMessage();
message.setText("Hello! Due to your subscription to data changes, we notify you for it.\n%s\n");
return message;
}
@Bean
public EmailService emailService() {
return new EmailServiceImpl();
}
@Bean
public Sender messageSender() {
return new Sender();
}
public static void main(String[] args) {
// Launch the application
ConfigurableApplicationContext context = SpringApplication.run(JmsApplication.class, args);
}
}
| [
"[email protected]"
] | |
6ee1dc7c1c6cb8a63423fd0d8129692281d0610f | ff8bd7f0d1c2befa841bc834352c47d5ae080594 | /src/main/java/pt/lisomatrix/Sockets/models/Absence.java | edfe4277ffcb637d717dee8be56af1c6f023f669 | [] | no_license | Lisomatrix/StudenStats-Backend | 7a33ff4a6bf5588351e271a84c07a05240ab7fa9 | 1f5a405f5021416b4c254fa796ea1d05a474e2f5 | refs/heads/master | 2021-08-25T18:01:04.276916 | 2019-09-28T09:38:52 | 2019-09-28T09:38:52 | 166,423,122 | 0 | 0 | null | 2021-08-02T17:18:58 | 2019-01-18T15:11:04 | CSS | UTF-8 | Java | false | false | 2,818 | java | package pt.lisomatrix.Sockets.models;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "absence")
public class Absence implements Serializable {
@Id
@Column(name = "absence_id")
@GeneratedValue(strategy = GenerationType.AUTO)
private long absenceId;
private Date date;
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "student_id", nullable = false)
private Student student;
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "discipline_id", nullable = false)
private Discipline discipline;
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "lesson_id", nullable = false)
private Lesson lesson;
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "absenceType_id", nullable = false)
private AbsenceType absenceType;
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "module_id", nullable = false)
private Module module;
@Column(nullable = false)
private boolean isJustifiable;
@Column(nullable = false)
private boolean isJustified;
private boolean isRecuperated;
public Module getModule() {
return module;
}
public void setModule(Module module) {
this.module = module;
}
public boolean isRecuperated() {
return isRecuperated;
}
public void setRecuperated(boolean recuperated) {
isRecuperated = recuperated;
}
public long getAbsenceId() {
return absenceId;
}
public void setAbsenceId(long absenceId) {
this.absenceId = absenceId;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
public Discipline getDiscipline() {
return discipline;
}
public void setDiscipline(Discipline discipline) {
this.discipline = discipline;
}
public Lesson getLesson() {
return lesson;
}
public void setLesson(Lesson lesson) {
this.lesson = lesson;
}
public AbsenceType getAbsenceType() {
return absenceType;
}
public void setAbsenceType(AbsenceType absenceType) {
this.absenceType = absenceType;
}
public boolean isJustifiable() {
return isJustifiable;
}
public void setJustifiable(boolean justifiable) {
isJustifiable = justifiable;
}
public boolean isJustified() {
return isJustified;
}
public void setJustified(boolean justified) {
isJustified = justified;
}
}
| [
"[email protected]"
] | |
53a2caec6dc7e89178d4a5d8ff6b5ca0bb96a644 | 4e9f0b12acf6b95c6229c4ca557d26723896b248 | /restaurant/src/main/java/com/blibli/future/pos/restaurant/common/exception/NotFoundMapper.java | 70999f5f69f73379b6163f152f104f3b954d5352 | [] | no_license | kelvinikome/restaurant-pos-app | d92b58d19db9cd550f59690c2d15828bc05fc69a | 1fd60e4f0891d58cdc7dc547fdf6f3afce3eaf7c | refs/heads/master | 2020-04-20T03:06:11.239913 | 2018-01-05T16:44:25 | 2018-01-05T16:44:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.blibli.future.pos.restaurant.common.exception;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
@Provider
public class NotFoundMapper extends BaseExceptionMapper<NotFoundException> {
@Override
public Integer getStatusCode() {
return Response.Status.NOT_FOUND.getStatusCode();
}
}
| [
"[email protected]"
] | |
145fd86203d594623578a318af633f656afe7d85 | 68c1dd289d32853a8479d63d6f5bfec0ab22cbf1 | /guns-film/src/main/java/com/stylefeng/guns/rest/modular/film/dao/CatDictRepository.java | cfe0951a9780fa2339752a65bd3514fbe5196eb7 | [] | no_license | chenzhibin66/guns-film | e8bfc07eff2ae04439b5a5495cf6ead38c39aeaf | e41f7755283f87901cf646daa4b4bd23786d37f7 | refs/heads/master | 2022-12-10T15:01:34.604441 | 2020-05-10T14:32:14 | 2020-05-10T14:32:14 | 249,651,033 | 1 | 2 | null | 2022-12-06T00:45:19 | 2020-03-24T08:21:17 | Java | UTF-8 | Java | false | false | 324 | java | package com.stylefeng.guns.rest.modular.film.dao;
import com.stylefeng.guns.rest.entity.CatDictDO;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 类型信息表 Mapper 接口
* </p>
*
* @author chenzhibin
* @since 2020-03-31
*/
public interface CatDictRepository extends BaseMapper<CatDictDO> {
}
| [
"[email protected]"
] | |
5ee65e1387c0a10ffed46131e5796d31037761c6 | 56d2ba474411e8add4286767c460f07077415b11 | /amain/src/main/java/cn/itsite/amain/yicommunity/entity/bean/MainDeviceListBean.java | b387f32a7bcc15ee2eb2d07529c7de2e8dc4c341 | [] | no_license | arjun512/YiCommunity3.0 | d205759bbae64a1490747ac7a8fcb174a5bbd6de | 0000c72efb143628bddab5939b734bdb81a5c3fd | refs/heads/master | 2020-05-16T17:21:18.497970 | 2018-05-29T01:11:48 | 2018-05-29T01:11:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,615 | java | package cn.itsite.amain.yicommunity.entity.bean;
import java.io.Serializable;
import java.util.List;
import cn.itsite.abase.common.BaseBean;
/**
* Author: LiuJia on 2018/1/3 0003 15:36.
* Email: [email protected]
*/
public class MainDeviceListBean extends BaseBean {
private List<DataBean> data;
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean implements Serializable{
/**
* defenseStatus : cancel
* defenseStatusDes : 仅24小时模式的探测器处于防御状态,其他探测器处于未防御状态。
* fid : 08634f6c-8c39-4e79-9870-6fa14c4ff535
* isCurrent : 0
* isManager : 1
* isOnline : 0
* name : 网关
* no : G111EU6B1000754
* password :
* residence : {"addr":"","addrDet":"","fid":"198d3131-2a76-42b5-8118-95ecd9369b71","name":""}
* status : 0
*/
private String defenseStatus;
private String defenseStatusDes;
private String fid;
private int isCurrent;
private int isManager;
private int isOnline;
private String name;
private String no;
private String password;
private ResidenceBean residence;
private int status;
public String getDefenseStatus() {
return defenseStatus;
}
public void setDefenseStatus(String defenseStatus) {
this.defenseStatus = defenseStatus;
}
public String getDefenseStatusDes() {
return defenseStatusDes;
}
public void setDefenseStatusDes(String defenseStatusDes) {
this.defenseStatusDes = defenseStatusDes;
}
public String getFid() {
return fid;
}
public void setFid(String fid) {
this.fid = fid;
}
public int getIsCurrent() {
return isCurrent;
}
public void setIsCurrent(int isCurrent) {
this.isCurrent = isCurrent;
}
public int getIsManager() {
return isManager;
}
public void setIsManager(int isManager) {
this.isManager = isManager;
}
public int getIsOnline() {
return isOnline;
}
public void setIsOnline(int isOnline) {
this.isOnline = isOnline;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public ResidenceBean getResidence() {
return residence;
}
public void setResidence(ResidenceBean residence) {
this.residence = residence;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public static class ResidenceBean implements Serializable {
/**
* addr :
* addrDet :
* fid : 198d3131-2a76-42b5-8118-95ecd9369b71
* name :
*/
private String addr;
private String addrDet;
private String fid;
private String name;
public String getAddr() {
return addr;
}
public void setAddr(String addr) {
this.addr = addr;
}
public String getAddrDet() {
return addrDet;
}
public void setAddrDet(String addrDet) {
this.addrDet = addrDet;
}
public String getFid() {
return fid;
}
public void setFid(String fid) {
this.fid = fid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
}
| [
"[email protected]"
] | |
737b769a540bf6979cc5fdfd4d96e271ba6ccf8f | 69d720e74c8c5296cf823da69705825e0ac56973 | /src/main/java/com/nadia/data/importers/excel/CombineToJson.java | cccc02d405b7b0bebbd62e84319a0a26e763349d | [] | no_license | ddolga/schooldata | df7f05f5c7d7185e3788a3085805558d00b5d9bd | 28f5a54c5f0bb98c3289fd98ffca6ac62c421ea8 | refs/heads/master | 2020-04-06T06:56:35.597546 | 2016-08-15T23:44:00 | 2016-08-15T23:44:00 | 51,760,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,181 | java | package com.nadia.data.importers.excel;
import com.nadia.data.api.CellProcessorInterface;
import com.nadia.data.api.WorkbookProcessInterface;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
public class CombineToJson implements WorkbookProcessInterface {
Logger logger = LoggerFactory.getLogger(CombineToJson.class);
private String[] readHeaderRow(Row row, CellProcessorInterface cellProcessor) {
int size = row.getLastCellNum();
String[] fieldNames = new String[size];
for (int i = 0; i < size; i++) {
Cell cell = row.getCell(i);
String str = cellProcessor.processCell(cell);
fieldNames[i] = str;
}
return fieldNames;
}
@Override
public Workbook process(String inFileName, String outFileName, CellProcessorInterface cellProcessor,int limit) {
String[] fieldNames = null;
try {
Workbook wb = WorkbookFactory.create(new File(inFileName));
logger.info("loaded: " + inFileName);
JSONArray jsonArray = new JSONArray();
boolean isHeader = true;
JSONObject line;
int maxCol = 0;
int rowCount = 0;
boolean stop = false;
for (Sheet sheet : wb) {
for (Row row : sheet) {
if (isHeader) {
fieldNames = readHeaderRow(row, cellProcessor);
maxCol = fieldNames.length;
isHeader = false;
} else {
// line = new JSONObject();
Map map = new LinkedHashMap<String,String>();
boolean isEmpty = true;
for (int i = 0; i < maxCol; i++) {
Cell cell = row.getCell(i);
String str = cellProcessor.processCell(cell);
isEmpty = isEmpty && (str == null || str.isEmpty());
// line.put(fieldNames[i], str);
map.put(fieldNames[i],str);
}
if (!isEmpty) {
jsonArray.add(map);
}
rowCount++;
if(limit > 0 && rowCount == limit){
stop = true;
break;
}
}
}
if(stop)
break;
}
wb.close();
FileWriter writer = new FileWriter(outFileName);
jsonArray.writeJSONString(writer);
writer.close();
return wb;
} catch (IOException | InvalidFormatException e) {
e.printStackTrace();
}
return null;
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.