blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
c34513f9057c05cdb35e43be447519f45e8c063d
be1466413758e1d2b569268ea0a0aabdcc4e703d
/cstonlibray/src/main/java/platform/cston/explain/widget/refresh/LoadingLayout.java
4c2834b7c7e8368767572c52ea66e2e10d184104
[]
no_license
xcyOrganazition/JSC
07fa3c400b21bf5d43d99e8220fb3c563e7ac5f3
8dd2148a53ca6c915730d44ef97563afd62d40be
refs/heads/master
2020-03-31T21:40:17.937175
2020-02-17T09:18:12
2020-02-17T09:18:49
152,589,256
0
0
null
null
null
null
UTF-8
Java
false
false
11,333
java
package platform.cston.explain.widget.refresh; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.Typeface; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; import android.view.animation.LinearInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import cston.cstonlibray.R; @SuppressLint("ViewConstructor") public abstract class LoadingLayout extends FrameLayout implements ILoadingLayout { static final Interpolator ANIMATION_INTERPOLATOR = new LinearInterpolator(); private FrameLayout mInnerLayout; protected final ImageView mHeaderImage; protected final ProgressBar mHeaderProgress; private boolean mUseIntrinsicAnimation; private final TextView mHeaderText; private final TextView mSubHeaderText; protected final PullToRefreshBase.Mode mMode; protected final PullToRefreshBase.Orientation mScrollDirection; private CharSequence mPullLabel; private CharSequence mRefreshingLabel; private CharSequence mReleaseLabel; public LoadingLayout(Context context, final PullToRefreshBase.Mode mode, final PullToRefreshBase.Orientation scrollDirection, TypedArray attrs) { super(context); mMode = mode; mScrollDirection = scrollDirection; switch (scrollDirection) { case HORIZONTAL: LayoutInflater.from(context).inflate(R.layout.cst_platform_pull_to_refresh_header_horizontal, this); break; case VERTICAL: default: LayoutInflater.from(context).inflate(R.layout.cst_platform_pull_to_refresh_header_vertical, this); break; } mInnerLayout = (FrameLayout) findViewById(R.id.fl_inner); mHeaderText = (TextView) mInnerLayout.findViewById(R.id.pull_to_refresh_text); mHeaderProgress = (ProgressBar) mInnerLayout.findViewById(R.id.pull_to_refresh_progress); mSubHeaderText = (TextView) mInnerLayout.findViewById(R.id.pull_to_refresh_sub_text); mHeaderImage = (ImageView) mInnerLayout.findViewById(R.id.pull_to_refresh_image); FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mInnerLayout.getLayoutParams(); switch (mode) { case PULL_FROM_END: lp.gravity = scrollDirection == PullToRefreshBase.Orientation.VERTICAL ? Gravity.TOP : Gravity.LEFT; // Load in labels mPullLabel = context.getString(R.string.cst_platform_pull_to_refresh_from_bottom_pull_label); mRefreshingLabel = context.getString(R.string.cst_platform_pull_to_refresh_from_bottom_refreshing_label); mReleaseLabel = context.getString(R.string.cst_platform_pull_to_refresh_from_bottom_release_label); break; case PULL_FROM_START: default: lp.gravity = scrollDirection == PullToRefreshBase.Orientation.VERTICAL ? Gravity.BOTTOM : Gravity.RIGHT; // Load in labels mPullLabel = context.getString(R.string.cst_platform_pull_to_refresh_pull_label); mRefreshingLabel = context.getString(R.string.cst_platform_pull_to_refresh_refreshing_label); mReleaseLabel = context.getString(R.string.cst_platform_pull_to_refresh_release_label); break; } if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrHeaderBackground)) { Drawable background = attrs.getDrawable(R.styleable.cst_platform_PullToRefresh_ptrHeaderBackground); if (null != background) { ViewCompat.setBackground(this, background); } } if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrHeaderTextAppearance)) { TypedValue styleID = new TypedValue(); attrs.getValue(R.styleable.cst_platform_PullToRefresh_ptrHeaderTextAppearance, styleID); setTextAppearance(styleID.data); } if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrSubHeaderTextAppearance)) { TypedValue styleID = new TypedValue(); attrs.getValue(R.styleable.cst_platform_PullToRefresh_ptrSubHeaderTextAppearance, styleID); setSubTextAppearance(styleID.data); } // Text Color attrs need to be set after TextAppearance attrs if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrHeaderTextColor)) { ColorStateList colors = attrs.getColorStateList(R.styleable.cst_platform_PullToRefresh_ptrHeaderTextColor); if (null != colors) { setTextColor(colors); } } if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrHeaderSubTextColor)) { ColorStateList colors = attrs.getColorStateList(R.styleable.cst_platform_PullToRefresh_ptrHeaderSubTextColor); if (null != colors) { setSubTextColor(colors); } } // Try and get defined drawable from Attrs Drawable imageDrawable = null; if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrDrawable)) { imageDrawable = attrs.getDrawable(R.styleable.cst_platform_PullToRefresh_ptrDrawable); } // Check Specific Drawable from Attrs, these overrite the generic // drawable attr above switch (mode) { case PULL_FROM_START: default: if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrDrawableStart)) { imageDrawable = attrs.getDrawable(R.styleable.cst_platform_PullToRefresh_ptrDrawableStart); } else if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrDrawableTop)) { imageDrawable = attrs.getDrawable(R.styleable.cst_platform_PullToRefresh_ptrDrawableTop); } break; case PULL_FROM_END: if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrDrawableEnd)) { imageDrawable = attrs.getDrawable(R.styleable.cst_platform_PullToRefresh_ptrDrawableEnd); } else if (attrs.hasValue(R.styleable.cst_platform_PullToRefresh_ptrDrawableBottom)) { imageDrawable = attrs.getDrawable(R.styleable.cst_platform_PullToRefresh_ptrDrawableBottom); } break; } // If we don't have a user defined drawable, load the default if (null == imageDrawable) { imageDrawable = context.getResources().getDrawable(getDefaultDrawableResId()); } // Set Drawable, and save width/height setLoadingDrawable(imageDrawable); reset(); } public final void setHeight(int height) { ViewGroup.LayoutParams lp = (ViewGroup.LayoutParams) getLayoutParams(); lp.height = height; requestLayout(); } public final void setWidth(int width) { ViewGroup.LayoutParams lp = (ViewGroup.LayoutParams) getLayoutParams(); lp.width = width; requestLayout(); } public final int getContentSize() { switch (mScrollDirection) { case HORIZONTAL: return mInnerLayout.getWidth(); case VERTICAL: default: return mInnerLayout.getHeight(); } } public final void hideAllViews() { if (View.VISIBLE == mHeaderText.getVisibility()) { mHeaderText.setVisibility(View.INVISIBLE); } if (View.VISIBLE == mHeaderProgress.getVisibility()) { mHeaderProgress.setVisibility(View.INVISIBLE); } if (View.VISIBLE == mHeaderImage.getVisibility()) { mHeaderImage.setVisibility(View.INVISIBLE); } if (View.VISIBLE == mSubHeaderText.getVisibility()) { mSubHeaderText.setVisibility(View.INVISIBLE); } } public final void onPull(float scaleOfLayout) { if (!mUseIntrinsicAnimation) { onPullImpl(scaleOfLayout); } } public final void pullToRefresh() { if (null != mHeaderText) { mHeaderText.setText(mPullLabel); } // Now call the callback pullToRefreshImpl(); } public final void refreshing() { if (null != mHeaderText) { mHeaderText.setText(mRefreshingLabel); } if (mUseIntrinsicAnimation) { ((AnimationDrawable) mHeaderImage.getDrawable()).start(); } else { // Now call the callback refreshingImpl(); } if (null != mSubHeaderText) { mSubHeaderText.setVisibility(View.GONE); } } public final void releaseToRefresh() { if (null != mHeaderText) { mHeaderText.setText(mReleaseLabel); } // Now call the callback releaseToRefreshImpl(); } public final void reset() { if (null != mHeaderText) { mHeaderText.setText(mPullLabel); } mHeaderImage.setVisibility(View.VISIBLE); if (mUseIntrinsicAnimation) { ((AnimationDrawable) mHeaderImage.getDrawable()).stop(); } else { // Now call the callback resetImpl(); } if (null != mSubHeaderText) { if (TextUtils.isEmpty(mSubHeaderText.getText())) { mSubHeaderText.setVisibility(View.GONE); } else { mSubHeaderText.setVisibility(View.VISIBLE); } } } @Override public void setLastUpdatedLabel(CharSequence label) { setSubHeaderText(label); } public final void setLoadingDrawable(Drawable imageDrawable) { // Set Drawable mHeaderImage.setImageDrawable(imageDrawable); mUseIntrinsicAnimation = (imageDrawable instanceof AnimationDrawable); // Now call the callback onLoadingDrawableSet(imageDrawable); } public void setPullLabel(CharSequence pullLabel) { mPullLabel = pullLabel; } public void setRefreshingLabel(CharSequence refreshingLabel) { mRefreshingLabel = refreshingLabel; } public void setReleaseLabel(CharSequence releaseLabel) { mReleaseLabel = releaseLabel; } @Override public void setTextTypeface(Typeface tf) { mHeaderText.setTypeface(tf); } public final void showInvisibleViews() { if (View.INVISIBLE == mHeaderText.getVisibility()) { mHeaderText.setVisibility(View.VISIBLE); } if (View.INVISIBLE == mHeaderProgress.getVisibility()) { mHeaderProgress.setVisibility(View.VISIBLE); } if (View.INVISIBLE == mHeaderImage.getVisibility()) { mHeaderImage.setVisibility(View.VISIBLE); } if (View.INVISIBLE == mSubHeaderText.getVisibility()) { mSubHeaderText.setVisibility(View.VISIBLE); } } /** * Callbacks for derivative Layouts */ protected abstract int getDefaultDrawableResId(); protected abstract void onLoadingDrawableSet(Drawable imageDrawable); protected abstract void onPullImpl(float scaleOfLayout); protected abstract void pullToRefreshImpl(); protected abstract void refreshingImpl(); protected abstract void releaseToRefreshImpl(); protected abstract void resetImpl(); private void setSubHeaderText(CharSequence label) { if (null != mSubHeaderText) { if (TextUtils.isEmpty(label)) { mSubHeaderText.setVisibility(View.GONE); } else { mSubHeaderText.setText(label); // Only set it to Visible if we're GONE, otherwise VISIBLE will // be set soon if (View.GONE == mSubHeaderText.getVisibility()) { mSubHeaderText.setVisibility(View.VISIBLE); } } } } private void setSubTextAppearance(int value) { if (null != mSubHeaderText) { mSubHeaderText.setTextAppearance(getContext(), value); } } private void setSubTextColor(ColorStateList color) { if (null != mSubHeaderText) { mSubHeaderText.setTextColor(color); } } private void setTextAppearance(int value) { if (null != mHeaderText) { mHeaderText.setTextAppearance(getContext(), value); } if (null != mSubHeaderText) { mSubHeaderText.setTextAppearance(getContext(), value); } } private void setTextColor(ColorStateList color) { if (null != mHeaderText) { mHeaderText.setTextColor(color); } if (null != mSubHeaderText) { mSubHeaderText.setTextColor(color); } } }
[ "xucy@polysoft.con.cn" ]
xucy@polysoft.con.cn
77da5c46d30f6c110be760554b5138840afb6653
f82511aca85e7eb10a48ae24db07fbe27177557f
/app/src/main/java/com/example/yakovlev_golani/summerbreeze/models/historicalweather/HistoricalWeatherListItem.java
78b19faee0ea6bb8664fcbcc2317abd76a29d554
[]
no_license
doronyg/SummerBreeze
83be3f73b744f09d9b8861f5d5b95191d577ca14
1d5c40acbf541611e989a8029c3150a61984b86f
refs/heads/master
2021-01-23T08:56:21.284702
2015-01-04T19:30:17
2015-01-04T19:30:17
27,905,306
0
0
null
null
null
null
UTF-8
Java
false
false
833
java
package com.example.yakovlev_golani.summerbreeze.models.historicalweather; import com.google.gson.annotations.Expose; import javax.annotation.Generated; @Generated("org.jsonschema2pojo") public class HistoricalWeatherListItem { @Expose private HistoricalItemMain main; @Expose private Integer dt; /** * * @return * The main */ public HistoricalItemMain getMain() { return main; } /** * * @param main * The main */ public void setMain(HistoricalItemMain main) { this.main = main; } /** * * @return * The dt */ public Integer getDt() { return dt; } /** * * @param dt * The dt */ public void setDt(Integer dt) { this.dt = dt; } }
[ "doron_golani@yahoo.com" ]
doron_golani@yahoo.com
7d7a550f4f7d1e515f1adf714b30254aae414d25
b348afa62a486eb4e71b644090dfededc5690da5
/jd/src/com/whty/platform/modules/luojia/entity/CreateOrderRequestPassenger.java
5e08676079b455dfeec12a221dd3b5a1fa1b3bae
[]
no_license
wanghuale/jd
91ed7ecc016151c71882861a4ad5259a9b5b0c94
4e9c9c59b594e8191722ed2691dbd10d7b692a3c
refs/heads/master
2021-01-15T09:32:19.485081
2014-02-11T14:52:42
2014-02-11T14:52:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,954
java
package com.whty.platform.modules.luojia.entity; public class CreateOrderRequestPassenger { private String name; private String certificateType; private String certificateNumber; private String passengerType; private String csrq; private String insuranceDeal; private String price; private String airTax; private String tax; private String price1; private String airTax1; private String tax1; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCertificateType() { return certificateType; } public void setCertificateType(String certificateType) { this.certificateType = certificateType; } public String getCertificateNumber() { return certificateNumber; } public void setCertificateNumber(String certificateNumber) { this.certificateNumber = certificateNumber; } public String getPassengerType() { return passengerType; } public void setPassengerType(String passengerType) { this.passengerType = passengerType; } public String getCsrq() { return csrq; } public void setCsrq(String csrq) { this.csrq = csrq; } public String getInsuranceDeal() { return insuranceDeal; } public void setInsuranceDeal(String insuranceDeal) { this.insuranceDeal = insuranceDeal; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getAirTax() { return airTax; } public void setAirTax(String airTax) { this.airTax = airTax; } public String getTax() { return tax; } public void setTax(String tax) { this.tax = tax; } public String getPrice1() { return price1; } public void setPrice1(String price1) { this.price1 = price1; } public String getAirTax1() { return airTax1; } public void setAirTax1(String airTax1) { this.airTax1 = airTax1; } public String getTax1() { return tax1; } public void setTax1(String tax1) { this.tax1 = tax1; } }
[ "huaywang163@163.com" ]
huaywang163@163.com
9c103fcf29b32d640ed5655b9036cbb10f09f1b6
a2d413bc497318336fa579f078b2e1246fc65d02
/src/main/java/com/chenli/sparkproject/model/AdStatQueryResult.java
63f075bef1345ace44e2bd5830b66f63043fb0c5
[]
no_license
ChocolateLi/spark-project
4303c1cf42725a983a552fb8985b35d5deffba00
61c9d7032b9993e2d7a7ee8450b15d66b433b8a0
refs/heads/master
2023-07-17T14:40:22.672586
2021-09-04T07:59:02
2021-09-04T07:59:02
393,862,793
0
0
null
null
null
null
UTF-8
Java
false
false
204
java
package com.chenli.sparkproject.model; public class AdStatQueryResult { private int count; public int getCount() { return count; } public void setCount(int count) { this.count = count; } }
[ "954357018@qq.com" ]
954357018@qq.com
39822a54c9f4c71ac2602d646d661d5a1364d7e7
8cb667bb78ba520f0da39c36dffd94980dfa7907
/app/src/androidTest/java/com/eaglesakura/andriders/ui/navigation/session/UserSessionActivityTest.java
77e1d9f84bf5ff417e810a015c0f668a09e5a475
[ "MIT" ]
permissive
eaglesakura/andriders-central-engine-v3
e4ee4c4b52dab36629856f489cf0b594c7ef950b
6600104720f6e98faa9931b2479b03c6c274f167
refs/heads/v3.0.x
2021-01-16T23:32:50.477896
2017-01-07T15:44:41
2017-01-07T15:44:41
51,501,559
1
3
MIT
2018-01-13T13:07:59
2016-02-11T08:05:38
Java
UTF-8
Java
false
false
1,466
java
package com.eaglesakura.andriders.ui.navigation.session; import com.eaglesakura.andriders.AppScenarioTest; import com.eaglesakura.andriders.R; import com.eaglesakura.andriders.plugin.connection.SessionControlConnection; import com.eaglesakura.andriders.ui.navigation.UserSessionActivity; import com.eaglesakura.android.devicetest.scenario.UiScenario; import com.eaglesakura.util.Util; import org.junit.Test; import static com.eaglesakura.android.devicetest.scenario.ScenarioContext.assertTopActivity; public class UserSessionActivityTest extends AppScenarioTest<UserSessionActivity> { public UserSessionActivityTest() { super(UserSessionActivity.class); } @Test public void Activityが開ける() throws Throwable { assertTopActivity(UserSessionActivity.class); } @Test public void セッションを開始できる() throws Throwable { SessionControlConnection connection = new SessionControlConnection(getContext()); connection.connect(() -> false); Util.sleep(500); // UI経由でセッションを介し UiScenario.clickFromId(R.id.Button_SessionChange).step(); UiScenario.clickFromText(R.string.Word_Central_SessionStart).step(); // しばらくしたらセッションが開始されている Util.sleep(1000); assertTrue(connection.getCentralSessionController().isSessionStarted()); connection.disconnect(() -> false); } }
[ "eagle.sakura@gmail.com" ]
eagle.sakura@gmail.com
f1c826c74cd78c69bdf5dbabd14593f5cd969f7b
beffddfaca8848a1ce7eafd6688e17b5095d5a94
/sKHUapp/src/main/java/com/example/skhuapp/manager/SendCommentResult.java
f83bf6812c705e1d76eeb8c99672401aadff8e9b
[]
no_license
jaesungbong/skhuApp
e509e0fdc0c5967c0133afe68da6415640fa82b6
873a70f12484c1c78772e703c83d8eb85e33c385
refs/heads/master
2016-09-13T20:01:15.615229
2016-04-26T03:51:55
2016-04-26T03:51:55
57,095,513
0
0
null
null
null
null
UTF-8
Java
false
false
121
java
package com.example.skhuapp.manager; public class SendCommentResult { String error; String message; String result; }
[ "jaesungbong@gmail.com" ]
jaesungbong@gmail.com
81aae109d016e0daa68b02a68a5c20ffefd48f15
6342c1e7292800804024d3d4faee901c257faf65
/Documents/NetBeansProjects/Module3Milestone/src/java/wilcoxp3/DataAccessObjectFactory.java
b5284ddb17a01e1f3851aeb6706030ddefac3c08
[]
no_license
wilcoxp3/Module3Project
0fa008f884a375135f1c1f154ee8654a3923a8ad
7e091adbff7c0143e0576e4d9fb47c848236e464
refs/heads/master
2020-12-24T19:12:41.809682
2016-04-11T23:36:19
2016-04-11T23:36:19
56,015,121
0
0
null
null
null
null
UTF-8
Java
false
false
540
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 wilcoxp3; /** * * @author Paul */ public class DataAccessObjectFactory { DataAccessObjectFactory() { } public static DataAccessObject<User> getUserDao() { return new FileUserDao(); } public static DataAccessObject<Product> getProductDao() { return new FileProductDao(); } }
[ "wilcoxpaul3@gmail.com" ]
wilcoxpaul3@gmail.com
31ab7cd11b365812ab3a7e8950de4ebcebf93364
806c493f83ccc87bfdbfd28685721767ec2a10a1
/MDo/app/src/main/java/com/example/uidq0205/mdo/MainActivity.java
0c372f36ca06372e05f4ae6ca33610ebf1a34138
[]
no_license
fengyulang/AndroidGroupTest
296440f97c7ed1518642f7ea851da15165e2f6c8
806ce18ed696ed51ec4fc66a08d8cb3aab0654a0
refs/heads/master
2021-01-21T10:59:21.342000
2018-09-26T16:21:44
2018-09-26T16:21:44
83,506,059
0
1
null
2017-03-01T11:17:34
2017-03-01T03:15:02
Java
UTF-8
Java
false
false
1,797
java
package com.example.uidq0205.mdo; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { public static String TAG="MainActivity"; private Button mMoBtn; private IDoService iDoService; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMoBtn=findViewById(R.id.tMoBtn); mMoBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try { iDoService.pting(); }catch (Exception es){ es.printStackTrace(); } } }); } @Override protected void onStart() { super.onStart(); Log.d(TAG, "onStart "); Intent sIntent=new Intent(MainActivity.this,DoService.class); this.bindService(sIntent,serviceConnection,BIND_AUTO_CREATE); } private ServiceConnection serviceConnection=new ServiceConnection() { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { iDoService=IDoService.Stub.asInterface(iBinder); Log.d(TAG, "serviceConnection: onServiceConnected "); } @Override public void onServiceDisconnected(ComponentName componentName) { iDoService=null; Log.d(TAG, "serviceConnection: onServiceDisconnected "); } }; }
[ "ouye187@163.com" ]
ouye187@163.com
974d193ee4b281e449cdf4f36c389fa91df03e41
bb4214380eeb2733a3724c2ad40c19066431ad9c
/factory/src/main/java/com/ljr/factory/data/group/GroupsDataSource.java
51e5f7df7c1ed0b3a77d3e04792956c16c6e880a
[]
no_license
ljrRookie/Chat_ljr
5cadb6927ba3aafb141dfbeda43411b76b63ba0a
118a4201cc3b9ed372bd6a30e17759ba17242f7a
refs/heads/master
2020-03-12T21:29:36.268924
2018-05-30T07:48:57
2018-05-30T07:48:57
130,829,318
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package com.ljr.factory.data.group; import com.ljr.common.factory.data.DbDataSource; import com.ljr.factory.model.db.Group; /** * Created by 林佳荣 on 2018/5/21. * Github:https://github.com/ljrRookie * Function : */ public interface GroupsDataSource extends DbDataSource<Group>{ }
[ "15622732935@163.com" ]
15622732935@163.com
01bfc3865ebd598a180d32036dadf6d48bbd41b4
99a7db50a02cf9a7ebec2eaa3633b1eedcae33dc
/Launcher/src/com/jidesoft/plaf/basic/MyComputerTreeNode.java
23e178bb6e39f83fabc6088f4ea4868e1b227bf7
[]
no_license
Ren0X1/JavaProject
6406fdac158b52d750ea0a38da91a1211b4f5efc
3c4ba1e9aa56f4628eb5df0972e14b7247ae27a8
refs/heads/master
2023-06-01T05:52:53.703303
2021-06-16T14:46:34
2021-06-16T14:46:34
305,355,892
1
2
null
2020-10-30T17:46:34
2020-10-19T11:06:33
Java
UTF-8
Java
false
false
1,254
java
/* * @(#)MyComputerTreeNode.java 8/19/2006 * * Copyright 2002 - 2006 JIDE Software Inc. All rights reserved. */ package com.jidesoft.plaf.basic; import com.jidesoft.swing.FolderChooser; import javax.swing.filechooser.FileSystemView; import java.io.File; import java.util.Arrays; class MyComputerTreeNode extends LazyMutableTreeNode { private static final long serialVersionUID = -7314394377241239982L; private FolderChooser _folderChooser; public MyComputerTreeNode(FolderChooser folderChooser) { super(folderChooser.getFileSystemView()); _folderChooser = folderChooser; } @Override protected void initChildren() { FileSystemView fsv = (FileSystemView) getUserObject(); File[] roots = fsv.getRoots(); if (roots != null) { Arrays.sort(roots); for (int i = 0, c = roots.length; i < c; i++) { if (!_folderChooser.accept(roots[i])) { continue; } BasicFileSystemTreeNode newChild = BasicFileSystemTreeNode.createFileSystemTreeNode(roots[i], _folderChooser); add(newChild); } } } @Override public String toString() { return "/"; } }
[ "alexyanamusicpro@gmail.com" ]
alexyanamusicpro@gmail.com
37c3b12bc71ec05294c542a1b9f7f74a3864cb30
6ca70f147304f330fb745f3879e055c37cddfb77
/Activities-And-Intents-Lab/app/src/androidTest/java/com/example/tuckingfypos/activities_and_intents/ApplicationTest.java
c6dc77888f14b909e2c3276ecef9b4bce3218944
[]
no_license
TuckingFypos/Activities-And-Intents-Lab
cef87b347d1dcd2c103d24eda5b9063b7d54ab3b
b2b55cbec812bffccf45911eea17543df872f82f
refs/heads/master
2020-12-25T13:51:07.180213
2016-07-01T11:20:25
2016-07-01T11:20:25
62,327,896
0
0
null
2016-06-30T16:54:50
2016-06-30T16:54:49
null
UTF-8
Java
false
false
378
java
package com.example.tuckingfypos.activities_and_intents; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "james.delayo@gmail.com" ]
james.delayo@gmail.com
0716c46033d867da42d74a6a656b08214158db96
04887c9c411d74aed748364e330742a29d69a863
/AUTH/001/example001/src/main/java/com/example001/support/security/UserDetailsServiceImpl.java
36e8e40f0fa52a6edfcae582ab0299653543e4ff
[]
no_license
agatespider/MP
9c4c74008577824dd5b30abbf8a37435f0ca0d50
178408bec559b428ccde3a87eacb1b92573f7dbd
refs/heads/master
2021-01-19T03:38:46.329361
2017-06-16T00:45:25
2017-06-16T00:45:25
84,406,881
0
0
null
2017-04-12T03:07:58
2017-03-09T06:33:25
JavaScript
UTF-8
Java
false
false
1,756
java
package com.example001.support.security; import com.example001.domain.User; import com.example001.repository.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.HashSet; import java.util.Set; /** * 로그인 인증을 위해서 UserDetailsService 구현체 개발 * @author 조호영 (kofwhgh@gmail.com) * @since 2017.03.10 * @version 0.1 * @see * * <pre> * << 개정이력(Modification Information) >> * * 수정일 수정자 수정내용 * ---------- ------ --------------------------- * 2017.03.10 조호영 최초 작성 * * </pre> */ @Service public class UserDetailsServiceImpl implements UserDetailsService { @Autowired private UserRepository userRepository; @Override @Transactional(readOnly = true) public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user = userRepository.findByUserId(username); Set<GrantedAuthority> grantedAuthorities = new HashSet<>(); grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_USER")); // 임의의 롤 ROLE_USER로 모두 매핑 return new org.springframework.security.core.userdetails.User(user.getUserId(), user.getUserPassword(), grantedAuthorities); } }
[ "lastfirsthero@gmail.com" ]
lastfirsthero@gmail.com
de832f1122d03499a82186da09f8ecacce00c2be
e41b87acffa9ea3d9a90a93630d57e8035a4cbc4
/metroSeguroFx/src/metrosegurofx/MetroSeguroFx.java
2b90793e36a24abb06f84f0d8a71bde21a6b2f24
[]
no_license
erickvazquez/metro-seguro
212dc1821eb1c8b13c58905211cee002a8a33d9f
49f4b67d845ffd563a8f7903bbc9684b1c5e0238
refs/heads/master
2022-11-23T23:08:41.608074
2020-07-31T23:53:38
2020-07-31T23:53:38
284,129,422
0
0
null
null
null
null
UTF-8
Java
false
false
1,456
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 metrosegurofx; import javafx.application.Application; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.stage.StageStyle; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; /** * * @author EHef_ */ public class MetroSeguroFx extends Application { double xOffset, yOffset; @Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); // stage.initStyle(StageStyle.TRANSPARENT); // scene.setFill(Color.TRANSPARENT); root.setOnMousePressed((MouseEvent event) -> { xOffset = event.getSceneX(); yOffset = event.getSceneY(); }); root.setOnMouseDragged((MouseEvent event) -> { stage.setX(event.getSceneX() - xOffset); stage.setY(event.getSceneY() - yOffset); }); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }
[ "erick.f.nunez@gmail.com" ]
erick.f.nunez@gmail.com
ea450d2279a50ec200404115a95efb887f1ca791
621a865f772ccbab32471fb388e20b620ebba6b0
/GameServer/java/net/sf/l2j/gameserver/instancemanager/QuestManager.java
cdf9a1082217785439a19a3eea88c2e5450efcaf
[]
no_license
BloodyDawn/Scions_of_Destiny
5257de035cdb7fe5ef92bc991119b464cba6790c
e03ef8117b57a1188ba80a381faff6f2e97d6c41
refs/heads/master
2021-01-12T00:02:47.744333
2017-04-24T06:30:39
2017-04-24T06:30:39
78,662,280
0
1
null
null
null
null
UTF-8
Java
false
false
6,019
java
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package net.sf.l2j.gameserver.instancemanager; import java.io.File; import java.io.IOException; import java.util.Map; import java.util.logging.Logger; import javolution.util.FastMap; import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.quest.Quest; import net.sf.l2j.gameserver.scripting.L2ScriptEngineManager; import net.sf.l2j.gameserver.scripting.ScriptManager; public class QuestManager extends ScriptManager<Quest> { protected static Logger _log = Logger.getLogger(QuestManager.class.getName()); // ========================================================= private static QuestManager _Instance; public static final QuestManager getInstance() { if (_Instance == null) { System.out.println("Initializing QuestManager"); _Instance = new QuestManager(); } return _Instance; } // ========================================================= // ========================================================= // Data Field private Map<String, Quest> _quests = new FastMap<>(); // ========================================================= // Constructor public QuestManager() { } // ========================================================= // Method - Public public final boolean reload(String questFolder) { Quest q = getQuest(questFolder); if (q == null) return false; return q.reload(); } /** * Reloads the quest given by questId.<BR> * <B>NOTICE: Will only work if the quest name is equal to the quest folder name</B> * @param questId The id of the quest to be reloaded * @return true if reload was successful, false otherwise */ public final boolean reload(int questId) { Quest q = getQuest(questId); if (q == null) return false; return q.reload(); } public final void reloadAllQuests() { _log.info("Reloading Server Scripts"); try { // unload all scripts for (Quest quest : _quests.values()) { if (quest != null) quest.unload(); } // Firstly, preconfigure jython path L2ScriptEngineManager.getInstance().preConfigure(); // now load all scripts File scripts = new File(Config.DATAPACK_ROOT + "/data/scripts.cfg"); L2ScriptEngineManager.getInstance().executeScriptList(scripts); QuestManager.getInstance().report(); } catch (IOException ioe) { _log.severe("Failed loading scripts.cfg, no script is going to be loaded"); } } public final void report() { System.out.println("Loaded: " + _quests.size() + " quests"); } public final void save() { for (Quest q : _quests.values()) q.saveGlobalData(); } // ========================================================= // Property - Public public final Quest getQuest(String name) { return _quests.get(name); } public final Quest getQuest(int questId) { for (Quest q : _quests.values()) { if (q.getQuestIntId() == questId) return q; } return null; } public final void addQuest(Quest newQuest) { if (newQuest == null) throw new IllegalArgumentException("Quest argument cannot be null"); Quest old = _quests.get(newQuest.getName()); // FIXME: unloading the old quest at this point is a tad too late. // the new quest has already initialized itself and read the data, starting // an unpredictable number of tasks with that data. The old quest will now // save data which will never be read. // However, requesting the newQuest to re-read the data is not necessarily a // good option, since the newQuest may have already started timers, spawned NPCs // or taken any other action which it might re-take by re-reading the data. // the current solution properly closes the running tasks of the old quest but // ignores the data; perhaps the least of all evils... if (old != null) { old.unload(); _log.info("Replaced: ("+old.getName()+") with a new version ("+newQuest.getName()+")"); } _quests.put(newQuest.getName(), newQuest); } public final boolean removeQuest(Quest q) { return _quests.remove(q.getName()) != null; } /** * @see net.sf.l2j.gameserver.scripting.ScriptManager#getAllManagedScripts() */ @Override public Iterable<Quest> getAllManagedScripts() { return _quests.values(); } /** * @see net.sf.l2j.gameserver.scripting.ScriptManager#unload(net.sf.l2j.gameserver.scripting.ManagedScript) */ @Override public boolean unload(Quest ms) { ms.saveGlobalData(); return removeQuest(ms); } /** * @see net.sf.l2j.gameserver.scripting.ScriptManager#getScriptManagerName() */ @Override public String getScriptManagerName() { return "QuestManager"; } }
[ "psv71@yandex.ru" ]
psv71@yandex.ru
c6d137174404fecde191255bc1abb32c620fd21f
56bdb8a0e8bf04a5ecb263e7d4ef1131f675c86b
/assignment/src/main/java/com/bjss/assignment/service/impl/BasketPrinterServiceImpl.java
4056d4745526ce754a8860ff85d56116dce3184e
[]
no_license
sahoora-nath/assignment
5fd9ec5cbb2d83f807d6c833d196806107503bc2
4e636fdeaefe303b2992fb7901ba06a76ea87ce0
refs/heads/master
2020-04-18T08:05:31.487110
2019-03-21T11:06:49
2019-03-21T11:06:49
167,383,966
0
0
null
null
null
null
UTF-8
Java
false
false
3,357
java
package com.bjss.assignment.service.impl; import com.bjss.assignment.PriceBasketException; import com.bjss.assignment.data.CartTotals; import com.bjss.assignment.data.Item; import com.bjss.assignment.service.BasketPrinterService; import org.springframework.context.MessageSource; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintStream; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.NumberFormat; import java.util.Locale; import java.util.Map; @Service public class BasketPrinterServiceImpl implements BasketPrinterService { private static final String NO_OFFERS_AVAILABLE = "no.offers.available"; @Resource(name = "messageSource") private MessageSource messageSource; @Override public void write(PrintStream out, CartTotals totals) throws PriceBasketException { if (out == null) { return; } try ( OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8")) { String subTotalString = getSubTotalMsg(totals.getSubTotal()); String offersString = getOffersMsg(totals.getOfferTotals()); String totalString = getTotalMsg(totals.getTotal()); writer.write(subTotalString + System.lineSeparator()); writer.write(offersString + System.lineSeparator()); writer.write(totalString + System.lineSeparator()); } catch (IOException ex) { throw new PriceBasketException( "BasketPrinter encountered an error occurred printing to the specified print stream", ex); } } public String getSubTotalMsg(BigDecimal subTotal) { NumberFormat numberFormatter = NumberFormat.getCurrencyInstance(Locale.getDefault()); String formatedValue = numberFormatter.format(subTotal); return messageSource.getMessage("subtotal", new Object[]{formatedValue}, Locale.getDefault()); } public String getOffersMsg(Map<String, Item> offerTotals) { StringBuilder sb = new StringBuilder(); if (offerTotals == null || offerTotals.isEmpty()) { sb.append(messageSource.getMessage(NO_OFFERS_AVAILABLE, new Object[]{}, Locale.getDefault())); sb.append(System.lineSeparator()); } else { for (Map.Entry<String, Item> itemEntry : offerTotals.entrySet()) { Item item = itemEntry.getValue(); BigDecimal discountInPence = (item.getDiscountPrice().multiply(new BigDecimal(100))) .setScale(0, RoundingMode.HALF_UP); BigDecimal discountPercentage = item.getDiscount().multiply(new BigDecimal(100)); sb.append(item.getId()).append(" ").append(discountPercentage).append("% off: -") .append(discountInPence).append("p").append(System.lineSeparator()); } } return sb.toString().trim(); } public String getTotalMsg(BigDecimal total) { NumberFormat numberFormatter = NumberFormat.getCurrencyInstance(Locale.getDefault()); String formatedValue = numberFormatter.format(total); return messageSource.getMessage("total", new Object[]{formatedValue}, Locale.getDefault()); } }
[ "sahoo.rabindra@gmail.com" ]
sahoo.rabindra@gmail.com
63b16426b612cbefee03a7fa53b24f51e1d234e5
83d56024094d15f64e07650dd2b606a38d7ec5f1
/sicc_druida/fuentes/java/contenido_textos_variables_consultar.java
17d172393fac33a11d2e2b4d2c2838d62486dc5a
[]
no_license
cdiglesias/SICC
bdeba6af8f49e8d038ef30b61fcc6371c1083840
72fedb14a03cb4a77f62885bec3226dbbed6a5bb
refs/heads/master
2021-01-19T19:45:14.788800
2016-04-07T16:20:51
2016-04-07T16:20:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
56,773
java
import org.w3c.dom.*; import java.util.ArrayList; public class contenido_textos_variables_consultar implements es.indra.druida.base.ObjetoXML { private ArrayList v = new ArrayList(); public Element getXML (Document doc){ getXML0(doc); getXML90(doc); getXML180(doc); getXML270(doc); getXML360(doc); getXML450(doc); getXML540(doc); getXML630(doc); getXML720(doc); return (Element)v.get(0); } /* Primer nodo */ private void getXML0(Document doc) { v.add(doc.createElement("PAGINA")); ((Element)v.get(0)).setAttribute("nombre","contenido_textos_variables_consultar" ); ((Element)v.get(0)).setAttribute("cod","01066" ); ((Element)v.get(0)).setAttribute("titulo","Consultar texto variable" ); ((Element)v.get(0)).setAttribute("estilos","estilosB3.css" ); ((Element)v.get(0)).setAttribute("colorf","#F0F0F0" ); ((Element)v.get(0)).setAttribute("msgle","Consultar texto variable" ); ((Element)v.get(0)).setAttribute("onload","onLoadPag()" ); ((Element)v.get(0)).setAttribute("xml:lang","es" ); ((Element)v.get(0)).setAttribute("repeat","N" ); /* Empieza nodo:1 / Elemento padre: 0 */ v.add(doc.createElement("JS")); ((Element)v.get(1)).setAttribute("src","sicc_util.js" ); ((Element)v.get(0)).appendChild((Element)v.get(1)); /* Termina nodo:1 */ /* Empieza nodo:2 / Elemento padre: 0 */ v.add(doc.createElement("JS")); ((Element)v.get(2)).setAttribute("src","PaginacionSicc.js" ); ((Element)v.get(0)).appendChild((Element)v.get(2)); /* Termina nodo:2 */ /* Empieza nodo:3 / Elemento padre: 0 */ v.add(doc.createElement("JS")); ((Element)v.get(3)).setAttribute("src","DruidaTransactionMare.js" ); ((Element)v.get(0)).appendChild((Element)v.get(3)); /* Termina nodo:3 */ /* Empieza nodo:4 / Elemento padre: 0 */ v.add(doc.createElement("JS")); ((Element)v.get(4)).setAttribute("src","contenido_textos_variables_consultar.js" ); ((Element)v.get(0)).appendChild((Element)v.get(4)); /* Termina nodo:4 */ /* Empieza nodo:5 / Elemento padre: 0 */ v.add(doc.createElement("JS")); ((Element)v.get(5)).setAttribute("src","validaciones_sicc.js" ); ((Element)v.get(0)).appendChild((Element)v.get(5)); /* Termina nodo:5 */ /* Empieza nodo:6 / Elemento padre: 0 */ v.add(doc.createElement("VALIDACION")); ((Element)v.get(0)).appendChild((Element)v.get(6)); /* Empieza nodo:7 / Elemento padre: 6 */ v.add(doc.createElement("ELEMENTO")); ((Element)v.get(7)).setAttribute("name","comboTipoCliente" ); ((Element)v.get(7)).setAttribute("required","true" ); ((Element)v.get(7)).setAttribute("cod","393" ); ((Element)v.get(6)).appendChild((Element)v.get(7)); /* Termina nodo:7 */ /* Termina nodo:6 */ /* Empieza nodo:8 / Elemento padre: 0 */ v.add(doc.createElement("FORMULARIO")); ((Element)v.get(8)).setAttribute("nombre","formulario" ); ((Element)v.get(8)).setAttribute("oculto","N" ); ((Element)v.get(0)).appendChild((Element)v.get(8)); /* Empieza nodo:9 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(9)).setAttribute("nombre","conectorAction" ); ((Element)v.get(9)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(9)); /* Termina nodo:9 */ /* Empieza nodo:10 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(10)).setAttribute("nombre","errCodigo" ); ((Element)v.get(10)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(10)); /* Termina nodo:10 */ /* Empieza nodo:11 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(11)).setAttribute("nombre","errDescripcion" ); ((Element)v.get(11)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(11)); /* Termina nodo:11 */ /* Empieza nodo:12 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(12)).setAttribute("nombre","accion" ); ((Element)v.get(12)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(12)); /* Termina nodo:12 */ /* Empieza nodo:13 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(13)).setAttribute("nombre","casoUso" ); ((Element)v.get(13)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(13)); /* Termina nodo:13 */ /* Empieza nodo:14 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(14)).setAttribute("nombre","pais" ); ((Element)v.get(14)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(14)); /* Termina nodo:14 */ /* Empieza nodo:15 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(15)).setAttribute("nombre","idioma" ); ((Element)v.get(15)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(15)); /* Termina nodo:15 */ /* Empieza nodo:16 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(16)).setAttribute("nombre","oidSeleccionado" ); ((Element)v.get(16)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(16)); /* Termina nodo:16 */ /* Empieza nodo:17 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(17)).setAttribute("nombre","oidTipoCliente" ); ((Element)v.get(17)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(17)); /* Termina nodo:17 */ /* Empieza nodo:18 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(18)).setAttribute("nombre","oidSubtipoCliente" ); ((Element)v.get(18)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(18)); /* Termina nodo:18 */ /* Empieza nodo:19 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(19)).setAttribute("nombre","oidTipoClasificacion" ); ((Element)v.get(19)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(19)); /* Termina nodo:19 */ /* Empieza nodo:20 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(20)).setAttribute("nombre","oidClasificacion" ); ((Element)v.get(20)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(20)); /* Termina nodo:20 */ /* Empieza nodo:21 / Elemento padre: 8 */ v.add(doc.createElement("VAR")); ((Element)v.get(21)).setAttribute("nombre","textoVariable" ); ((Element)v.get(21)).setAttribute("valor","" ); ((Element)v.get(8)).appendChild((Element)v.get(21)); /* Termina nodo:21 */ /* Empieza nodo:22 / Elemento padre: 8 */ v.add(doc.createElement("CAPA")); ((Element)v.get(22)).setAttribute("nombre","capa1" ); } private void getXML90(Document doc) { ((Element)v.get(8)).appendChild((Element)v.get(22)); /* Empieza nodo:23 / Elemento padre: 22 */ v.add(doc.createElement("table")); ((Element)v.get(23)).setAttribute("width","100%" ); ((Element)v.get(23)).setAttribute("border","0" ); ((Element)v.get(23)).setAttribute("cellspacing","0" ); ((Element)v.get(23)).setAttribute("cellpadding","0" ); ((Element)v.get(22)).appendChild((Element)v.get(23)); /* Empieza nodo:24 / Elemento padre: 23 */ v.add(doc.createElement("tr")); ((Element)v.get(23)).appendChild((Element)v.get(24)); /* Empieza nodo:25 / Elemento padre: 24 */ v.add(doc.createElement("td")); ((Element)v.get(25)).setAttribute("width","12" ); ((Element)v.get(25)).setAttribute("align","center" ); ((Element)v.get(24)).appendChild((Element)v.get(25)); /* Empieza nodo:26 / Elemento padre: 25 */ v.add(doc.createElement("IMG")); ((Element)v.get(26)).setAttribute("src","b.gif" ); ((Element)v.get(26)).setAttribute("width","12" ); ((Element)v.get(26)).setAttribute("height","12" ); ((Element)v.get(25)).appendChild((Element)v.get(26)); /* Termina nodo:26 */ /* Termina nodo:25 */ /* Empieza nodo:27 / Elemento padre: 24 */ v.add(doc.createElement("td")); ((Element)v.get(27)).setAttribute("width","750" ); ((Element)v.get(24)).appendChild((Element)v.get(27)); /* Empieza nodo:28 / Elemento padre: 27 */ v.add(doc.createElement("IMG")); ((Element)v.get(28)).setAttribute("src","b.gif" ); ((Element)v.get(27)).appendChild((Element)v.get(28)); /* Termina nodo:28 */ /* Termina nodo:27 */ /* Empieza nodo:29 / Elemento padre: 24 */ v.add(doc.createElement("td")); ((Element)v.get(29)).setAttribute("width","12" ); ((Element)v.get(24)).appendChild((Element)v.get(29)); /* Empieza nodo:30 / Elemento padre: 29 */ v.add(doc.createElement("IMG")); ((Element)v.get(30)).setAttribute("src","b.gif" ); ((Element)v.get(30)).setAttribute("width","12" ); ((Element)v.get(30)).setAttribute("height","1" ); ((Element)v.get(29)).appendChild((Element)v.get(30)); /* Termina nodo:30 */ /* Termina nodo:29 */ /* Termina nodo:24 */ /* Empieza nodo:31 / Elemento padre: 23 */ v.add(doc.createElement("tr")); ((Element)v.get(23)).appendChild((Element)v.get(31)); /* Empieza nodo:32 / Elemento padre: 31 */ v.add(doc.createElement("td")); ((Element)v.get(31)).appendChild((Element)v.get(32)); /* Empieza nodo:33 / Elemento padre: 32 */ v.add(doc.createElement("IMG")); ((Element)v.get(33)).setAttribute("src","b.gif" ); ((Element)v.get(32)).appendChild((Element)v.get(33)); /* Termina nodo:33 */ /* Termina nodo:32 */ /* Empieza nodo:34 / Elemento padre: 31 */ v.add(doc.createElement("td")); ((Element)v.get(31)).appendChild((Element)v.get(34)); /* Empieza nodo:35 / Elemento padre: 34 */ v.add(doc.createElement("fieldset")); ((Element)v.get(34)).appendChild((Element)v.get(35)); /* Empieza nodo:36 / Elemento padre: 35 */ v.add(doc.createElement("legend")); ((Element)v.get(36)).setAttribute("class","legend" ); ((Element)v.get(35)).appendChild((Element)v.get(36)); /* Empieza nodo:37 / Elemento padre: 36 */ v.add(doc.createElement("LABELC")); ((Element)v.get(37)).setAttribute("nombre","lblDatosAlta" ); ((Element)v.get(37)).setAttribute("alto","13" ); ((Element)v.get(37)).setAttribute("filas","1" ); ((Element)v.get(37)).setAttribute("cod","00127" ); ((Element)v.get(37)).setAttribute("id","legend" ); ((Element)v.get(36)).appendChild((Element)v.get(37)); /* Termina nodo:37 */ /* Termina nodo:36 */ /* Empieza nodo:38 / Elemento padre: 35 */ v.add(doc.createElement("table")); ((Element)v.get(38)).setAttribute("width","100%" ); ((Element)v.get(38)).setAttribute("border","0" ); ((Element)v.get(38)).setAttribute("align","center" ); ((Element)v.get(38)).setAttribute("cellspacing","0" ); ((Element)v.get(38)).setAttribute("cellpadding","0" ); ((Element)v.get(35)).appendChild((Element)v.get(38)); /* Empieza nodo:39 / Elemento padre: 38 */ v.add(doc.createElement("tr")); ((Element)v.get(38)).appendChild((Element)v.get(39)); /* Empieza nodo:40 / Elemento padre: 39 */ v.add(doc.createElement("td")); ((Element)v.get(40)).setAttribute("colspan","4" ); ((Element)v.get(39)).appendChild((Element)v.get(40)); /* Empieza nodo:41 / Elemento padre: 40 */ v.add(doc.createElement("IMG")); ((Element)v.get(41)).setAttribute("src","b.gif" ); ((Element)v.get(41)).setAttribute("width","8" ); ((Element)v.get(41)).setAttribute("height","8" ); ((Element)v.get(40)).appendChild((Element)v.get(41)); /* Termina nodo:41 */ /* Termina nodo:40 */ /* Termina nodo:39 */ /* Empieza nodo:42 / Elemento padre: 38 */ v.add(doc.createElement("tr")); ((Element)v.get(38)).appendChild((Element)v.get(42)); /* Empieza nodo:43 / Elemento padre: 42 */ v.add(doc.createElement("td")); ((Element)v.get(42)).appendChild((Element)v.get(43)); /* Empieza nodo:44 / Elemento padre: 43 */ v.add(doc.createElement("IMG")); ((Element)v.get(44)).setAttribute("src","b.gif" ); ((Element)v.get(44)).setAttribute("width","8" ); ((Element)v.get(44)).setAttribute("height","8" ); ((Element)v.get(43)).appendChild((Element)v.get(44)); /* Termina nodo:44 */ /* Termina nodo:43 */ /* Empieza nodo:45 / Elemento padre: 42 */ v.add(doc.createElement("td")); ((Element)v.get(42)).appendChild((Element)v.get(45)); /* Empieza nodo:46 / Elemento padre: 45 */ v.add(doc.createElement("LABELC")); ((Element)v.get(46)).setAttribute("nombre","lblTipoCliente" ); ((Element)v.get(46)).setAttribute("alto","13" ); ((Element)v.get(46)).setAttribute("filas","1" ); ((Element)v.get(46)).setAttribute("valor","" ); ((Element)v.get(46)).setAttribute("id","datosTitle" ); ((Element)v.get(46)).setAttribute("cod","393" ); ((Element)v.get(45)).appendChild((Element)v.get(46)); /* Termina nodo:46 */ /* Termina nodo:45 */ /* Empieza nodo:47 / Elemento padre: 42 */ v.add(doc.createElement("td")); } private void getXML180(Document doc) { ((Element)v.get(42)).appendChild((Element)v.get(47)); /* Empieza nodo:48 / Elemento padre: 47 */ v.add(doc.createElement("IMG")); ((Element)v.get(48)).setAttribute("src","b.gif" ); ((Element)v.get(48)).setAttribute("width","8" ); ((Element)v.get(48)).setAttribute("height","8" ); ((Element)v.get(47)).appendChild((Element)v.get(48)); /* Termina nodo:48 */ /* Termina nodo:47 */ /* Empieza nodo:49 / Elemento padre: 42 */ v.add(doc.createElement("td")); ((Element)v.get(42)).appendChild((Element)v.get(49)); /* Empieza nodo:50 / Elemento padre: 49 */ v.add(doc.createElement("LABELC")); ((Element)v.get(50)).setAttribute("nombre","lblSubtipoCliente" ); ((Element)v.get(50)).setAttribute("alto","13" ); ((Element)v.get(50)).setAttribute("filas","1" ); ((Element)v.get(50)).setAttribute("valor","" ); ((Element)v.get(50)).setAttribute("id","datosTitle" ); ((Element)v.get(50)).setAttribute("cod","595" ); ((Element)v.get(49)).appendChild((Element)v.get(50)); /* Termina nodo:50 */ /* Termina nodo:49 */ /* Empieza nodo:51 / Elemento padre: 42 */ v.add(doc.createElement("td")); ((Element)v.get(51)).setAttribute("width","100%" ); ((Element)v.get(42)).appendChild((Element)v.get(51)); /* Empieza nodo:52 / Elemento padre: 51 */ v.add(doc.createElement("IMG")); ((Element)v.get(52)).setAttribute("src","b.gif" ); ((Element)v.get(52)).setAttribute("width","8" ); ((Element)v.get(52)).setAttribute("height","8" ); ((Element)v.get(51)).appendChild((Element)v.get(52)); /* Termina nodo:52 */ /* Termina nodo:51 */ /* Termina nodo:42 */ /* Empieza nodo:53 / Elemento padre: 38 */ v.add(doc.createElement("tr")); ((Element)v.get(38)).appendChild((Element)v.get(53)); /* Empieza nodo:54 / Elemento padre: 53 */ v.add(doc.createElement("td")); ((Element)v.get(53)).appendChild((Element)v.get(54)); /* Empieza nodo:55 / Elemento padre: 54 */ v.add(doc.createElement("IMG")); ((Element)v.get(55)).setAttribute("src","b.gif" ); ((Element)v.get(55)).setAttribute("width","8" ); ((Element)v.get(55)).setAttribute("height","8" ); ((Element)v.get(54)).appendChild((Element)v.get(55)); /* Termina nodo:55 */ /* Termina nodo:54 */ /* Empieza nodo:56 / Elemento padre: 53 */ v.add(doc.createElement("td")); ((Element)v.get(56)).setAttribute("nowrap","nowrap" ); ((Element)v.get(53)).appendChild((Element)v.get(56)); /* Empieza nodo:57 / Elemento padre: 56 */ v.add(doc.createElement("COMBO")); ((Element)v.get(57)).setAttribute("nombre","comboTipoCliente" ); ((Element)v.get(57)).setAttribute("req","S" ); ((Element)v.get(57)).setAttribute("multiple","N" ); ((Element)v.get(57)).setAttribute("valorinicial","" ); ((Element)v.get(57)).setAttribute("textoinicial","" ); ((Element)v.get(57)).setAttribute("size","1" ); ((Element)v.get(57)).setAttribute("id","datosCampos" ); ((Element)v.get(57)).setAttribute("onchange","onChangeCmbTipoCliente();" ); ((Element)v.get(57)).setAttribute("onshtab","onShTabComboTipoCliente();" ); ((Element)v.get(57)).setAttribute("ontab","onTabComboTipoCliente();" ); ((Element)v.get(56)).appendChild((Element)v.get(57)); /* Empieza nodo:58 / Elemento padre: 57 */ v.add(doc.createElement("ROWSET")); ((Element)v.get(57)).appendChild((Element)v.get(58)); /* Termina nodo:58 */ /* Termina nodo:57 */ /* Termina nodo:56 */ /* Empieza nodo:59 / Elemento padre: 53 */ v.add(doc.createElement("td")); ((Element)v.get(53)).appendChild((Element)v.get(59)); /* Empieza nodo:60 / Elemento padre: 59 */ v.add(doc.createElement("IMG")); ((Element)v.get(60)).setAttribute("src","b.gif" ); ((Element)v.get(60)).setAttribute("width","8" ); ((Element)v.get(60)).setAttribute("height","8" ); ((Element)v.get(59)).appendChild((Element)v.get(60)); /* Termina nodo:60 */ /* Termina nodo:59 */ /* Empieza nodo:61 / Elemento padre: 53 */ v.add(doc.createElement("td")); ((Element)v.get(61)).setAttribute("nowrap","nowrap" ); ((Element)v.get(53)).appendChild((Element)v.get(61)); /* Empieza nodo:62 / Elemento padre: 61 */ v.add(doc.createElement("COMBO")); ((Element)v.get(62)).setAttribute("nombre","comboSubtipoCliente" ); ((Element)v.get(62)).setAttribute("req","N" ); ((Element)v.get(62)).setAttribute("multiple","N" ); ((Element)v.get(62)).setAttribute("valorinicial","" ); ((Element)v.get(62)).setAttribute("textoinicial","" ); ((Element)v.get(62)).setAttribute("size","1" ); ((Element)v.get(62)).setAttribute("id","datosCampos" ); ((Element)v.get(62)).setAttribute("onchange","onChangeSubtipoCliente();" ); ((Element)v.get(62)).setAttribute("onshtab","onShTabComboSubtipoCliente();" ); ((Element)v.get(62)).setAttribute("ontab","onTabComboSubtipoCliente();" ); ((Element)v.get(61)).appendChild((Element)v.get(62)); /* Empieza nodo:63 / Elemento padre: 62 */ v.add(doc.createElement("ROWSET")); ((Element)v.get(62)).appendChild((Element)v.get(63)); /* Termina nodo:63 */ /* Termina nodo:62 */ /* Termina nodo:61 */ /* Empieza nodo:64 / Elemento padre: 53 */ v.add(doc.createElement("td")); ((Element)v.get(64)).setAttribute("width","100%" ); ((Element)v.get(53)).appendChild((Element)v.get(64)); /* Empieza nodo:65 / Elemento padre: 64 */ v.add(doc.createElement("IMG")); ((Element)v.get(65)).setAttribute("src","b.gif" ); ((Element)v.get(65)).setAttribute("width","8" ); ((Element)v.get(65)).setAttribute("height","8" ); ((Element)v.get(64)).appendChild((Element)v.get(65)); /* Termina nodo:65 */ /* Termina nodo:64 */ /* Termina nodo:53 */ /* Empieza nodo:66 / Elemento padre: 38 */ v.add(doc.createElement("tr")); ((Element)v.get(38)).appendChild((Element)v.get(66)); /* Empieza nodo:67 / Elemento padre: 66 */ v.add(doc.createElement("td")); ((Element)v.get(67)).setAttribute("colspan","4" ); ((Element)v.get(66)).appendChild((Element)v.get(67)); /* Empieza nodo:68 / Elemento padre: 67 */ v.add(doc.createElement("IMG")); ((Element)v.get(68)).setAttribute("src","b.gif" ); ((Element)v.get(68)).setAttribute("width","8" ); } private void getXML270(Document doc) { ((Element)v.get(68)).setAttribute("height","8" ); ((Element)v.get(67)).appendChild((Element)v.get(68)); /* Termina nodo:68 */ /* Termina nodo:67 */ /* Termina nodo:66 */ /* Termina nodo:38 */ /* Empieza nodo:69 / Elemento padre: 35 */ v.add(doc.createElement("table")); ((Element)v.get(69)).setAttribute("width","100%" ); ((Element)v.get(69)).setAttribute("border","0" ); ((Element)v.get(69)).setAttribute("align","center" ); ((Element)v.get(69)).setAttribute("cellspacing","0" ); ((Element)v.get(69)).setAttribute("cellpadding","0" ); ((Element)v.get(35)).appendChild((Element)v.get(69)); /* Empieza nodo:70 / Elemento padre: 69 */ v.add(doc.createElement("tr")); ((Element)v.get(69)).appendChild((Element)v.get(70)); /* Empieza nodo:71 / Elemento padre: 70 */ v.add(doc.createElement("td")); ((Element)v.get(71)).setAttribute("colspan","4" ); ((Element)v.get(70)).appendChild((Element)v.get(71)); /* Empieza nodo:72 / Elemento padre: 71 */ v.add(doc.createElement("IMG")); ((Element)v.get(72)).setAttribute("src","b.gif" ); ((Element)v.get(72)).setAttribute("width","8" ); ((Element)v.get(72)).setAttribute("height","8" ); ((Element)v.get(71)).appendChild((Element)v.get(72)); /* Termina nodo:72 */ /* Termina nodo:71 */ /* Termina nodo:70 */ /* Empieza nodo:73 / Elemento padre: 69 */ v.add(doc.createElement("tr")); ((Element)v.get(69)).appendChild((Element)v.get(73)); /* Empieza nodo:74 / Elemento padre: 73 */ v.add(doc.createElement("td")); ((Element)v.get(73)).appendChild((Element)v.get(74)); /* Empieza nodo:75 / Elemento padre: 74 */ v.add(doc.createElement("IMG")); ((Element)v.get(75)).setAttribute("src","b.gif" ); ((Element)v.get(75)).setAttribute("width","8" ); ((Element)v.get(75)).setAttribute("height","8" ); ((Element)v.get(74)).appendChild((Element)v.get(75)); /* Termina nodo:75 */ /* Termina nodo:74 */ /* Empieza nodo:76 / Elemento padre: 73 */ v.add(doc.createElement("td")); ((Element)v.get(73)).appendChild((Element)v.get(76)); /* Empieza nodo:77 / Elemento padre: 76 */ v.add(doc.createElement("LABELC")); ((Element)v.get(77)).setAttribute("nombre","lblTipoClasificacion" ); ((Element)v.get(77)).setAttribute("alto","13" ); ((Element)v.get(77)).setAttribute("filas","1" ); ((Element)v.get(77)).setAttribute("valor","" ); ((Element)v.get(77)).setAttribute("id","datosTitle" ); ((Element)v.get(77)).setAttribute("cod","756" ); ((Element)v.get(76)).appendChild((Element)v.get(77)); /* Termina nodo:77 */ /* Termina nodo:76 */ /* Empieza nodo:78 / Elemento padre: 73 */ v.add(doc.createElement("td")); ((Element)v.get(73)).appendChild((Element)v.get(78)); /* Empieza nodo:79 / Elemento padre: 78 */ v.add(doc.createElement("IMG")); ((Element)v.get(79)).setAttribute("src","b.gif" ); ((Element)v.get(79)).setAttribute("width","8" ); ((Element)v.get(79)).setAttribute("height","8" ); ((Element)v.get(78)).appendChild((Element)v.get(79)); /* Termina nodo:79 */ /* Termina nodo:78 */ /* Empieza nodo:80 / Elemento padre: 73 */ v.add(doc.createElement("td")); ((Element)v.get(73)).appendChild((Element)v.get(80)); /* Empieza nodo:81 / Elemento padre: 80 */ v.add(doc.createElement("LABELC")); ((Element)v.get(81)).setAttribute("nombre","lblClasificacion" ); ((Element)v.get(81)).setAttribute("alto","13" ); ((Element)v.get(81)).setAttribute("filas","1" ); ((Element)v.get(81)).setAttribute("valor","" ); ((Element)v.get(81)).setAttribute("id","datosTitle" ); ((Element)v.get(81)).setAttribute("cod","550" ); ((Element)v.get(80)).appendChild((Element)v.get(81)); /* Termina nodo:81 */ /* Termina nodo:80 */ /* Empieza nodo:82 / Elemento padre: 73 */ v.add(doc.createElement("td")); ((Element)v.get(82)).setAttribute("width","100%" ); ((Element)v.get(73)).appendChild((Element)v.get(82)); /* Empieza nodo:83 / Elemento padre: 82 */ v.add(doc.createElement("IMG")); ((Element)v.get(83)).setAttribute("src","b.gif" ); ((Element)v.get(83)).setAttribute("width","8" ); ((Element)v.get(83)).setAttribute("height","8" ); ((Element)v.get(82)).appendChild((Element)v.get(83)); /* Termina nodo:83 */ /* Termina nodo:82 */ /* Termina nodo:73 */ /* Empieza nodo:84 / Elemento padre: 69 */ v.add(doc.createElement("tr")); ((Element)v.get(69)).appendChild((Element)v.get(84)); /* Empieza nodo:85 / Elemento padre: 84 */ v.add(doc.createElement("td")); ((Element)v.get(84)).appendChild((Element)v.get(85)); /* Empieza nodo:86 / Elemento padre: 85 */ v.add(doc.createElement("IMG")); ((Element)v.get(86)).setAttribute("src","b.gif" ); ((Element)v.get(86)).setAttribute("width","8" ); ((Element)v.get(86)).setAttribute("height","8" ); ((Element)v.get(85)).appendChild((Element)v.get(86)); /* Termina nodo:86 */ /* Termina nodo:85 */ /* Empieza nodo:87 / Elemento padre: 84 */ v.add(doc.createElement("td")); ((Element)v.get(87)).setAttribute("nowrap","nowrap" ); ((Element)v.get(84)).appendChild((Element)v.get(87)); /* Empieza nodo:88 / Elemento padre: 87 */ v.add(doc.createElement("COMBO")); ((Element)v.get(88)).setAttribute("nombre","comboTipoClasificacion" ); ((Element)v.get(88)).setAttribute("req","N" ); ((Element)v.get(88)).setAttribute("multiple","N" ); ((Element)v.get(88)).setAttribute("valorinicial","" ); ((Element)v.get(88)).setAttribute("textoinicial","" ); ((Element)v.get(88)).setAttribute("size","1" ); ((Element)v.get(88)).setAttribute("id","datosCampos" ); ((Element)v.get(88)).setAttribute("onchange","onChangeTipoClasificacion();" ); ((Element)v.get(88)).setAttribute("onshtab","onShTabComboTipoClasificacion();" ); ((Element)v.get(88)).setAttribute("ontab","onTabComboTipoClasificacion();" ); ((Element)v.get(87)).appendChild((Element)v.get(88)); /* Empieza nodo:89 / Elemento padre: 88 */ v.add(doc.createElement("ROWSET")); ((Element)v.get(88)).appendChild((Element)v.get(89)); /* Termina nodo:89 */ /* Termina nodo:88 */ /* Termina nodo:87 */ /* Empieza nodo:90 / Elemento padre: 84 */ v.add(doc.createElement("td")); } private void getXML360(Document doc) { ((Element)v.get(84)).appendChild((Element)v.get(90)); /* Empieza nodo:91 / Elemento padre: 90 */ v.add(doc.createElement("IMG")); ((Element)v.get(91)).setAttribute("src","b.gif" ); ((Element)v.get(91)).setAttribute("width","8" ); ((Element)v.get(91)).setAttribute("height","8" ); ((Element)v.get(90)).appendChild((Element)v.get(91)); /* Termina nodo:91 */ /* Termina nodo:90 */ /* Empieza nodo:92 / Elemento padre: 84 */ v.add(doc.createElement("td")); ((Element)v.get(92)).setAttribute("nowrap","nowrap" ); ((Element)v.get(84)).appendChild((Element)v.get(92)); /* Empieza nodo:93 / Elemento padre: 92 */ v.add(doc.createElement("COMBO")); ((Element)v.get(93)).setAttribute("nombre","comboClasificacion" ); ((Element)v.get(93)).setAttribute("req","N" ); ((Element)v.get(93)).setAttribute("multiple","N" ); ((Element)v.get(93)).setAttribute("valorinicial","" ); ((Element)v.get(93)).setAttribute("textoinicial","" ); ((Element)v.get(93)).setAttribute("size","1" ); ((Element)v.get(93)).setAttribute("id","datosCampos" ); ((Element)v.get(93)).setAttribute("onshtab","onShTabComboClasificacion();" ); ((Element)v.get(93)).setAttribute("ontab","onTabComboClasificacion();" ); ((Element)v.get(92)).appendChild((Element)v.get(93)); /* Empieza nodo:94 / Elemento padre: 93 */ v.add(doc.createElement("ROWSET")); ((Element)v.get(93)).appendChild((Element)v.get(94)); /* Termina nodo:94 */ /* Termina nodo:93 */ /* Termina nodo:92 */ /* Empieza nodo:95 / Elemento padre: 84 */ v.add(doc.createElement("td")); ((Element)v.get(95)).setAttribute("width","100%" ); ((Element)v.get(84)).appendChild((Element)v.get(95)); /* Empieza nodo:96 / Elemento padre: 95 */ v.add(doc.createElement("IMG")); ((Element)v.get(96)).setAttribute("src","b.gif" ); ((Element)v.get(96)).setAttribute("width","8" ); ((Element)v.get(96)).setAttribute("height","8" ); ((Element)v.get(95)).appendChild((Element)v.get(96)); /* Termina nodo:96 */ /* Termina nodo:95 */ /* Termina nodo:84 */ /* Empieza nodo:97 / Elemento padre: 69 */ v.add(doc.createElement("tr")); ((Element)v.get(69)).appendChild((Element)v.get(97)); /* Empieza nodo:98 / Elemento padre: 97 */ v.add(doc.createElement("td")); ((Element)v.get(98)).setAttribute("colspan","4" ); ((Element)v.get(97)).appendChild((Element)v.get(98)); /* Empieza nodo:99 / Elemento padre: 98 */ v.add(doc.createElement("IMG")); ((Element)v.get(99)).setAttribute("src","b.gif" ); ((Element)v.get(99)).setAttribute("width","8" ); ((Element)v.get(99)).setAttribute("height","8" ); ((Element)v.get(98)).appendChild((Element)v.get(99)); /* Termina nodo:99 */ /* Termina nodo:98 */ /* Termina nodo:97 */ /* Termina nodo:69 */ /* Termina nodo:35 */ /* Empieza nodo:100 / Elemento padre: 34 */ v.add(doc.createElement("fieldset")); ((Element)v.get(34)).appendChild((Element)v.get(100)); /* Empieza nodo:101 / Elemento padre: 100 */ v.add(doc.createElement("table")); ((Element)v.get(101)).setAttribute("width","100%" ); ((Element)v.get(101)).setAttribute("border","0" ); ((Element)v.get(101)).setAttribute("align","center" ); ((Element)v.get(101)).setAttribute("cellspacing","0" ); ((Element)v.get(101)).setAttribute("cellpadding","0" ); ((Element)v.get(100)).appendChild((Element)v.get(101)); /* Empieza nodo:102 / Elemento padre: 101 */ v.add(doc.createElement("tr")); ((Element)v.get(101)).appendChild((Element)v.get(102)); /* Empieza nodo:103 / Elemento padre: 102 */ v.add(doc.createElement("td")); ((Element)v.get(103)).setAttribute("class","botonera" ); ((Element)v.get(102)).appendChild((Element)v.get(103)); /* Empieza nodo:104 / Elemento padre: 103 */ v.add(doc.createElement("BOTON")); ((Element)v.get(104)).setAttribute("nombre","btnBuscar" ); ((Element)v.get(104)).setAttribute("ID","botonContenido" ); ((Element)v.get(104)).setAttribute("tipo","html" ); ((Element)v.get(104)).setAttribute("accion","onClickBtnBuscar();" ); ((Element)v.get(104)).setAttribute("estado","false" ); ((Element)v.get(104)).setAttribute("cod","MMGGlobal.queryButton.label" ); ((Element)v.get(104)).setAttribute("ontab","onTabBuscar();" ); ((Element)v.get(104)).setAttribute("onshtab","onShTabBuscar();" ); ((Element)v.get(103)).appendChild((Element)v.get(104)); /* Termina nodo:104 */ /* Termina nodo:103 */ /* Termina nodo:102 */ /* Termina nodo:101 */ /* Termina nodo:100 */ /* Termina nodo:34 */ /* Termina nodo:31 */ /* Termina nodo:23 */ /* Termina nodo:22 */ /* Empieza nodo:105 / Elemento padre: 8 */ v.add(doc.createElement("CAPA")); ((Element)v.get(105)).setAttribute("nombre","capaLista" ); ((Element)v.get(105)).setAttribute("ancho","100%" ); ((Element)v.get(105)).setAttribute("alto","330" ); ((Element)v.get(105)).setAttribute("x","5" ); ((Element)v.get(105)).setAttribute("y","170" ); ((Element)v.get(105)).setAttribute("colorf","" ); ((Element)v.get(105)).setAttribute("borde","0" ); ((Element)v.get(105)).setAttribute("imagenf","" ); ((Element)v.get(105)).setAttribute("repeat","" ); ((Element)v.get(105)).setAttribute("padding","" ); ((Element)v.get(105)).setAttribute("visibilidad","" ); ((Element)v.get(105)).setAttribute("contravsb","" ); ((Element)v.get(105)).setAttribute("zindex","" ); ((Element)v.get(8)).appendChild((Element)v.get(105)); /* Empieza nodo:106 / Elemento padre: 105 */ v.add(doc.createElement("LISTAEDITABLE")); ((Element)v.get(106)).setAttribute("nombre","listado1" ); ((Element)v.get(106)).setAttribute("ancho","369" ); ((Element)v.get(106)).setAttribute("alto","301" ); ((Element)v.get(106)).setAttribute("x","12" ); ((Element)v.get(106)).setAttribute("y","0" ); ((Element)v.get(106)).setAttribute("colorFondo","#CECFCE" ); ((Element)v.get(106)).setAttribute("msgDebugJS","S" ); ((Element)v.get(105)).appendChild((Element)v.get(106)); /* Empieza nodo:107 / Elemento padre: 106 */ v.add(doc.createElement("IMGBOTONES")); ((Element)v.get(107)).setAttribute("precarga","S" ); } private void getXML450(Document doc) { ((Element)v.get(107)).setAttribute("conROver","S" ); ((Element)v.get(106)).appendChild((Element)v.get(107)); /* Empieza nodo:108 / Elemento padre: 107 */ v.add(doc.createElement("BTNSELECCION")); ((Element)v.get(108)).setAttribute("normal","btnLista2N.gif" ); ((Element)v.get(108)).setAttribute("rollOver","btnLista2S.gif" ); ((Element)v.get(108)).setAttribute("seleccionado","btnLista2M.gif" ); ((Element)v.get(108)).setAttribute("desactivado","btnLista2D.gif" ); ((Element)v.get(107)).appendChild((Element)v.get(108)); /* Termina nodo:108 */ /* Empieza nodo:109 / Elemento padre: 107 */ v.add(doc.createElement("BTNMINIMIZAR")); ((Element)v.get(109)).setAttribute("minimizar","bot_pliega_columna_on.gif" ); ((Element)v.get(109)).setAttribute("minimROver","bot_pliega_columna_over.gif" ); ((Element)v.get(109)).setAttribute("maximizar","bot_despliega_columna_on.gif" ); ((Element)v.get(109)).setAttribute("aximROver","bot_despliega_columna_over.gif" ); ((Element)v.get(107)).appendChild((Element)v.get(109)); /* Termina nodo:109 */ /* Empieza nodo:110 / Elemento padre: 107 */ v.add(doc.createElement("BTNORDENAR")); ((Element)v.get(110)).setAttribute("ordenar","ascendente_on.gif" ); ((Element)v.get(110)).setAttribute("ordenarInv","descendente_on.gif" ); ((Element)v.get(107)).appendChild((Element)v.get(110)); /* Termina nodo:110 */ /* Termina nodo:107 */ /* Empieza nodo:111 / Elemento padre: 106 */ v.add(doc.createElement("LINEAS")); ((Element)v.get(106)).appendChild((Element)v.get(111)); /* Empieza nodo:112 / Elemento padre: 111 */ v.add(doc.createElement("GROSOR")); ((Element)v.get(112)).setAttribute("borde","1" ); ((Element)v.get(112)).setAttribute("horizDatos","1" ); ((Element)v.get(112)).setAttribute("horizCabecera","1" ); ((Element)v.get(112)).setAttribute("vertical","1" ); ((Element)v.get(112)).setAttribute("horizTitulo","1" ); ((Element)v.get(112)).setAttribute("horizBase","1" ); ((Element)v.get(111)).appendChild((Element)v.get(112)); /* Termina nodo:112 */ /* Empieza nodo:113 / Elemento padre: 111 */ v.add(doc.createElement("COLOR")); ((Element)v.get(113)).setAttribute("borde","#999999" ); ((Element)v.get(113)).setAttribute("vertCabecera","#E0E0E0" ); ((Element)v.get(113)).setAttribute("vertDatos","#FFFFFF" ); ((Element)v.get(113)).setAttribute("horizDatos","#FFFFFF" ); ((Element)v.get(113)).setAttribute("horizCabecera","#999999" ); ((Element)v.get(113)).setAttribute("horizTitulo","#999999" ); ((Element)v.get(113)).setAttribute("horizBase","#999999" ); ((Element)v.get(111)).appendChild((Element)v.get(113)); /* Termina nodo:113 */ /* Termina nodo:111 */ /* Empieza nodo:114 / Elemento padre: 106 */ v.add(doc.createElement("TITULO")); ((Element)v.get(114)).setAttribute("colFondo","#CECFCE" ); ((Element)v.get(114)).setAttribute("alto","22" ); ((Element)v.get(114)).setAttribute("imgFondo","" ); ((Element)v.get(114)).setAttribute("cod","00135" ); ((Element)v.get(114)).setAttribute("ID","datosTitle" ); ((Element)v.get(106)).appendChild((Element)v.get(114)); /* Termina nodo:114 */ /* Empieza nodo:115 / Elemento padre: 106 */ v.add(doc.createElement("BASE")); ((Element)v.get(115)).setAttribute("colFondo","#CECFCE" ); ((Element)v.get(115)).setAttribute("alto","22" ); ((Element)v.get(115)).setAttribute("imgFondo","" ); ((Element)v.get(106)).appendChild((Element)v.get(115)); /* Termina nodo:115 */ /* Empieza nodo:116 / Elemento padre: 106 */ v.add(doc.createElement("COLUMNAS")); ((Element)v.get(116)).setAttribute("ajustarMinimo","S" ); ((Element)v.get(116)).setAttribute("permiteOrdenar","S" ); ((Element)v.get(116)).setAttribute("blancosAInsertar","1" ); ((Element)v.get(116)).setAttribute("sinSaltoLinea","S" ); ((Element)v.get(116)).setAttribute("AnchoMinimizadas","20" ); ((Element)v.get(116)).setAttribute("botonOrdenar","S" ); ((Element)v.get(106)).appendChild((Element)v.get(116)); /* Empieza nodo:117 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(117)).setAttribute("ancho","100" ); ((Element)v.get(117)).setAttribute("minimizable","S" ); ((Element)v.get(117)).setAttribute("minimizada","N" ); ((Element)v.get(116)).appendChild((Element)v.get(117)); /* Termina nodo:117 */ /* Empieza nodo:118 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(118)).setAttribute("ancho","100" ); ((Element)v.get(118)).setAttribute("minimizable","S" ); ((Element)v.get(118)).setAttribute("minimizada","N" ); ((Element)v.get(116)).appendChild((Element)v.get(118)); /* Termina nodo:118 */ /* Empieza nodo:119 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(119)).setAttribute("ancho","100" ); ((Element)v.get(119)).setAttribute("minimizable","S" ); ((Element)v.get(119)).setAttribute("minimizada","N" ); ((Element)v.get(116)).appendChild((Element)v.get(119)); /* Termina nodo:119 */ /* Empieza nodo:120 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(120)).setAttribute("ancho","100" ); ((Element)v.get(120)).setAttribute("minimizable","S" ); ((Element)v.get(120)).setAttribute("minimizada","N" ); ((Element)v.get(116)).appendChild((Element)v.get(120)); /* Termina nodo:120 */ /* Empieza nodo:121 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(121)).setAttribute("ancho","100" ); ((Element)v.get(121)).setAttribute("minimizable","S" ); ((Element)v.get(121)).setAttribute("minimizada","N" ); ((Element)v.get(116)).appendChild((Element)v.get(121)); /* Termina nodo:121 */ /* Empieza nodo:122 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(122)).setAttribute("ancho","100" ); ((Element)v.get(122)).setAttribute("minimizable","S" ); ((Element)v.get(122)).setAttribute("minimizada","N" ); ((Element)v.get(122)).setAttribute("oculta","S" ); ((Element)v.get(116)).appendChild((Element)v.get(122)); /* Termina nodo:122 */ /* Empieza nodo:123 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(123)).setAttribute("ancho","100" ); } private void getXML540(Document doc) { ((Element)v.get(123)).setAttribute("minimizable","S" ); ((Element)v.get(123)).setAttribute("minimizada","N" ); ((Element)v.get(123)).setAttribute("oculta","S" ); ((Element)v.get(116)).appendChild((Element)v.get(123)); /* Termina nodo:123 */ /* Empieza nodo:124 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(124)).setAttribute("ancho","100" ); ((Element)v.get(124)).setAttribute("minimizable","S" ); ((Element)v.get(124)).setAttribute("minimizada","N" ); ((Element)v.get(124)).setAttribute("oculta","S" ); ((Element)v.get(116)).appendChild((Element)v.get(124)); /* Termina nodo:124 */ /* Empieza nodo:125 / Elemento padre: 116 */ v.add(doc.createElement("COL")); ((Element)v.get(125)).setAttribute("ancho","100" ); ((Element)v.get(125)).setAttribute("minimizable","S" ); ((Element)v.get(125)).setAttribute("minimizada","N" ); ((Element)v.get(125)).setAttribute("oculta","S" ); ((Element)v.get(116)).appendChild((Element)v.get(125)); /* Termina nodo:125 */ /* Termina nodo:116 */ /* Empieza nodo:126 / Elemento padre: 106 */ v.add(doc.createElement("CABECERA")); ((Element)v.get(126)).setAttribute("alto","25" ); ((Element)v.get(126)).setAttribute("IDScroll","EstCab" ); ((Element)v.get(126)).setAttribute("imgFondo","" ); ((Element)v.get(126)).setAttribute("colFondo","#CCCCCC" ); ((Element)v.get(106)).appendChild((Element)v.get(126)); /* Empieza nodo:127 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(127)).setAttribute("colFondo","" ); ((Element)v.get(127)).setAttribute("ID","EstCab" ); ((Element)v.get(127)).setAttribute("cod","393" ); ((Element)v.get(126)).appendChild((Element)v.get(127)); /* Elemento padre:127 / Elemento actual: 128 */ v.add(doc.createTextNode("Tipo cliente")); ((Element)v.get(127)).appendChild((Text)v.get(128)); /* Termina nodo Texto:128 */ /* Termina nodo:127 */ /* Empieza nodo:129 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(129)).setAttribute("colFondo","" ); ((Element)v.get(129)).setAttribute("ID","EstCab" ); ((Element)v.get(129)).setAttribute("cod","595" ); ((Element)v.get(126)).appendChild((Element)v.get(129)); /* Elemento padre:129 / Elemento actual: 130 */ v.add(doc.createTextNode("Subtipo cliente")); ((Element)v.get(129)).appendChild((Text)v.get(130)); /* Termina nodo Texto:130 */ /* Termina nodo:129 */ /* Empieza nodo:131 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(131)).setAttribute("colFondo","" ); ((Element)v.get(131)).setAttribute("ID","EstCab" ); ((Element)v.get(131)).setAttribute("cod","756" ); ((Element)v.get(126)).appendChild((Element)v.get(131)); /* Elemento padre:131 / Elemento actual: 132 */ v.add(doc.createTextNode("Tipo clasificacion")); ((Element)v.get(131)).appendChild((Text)v.get(132)); /* Termina nodo Texto:132 */ /* Termina nodo:131 */ /* Empieza nodo:133 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(133)).setAttribute("colFondo","" ); ((Element)v.get(133)).setAttribute("ID","EstCab" ); ((Element)v.get(133)).setAttribute("cod","550" ); ((Element)v.get(126)).appendChild((Element)v.get(133)); /* Elemento padre:133 / Elemento actual: 134 */ v.add(doc.createTextNode("Clasificacion")); ((Element)v.get(133)).appendChild((Text)v.get(134)); /* Termina nodo Texto:134 */ /* Termina nodo:133 */ /* Empieza nodo:135 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(135)).setAttribute("colFondo","" ); ((Element)v.get(135)).setAttribute("ID","EstCab" ); ((Element)v.get(135)).setAttribute("cod","3108" ); ((Element)v.get(126)).appendChild((Element)v.get(135)); /* Elemento padre:135 / Elemento actual: 136 */ v.add(doc.createTextNode("Texto variable")); ((Element)v.get(135)).appendChild((Text)v.get(136)); /* Termina nodo Texto:136 */ /* Termina nodo:135 */ /* Empieza nodo:137 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(137)).setAttribute("colFondo","" ); ((Element)v.get(137)).setAttribute("ID","EstCab" ); ((Element)v.get(137)).setAttribute("cod","" ); ((Element)v.get(126)).appendChild((Element)v.get(137)); /* Termina nodo:137 */ /* Empieza nodo:138 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(138)).setAttribute("colFondo","" ); ((Element)v.get(138)).setAttribute("ID","EstCab" ); ((Element)v.get(138)).setAttribute("cod","" ); ((Element)v.get(126)).appendChild((Element)v.get(138)); /* Termina nodo:138 */ /* Empieza nodo:139 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(139)).setAttribute("colFondo","" ); ((Element)v.get(139)).setAttribute("ID","EstCab" ); ((Element)v.get(139)).setAttribute("cod","" ); ((Element)v.get(126)).appendChild((Element)v.get(139)); /* Termina nodo:139 */ /* Empieza nodo:140 / Elemento padre: 126 */ v.add(doc.createElement("COL")); ((Element)v.get(140)).setAttribute("colFondo","" ); ((Element)v.get(140)).setAttribute("ID","EstCab" ); ((Element)v.get(140)).setAttribute("cod","" ); ((Element)v.get(126)).appendChild((Element)v.get(140)); /* Termina nodo:140 */ /* Termina nodo:126 */ /* Empieza nodo:141 / Elemento padre: 106 */ v.add(doc.createElement("DATOS")); ((Element)v.get(141)).setAttribute("alto","22" ); ((Element)v.get(141)).setAttribute("accion","" ); ((Element)v.get(141)).setAttribute("tipoEnvio","edicion" ); ((Element)v.get(141)).setAttribute("formaEnvio","xml" ); ((Element)v.get(141)).setAttribute("maxSel","1" ); ((Element)v.get(141)).setAttribute("msgErrMaxSel","" ); ((Element)v.get(141)).setAttribute("coloresScrollNativo","#D4D0C8,black,white,#D4D0C8,#D4D0C8,#ECE9E4,black" ); ((Element)v.get(141)).setAttribute("colorROver","#D0D9E8" ); ((Element)v.get(141)).setAttribute("onLoad","" ); ((Element)v.get(141)).setAttribute("colorSelecc","#D0D9E8" ); ((Element)v.get(106)).appendChild((Element)v.get(141)); /* Empieza nodo:142 / Elemento padre: 141 */ v.add(doc.createElement("COL")); } private void getXML630(Document doc) { ((Element)v.get(142)).setAttribute("tipo","texto" ); ((Element)v.get(142)).setAttribute("ID","EstDat" ); ((Element)v.get(141)).appendChild((Element)v.get(142)); /* Termina nodo:142 */ /* Empieza nodo:143 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(143)).setAttribute("tipo","texto" ); ((Element)v.get(143)).setAttribute("ID","EstDat2" ); ((Element)v.get(141)).appendChild((Element)v.get(143)); /* Termina nodo:143 */ /* Empieza nodo:144 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(144)).setAttribute("tipo","texto" ); ((Element)v.get(144)).setAttribute("ID","EstDat" ); ((Element)v.get(141)).appendChild((Element)v.get(144)); /* Termina nodo:144 */ /* Empieza nodo:145 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(145)).setAttribute("tipo","texto" ); ((Element)v.get(145)).setAttribute("ID","EstDat2" ); ((Element)v.get(141)).appendChild((Element)v.get(145)); /* Termina nodo:145 */ /* Empieza nodo:146 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(146)).setAttribute("tipo","texto" ); ((Element)v.get(146)).setAttribute("ID","EstDat" ); ((Element)v.get(141)).appendChild((Element)v.get(146)); /* Termina nodo:146 */ /* Empieza nodo:147 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(147)).setAttribute("tipo","texto" ); ((Element)v.get(147)).setAttribute("ID","EstDat2" ); ((Element)v.get(141)).appendChild((Element)v.get(147)); /* Termina nodo:147 */ /* Empieza nodo:148 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(148)).setAttribute("tipo","texto" ); ((Element)v.get(148)).setAttribute("ID","EstDat" ); ((Element)v.get(141)).appendChild((Element)v.get(148)); /* Termina nodo:148 */ /* Empieza nodo:149 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(149)).setAttribute("tipo","texto" ); ((Element)v.get(149)).setAttribute("ID","EstDat2" ); ((Element)v.get(141)).appendChild((Element)v.get(149)); /* Termina nodo:149 */ /* Empieza nodo:150 / Elemento padre: 141 */ v.add(doc.createElement("COL")); ((Element)v.get(150)).setAttribute("tipo","texto" ); ((Element)v.get(150)).setAttribute("ID","EstDat" ); ((Element)v.get(141)).appendChild((Element)v.get(150)); /* Termina nodo:150 */ /* Termina nodo:141 */ /* Empieza nodo:151 / Elemento padre: 106 */ v.add(doc.createElement("ROWSET")); ((Element)v.get(106)).appendChild((Element)v.get(151)); /* Termina nodo:151 */ /* Empieza nodo:152 / Elemento padre: 106 */ v.add(doc.createElement("PAGINADO")); ((Element)v.get(152)).setAttribute("nombre","mipgndo" ); ((Element)v.get(152)).setAttribute("ancho","679" ); ((Element)v.get(152)).setAttribute("sep","$" ); ((Element)v.get(152)).setAttribute("x","12" ); ((Element)v.get(152)).setAttribute("class","botonera" ); ((Element)v.get(152)).setAttribute("y","294" ); ((Element)v.get(152)).setAttribute("control","|" ); ((Element)v.get(152)).setAttribute("conector","" ); ((Element)v.get(152)).setAttribute("rowset","" ); ((Element)v.get(152)).setAttribute("cargainicial","N" ); ((Element)v.get(152)).setAttribute("onload","procesarPaginado(mipgndo,msgError, ultima, rowset, 'muestraLista(ultima, rowset)')" ); ((Element)v.get(106)).appendChild((Element)v.get(152)); /* Empieza nodo:153 / Elemento padre: 152 */ v.add(doc.createElement("BOTON")); ((Element)v.get(153)).setAttribute("nombre","ret1" ); ((Element)v.get(153)).setAttribute("x","37" ); ((Element)v.get(153)).setAttribute("y","282" ); ((Element)v.get(153)).setAttribute("ID","botonContenido" ); ((Element)v.get(153)).setAttribute("img","retroceder_on" ); ((Element)v.get(153)).setAttribute("tipo","0" ); ((Element)v.get(153)).setAttribute("estado","false" ); ((Element)v.get(153)).setAttribute("alt","" ); ((Element)v.get(153)).setAttribute("codigo","" ); ((Element)v.get(153)).setAttribute("accion","mipgndo.retroceder();" ); ((Element)v.get(152)).appendChild((Element)v.get(153)); /* Termina nodo:153 */ /* Empieza nodo:154 / Elemento padre: 152 */ v.add(doc.createElement("BOTON")); ((Element)v.get(154)).setAttribute("nombre","ava1" ); ((Element)v.get(154)).setAttribute("x","52" ); ((Element)v.get(154)).setAttribute("y","282" ); ((Element)v.get(154)).setAttribute("ID","botonContenido" ); ((Element)v.get(154)).setAttribute("img","avanzar_on" ); ((Element)v.get(154)).setAttribute("tipo","0" ); ((Element)v.get(154)).setAttribute("estado","false" ); ((Element)v.get(154)).setAttribute("alt","" ); ((Element)v.get(154)).setAttribute("codigo","" ); ((Element)v.get(154)).setAttribute("accion","mipgndo.avanzar();" ); ((Element)v.get(152)).appendChild((Element)v.get(154)); /* Termina nodo:154 */ /* Termina nodo:152 */ /* Termina nodo:106 */ /* Empieza nodo:155 / Elemento padre: 105 */ v.add(doc.createElement("BOTON")); ((Element)v.get(155)).setAttribute("nombre","primera1" ); ((Element)v.get(155)).setAttribute("x","20" ); ((Element)v.get(155)).setAttribute("y","282" ); ((Element)v.get(155)).setAttribute("ID","botonContenido" ); ((Element)v.get(155)).setAttribute("img","primera_on" ); ((Element)v.get(155)).setAttribute("tipo","-2" ); ((Element)v.get(155)).setAttribute("estado","false" ); ((Element)v.get(155)).setAttribute("alt","" ); ((Element)v.get(155)).setAttribute("codigo","" ); ((Element)v.get(155)).setAttribute("accion","mipgndo.retrocederPrimeraPagina();" ); ((Element)v.get(105)).appendChild((Element)v.get(155)); /* Termina nodo:155 */ /* Empieza nodo:156 / Elemento padre: 105 */ v.add(doc.createElement("BOTON")); ((Element)v.get(156)).setAttribute("nombre","separa" ); ((Element)v.get(156)).setAttribute("x","59" ); ((Element)v.get(156)).setAttribute("y","278" ); } private void getXML720(Document doc) { ((Element)v.get(156)).setAttribute("ID","botonContenido" ); ((Element)v.get(156)).setAttribute("img","separa_base" ); ((Element)v.get(156)).setAttribute("tipo","0" ); ((Element)v.get(156)).setAttribute("estado","false" ); ((Element)v.get(156)).setAttribute("alt","" ); ((Element)v.get(156)).setAttribute("codigo","" ); ((Element)v.get(156)).setAttribute("accion","" ); ((Element)v.get(105)).appendChild((Element)v.get(156)); /* Termina nodo:156 */ /* Empieza nodo:157 / Elemento padre: 105 */ v.add(doc.createElement("BOTON")); ((Element)v.get(157)).setAttribute("nombre","btnDetalle" ); ((Element)v.get(157)).setAttribute("x","80" ); ((Element)v.get(157)).setAttribute("y","279" ); ((Element)v.get(157)).setAttribute("ID","botonContenido" ); ((Element)v.get(157)).setAttribute("tipo","html" ); ((Element)v.get(157)).setAttribute("estado","false" ); ((Element)v.get(157)).setAttribute("cod","MMGGlobal.viewButton.label" ); ((Element)v.get(157)).setAttribute("accion","onClickBtnDetalle();" ); ((Element)v.get(157)).setAttribute("ontab","ontabBotonDetalle();" ); ((Element)v.get(157)).setAttribute("onshtab","onshtabBotonDetalle();" ); ((Element)v.get(105)).appendChild((Element)v.get(157)); /* Termina nodo:157 */ /* Empieza nodo:158 / Elemento padre: 105 */ v.add(doc.createElement("BOTON")); ((Element)v.get(158)).setAttribute("nombre","btnModificar" ); ((Element)v.get(158)).setAttribute("x","80" ); ((Element)v.get(158)).setAttribute("y","279" ); ((Element)v.get(158)).setAttribute("ID","botonContenido" ); ((Element)v.get(158)).setAttribute("tipo","html" ); ((Element)v.get(158)).setAttribute("estado","false" ); ((Element)v.get(158)).setAttribute("cod","MMGGlobal.updateButton.label" ); ((Element)v.get(158)).setAttribute("accion","onClickBtnModificar();" ); ((Element)v.get(158)).setAttribute("ontab","ontabBotonModificar();" ); ((Element)v.get(158)).setAttribute("onshtab","onshtabBotonModificar();" ); ((Element)v.get(105)).appendChild((Element)v.get(158)); /* Termina nodo:158 */ /* Termina nodo:105 */ /* Termina nodo:8 */ } }
[ "hp.vega@hotmail.com" ]
hp.vega@hotmail.com
eb591361bfbc95bd5882d03f8c97978b25921341
92f75f65766402204ecbeaac6cece2a75bbf7c0d
/src/main/java/com/demotivirus/Day_164/Main.java
88e3f8e91f046c3fb429e34626e21486786b5bf6
[]
no_license
demotivirus/365_Days_Challenge
338139efe4f677ebb78abac4e4c674639ad78ab8
cfc25eb921dd59f9581a39bf00fb0fc15809e4bb
refs/heads/master
2023-07-21T19:04:26.927157
2021-09-07T20:25:29
2021-09-07T20:25:29
336,847,354
1
0
null
2021-09-07T20:20:42
2021-02-07T17:32:36
Java
UTF-8
Java
false
false
215
java
package com.demotivirus.Day_164; public class Main { public static void main(String[] args) { DataBase dataBase = DataBaseFactory.create("PostgreSQL"); dataBase.execute(Command.SELECT); } }
[ "demotivirus@gmail.com" ]
demotivirus@gmail.com
29b268a5e011a42704e8b32cd3ad35d33b6d2c30
80807f2729b47af4ab482734ea50f392e21ee0b1
/app/src/main/java/com/jin/dayjob/push/ConnectionDetector.java
0b62d6a79e22d0539c4171ee2442c9d11e78cb39
[]
no_license
DayJob/newDayJob
7258302c215747365d170ee93f39e5d5aec02b5b
0130b202bad0f24207429f44958c7528a97146be
refs/heads/master
2016-08-05T01:03:50.006852
2015-10-06T10:39:35
2015-10-06T10:39:35
37,664,485
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
package com.jin.dayjob.push; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class ConnectionDetector { private Context _context; public ConnectionDetector(Context context){ this._context = context; } /** * Checking for all possible internet providers * **/ public boolean isConnectingToInternet(){ ConnectivityManager connectivity = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivity != null) { NetworkInfo[] info = connectivity.getAllNetworkInfo(); if (info != null) for (int i = 0; i < info.length; i++) if (info[i].getState() == NetworkInfo.State.CONNECTED) { return true; } } return false; } }
[ "ac12bd@gmail.com" ]
ac12bd@gmail.com
6724e17e46d8d863002f5db101aa036d298bc9b8
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/neo4j--neo4j/b25304644f07927716bafb9ca958515b07a9040e/after/GenSafePointerPairTest.java
3ac37229424bbc469ef55ff1bbbdc4effcdbec0e
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
28,365
java
/* * Copyright (c) 2002-2016 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.index.gbptree; import org.junit.Test; import org.neo4j.io.pagecache.PageCursor; import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.neo4j.index.gbptree.GenSafePointerPair.BROKEN; import static org.neo4j.index.gbptree.GenSafePointerPair.CRASH; import static org.neo4j.index.gbptree.GenSafePointerPair.EMPTY; import static org.neo4j.index.gbptree.GenSafePointerPair.GEN_COMPARISON_MASK; import static org.neo4j.index.gbptree.GenSafePointerPair.READ; import static org.neo4j.index.gbptree.GenSafePointerPair.READ_OR_WRITE_MASK; import static org.neo4j.index.gbptree.GenSafePointerPair.STABLE; import static org.neo4j.index.gbptree.GenSafePointerPair.STATE_SHIFT_A; import static org.neo4j.index.gbptree.GenSafePointerPair.STATE_SHIFT_B; import static org.neo4j.index.gbptree.GenSafePointerPair.UNSTABLE; import static org.neo4j.index.gbptree.GenSafePointerPair.WRITE; import static org.neo4j.index.gbptree.GenSafePointerPair.failureDescription; import static org.neo4j.index.gbptree.GenSafePointerPair.isRead; import static org.neo4j.index.gbptree.GenSafePointerPair.pointerStateFromResult; import static org.neo4j.index.gbptree.GenSafePointerPair.pointerStateName; public class GenSafePointerPairTest { private static final int PAGE_SIZE = 128; private static final int OLDER_STABLE_GENERATION = 1; private static final int STABLE_GENERATION = 2; private static final int OLDER_CRASH_GENERATION = 3; private static final int CRASH_GENERATION = 4; private static final int UNSTABLE_GENERATION = 5; private static final long EMPTY_POINTER = 0L; private static final long POINTER_A = 5; private static final long POINTER_B = 6; private static final long WRITTEN_POINTER = 10; private static final int EXPECTED_GEN_DISREGARD = -2; private static final int EXPECTED_GEN_B_BIG = -1; private static final int EXPECTED_GEN_EQUAL = 0; private static final int EXPECTED_GEN_A_BIG = 1; private static final boolean SLOT_A = true; private static final boolean SLOT_B = false; private final PageCursor cursor = ByteArrayPageCursor.wrap( new byte[PAGE_SIZE] ); @Test public void readEmptyEmptyShouldFail() throws Exception { // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, EMPTY, EMPTY ); } @Test public void writeEmptyEmptyShouldWriteSlotA() throws Exception { // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_A, written ); assertEquals( WRITTEN_POINTER, readSlotA() ); assertEquals( EMPTY_POINTER, readSlotB() ); } @Test public void readEmptyUnstableShouldReadSlotB() throws Exception { // GIVEN writeSlotB( UNSTABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_B, result ); } @Test public void writeEmptyUnstableShouldWriteSlotB() throws Exception { // GIVEN writeSlotB( UNSTABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_B, written ); assertEquals( EMPTY_POINTER, readSlotA() ); assertEquals( WRITTEN_POINTER, readSlotB() ); } @Test public void readEmptyStableShouldReadSlotB() throws Exception { // GIVEN writeSlotB( STABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_B, result ); } @Test public void writeEmptyStableShouldWriteSlotA() throws Exception { // GIVEN writeSlotB( STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_A, written ); assertEquals( WRITTEN_POINTER, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readEmptyCrashShouldFail() throws Exception { // GIVEN writeSlotB( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, EMPTY, CRASH ); } @Test public void writeEmptyCrashShouldFail() throws Exception { // GIVEN writeSlotB( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, EMPTY, CRASH ); assertEquals( EMPTY_POINTER, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } // TODO: On all writes, verify slot result @Test public void readEmptyBrokenShouldFail() throws Exception { // GIVEN writeBrokenSlotB(); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, EMPTY, BROKEN ); } @Test public void writeEmptyBrokenShouldFail() throws Exception { // GIVEN writeBrokenSlotB(); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, EMPTY, BROKEN ); assertEquals( EMPTY_POINTER, readSlotA() ); assertBrokenB(); } @Test public void readUnstableEmptyShouldReadSlotA() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_A, result ); } @Test public void writeUnstableEmptyShouldWriteSlotA() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_A, written ); assertEquals( WRITTEN_POINTER, readSlotA() ); assertEquals( EMPTY_POINTER, readSlotB() ); } @Test public void readUnstableUnstableShouldFail() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); writeSlotB( UNSTABLE_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_EQUAL, UNSTABLE, UNSTABLE ); } @Test public void writeUnstableUnstableShouldFail() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); writeSlotB( UNSTABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_EQUAL, UNSTABLE, UNSTABLE ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readUnstableCrashShouldFail() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_A_BIG, UNSTABLE, CRASH ); } @Test public void writeUnstableCrashShouldFail() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_A_BIG, UNSTABLE, CRASH ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readUnstableBrokenShouldFail() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); writeBrokenSlotB(); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, UNSTABLE, BROKEN ); } @Test public void writeUnstableBrokenShouldFail() throws Exception { // GIVEN writeSlotA( UNSTABLE_GENERATION ); writeBrokenSlotB(); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, UNSTABLE, BROKEN ); assertEquals( POINTER_A, readSlotA() ); assertBrokenB(); } @Test public void readStableEmptyShouldReadSlotA() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_A, result ); } @Test public void writeStableEmptyShouldWriteSlotB() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_B, written ); assertEquals( POINTER_A, readSlotA() ); assertEquals( WRITTEN_POINTER, readSlotB() ); } @Test public void readStableUnstableShouldReadSlotB() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( UNSTABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_B, result ); } @Test public void writeStableUnstableShouldWriteSlotB() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( UNSTABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_B, written ); assertEquals( POINTER_A, readSlotA() ); assertEquals( WRITTEN_POINTER, readSlotB() ); } @Test public void readStableStableShouldFail() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( STABLE_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_EQUAL, STABLE, STABLE ); } @Test public void writeStableStableShouldFail() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_EQUAL, STABLE, STABLE ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readStableOlderStableShouldReadSlotA() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( OLDER_STABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_A, result ); } @Test public void writeStableOlderStableShouldWriteSlotB() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( OLDER_STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_B, written ); assertEquals( POINTER_A, readSlotA() ); assertEquals( WRITTEN_POINTER, readSlotB() ); } @Test public void readOlderStableStableShouldReadSlotB() throws Exception { // GIVEN writeSlotA( OLDER_STABLE_GENERATION ); writeSlotB( STABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_B, result ); } @Test public void writeOlderStableStableShouldWriteSlotA() throws Exception { // GIVEN writeSlotA( OLDER_STABLE_GENERATION ); writeSlotB( STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_A, written ); assertEquals( WRITTEN_POINTER, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readStableCrashShouldReadSlotA() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_A, result ); } @Test public void writeStableCrashShouldWriteSlotB() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_B, written ); assertEquals( POINTER_A, readSlotA() ); assertEquals( WRITTEN_POINTER, readSlotB() ); } @Test public void readStableBrokenShouldReadSlotA() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeBrokenSlotB(); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_A, result ); } @Test public void writeStableBrokenShouldWriteSlotB() throws Exception { // GIVEN writeSlotA( STABLE_GENERATION ); writeBrokenSlotB(); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_B, written ); assertEquals( POINTER_A, readSlotA() ); assertEquals( WRITTEN_POINTER, readSlotB() ); } @Test public void readCrashEmptyShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, CRASH, EMPTY ); } @Test public void writeCrashEmptyShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, CRASH, EMPTY ); assertEquals( POINTER_A, readSlotA() ); assertEquals( EMPTY_POINTER, readSlotB() ); } @Test public void readCrashUnstableShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( UNSTABLE_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_B_BIG, CRASH, UNSTABLE ); } @Test public void writeCrashUnstableShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( UNSTABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_B_BIG, CRASH, UNSTABLE ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readCrashStableShouldReadSlotB() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( STABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_B, result ); } @Test public void writeCrashStableShouldWriteSlotA() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_A, written ); assertEquals( WRITTEN_POINTER, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readCrashCrashShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_EQUAL, CRASH, CRASH ); } @Test public void writeCrashCrashShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_EQUAL, CRASH, CRASH ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readCrashOlderCrashShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( OLDER_CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_A_BIG, CRASH, CRASH ); } @Test public void writeCrashOlderCrashShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeSlotB( OLDER_CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_A_BIG, CRASH, CRASH ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readOlderCrashCrashShouldFail() throws Exception { // GIVEN writeSlotA( OLDER_CRASH_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_B_BIG, CRASH, CRASH ); } @Test public void writeOlderCrashCrashShouldFail() throws Exception { // GIVEN writeSlotA( OLDER_CRASH_GENERATION ); writeSlotB( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_B_BIG, CRASH, CRASH ); assertEquals( POINTER_A, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readCrashBrokenShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeBrokenSlotB(); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, CRASH, BROKEN ); } @Test public void writeCrashBrokenShouldFail() throws Exception { // GIVEN writeSlotA( CRASH_GENERATION ); writeBrokenSlotB(); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, CRASH, BROKEN ); assertEquals( POINTER_A, readSlotA() ); assertBrokenB(); } @Test public void readBrokenEmptyShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, BROKEN, EMPTY ); } @Test public void writeBrokenEmptyShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, BROKEN, EMPTY ); assertBrokenA(); assertEquals( EMPTY_POINTER, readSlotB() ); } @Test public void readBrokenUnstableShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); writeSlotB( UNSTABLE_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, BROKEN, UNSTABLE ); } @Test public void writeBrokenUnstableShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); writeSlotB( UNSTABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, BROKEN, UNSTABLE ); assertBrokenA(); assertEquals( POINTER_B, readSlotB() ); } @Test public void readBrokenStableShouldReadSlotB() throws Exception { // GIVEN writeBrokenSlotA(); writeSlotB( STABLE_GENERATION ); // WHEN long result = read(); // THEN assertReadSuccess( POINTER_B, result ); } @Test public void writeBrokenStableShouldWriteSlotA() throws Exception { // GIVEN writeBrokenSlotA(); writeSlotB( STABLE_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertWriteSuccess( SLOT_A, written ); assertEquals( WRITTEN_POINTER, readSlotA() ); assertEquals( POINTER_B, readSlotB() ); } @Test public void readBrokenCrashShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); writeSlotB( CRASH_GENERATION ); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, BROKEN, CRASH ); } @Test public void writeBrokenCrashShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); writeSlotB( CRASH_GENERATION ); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, BROKEN, CRASH ); assertBrokenA(); assertEquals( POINTER_B, readSlotB() ); } @Test public void readBrokenBrokenShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); writeBrokenSlotB(); // WHEN long result = read(); // THEN assertFailure( result, READ, EXPECTED_GEN_DISREGARD, BROKEN, BROKEN ); } @Test public void writeBrokenBrokenShouldFail() throws Exception { // GIVEN writeBrokenSlotA(); writeBrokenSlotB(); // WHEN long written = write( WRITTEN_POINTER ); // THEN assertFailure( written, WRITE, EXPECTED_GEN_DISREGARD, BROKEN, BROKEN ); assertBrokenA(); assertBrokenB(); } private void assertFailure( long result, long readOrWrite, int genComparison, byte pointerStateA, byte pointerStateB ) { assertFalse( GenSafePointerPair.isSuccess( result ) ); // Raw failure bits assertEquals( readOrWrite, result & READ_OR_WRITE_MASK ); if ( genComparison != EXPECTED_GEN_DISREGARD ) { assertEquals( genComparisonBits( genComparison ), result & GEN_COMPARISON_MASK ); } assertEquals( pointerStateA, pointerStateFromResult( result, STATE_SHIFT_A ) ); assertEquals( pointerStateB, pointerStateFromResult( result, STATE_SHIFT_B ) ); // Failure description String failureDescription = failureDescription( result ); assertThat( failureDescription, containsString( isRead( result ) ? "READ" : "WRITE" ) ); if ( genComparison != EXPECTED_GEN_DISREGARD ) { assertThat( failureDescription, containsString( genComparisonName( genComparison ) ) ); } assertThat( failureDescription, containsString( pointerStateName( pointerStateA ) ) ); assertThat( failureDescription, containsString( pointerStateName( pointerStateB ) ) ); } private String genComparisonName( int genComparison ) { switch ( genComparison ) { case EXPECTED_GEN_B_BIG: return GenSafePointerPair.GEN_COMPARISON_NAME_B_BIG; case EXPECTED_GEN_EQUAL: return GenSafePointerPair.GEN_COMPARISON_NAME_EQUAL; case EXPECTED_GEN_A_BIG: return GenSafePointerPair.GEN_COMPARISON_NAME_A_BIG; default: throw new UnsupportedOperationException( String.valueOf( genComparison ) ); } } private long genComparisonBits( int genComparison ) { switch ( genComparison ) { case EXPECTED_GEN_B_BIG: return GenSafePointerPair.GEN_B_BIG; case EXPECTED_GEN_EQUAL: return GenSafePointerPair.GEN_EQUAL; case EXPECTED_GEN_A_BIG: return GenSafePointerPair.GEN_A_BIG; default: throw new UnsupportedOperationException( String.valueOf( genComparison ) ); } } private long readSlotA() { cursor.setOffset( 0 ); return readSlot(); } private long readSlotB() { cursor.setOffset( GenSafePointer.SIZE ); return readSlot(); } private long readSlot() { long generation = GenSafePointer.readGeneration( cursor ); long pointer = GenSafePointer.readPointer( cursor ); short checksum = GenSafePointer.readChecksum( cursor ); assertEquals( GenSafePointer.checksumOf( generation, pointer ), checksum ); return pointer; } private long read() { cursor.setOffset( 0 ); return GenSafePointerPair.read( cursor, STABLE_GENERATION, UNSTABLE_GENERATION ); } private long write( long pointer ) { cursor.setOffset( 0 ); return GenSafePointerPair.write( cursor, pointer, STABLE_GENERATION, UNSTABLE_GENERATION ); } private void writeSlotA( int generation ) { cursor.setOffset( 0 ); writeSlot( generation, POINTER_A ); } private void writeSlotB( int generation ) { cursor.setOffset( GenSafePointer.SIZE ); writeSlot( generation, POINTER_B ); } private void writeSlot( int generation, long pointer ) { GenSafePointer.write( cursor, generation, pointer ); } private void writeBrokenSlotA() { cursor.setOffset( 0 ); writeBrokenSlot(); } private void writeBrokenSlotB() { cursor.setOffset( GenSafePointer.SIZE ); writeBrokenSlot(); } private void writeBrokenSlot() { int offset = cursor.getOffset(); writeSlot( 10, 20 ); cursor.setOffset( offset + GenSafePointer.SIZE - GenSafePointer.CHECKSUM_SIZE ); short checksum = GenSafePointer.readChecksum( cursor ); cursor.setOffset( offset + GenSafePointer.SIZE - GenSafePointer.CHECKSUM_SIZE ); cursor.putShort( (short) ~checksum ); } private void assertBrokenA() { cursor.setOffset( 0 ); assertBroken(); } private void assertBrokenB() { cursor.setOffset( GenSafePointer.SIZE ); assertBroken(); } private void assertBroken() { long generation = GenSafePointer.readGeneration( cursor ); long pointer = GenSafePointer.readPointer( cursor ); short checksum = GenSafePointer.readChecksum( cursor ); assertNotEquals( GenSafePointer.checksumOf( generation, pointer ), checksum ); } private void assertSuccess( long result ) { assertTrue( GenSafePointerPair.isSuccess( result ) ); } private void assertWriteSuccess( boolean expectedSlot, long result ) { assertSuccess( result ); boolean actuallyWrittenSlot = (result & GenSafePointerPair.WRITE_TO_MASK) == GenSafePointerPair.WRITE_TO_A ? SLOT_A : SLOT_B; assertEquals( expectedSlot, actuallyWrittenSlot ); } private void assertReadSuccess( long expectedPointer, long result ) { assertSuccess( result ); assertEquals( result, expectedPointer ); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
772d3e570db4439694652e687993965f15321f80
55859bfb85fdeb8a4ebbc1919d43359794d30bdc
/Eerste Jaar/H5/src/be/pxl/h5/exeoef1/Exeoef1.java
4ccdc812a5c307d640eb5356be9607292c1bbf21
[]
no_license
IgnaceFrederix/PXL-1TIN-Programming-Basic
10ced082820a485f5b3c3f1205e23dcd2e34bf81
69f9381a16e8845a96beed46b6593c31c1a59212
refs/heads/master
2022-01-20T07:24:59.564843
2019-07-19T21:07:20
2019-07-19T21:07:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package be.pxl.h5.exeoef1; import java.util.Scanner; public class Exeoef1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); double F; int C; System.out.println("geef de graden celsicus in"); C = input.nextInt(); F = (9.0/5.0)*C +32; System.out.println("de temeratuur in F is " + F); input.close(); } }
[ "ignace.frederix@gmail.com" ]
ignace.frederix@gmail.com
e5229155e6fcad799aff5425fde95140d515cd81
14c5c8ab07eab6e3be14520b693fc4a08b9eca74
/app/src/test/java/com/example/khonapp/ExampleUnitTest.java
2b9700214c37d9389245597703ef8edf90f13fe3
[]
no_license
pondpondnaja/khon
5e174578be55d4ba16660b0281a2b35e62185ef2
a69bc207c88ae4fd734c13f6b813d9a3518c9fd6
refs/heads/master
2023-01-12T07:28:39.088478
2020-02-28T14:36:25
2020-02-28T14:37:53
243,481,248
0
0
null
2022-12-27T15:36:30
2020-02-27T09:31:49
Python
UTF-8
Java
false
false
391
java
package com.example.khonapp; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * 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); } }
[ "giggabome@gmail.com" ]
giggabome@gmail.com
8fbc490156125e056d12e89aa0981ddffa3fdaa3
fac5d6126ab147e3197448d283f9a675733f3c34
/src/main/java/dji/thirdparty/rx/internal/operators/CompletableOnSubscribeMergeArray.java
c2fcce03dc2d1f92f9b6d4bd97af6c3300b26379
[]
no_license
KnzHz/fpv_live
412e1dc8ab511b1a5889c8714352e3a373cdae2f
7902f1a4834d581ee6afd0d17d87dc90424d3097
refs/heads/master
2022-12-18T18:15:39.101486
2020-09-24T19:42:03
2020-09-24T19:42:03
294,176,898
0
0
null
2020-09-09T17:03:58
2020-09-09T17:03:57
null
UTF-8
Java
false
false
2,783
java
package dji.thirdparty.rx.internal.operators; import dji.thirdparty.rx.Completable; import dji.thirdparty.rx.Subscription; import dji.thirdparty.rx.plugins.RxJavaPlugins; import dji.thirdparty.rx.subscriptions.CompositeSubscription; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; public final class CompletableOnSubscribeMergeArray implements Completable.CompletableOnSubscribe { final Completable[] sources; public CompletableOnSubscribeMergeArray(Completable[] sources2) { this.sources = sources2; } public void call(Completable.CompletableSubscriber s) { final CompositeSubscription set = new CompositeSubscription(); final AtomicInteger wip = new AtomicInteger(this.sources.length + 1); final AtomicBoolean once = new AtomicBoolean(); s.onSubscribe(set); Completable[] arr$ = this.sources; int len$ = arr$.length; int i$ = 0; while (i$ < len$) { Completable c = arr$[i$]; if (!set.isUnsubscribed()) { if (c == null) { set.unsubscribe(); NullPointerException npe = new NullPointerException("A completable source is null"); if (once.compareAndSet(false, true)) { s.onError(npe); return; } RxJavaPlugins.getInstance().getErrorHandler().handleError(npe); } final Completable.CompletableSubscriber completableSubscriber = s; c.subscribe(new Completable.CompletableSubscriber() { /* class dji.thirdparty.rx.internal.operators.CompletableOnSubscribeMergeArray.AnonymousClass1 */ public void onSubscribe(Subscription d) { set.add(d); } public void onError(Throwable e) { set.unsubscribe(); if (once.compareAndSet(false, true)) { completableSubscriber.onError(e); } else { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } public void onCompleted() { if (wip.decrementAndGet() == 0 && once.compareAndSet(false, true)) { completableSubscriber.onCompleted(); } } }); i$++; } else { return; } } if (wip.decrementAndGet() == 0 && once.compareAndSet(false, true)) { s.onCompleted(); } } }
[ "michael@districtrace.com" ]
michael@districtrace.com
27380a0ee4ce1942b424ce7da3d04c12db36c0cd
148e9d7f129ba2b150ee50487be8a6229f4876cc
/src/lm/HMM.java
f519b188f9c3a423c432465ecdf164a0a83b35f6
[]
no_license
JoshuaMathias/josh-utils
9163d4425cd0bd53e103976cf1be5852b48bf2ab
38f795e5ddb72ae1fa275de98be5c67bdb57aef5
refs/heads/master
2021-08-30T08:09:56.136076
2017-12-16T23:47:24
2017-12-16T23:47:24
105,678,849
0
0
null
null
null
null
UTF-8
Java
false
false
27,267
java
package lm; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import functions.FileUtils; import functions.ParseUtils; import functions.StatUtils; /* * Represents states and transitions of a POS tagger. */ public class HMM { int state_num=0; // The number of states int sym_num=0; // The size of output symbol alphabet int init_line_num=0; // The number of lines for the initial probability int trans_line_num=0; // The number of lines for the transition probability int emiss_line_num=0; // The number of lines for the emission probability int maxOrder = 2; double l1 = 0.0; double l2 = 0.0; double l3 = 0.0; String unkFilename = ""; Map<String, Double> initials; // Key: state_str. Value: prob. List<Map<String, Double>> transitions; // Key: From_state. Value: Map: Key: to_state. Value: prob. Map<String, Map<String, Double>> symbols; // Key: state_str. Value: Map: Key: symbol. Value: prob. List<String> tags; // List of every possible tag. Map<String, Double> gramProbs; Set<String> states; Set<String> tokens; HashMap<String, Integer> stateToIndex; String[] indexToState; HashMap<String, Integer> symbolToIndex; String[] indexToSymbol; double[][] stateGraph; double[][] stateSymbols; double[] initialProbs; List<Integer> initialIndices; List<Map<String, Double>> gramCounts; // Counts for each gram of POS tags. Map<String, Map<String, Integer>> symbolCounts; // Counts for the symbols of each tag. Key: tag. Value: Map: Key: symbol. Value: prob. Map<String, Integer> initialCounts; // Counts for the first symbol of each sentence. Map<String, Double> unkProbs; public HMM(String trainingStr, int maxOrder) { this.maxOrder = maxOrder; getNGramTagCounts(trainingStr, maxOrder); if (maxOrder == 2) { buildBigramHMM(); } else if (maxOrder == 3) { buildTrigramHMM(); } } public HMM(String trainingStr, int maxOrder, double l1, double l2, double l3, String unkFilename) { this.maxOrder = maxOrder; getNGramTagCounts(trainingStr, maxOrder); if (maxOrder == 2) { buildBigramHMM(); } else if (maxOrder == 3) { this.l1 = l1; this.l2 = l2; this.l3 = l3; this.unkFilename = unkFilename; initSmoothing(); buildTrigramHMM(); } } public HMM(String hmm_file) { checkHMM(hmm_file); } public void checkHMM(String hmm_file) { List<List<String>> hmmLines = ParseUtils.splitLinesWhitespace(FileUtils.readFile(hmm_file)); // System.out.println("hmm lines: "+hmmLines.size()); // if (hmmLines.size() > 4) { // state_num = Integer.parseInt(ParseUtils.splitChar(hmmLines.get(0),'=').get(1)); // sym_num = Integer.parseInt(ParseUtils.splitChar(hmmLines.get(1),'=').get(1)); // init_line_num = Integer.parseInt(ParseUtils.splitChar(hmmLines.get(2),'=').get(1)); // trans_line_num = Integer.parseInt(ParseUtils.splitChar(hmmLines.get(3),'=').get(1)); // emiss_line_num = Integer.parseInt(ParseUtils.splitChar(hmmLines.get(4),'=').get(1)); // } int lineI = 5; for (; lineI<hmmLines.size(); lineI++) { if (hmmLines.get(lineI).get(0).contains("\\init")) { break; } } lineI++; // states = new HashSet<String>(); stateToIndex = new HashMap<String, Integer>(); int stateIndex=0; // Parse initials initials = new HashMap<String, Double>(); // int initLineCount = 0; List<String> line; for (; lineI<hmmLines.size(); lineI++) { line = hmmLines.get(lineI); if (line.get(0).contains("\\transition")) { break; } // initLineCount++; if (line.size() > 1) { double prob = Double.parseDouble(line.get(1)); if (prob < 0.0 || prob > 1.0) { System.err.println("warning: the prob is not in [0,1] range: "+line); continue; } initials.put(line.get(0), Math.log10(prob)); stateToIndex.put(line.get(0), stateIndex); // Get a set of all states. stateIndex++; // states.add(line.get(0)); } } lineI++; // Parse transitions // gramProbs = new HashMap<String, Double>(); // HashSet<String> tagsSet = new HashSet<String>(); // int transLineCount = 0; // for (; lineI<hmmLines.size(); lineI++) { // line = hmmLines.get(lineI); // if (line.contains("\\emission")) { // break; // } // transLineCount++; // String[] splitLine = line.split("\\s"); // if (splitLine.length > 2) { // states.add(splitLine[1]); // Get a set of all states. // if (maxOrder > 2 && ParseUtils.splitChar(splitLine[1],'_').size() > 1) { // // Form a trigram A_B_C out of the to and from states A_B, B_C. // tags.add(splitLine[0]); // tags.add(splitLine[1]); // List<String> splitGram = ParseUtils.splitChar(splitLine[1],'_'); // String trigram = splitLine[0]+"_"+splitGram.get(1); // gramProbs.put(trigram, Double.parseDouble(splitLine[2])); // tagsSet.add(splitGram.get(1)); // } else if (maxOrder == 2) { // gramProbs.put(splitLine[0]+"_"+splitLine[1], Double.parseDouble(splitLine[2])); // } // } // } // Map state names to indices int transitionLineI = lineI; for (; lineI<hmmLines.size(); lineI++) { line = hmmLines.get(lineI); if (line.get(0).contains("\\emission")) { break; } if (line.size() > 2) { if (!stateToIndex.containsKey(line.get(1))) { stateToIndex.put(line.get(1), stateIndex); // Get a set of all states. stateIndex++; } } } // Map indices to state names. indexToState = new String[stateToIndex.size()]; for (Entry<String, Integer> stateEntry : stateToIndex.entrySet()) { indexToState[stateEntry.getValue()] = stateEntry.getKey(); } // Form graph using state indices. state_num = stateIndex; stateGraph = new double[state_num][state_num]; // Each from state has an array of to states. StatUtils.fill2DArrayDouble(stateGraph, Double.NEGATIVE_INFINITY); int emissionLineI=lineI; lineI = transitionLineI; // Go through transition lines again. for (; lineI<emissionLineI; lineI++) { line = hmmLines.get(lineI); if (line.size() > 2) { // Store to_state in array of from_state. double prob = Double.parseDouble(line.get(2)); if (prob < 0.0 || prob > 1.0) { System.err.println("warning: the prob is not in [0,1] range: "+line); continue; } stateGraph[stateToIndex.get(line.get(0))][stateToIndex.get(line.get(1))] = Math.log10(prob); } } // Make array of initial probabilities initialProbs = new double[state_num]; Arrays.fill(initialProbs, Double.NEGATIVE_INFINITY); initialIndices = new ArrayList<Integer>(); for (Entry<String, Double> entry : initials.entrySet()) { int initIndex = stateToIndex.get(entry.getKey()); initialProbs[initIndex] = entry.getValue(); initialIndices.add(initIndex); } // tags = new ArrayList<String>(tagsSet); lineI++; // Parse emissions // symbols = new HashMap<String, Map<String, Double>>(); // tokens = new HashSet<String>(); //// int emisLineCount = 0; // for (; lineI<hmmLines.size(); lineI++) { // line = hmmLines.get(lineI); //// emisLineCount++; // if (line.size() > 2) { //// String symbols = splitLine[0]+ParseUtils.splitChar(splitLine[1],'_').get(1); // Map<String, Double> posMap; // if (symbols.containsKey(line.get(0))) { // posMap = symbols.get(line.get(0)); // } else { // posMap = new HashMap<String, Double>(); // } // posMap.put(line.get(1), Double.parseDouble(line.get(2))); // // symbols.put(line.get(0),posMap); // tokens.add(line.get(1)); // } // } symbolToIndex = new HashMap<String, Integer>(); int symbolIndex = 0; symbolToIndex.put("<unk>", symbolIndex); symbolIndex++; emissionLineI = lineI; for (; lineI<hmmLines.size(); lineI++) { line = hmmLines.get(lineI); if (line.size() > 2) { if (!symbolToIndex.containsKey(line.get(1))) { symbolToIndex.put(line.get(1), symbolIndex); symbolIndex++; } } } indexToSymbol = new String[symbolIndex+1]; sym_num = symbolIndex+1; stateSymbols = new double[sym_num][sym_num]; StatUtils.fill2DArrayDouble(stateSymbols, Double.NEGATIVE_INFINITY); lineI = emissionLineI; for (; lineI<hmmLines.size(); lineI++) { line = hmmLines.get(lineI); if (line.size() > 2) { double prob = Double.parseDouble(line.get(2)); if (prob < 0.0 || prob > 1.0) { System.err.println("warning: the prob is not in [0,1] range: "+line); continue; } stateSymbols[stateToIndex.get(line.get(0))][symbolToIndex.get(line.get(1))] = Math.log10(prob); // System.out.println("Setting symbol prob at state "+stateToIndex.get(line.get(0))+" symbol "+symbolToIndex.get(line.get(1))+" to "+Math.log10(prob)); } } hmmLines = null; // if (state_num != states.size()) { // System.out.println("warning: different numbers of state_num: claimed="+state_num+", real="+states.size()); // } else { // System.out.println("state_num="+state_num); // } // if (sym_num != tokens.size()) { // System.out.println("warning: different numbers of sym_num: claimed="+sym_num+", real="+tokens.size()); // } else { // System.out.println("sym_num="+sym_num); // } // // if (init_line_num != initLineCount) { // System.out.println("warning: different numbers of init_line_num: claimed="+init_line_num+", real="+initLineCount); // } else { // System.out.println("init_line_num="+init_line_num); // } // // if (trans_line_num != transLineCount) { // System.out.println("warning: different numbers of trans_line_num: claimed="+trans_line_num+", real="+transLineCount); // } else { // System.out.println("trans_line_num="+trans_line_num); // } // // if (emiss_line_num != emisLineCount) { // System.out.println("warning: different numbers of emiss_line_num: claimed="+emiss_line_num+", real="+emisLineCount); // } else { // System.out.println("emiss_line_num="+emiss_line_num); // } // Check that initial state probabilities sum to 1. // double init_prob_sum = StatUtils.getMapTotalDouble(initials); // if (!StatUtils.equalsDouble(init_prob_sum, 1.0)) { // System.out.println("warning: the init_prob_sum is "+init_prob_sum); // } // Check that transition probabilities sum to 1. // For each from_state, sum each of its possible to_states. // for (String fromState : states) { // double sum = 0.0; // for (String tag : tags) { // String complete_gram = fromState+"_"+tag; // if (gramProbs.containsKey(complete_gram)) { // sum+=gramProbs.get(complete_gram); // } // } // if (!StatUtils.equalsDouble(sum, 1.0)) { // System.out.println("warning: the trans_prob_sum for state "+fromState+" is "+sum); // } // } // Check that the symbol probs for each tag (in emission) sum to 1. // for (String state : states) { // if (!state.equals("BOS")) { // double sum = 0.0; // if (symbols.containsKey(state)) { // sum = StatUtils.getMapTotalDouble(symbols.get(state)); // } // if (!StatUtils.equalsDouble(sum, 1.0)) { // System.out.println("warning: the emiss_prob_sum for state "+state+" is "+sum); // } // } // } } /* * Viterbi Algorithm * Input: * observations of len T: List<String> observations * state-graph of len N: double[fromState][toState] stateGraph * Returns best path, as a String of states, with the last token of the string being the probability of the path. */ public String viterbi(List<String> observations) { observations.add("<s>"); int num_obs = observations.size(); double[][] pathProbs = new double[state_num+2][num_obs+1]; // path probability matrix viterbi[N+2, T] pathProbs = StatUtils.fill2DArrayDouble(pathProbs, Double.NEGATIVE_INFINITY); int[][] backpointer = new int[state_num+2][num_obs+1]; // Backpointers, for retrieving the best path at the end. // Initialization // For each initial state, put its initial probability in the first column of pathProbs, for the index of the initial state. // Set backpointers for each state to the most likely // for (int initialI=0; initialI<initials.size(); initialI++) { for (int initI : initialIndices) { pathProbs[initI][0] = initialProbs[initI]; } int stepI; for (stepI=1; stepI<=num_obs; stepI++) { int symI = 0; // Set symbol to <unk> by default. if (symbolToIndex.containsKey(observations.get(stepI-1))) { symI = symbolToIndex.get(observations.get(stepI-1)); } for (int stateI=0; stateI<state_num; stateI++) { double symProb = stateSymbols[stateI][symI]; if (symProb == Double.NEGATIVE_INFINITY) { continue; } // else { // System.out.print("state: "+stateI+" "+indexToState[stateI]+" "); // System.out.print("sym index: "+symI+" sym prob: "+symProb+"\n"); // } double bestProb = Double.NEGATIVE_INFINITY; int bestState = -1; for (int prevStateI=0; prevStateI<state_num; prevStateI++) { double pathProb = pathProbs[prevStateI][stepI-1]; // System.out.println("pathProbs: "+pathProbs); if (pathProb == Double.NEGATIVE_INFINITY) { continue; } // else { // System.out.print("pathProb: "+pathProb+" "); // } double transProb = stateGraph[prevStateI][stateI]; if (transProb == Double.NEGATIVE_INFINITY) { continue; } // else { // System.out.print("transProb: "+transProb); // } // System.out.print("prev state: "+prevStateI+" {"+indexToState[prevStateI]+") current state: "+stateI+" ("+indexToState[stateI]+") pathprob: "+pathProb+" transProb: "+transProb+"\n"); double prevProb = pathProb + transProb + symProb; // System.out.println("prevProb: "+prevProb); if (prevProb > bestProb) { // System.out.println("Found prob: "+prevProb+" state: "+prevStateI); bestProb = prevProb; bestState = prevStateI; } // System.out.println(); } // System.out.println("Best prob: "+bestProb+" best state: "+bestState+" ("+indexToState[bestState]+")"); pathProbs[stateI][stepI] = bestProb; backpointer[stateI][stepI] = bestState; } } double bestProb = Double.NEGATIVE_INFINITY; int bestState = -1; for (int nextStateI=0; nextStateI<state_num; nextStateI++) { double nextProb = pathProbs[nextStateI][num_obs-1]; if (nextProb > bestProb) { bestProb = nextProb; bestState = nextStateI; } // System.err.println("best final prob: "+bestProb+" best final state: "+bestState); } // backpointer[bestState][stepI] = bestState; StringBuilder tagStr = new StringBuilder(); if (bestState == -1) { tagStr.append("*NONE*"); } else { int currPointer = bestState; for (stepI=num_obs-1; stepI>=0; stepI--) { tagStr.insert(0, indexToState[currPointer]+" "); currPointer = backpointer[currPointer][stepI]; } tagStr.append(bestProb); } observations.remove(observations.size()-1); return tagStr.toString(); } /* * Use the Viterbi algorithm on a give line of text to apply POS tags. * Return format: text => tags lgprob */ public String tagLine(String text) { List<String> words = ParseUtils.splitSpaces(text); String bestTags = viterbi(words); String taggedStr = ParseUtils.listToString(words)+" => "+bestTags; return taggedStr; } /* * Read in file input_file and tag each line. * Write to file output_file. * Use the Viterbi algorithm to perform the tagging. */ public void tagFile(String input_file, String output_file) { List<String> lines = FileUtils.readLines(input_file); StringBuilder outputStr = new StringBuilder(); for (String line : lines) { outputStr.append(tagLine(line)+"\n"); } FileUtils.writeFile(output_file, outputStr.toString()); } /* * Convert tagging format to w1/t1 wn/tn. */ public static String convertFormat(String inputStr) { List<String> lines = ParseUtils.splitLines(inputStr); StringBuilder outputStr = new StringBuilder(); for (String line : lines) { String[] splitLine = line.split("\\s=>\\s"); if (splitLine.length > 1) { String[] words = splitLine[0].split("\\s+"); String[] tags = splitLine[1].split("\\s+"); if (words.length != tags.length-2) { // Skip start state (BOS_BOS) and don't include probability at end. System.err.println("Warning: There are "+words.length+" words and "+(tags.length-2)+" corresponding tags in the following line:\n"+line); } for (int wordI=0; wordI<words.length; wordI++) { outputStr.append(words[wordI]+"/"); if (tags.length-2 > wordI) { List<String> splitState = ParseUtils.splitChar(tags[wordI+1], '_'); if (splitState.size() > 1) { outputStr.append(splitState.get(1)); } else { outputStr.append(tags[wordI+1]); } } else { outputStr.append(words[wordI]); } if (wordI<words.length-1) { outputStr.append(" "); } } outputStr.append("\n"); } } return outputStr.toString(); } /* * Initialize interpolation weights and the <unk> probabilities. */ public void initSmoothing() { unkProbs = new HashMap<String, Double>(); List<String> unkLines = FileUtils.readLines(unkFilename); for (String line : unkLines) { String[] splitLine = line.split("\\s"); if (splitLine.length > 1) { unkProbs.put(splitLine[0], Double.parseDouble(splitLine[1])); } } tokens.add("<unk>"); } /* * Separate symbols and POS tags. Start with BOS_symbol (for bigram). * Add */ public void buildBigramHMM() { initials = new LinkedHashMap<String, Double>(); symbols = new LinkedHashMap<String, Map<String, Double>>(); // Calculate unigram symbol to tag probabilities, as count(tag for symbol) / total(symbol). for (Entry<String, Map<String, Integer>> entry : symbolCounts.entrySet()) { symbols.put(entry.getKey(), StatUtils.divideByTotal(entry.getValue())); } transitions = StatUtils.getNGramTagProbs(gramCounts); initials = StatUtils.divideByTotal(initialCounts); } public void buildTrigramHMM() { initials = new LinkedHashMap<String, Double>(); symbols = new LinkedHashMap<String, Map<String, Double>>(); // Calculate unigram symbol to tag probabilities, as count(tag for symbol) / total(symbol) * (1-P(<unk>|tag)). if (unkProbs == null) { System.out.println("Unk probs is null"); initSmoothing(); } for (Entry<String, Map<String, Integer>> entry : symbolCounts.entrySet()) { double total = StatUtils.getMapTotal(entry.getValue()); double unkProb; if (unkProbs.containsKey(entry.getKey())) { unkProb = unkProbs.get(entry.getKey()); } else { unkProb = 0.0; // System.out.println("Warning: No <unk> prob for tag "+entry.getKey()); } Map<String, Double> normalizedMap = new HashMap<String, Double>(); for (Entry<String, Integer> symbolEntry : entry.getValue().entrySet()) { normalizedMap.put(entry.getKey(), symbolEntry.getValue()/total * (1-unkProb)); } symbols.put(entry.getKey(), normalizedMap); } transitions = calcTriProbs(); initials = StatUtils.divideByTotal(initialCounts); } /* * Returns a List containing a Map for each n-gram order, from n=1 to n=maxOrder, * each map containing each distinct n-gram (key) with its count/frequency as its value. * Break each token by the last slash / into a symbol and a tag. * if currentN==0: * Replace all / in the symbol with \/. * Increment count for the symbol's count for this tag. * Increment count for gram count for this tag. */ public void getNGramTagCounts(String text, int maxOrder) { tokens = new HashSet<String>(); gramCounts = new ArrayList<Map<String, Double>>(); for (int i=0; i<maxOrder; i++) { gramCounts.add(new LinkedHashMap<String, Double>()); } symbolCounts = new LinkedHashMap<String, Map<String, Integer>>(); initialCounts = new HashMap<String, Integer>(); if (maxOrder > 0) { List<List<String[]>> lines = ParseUtils.getLinesAsPOSSentences(text); int startI=0; int currentN=0; String gramStr = ""; for (int lineI=0; lineI<lines.size(); lineI++) { List<String[]> line = lines.get(lineI); String tempBOS = "BOS_BOS"; for (int i=2; i<maxOrder; i++) { StatUtils.incrementDouble(gramCounts.get(i-1), tempBOS); tempBOS += "_BOS"; } gramStr = ""; for (startI=0; startI<line.size(); startI++) { for (currentN=0; currentN<maxOrder; currentN++) { // All n-grams for the current last word. int endI = startI+currentN; if (endI >= line.size()) { break; } String[] token = line.get(endI); if (currentN == 0) { // if (endI == 0 || endI == line.size()-1) { // Don't include <s> or </s> as unigrams. // continue; // } // POS to unigram symbol counts. if (startI>0) { StatUtils.incrementOneMap(symbolCounts, token[1], token[0]); } else { StatUtils.incrementOne(initialCounts, token[1]); } tokens.add(token[0]); } else { gramStr += "_"; } gramStr += token[1]; StatUtils.incrementDouble(gramCounts.get(currentN),gramStr); // System.out.println("incrementing gramStr: "+gramStr); } // System.out.println("gramStr: "+gramStr+" last count: "+gramCounts.get(currentN-2).get(gramStr)); gramStr = ""; } String tempEOS = "EOS_EOS"; for (int i=2; i<maxOrder; i++) { // System.out.println("Incrementing "+tempEOS+" for gram "+i); gramCounts.set(i,StatUtils.incrementDouble(gramCounts.get(i-1), tempEOS)); tempEOS += "_EOS"; } } } tags = new ArrayList<String>(gramCounts.get(0).keySet()); } /* * Returns a list of map of Ngram probabilities, for each n provided in gramCounts. */ public List<Map<String, Double>> calcTriProbs() { List<Map<String, Double>> gramProbs = new ArrayList<Map<String, Double>>(); for (int i=0; i<gramCounts.size(); i++) { gramProbs.add(new HashMap<String, Double>()); } // Calculate unigram probs. Map<String, Double> firstGram = gramCounts.get(0); double total = StatUtils.getMapTotalDouble(firstGram); // Get total number of tokens. Map<String, Double> probsMap = gramProbs.get(0); for (Entry<String, Double> entry : firstGram.entrySet()) { probsMap.put(entry.getKey(), entry.getValue() / total); } // Calculate bigram and trigram probs, without smoothing. for (int n=1; n<3; n++) { probsMap = gramProbs.get(n); Map<String, Double> countsMap = gramCounts.get(n); Map<String, Double> previousMap = gramCounts.get(n-1); for (Entry<String, Double> entry : countsMap.entrySet()) { String prevGram = ParseUtils.getUntilNChar(entry.getKey(), '_', n); // Get the previous gram. try { // if (prevGram.contains("EOS")) { // System.out.println("entry key: "+entry.getKey()+" entry value: "+entry.getValue()+" prevGram: "+prevGram+" prevValue: "+previousMap.get(prevGram)); // } probsMap.put(entry.getKey(), entry.getValue() / previousMap.get(prevGram)); } catch (NullPointerException e) { if (!previousMap.containsKey(prevGram)) { System.out.println("Couldn't find previous gram for "+entry.getKey()+": "+prevGram); } e.printStackTrace(); System.exit(0); } } } // Calculate trigram probs. // Include all possible trigrams, using interpolation. int n=2; Map<String, Double> countsMap = gramCounts.get(n); Map<String, Double> previousMap = gramCounts.get(n-1); probsMap = gramProbs.get(n); int p3UnkProb = 1/((tags.size()-2)+1); // Don't include BOS and EOS for tag size. for (int i=0; i<tags.size(); i++) { String iStr = tags.get(i); for (int j=0; j<tags.size(); j++) { String jStr = tags.get(j); for (int k=0; k<tags.size(); k++) {; String kStr = tags.get(k); String fromBigram = iStr+"_"+jStr; String toBigram = jStr+"_"+kStr; String trigram = fromBigram+"_"+kStr; // System.out.println("trigram: "+trigram); double p1 = 0.0; double p2 = 0.0; double p3 = 0.0; if (firstGram.containsKey(kStr)) { p1 = firstGram.get(kStr); } if (previousMap.containsKey(jStr)) { p2 = previousMap.get(toBigram); } if (countsMap.containsKey(trigram)) { p3 = countsMap.get(trigram); } else if (tags.get(k).equals("BOS")){ p3 = 0; } else { p3 = p3UnkProb; } double p3_smoothed = l3*p3 + l2*p2 + l1*p1; probsMap.put(trigram, p3_smoothed); } } } return gramProbs; } @Override public String toString() { state_num = (int) Math.pow(tags.size(),maxOrder-1); // init_line_num = initials.size(); sym_num = tokens.size()-1; // Don't count <s> if (maxOrder == 2) { emiss_line_num = StatUtils.getTotalElementsDouble(symbols); } StringBuilder emitStr = new StringBuilder(); if (maxOrder == 3) { ArrayList<String> emitLines = new ArrayList<String>(); for (int j=0; j<tags.size(); j++) { String jStr = tags.get(j); if (symbols.containsKey(jStr)) { for (Entry<String, Double> symbolEntry : symbols.get(jStr).entrySet()) { emitLines.add("_"+jStr +"\t"+symbolEntry.getKey()+"\t"+symbolEntry.getValue()); } if (unkProbs.containsKey(jStr)) { emitLines.add("_"+jStr +"\t<unk>\t"+unkProbs.get(jStr)); } for (int i=0; i<tags.size(); i++) { String iStr = tags.get(i); for (String emitLine : emitLines) { emiss_line_num++; emitStr.append(iStr+emitLine+"\n"); } } } } emitLines.clear(); } else { emitStr.append(ParseUtils.mapToStringDouble2D(symbols)); } StringBuilder transitionStr = new StringBuilder(); Map<String, Double> gramProbs = transitions.get(maxOrder-1); if (maxOrder == 2) { for (String fromTag : tags) { for (String toTag : tags) { String gramStr = fromTag+"_"+toTag; // System.out.println("gramStr: "+gramStr); if (gramProbs.containsKey(gramStr)) { trans_line_num++; transitionStr.append(fromTag+"\t"+toTag+"\t"+gramProbs.get(gramStr)+"\n"); } } } } else if (maxOrder == 3) { for (int i=0; i<tags.size(); i++) { String iStr = tags.get(i); for (int j=0; j<tags.size(); j++) { String jStr = tags.get(j); for (int k=0; k<tags.size(); k++) {; String kStr = tags.get(k); String fromBigram = iStr+"_"+jStr; String toBigram = jStr+"_"+kStr; String trigram = fromBigram+"_"+kStr; // System.out.println("gramStr: "+gramStr); if (gramProbs.containsKey(trigram)) { trans_line_num++; transitionStr.append(fromBigram+"\t"+toBigram+"\t"+gramProbs.get(trigram)+"\n"); } } } } } // System.out.println("trans_line_num: "+trans_line_num); StringBuilder hmmString = new StringBuilder(); hmmString.append("state_num="+state_num+"\nsym_num="+sym_num+"\ninit_line_num="+init_line_num+"\ntrans_line_num="+trans_line_num+ "\nemiss_line_num="+emiss_line_num+"\n\n"); hmmString.append("\\init\n"); // Add initial symbol probabilities hmmString.append(ParseUtils.mapToStringDouble(initials)+"\n"); hmmString.append("\n\\transition\n"); // Add gram probabilities hmmString.append(transitionStr); hmmString.append("\n\\emission\n"); // Add symbol probabilities hmmString.append(emitStr); return hmmString.toString(); } }
[ "joshuamonkey@gmail.com" ]
joshuamonkey@gmail.com
c4a80d4fbfd3f55c26f73ddc34b6bac901eccce7
b6f89aa31df5840df3c7e54f6bf12be2fd6b5b1d
/ShopFinal/src/main/java/shop/service/ProductCartService.java
05783f24355ff62cd5e5ef4754272a1087448f43
[]
no_license
hoahd93/duantotnghiep
0eebb73542909e489c9851b5402f492f2d80594a
ac1fa0c9febe960a7b665ed08525bffd9c9d810e
refs/heads/master
2022-12-23T22:51:04.845593
2020-11-11T09:25:57
2020-11-11T09:25:57
227,046,767
0
0
null
2022-12-16T15:17:33
2019-12-10T06:38:30
CSS
WINDOWS-1252
Java
false
false
685
java
///////////////////////////////////////////////////////////////////////////// // // © 2019 andro Japan. All right reserved. // ///////////////////////////////////////////////////////////////////////////// package shop.service; import shop.model.ProductCart; /** * [OVERVIEW] XXXXX. * * @author: HoaHD * @version: 1.0 * @History * [NUMBER] [VER] [DATE] [USER] [CONTENT] * -------------------------------------------------------------------------- * 001 1.0 2019/10/02 HoaHD Create new */ public interface ProductCartService { //get ProductCart by productDetailId public ProductCart getProduct(int productDetailId); }
[ "danghoahoang@gmail.com" ]
danghoahoang@gmail.com
c889868e595705eb62c6b172cbd3babb369cf354
797aa7e0a1df4d944555ab8646d7c5a17709c9cf
/src/main/java/com/unrc/app/UserValidate.java
879c577dfa8f40192c39e2ec1a43b5d38deb9c2d
[]
no_license
lbuttignol/connect4
27626f99cea151d372b504d9767b175066b4ebf4
4634dc77a23e14d02ca994d5ba461d0a21849f55
refs/heads/master
2021-01-22T08:29:23.393772
2015-05-13T01:29:52
2015-05-13T01:29:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,369
java
package com.unrc.app; import java.util.List; public class UserValidate { public UserValidate(){ } //Permite verificar si los datos ingresados son correctos para registrarse en el sistema public void isValidateSingUpUser(String email,String fName,String lName,String password) throws UserException{ List<User> list=User.where("email = ?",email); //Si ya existe el email en la base de datos.(Email es unico). if (list.size()!=0) { throw new UserException("e-mail invalido. Ya tiene una cuenta en connect4","001"); }else{ //Si la password tiene un largo menor a 8 caracteres. if (password.length()<8){ throw new UserException("Password demasiado corta.Debe tener a.mas de 8 caracteres.","002"); } } } //Verifica en la base de datos si el email está y si la contraseña es la correcta public void isValidateSingInUser(String email,String pass)throws UserException{ List<User> list=User.where("email = ?",email); //Si no existe el email en la base de datos. if (list.size()==0){ throw new UserException("E-mail incorrecto","003"); }else{ User u=list.get(0); //E-mail unico //Si el password no coincide con el password del email ingresado if (!(u.get("password").equals(pass))){ throw new UserException("Contraseña incorrecta","004"); } } } }
[ "millopez94@gmail.com" ]
millopez94@gmail.com
ed2c950e898861107da141dd4f53b76369147a2b
673890aa5efab4e133a64c38c4c6d243c0b9930c
/src/test/java/Runner/TestRunner.java
f2f21f6bc191028d1600853fd775d01ce8ea5c71
[]
no_license
LoganRamu/HRMPageAutomation
f4f509afaae1ab479ff7956a5cf01248982093aa
b5434abb8763c06a49912058fedb1d853ff5736b
refs/heads/master
2023-07-23T17:07:21.503713
2021-09-09T12:26:53
2021-09-09T12:26:53
400,226,270
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package Runner; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions( features = "src//test//resources//features", glue = "Step_Def", dryRun = false, monochrome = true ) public class TestRunner { }
[ "loganmaniu@gmail.com" ]
loganmaniu@gmail.com
7d54311d8089015f311d2f6e3a4318ad866b83fd
a4cf738dc0e999840ac12dbc02985d249028f11b
/org/eve/view/TableActionState.java
4626fd06e99fa8c99a597e3dea71456a43dc55dc
[]
no_license
ABID-Yassine/eve
d099f8fd842507f550daffe7db9f66af6f79b699
2ab6a4302ea1132152fbeac7d505eacbd917fb84
refs/heads/master
2023-05-26T07:59:12.370392
2011-07-01T01:21:14
2011-07-01T01:21:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package org.eve.view; public final class TableActionState { private boolean visible; /** * @return the visible */ public final boolean isVisible() { return visible; } /** * @param visible the visible to set */ public final void setVisible(boolean visible) { this.visible = visible; } }
[ "mad.kanie@gmail.com" ]
mad.kanie@gmail.com
ea60022b0d9772ad0012ee1981b617e6b2e7172d
d37af28d8bf95332ec0903b29be1ef8962c624c8
/src/java/fr/paris/lutece/portal/web/search/SearchIndexationJspBean.java
97adab02705bd0d28b60a3da34c78933c5b947e2
[ "LicenseRef-scancode-other-permissive" ]
permissive
khalilo/lutece-core
df2ca89f45fb627f87724cb6ce18781018f7433f
0787eeb49de256fafc7319c7763ea2f3972646f1
refs/heads/master
2020-06-14T23:58:47.435720
2016-11-10T13:41:53
2016-11-10T13:41:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,293
java
/* * Copyright (c) 2002-2014, Mairie de Paris * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright notice * and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice * and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * License 1.0 */ package fr.paris.lutece.portal.web.search; import fr.paris.lutece.portal.service.search.IndexationService; import fr.paris.lutece.portal.service.search.SearchIndexer; import fr.paris.lutece.portal.service.template.AppTemplateService; import fr.paris.lutece.portal.web.admin.AdminFeaturesPageJspBean; import fr.paris.lutece.util.html.HtmlTemplate; import java.util.Collection; import java.util.HashMap; import javax.servlet.http.HttpServletRequest; /** * This class provides the user interface to manage the launching of the indexing of the site pages */ public class SearchIndexationJspBean extends AdminFeaturesPageJspBean { // ////////////////////////////////////////////////////////////////////////// // Constantes /** * Right to manage indexation */ public static final String RIGHT_INDEXER = "CORE_SEARCH_INDEXATION"; private static final long serialVersionUID = 2585709013740037568L; private static final String TEMPLATE_MANAGE_INDEXER = "admin/search/manage_search_indexation.html"; private static final String TEMPLATE_INDEXER_LOGS = "admin/search/search_indexation_logs.html"; private static final String MARK_LOGS = "logs"; private static final String MARK_INDEXERS_LIST = "indexers_list"; /** * Displays the indexing parameters * * @param request * the http request * @return the html code which displays the parameters page */ public String getIndexingProperties( HttpServletRequest request ) { HashMap<String, Collection<SearchIndexer>> model = new HashMap<String, Collection<SearchIndexer>>( ); Collection<SearchIndexer> listIndexers = IndexationService.getIndexers( ); model.put( MARK_INDEXERS_LIST, listIndexers ); HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_MANAGE_INDEXER, getLocale( ), model ); return getAdminPage( template.getHtml( ) ); } /** * Calls the indexing process * * @param request * the http request * @return the result of the indexing process */ public String doIndexing( HttpServletRequest request ) { HashMap<String, Object> model = new HashMap<String, Object>( ); String strLogs; if ( request.getParameter( "incremental" ) != null ) { strLogs = IndexationService.processIndexing( false ); } else { strLogs = IndexationService.processIndexing( true ); } model.put( MARK_LOGS, strLogs ); HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_INDEXER_LOGS, null, model ); return getAdminPage( template.getHtml( ) ); } }
[ "pierrelevy@users.noreply.github.com" ]
pierrelevy@users.noreply.github.com
9838d6d22e64fd44db2322326c7d1f4a3fb76f42
fa31912371225d72cc67ca230eb9b52461c7c4a6
/app/src/main/java/ru/infocom_s/propotype/FragmentCardNews.java
3634b424018420ba2838484911f38f0683f9b2a8
[]
no_license
AlexanderZerg13/Prototype
4f8096a4fcdf523aae8171b957063ead338e8d5a
be3dd055e0f5220a08f0c33261e57db646cd1e6a
refs/heads/master
2021-01-01T04:29:45.358308
2016-05-24T12:46:37
2016-05-24T12:46:37
56,750,701
1
0
null
null
null
null
UTF-8
Java
false
false
5,495
java
package ru.infocom_s.propotype; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.transition.ChangeBounds; import android.transition.ChangeImageTransform; import android.transition.ChangeTransform; import android.transition.Fade; import android.transition.TransitionSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; import java.util.UUID; import ru.infocom_s.propotype.data.News; import ru.infocom_s.propotype.data.NewsLab; public class FragmentCardNews extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActivity().setTitle("Новости"); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate( R.layout.recycler_view, container, false); NewsAdapter adapter = new NewsAdapter(getActivity()); RecyclerView recyclerView = (RecyclerView) v.findViewById(R.id.recycler_view); recyclerView.setAdapter(adapter); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { // int topRowVerticalPosition = // (recyclerView == null || recyclerView.getChildCount() == 0) ? 0 : recyclerView.getChildAt(0).getTop(); // swipeRefreshLayout.setEnabled(topRowVerticalPosition >= 0); } @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); } }); return v; } public class NewsViewHolder extends RecyclerView.ViewHolder { ImageView newsCardImage; TextView newsCardText; TextView newsCardDescribe; UUID id; public NewsViewHolder(LayoutInflater inflater, ViewGroup parent) { super(inflater.inflate(R.layout.item_news, parent, false)); newsCardImage = (ImageView) itemView.findViewById(R.id.news_card_image); newsCardText = (TextView) itemView.findViewById(R.id.news_card_text); newsCardDescribe = (TextView) itemView.findViewById(R.id.news_card_describe); itemView.setOnClickListener(new View.OnClickListener() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onClick(View v) { FragmentManager fm = getActivity().getSupportFragmentManager(); Fragment fragment = FragmentNewsDescribe.newInstance(id); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { fragment.setSharedElementEnterTransition(new DetailsTransition()); fragment.setEnterTransition(new Fade()); setExitTransition(new Fade()); fragment.setSharedElementReturnTransition(new DetailsTransition()); } fm.beginTransaction() .addSharedElement(newsCardImage, "image") .replace(R.id.fragmentContainer, fragment) .addToBackStack(null) .commit(); } }); } } public class NewsAdapter extends RecyclerView.Adapter<NewsViewHolder> { private Context mContext; private ArrayList<News> mListNews; public NewsAdapter(Context context) { mContext = context; mListNews = NewsLab.get(mContext).getNews(); } @Override public NewsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new NewsViewHolder(LayoutInflater.from(parent.getContext()), parent); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onBindViewHolder(NewsViewHolder holder, int position) { News n = mListNews.get(position); holder.newsCardText.setText(n.getTitle()); holder.newsCardDescribe.setText(n.getDescription()); holder.newsCardImage.setImageResource(n.getImageViewResource()); holder.id = n.getId(); holder.newsCardImage.setTransitionName(position + "_position"); } @Override public int getItemCount() { return mListNews.size(); } } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public class DetailsTransition extends TransitionSet { public DetailsTransition() { setOrdering(ORDERING_TOGETHER); addTransition(new ChangeBounds()). addTransition(new ChangeTransform()). addTransition(new ChangeImageTransform()); } } }
[ "pilin94@gmail.com" ]
pilin94@gmail.com
a15e6433a14bed37287ae9edd06e34980ef5ef9a
c4ae94b7646a128415e68050879cec767374a40b
/api/src/main/java/org/hawkular/accounts/api/internal/impl/MsgLogger.java
9472b18c25a9f9be35e85eab5e2cb5e6f21e1eec
[ "Apache-2.0" ]
permissive
ammendonca/hawkular-accounts
7971b4437c9cdb3113ba09d466a99cd5252371b0
18fd514265815652d658193dd072b82b3168314f
refs/heads/master
2021-01-15T11:08:37.077348
2016-01-14T13:14:55
2016-01-14T13:14:55
49,666,358
0
0
null
2016-01-14T18:26:11
2016-01-14T18:26:11
null
UTF-8
Java
false
false
1,900
java
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * 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.hawkular.accounts.api.internal.impl; import org.jboss.logging.Logger; import org.jboss.logging.annotations.Cause; import org.jboss.logging.annotations.LogMessage; import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.MessageLogger; import org.jboss.logging.annotations.ValidIdRange; /** * JBoss Logging integration, with the possible messages that we have for the API. * * @author Juraci Paixão Kröhling */ @MessageLogger(projectCode = "HAWKACC") @ValidIdRange(min = 100000, max = 109999) public interface MsgLogger { MsgLogger LOGGER = Logger.getMessageLogger(MsgLogger.class, MsgLogger.class.getPackage().getName()); @LogMessage(level = Logger.Level.WARN) @Message(id = 100000, value = "Could not process prepare query: [%s]") void couldNotPrepareQuery(String query, @Cause Throwable t); @LogMessage(level = Logger.Level.FATAL) @Message(id = 100001, value = "Failed to initialize Cassandra's schema for Accounts. Reason") void failedToInitializeSchema(@Cause Throwable t); @LogMessage(level = Logger.Level.DEBUG) @Message(id = 100002, value = "Shutting down Cassandra driver for Accounts") void shuttingDownCassandraDriver(); }
[ "juraci@kroehling.de" ]
juraci@kroehling.de
4113da85763f29dc3d318f66478a9f668161b9f4
9cd9158e652f5db4f6fcb993d33eb5542e67b466
/OnlineCabBooking/src/mapper/IndividualBookingMapper.java
88a9e8e569d2496c9ba45fb53f74aaa35c4d5a7a
[]
no_license
hlnancy19p/OnlineCabService
f55138a8b3645f90daca7e4abc3f5f0e0a5b9165
477e46ede96cfc07fb78a0aaaaed5a0d9d2f02cc
refs/heads/master
2022-06-21T08:29:45.691210
2020-04-27T02:34:32
2020-04-27T02:34:32
259,184,459
0
0
null
null
null
null
UTF-8
Java
false
false
2,086
java
package mapper; import java.util.List; import domain.Order; import domain.User; public interface IndividualBookingMapper { /** * Add an order record to the database * * @param order * - the instance of an Order object to be stored * @return true, if the order record is stored successfully; otherwise, return * false */ public Boolean createOrder(Order order); /** * Get the information of an order from database * * @param order * - the instance of an order with id information included * @return An instance of Order object which contains full information of a * specific order */ public Order readOneOrder(Order order); /** * Update the information of an order in the database * * @param order * - the instance of an Order object * @return true, if the information is updated successfully; otherwise, return * false */ public Boolean updateOrder(Order order); /** * Delete one order record in the database * * @param order * - an order object which represents the order record to be deleted * in the database * @return true, if the corresponding order record is deleted successfully; * otherwise, return false */ public Boolean deleteOneOrder(Order order); /** * Delete multiple order records in the database * * @param orderIds * - a list of IDs for order records to be deleted * @return the result code for delete operation */ public int deleteOrders(int[] orderIds); /** * Get all individual orders related to a specific user * * @param user * - the user to be retrieved related order records * @return a list of orders related to the specified user */ public List<Order> getUserOrders(User user); /** * Get all business orders related to a specific user * * @param user * - the user to be retrieved related order records * @return a list of orders related to the specified user */ public List<Order> getBusinessOrders(User user); }
[ "wuhl021@gmail.com" ]
wuhl021@gmail.com
4d8346b021e68c203b92b1c1e8f535287cfcf4ce
b27fa5a6976d1f20b14b868fc3d1b611b9bd0a7f
/org/snaker/engine/core/QueryService.java
f4084b7b14126c4abc404569a28edccc0d7bee08
[]
no_license
jiyongming-self/snaker-core
2bd350d501f071d32dbe06893f9360a13dc979fb
690f227ac46560b93ad891613e962bffba3c145c
refs/heads/master
2023-03-17T17:51:58.024594
2021-03-10T08:58:16
2021-03-10T08:58:16
346,235,806
0
0
null
null
null
null
UTF-8
Java
false
false
4,862
java
/* Copyright 2013-2015 www.snakerflow.com. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.snaker.engine.core; import java.util.List; import org.snaker.engine.IQueryService; import org.snaker.engine.access.Page; import org.snaker.engine.access.QueryFilter; import org.snaker.engine.entity.HistoryOrder; import org.snaker.engine.entity.HistoryTask; import org.snaker.engine.entity.HistoryTaskActor; import org.snaker.engine.entity.Order; import org.snaker.engine.entity.Task; import org.snaker.engine.entity.TaskActor; import org.snaker.engine.entity.WorkItem; import org.snaker.engine.helper.AssertHelper; /** * 查询服务实现类 * @author yuqs * @since 1.0 */ public class QueryService extends AccessService implements IQueryService { public Order getOrder(String orderId) { return access().getOrder(orderId); } public Task getTask(String taskId) { return access().getTask(taskId); } public String[] getTaskActorsByTaskId(String taskId) { List<TaskActor> actors = access().getTaskActorsByTaskId(taskId); if(actors == null || actors.isEmpty()) return null; String[] actorIds = new String[actors.size()]; for(int i = 0; i < actors.size(); i++) { TaskActor ta = actors.get(i); actorIds[i] = ta.getActorId(); } return actorIds; } public String[] getHistoryTaskActorsByTaskId(String taskId) { List<HistoryTaskActor> actors = access().getHistTaskActorsByTaskId(taskId); if(actors == null || actors.isEmpty()) return null; String[] actorIds = new String[actors.size()]; for(int i = 0; i < actors.size(); i++) { HistoryTaskActor ta = actors.get(i); actorIds[i] = ta.getActorId(); } return actorIds; } public HistoryOrder getHistOrder(String orderId) { return access().getHistOrder(orderId); } public HistoryTask getHistTask(String taskId) { return access().getHistTask(taskId); } public List<Task> getActiveTasks(QueryFilter filter) { AssertHelper.notNull(filter); return access().getActiveTasks(null, filter); } public List<Task> getActiveTasks(Page<Task> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getActiveTasks(page, filter); } public List<Order> getActiveOrders(QueryFilter filter) { AssertHelper.notNull(filter); return access().getActiveOrders(null, filter); } public List<Order> getActiveOrders(Page<Order> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getActiveOrders(page, filter); } public List<HistoryOrder> getHistoryOrders(QueryFilter filter) { AssertHelper.notNull(filter); return access().getHistoryOrders(null, filter); } public List<HistoryOrder> getHistoryOrders(Page<HistoryOrder> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getHistoryOrders(page, filter); } public List<HistoryTask> getHistoryTasks(QueryFilter filter) { AssertHelper.notNull(filter); return access().getHistoryTasks(null, filter); } public List<HistoryTask> getHistoryTasks(Page<HistoryTask> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getHistoryTasks(page, filter); } public List<WorkItem> getWorkItems(Page<WorkItem> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getWorkItems(page, filter); } public List<HistoryOrder> getCCWorks(Page<HistoryOrder> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getCCWorks(page, filter); } public List<WorkItem> getHistoryWorkItems(Page<WorkItem> page, QueryFilter filter) { AssertHelper.notNull(filter); return access().getHistoryWorkItems(page, filter); } public <T> T nativeQueryObject(Class<T> T, String sql, Object... args) { AssertHelper.notEmpty(sql); AssertHelper.notNull(T); return access().queryObject(T, sql, args); } public <T> List<T> nativeQueryList(Class<T> T, String sql, Object... args) { AssertHelper.notEmpty(sql); AssertHelper.notNull(T); return access().queryList(T, sql, args); } public <T> List<T> nativeQueryList(Page<T> page, Class<T> T, String sql, Object... args) { AssertHelper.notEmpty(sql); AssertHelper.notNull(T); return access().queryList(page, new QueryFilter(), T, sql, args); } @Override public HistoryTask getFirstTask(String orderId) { AssertHelper.notNull(orderId); return access().getFirstTask(orderId); } }
[ "jiyongming@yiling.cn" ]
jiyongming@yiling.cn
fb47e2237bd1ae6b9654b815f7f4003ea0d4d85d
f1c3ed76d8c82ae83b987d047171490cc6a04439
/src/main/java/com/zhicheng/wukongcharge/models/TransactionEventProto.java
0c6125456030e4b39d9911caec545d9f2b757e2b
[]
no_license
danaigua/WukongCharge
9f9b9968d12f0d4f64983dcd3eece314e6e24709
e03881b0a53716343996cfbe4aa3cb881cd7d38f
refs/heads/master
2022-12-21T09:05:14.490831
2019-08-08T12:44:38
2019-08-08T12:44:38
200,964,042
2
1
null
2022-12-16T05:54:32
2019-08-07T03:20:19
Java
UTF-8
Java
false
true
156,090
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: transactionEvent.proto package com.zhicheng.wukongcharge.models; public final class TransactionEventProto { private TransactionEventProto() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } public interface transactionEventReqOrBuilder extends // @@protoc_insertion_point(interface_extends:transactionEventReq) com.google.protobuf.MessageOrBuilder { /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ boolean hasEventType(); /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType getEventType(); /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ boolean hasTimestamp(); /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ java.lang.String getTimestamp(); /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ com.google.protobuf.ByteString getTimestampBytes(); /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ boolean hasTransaction(); /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType getTransaction(); /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder getTransactionOrBuilder(); /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ boolean hasIDToken(); /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType getIDToken(); /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenTypeOrBuilder getIDTokenOrBuilder(); /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ boolean hasConnectorId(); /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ int getConnectorId(); /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ boolean hasTotalTime(); /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ int getTotalTime(); /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ boolean hasTotalCost(); /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ int getTotalCost(); /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ boolean hasEnergy(); /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ int getEnergy(); } /** * Protobuf type {@code transactionEventReq} */ public static final class transactionEventReq extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:transactionEventReq) transactionEventReqOrBuilder { private static final long serialVersionUID = 0L; // Use transactionEventReq.newBuilder() to construct. private transactionEventReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private transactionEventReq() { eventType_ = 0; timestamp_ = ""; connectorId_ = 0; totalTime_ = 0; totalCost_ = 0; energy_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private transactionEventReq( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType value = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(1, rawValue); } else { bitField0_ |= 0x00000001; eventType_ = rawValue; } break; } case 18: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000002; timestamp_ = bs; break; } case 26: { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder subBuilder = null; if (((bitField0_ & 0x00000004) == 0x00000004)) { subBuilder = transaction_.toBuilder(); } transaction_ = input.readMessage(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(transaction_); transaction_ = subBuilder.buildPartial(); } bitField0_ |= 0x00000004; break; } case 34: { com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.Builder subBuilder = null; if (((bitField0_ & 0x00000008) == 0x00000008)) { subBuilder = iDToken_.toBuilder(); } iDToken_ = input.readMessage(com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(iDToken_); iDToken_ = subBuilder.buildPartial(); } bitField0_ |= 0x00000008; break; } case 40: { bitField0_ |= 0x00000010; connectorId_ = input.readUInt32(); break; } case 48: { bitField0_ |= 0x00000020; totalTime_ = input.readUInt32(); break; } case 56: { bitField0_ |= 0x00000040; totalCost_ = input.readUInt32(); break; } case 64: { bitField0_ |= 0x00000080; energy_ = input.readUInt32(); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_fieldAccessorTable .ensureFieldAccessorsInitialized( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.class, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.Builder.class); } /** * Protobuf enum {@code transactionEventReq.transactionEventEnumType} */ public enum transactionEventEnumType implements com.google.protobuf.ProtocolMessageEnum { /** * <pre> *结束充电 * </pre> * * <code>Ended = 0;</code> */ Ended(0), /** * <pre> *�?始充�? * </pre> * * <code>Started = 1;</code> */ Started(1), /** * <pre> *充电中数据更�? * </pre> * * <code>Updated = 2;</code> */ Updated(2), ; /** * <pre> *结束充电 * </pre> * * <code>Ended = 0;</code> */ public static final int Ended_VALUE = 0; /** * <pre> *�?始充�? * </pre> * * <code>Started = 1;</code> */ public static final int Started_VALUE = 1; /** * <pre> *充电中数据更�? * </pre> * * <code>Updated = 2;</code> */ public static final int Updated_VALUE = 2; public final int getNumber() { return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static transactionEventEnumType valueOf(int value) { return forNumber(value); } public static transactionEventEnumType forNumber(int value) { switch (value) { case 0: return Ended; case 1: return Started; case 2: return Updated; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<transactionEventEnumType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< transactionEventEnumType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<transactionEventEnumType>() { public transactionEventEnumType findValueByNumber(int number) { return transactionEventEnumType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.getDescriptor().getEnumTypes().get(0); } private static final transactionEventEnumType[] VALUES = values(); public static transactionEventEnumType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } private final int value; private transactionEventEnumType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:transactionEventReq.transactionEventEnumType) } /** * Protobuf enum {@code transactionEventReq.chargingStateEnumType} */ public enum chargingStateEnumType implements com.google.protobuf.ProtocolMessageEnum { /** * <pre> *充电�? * </pre> * * <code>Charging = 0;</code> */ Charging(0), /** * <pre> *充电挂起 * </pre> * * <code>Suspended = 1;</code> */ Suspended(1), ; /** * <pre> *充电�? * </pre> * * <code>Charging = 0;</code> */ public static final int Charging_VALUE = 0; /** * <pre> *充电挂起 * </pre> * * <code>Suspended = 1;</code> */ public static final int Suspended_VALUE = 1; public final int getNumber() { return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static chargingStateEnumType valueOf(int value) { return forNumber(value); } public static chargingStateEnumType forNumber(int value) { switch (value) { case 0: return Charging; case 1: return Suspended; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<chargingStateEnumType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< chargingStateEnumType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<chargingStateEnumType>() { public chargingStateEnumType findValueByNumber(int number) { return chargingStateEnumType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.getDescriptor().getEnumTypes().get(1); } private static final chargingStateEnumType[] VALUES = values(); public static chargingStateEnumType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } private final int value; private chargingStateEnumType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:transactionEventReq.chargingStateEnumType) } /** * Protobuf enum {@code transactionEventReq.reasonEnumType} */ public enum reasonEnumType implements com.google.protobuf.ProtocolMessageEnum { /** * <pre> *取消授权 * </pre> * * <code>DeAuthorized = 0;</code> */ DeAuthorized(0), /** * <pre> *本地停充,如拔掉插头 * </pre> * * <code>Local = 1;</code> */ Local(1), /** * <pre> *按电量充时,达到�?大可充电�? * </pre> * * <code>EnergyLimitReached = 2;</code> */ EnergyLimitReached(2), /** * <pre> *电动车失去连�?(预留给电动汽�?) * </pre> * * <code>EVDisconnected = 3;</code> */ EVDisconnected(3), /** * <pre> *接地故障 * </pre> * * <code>GroundFault = 4;</code> */ GroundFault(4), /** * <pre> *过流故障 * </pre> * * <code>OvercurrrendFault = 5;</code> */ OvercurrrendFault(5), /** * <pre> *掉电 * </pre> * * <code>PowerLoss = 6;</code> */ PowerLoss(6), /** * <pre> * </pre> * * <code>PowerQuality = 7;</code> */ PowerQuality(7), /** * <pre> *后台停充 * </pre> * * <code>Remote = 8;</code> */ Remote(8), /** * <pre> *达到�?大充电时�? * </pre> * * <code>TimeLimitReached = 9;</code> */ TimeLimitReached(9), /** * <pre> *充电超时 * </pre> * * <code>Timeout = 10;</code> */ Timeout(10), /** * <pre> *充满 * </pre> * * <code>SOCLimitReached = 11;</code> */ SOCLimitReached(11), /** * <pre> *Reset * </pre> * * <code>ImmediateReset = 12;</code> */ ImmediateReset(12), ; /** * <pre> *取消授权 * </pre> * * <code>DeAuthorized = 0;</code> */ public static final int DeAuthorized_VALUE = 0; /** * <pre> *本地停充,如拔掉插头 * </pre> * * <code>Local = 1;</code> */ public static final int Local_VALUE = 1; /** * <pre> *按电量充时,达到�?大可充电�? * </pre> * * <code>EnergyLimitReached = 2;</code> */ public static final int EnergyLimitReached_VALUE = 2; /** * <pre> *电动车失去连�?(预留给电动汽�?) * </pre> * * <code>EVDisconnected = 3;</code> */ public static final int EVDisconnected_VALUE = 3; /** * <pre> *接地故障 * </pre> * * <code>GroundFault = 4;</code> */ public static final int GroundFault_VALUE = 4; /** * <pre> *过流故障 * </pre> * * <code>OvercurrrendFault = 5;</code> */ public static final int OvercurrrendFault_VALUE = 5; /** * <pre> *掉电 * </pre> * * <code>PowerLoss = 6;</code> */ public static final int PowerLoss_VALUE = 6; /** * <pre> * </pre> * * <code>PowerQuality = 7;</code> */ public static final int PowerQuality_VALUE = 7; /** * <pre> *后台停充 * </pre> * * <code>Remote = 8;</code> */ public static final int Remote_VALUE = 8; /** * <pre> *达到�?大充电时�? * </pre> * * <code>TimeLimitReached = 9;</code> */ public static final int TimeLimitReached_VALUE = 9; /** * <pre> *充电超时 * </pre> * * <code>Timeout = 10;</code> */ public static final int Timeout_VALUE = 10; /** * <pre> *充满 * </pre> * * <code>SOCLimitReached = 11;</code> */ public static final int SOCLimitReached_VALUE = 11; /** * <pre> *Reset * </pre> * * <code>ImmediateReset = 12;</code> */ public static final int ImmediateReset_VALUE = 12; public final int getNumber() { return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static reasonEnumType valueOf(int value) { return forNumber(value); } public static reasonEnumType forNumber(int value) { switch (value) { case 0: return DeAuthorized; case 1: return Local; case 2: return EnergyLimitReached; case 3: return EVDisconnected; case 4: return GroundFault; case 5: return OvercurrrendFault; case 6: return PowerLoss; case 7: return PowerQuality; case 8: return Remote; case 9: return TimeLimitReached; case 10: return Timeout; case 11: return SOCLimitReached; case 12: return ImmediateReset; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<reasonEnumType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< reasonEnumType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<reasonEnumType>() { public reasonEnumType findValueByNumber(int number) { return reasonEnumType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.getDescriptor().getEnumTypes().get(2); } private static final reasonEnumType[] VALUES = values(); public static reasonEnumType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } private final int value; private reasonEnumType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:transactionEventReq.reasonEnumType) } public interface transactionTypeOrBuilder extends // @@protoc_insertion_point(interface_extends:transactionEventReq.transactionType) com.google.protobuf.MessageOrBuilder { /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ boolean hasChargingState(); /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType getChargingState(); /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ boolean hasTimeSpentCharging(); /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ int getTimeSpentCharging(); /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ boolean hasEnergySpentCharging(); /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ int getEnergySpentCharging(); /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ boolean hasMoneySpentCharging(); /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ int getMoneySpentCharging(); /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ boolean hasStoppedReason(); /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType getStoppedReason(); /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ boolean hasTransactionId(); /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ java.lang.String getTransactionId(); /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ com.google.protobuf.ByteString getTransactionIdBytes(); } /** * Protobuf type {@code transactionEventReq.transactionType} */ public static final class transactionType extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:transactionEventReq.transactionType) transactionTypeOrBuilder { private static final long serialVersionUID = 0L; // Use transactionType.newBuilder() to construct. private transactionType(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private transactionType() { chargingState_ = 0; timeSpentCharging_ = 0; energySpentCharging_ = 0; moneySpentCharging_ = 0; stoppedReason_ = 0; transactionId_ = ""; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private transactionType( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType value = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(1, rawValue); } else { bitField0_ |= 0x00000001; chargingState_ = rawValue; } break; } case 16: { bitField0_ |= 0x00000002; timeSpentCharging_ = input.readUInt32(); break; } case 24: { bitField0_ |= 0x00000004; energySpentCharging_ = input.readUInt32(); break; } case 32: { bitField0_ |= 0x00000008; moneySpentCharging_ = input.readUInt32(); break; } case 40: { int rawValue = input.readEnum(); @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType value = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(5, rawValue); } else { bitField0_ |= 0x00000010; stoppedReason_ = rawValue; } break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; transactionId_ = bs; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_transactionType_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_transactionType_fieldAccessorTable .ensureFieldAccessorsInitialized( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.class, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder.class); } private int bitField0_; public static final int CHARGINGSTATE_FIELD_NUMBER = 1; private int chargingState_; /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ public boolean hasChargingState() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType getChargingState() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType.valueOf(chargingState_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType.Charging : result; } public static final int TIMESPENTCHARGING_FIELD_NUMBER = 2; private int timeSpentCharging_; /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ public boolean hasTimeSpentCharging() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ public int getTimeSpentCharging() { return timeSpentCharging_; } public static final int ENERGYSPENTCHARGING_FIELD_NUMBER = 3; private int energySpentCharging_; /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ public boolean hasEnergySpentCharging() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ public int getEnergySpentCharging() { return energySpentCharging_; } public static final int MONEYSPENTCHARGING_FIELD_NUMBER = 4; private int moneySpentCharging_; /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ public boolean hasMoneySpentCharging() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ public int getMoneySpentCharging() { return moneySpentCharging_; } public static final int STOPPEDREASON_FIELD_NUMBER = 5; private int stoppedReason_; /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ public boolean hasStoppedReason() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType getStoppedReason() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType.valueOf(stoppedReason_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType.DeAuthorized : result; } public static final int TRANSACTIONID_FIELD_NUMBER = 6; private volatile java.lang.Object transactionId_; /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } return s; } } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public com.google.protobuf.ByteString getTransactionIdBytes() { java.lang.Object ref = transactionId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); transactionId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, chargingState_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeUInt32(2, timeSpentCharging_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeUInt32(3, energySpentCharging_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeUInt32(4, moneySpentCharging_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeEnum(5, stoppedReason_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, transactionId_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, chargingState_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, timeSpentCharging_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(3, energySpentCharging_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(4, moneySpentCharging_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(5, stoppedReason_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, transactionId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType)) { return super.equals(obj); } com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType other = (com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType) obj; boolean result = true; result = result && (hasChargingState() == other.hasChargingState()); if (hasChargingState()) { result = result && chargingState_ == other.chargingState_; } result = result && (hasTimeSpentCharging() == other.hasTimeSpentCharging()); if (hasTimeSpentCharging()) { result = result && (getTimeSpentCharging() == other.getTimeSpentCharging()); } result = result && (hasEnergySpentCharging() == other.hasEnergySpentCharging()); if (hasEnergySpentCharging()) { result = result && (getEnergySpentCharging() == other.getEnergySpentCharging()); } result = result && (hasMoneySpentCharging() == other.hasMoneySpentCharging()); if (hasMoneySpentCharging()) { result = result && (getMoneySpentCharging() == other.getMoneySpentCharging()); } result = result && (hasStoppedReason() == other.hasStoppedReason()); if (hasStoppedReason()) { result = result && stoppedReason_ == other.stoppedReason_; } result = result && (hasTransactionId() == other.hasTransactionId()); if (hasTransactionId()) { result = result && getTransactionId() .equals(other.getTransactionId()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasChargingState()) { hash = (37 * hash) + CHARGINGSTATE_FIELD_NUMBER; hash = (53 * hash) + chargingState_; } if (hasTimeSpentCharging()) { hash = (37 * hash) + TIMESPENTCHARGING_FIELD_NUMBER; hash = (53 * hash) + getTimeSpentCharging(); } if (hasEnergySpentCharging()) { hash = (37 * hash) + ENERGYSPENTCHARGING_FIELD_NUMBER; hash = (53 * hash) + getEnergySpentCharging(); } if (hasMoneySpentCharging()) { hash = (37 * hash) + MONEYSPENTCHARGING_FIELD_NUMBER; hash = (53 * hash) + getMoneySpentCharging(); } if (hasStoppedReason()) { hash = (37 * hash) + STOPPEDREASON_FIELD_NUMBER; hash = (53 * hash) + stoppedReason_; } if (hasTransactionId()) { hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; hash = (53 * hash) + getTransactionId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code transactionEventReq.transactionType} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:transactionEventReq.transactionType) com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_transactionType_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_transactionType_fieldAccessorTable .ensureFieldAccessorsInitialized( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.class, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder.class); } // Construct using com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); chargingState_ = 0; bitField0_ = (bitField0_ & ~0x00000001); timeSpentCharging_ = 0; bitField0_ = (bitField0_ & ~0x00000002); energySpentCharging_ = 0; bitField0_ = (bitField0_ & ~0x00000004); moneySpentCharging_ = 0; bitField0_ = (bitField0_ & ~0x00000008); stoppedReason_ = 0; bitField0_ = (bitField0_ & ~0x00000010); transactionId_ = ""; bitField0_ = (bitField0_ & ~0x00000020); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_transactionType_descriptor; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType getDefaultInstanceForType() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance(); } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType build() { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType buildPartial() { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType result = new com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.chargingState_ = chargingState_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.timeSpentCharging_ = timeSpentCharging_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.energySpentCharging_ = energySpentCharging_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.moneySpentCharging_ = moneySpentCharging_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.stoppedReason_ = stoppedReason_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.transactionId_ = transactionId_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType) { return mergeFrom((com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType other) { if (other == com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance()) return this; if (other.hasChargingState()) { setChargingState(other.getChargingState()); } if (other.hasTimeSpentCharging()) { setTimeSpentCharging(other.getTimeSpentCharging()); } if (other.hasEnergySpentCharging()) { setEnergySpentCharging(other.getEnergySpentCharging()); } if (other.hasMoneySpentCharging()) { setMoneySpentCharging(other.getMoneySpentCharging()); } if (other.hasStoppedReason()) { setStoppedReason(other.getStoppedReason()); } if (other.hasTransactionId()) { bitField0_ |= 0x00000020; transactionId_ = other.transactionId_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int chargingState_ = 0; /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ public boolean hasChargingState() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType getChargingState() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType.valueOf(chargingState_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType.Charging : result; } /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ public Builder setChargingState(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.chargingStateEnumType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; chargingState_ = value.getNumber(); onChanged(); return this; } /** * <code>optional .transactionEventReq.chargingStateEnumType chargingState = 1;</code> */ public Builder clearChargingState() { bitField0_ = (bitField0_ & ~0x00000001); chargingState_ = 0; onChanged(); return this; } private int timeSpentCharging_ ; /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ public boolean hasTimeSpentCharging() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ public int getTimeSpentCharging() { return timeSpentCharging_; } /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ public Builder setTimeSpentCharging(int value) { bitField0_ |= 0x00000002; timeSpentCharging_ = value; onChanged(); return this; } /** * <pre> *充电时长 * </pre> * * <code>optional uint32 timeSpentCharging = 2;</code> */ public Builder clearTimeSpentCharging() { bitField0_ = (bitField0_ & ~0x00000002); timeSpentCharging_ = 0; onChanged(); return this; } private int energySpentCharging_ ; /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ public boolean hasEnergySpentCharging() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ public int getEnergySpentCharging() { return energySpentCharging_; } /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ public Builder setEnergySpentCharging(int value) { bitField0_ |= 0x00000004; energySpentCharging_ = value; onChanged(); return this; } /** * <pre> *充电电量 * </pre> * * <code>optional uint32 energySpentCharging = 3;</code> */ public Builder clearEnergySpentCharging() { bitField0_ = (bitField0_ & ~0x00000004); energySpentCharging_ = 0; onChanged(); return this; } private int moneySpentCharging_ ; /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ public boolean hasMoneySpentCharging() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ public int getMoneySpentCharging() { return moneySpentCharging_; } /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ public Builder setMoneySpentCharging(int value) { bitField0_ |= 0x00000008; moneySpentCharging_ = value; onChanged(); return this; } /** * <pre> *充电消�?�金�? * </pre> * * <code>optional uint32 moneySpentCharging = 4;</code> */ public Builder clearMoneySpentCharging() { bitField0_ = (bitField0_ & ~0x00000008); moneySpentCharging_ = 0; onChanged(); return this; } private int stoppedReason_ = 0; /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ public boolean hasStoppedReason() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType getStoppedReason() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType.valueOf(stoppedReason_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType.DeAuthorized : result; } /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ public Builder setStoppedReason(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.reasonEnumType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; stoppedReason_ = value.getNumber(); onChanged(); return this; } /** * <pre> *停充原因 * </pre> * * <code>optional .transactionEventReq.reasonEnumType stoppedReason = 5;</code> */ public Builder clearStoppedReason() { bitField0_ = (bitField0_ & ~0x00000010); stoppedReason_ = 0; onChanged(); return this; } private java.lang.Object transactionId_ = ""; /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public com.google.protobuf.ByteString getTransactionIdBytes() { java.lang.Object ref = transactionId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); transactionId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public Builder setTransactionId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; transactionId_ = value; onChanged(); return this; } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public Builder clearTransactionId() { bitField0_ = (bitField0_ & ~0x00000020); transactionId_ = getDefaultInstance().getTransactionId(); onChanged(); return this; } /** * <pre> *订单ID * </pre> * * <code>optional string transactionId = 6;</code> */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; transactionId_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:transactionEventReq.transactionType) } // @@protoc_insertion_point(class_scope:transactionEventReq.transactionType) private static final com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType(); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<transactionType> PARSER = new com.google.protobuf.AbstractParser<transactionType>() { public transactionType parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new transactionType(input, extensionRegistry); } }; public static com.google.protobuf.Parser<transactionType> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<transactionType> getParserForType() { return PARSER; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private int bitField0_; public static final int EVENTTYPE_FIELD_NUMBER = 1; private int eventType_; /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ public boolean hasEventType() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType getEventType() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType.valueOf(eventType_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType.Ended : result; } public static final int TIMESTAMP_FIELD_NUMBER = 2; private volatile java.lang.Object timestamp_; /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public boolean hasTimestamp() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public java.lang.String getTimestamp() { java.lang.Object ref = timestamp_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { timestamp_ = s; } return s; } } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public com.google.protobuf.ByteString getTimestampBytes() { java.lang.Object ref = timestamp_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); timestamp_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TRANSACTION_FIELD_NUMBER = 3; private com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType transaction_; /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public boolean hasTransaction() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType getTransaction() { return transaction_ == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance() : transaction_; } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder getTransactionOrBuilder() { return transaction_ == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance() : transaction_; } public static final int IDTOKEN_FIELD_NUMBER = 4; private com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType iDToken_; /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public boolean hasIDToken() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType getIDToken() { return iDToken_ == null ? com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.getDefaultInstance() : iDToken_; } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenTypeOrBuilder getIDTokenOrBuilder() { return iDToken_ == null ? com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.getDefaultInstance() : iDToken_; } public static final int CONNECTORID_FIELD_NUMBER = 5; private int connectorId_; /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ public boolean hasConnectorId() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ public int getConnectorId() { return connectorId_; } public static final int TOTALTIME_FIELD_NUMBER = 6; private int totalTime_; /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ public boolean hasTotalTime() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ public int getTotalTime() { return totalTime_; } public static final int TOTALCOST_FIELD_NUMBER = 7; private int totalCost_; /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ public boolean hasTotalCost() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ public int getTotalCost() { return totalCost_; } public static final int ENERGY_FIELD_NUMBER = 8; private int energy_; /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ public boolean hasEnergy() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ public int getEnergy() { return energy_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasEventType()) { memoizedIsInitialized = 0; return false; } if (!hasTimestamp()) { memoizedIsInitialized = 0; return false; } if (!hasTransaction()) { memoizedIsInitialized = 0; return false; } if (hasIDToken()) { if (!getIDToken().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, eventType_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, timestamp_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeMessage(3, getTransaction()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeMessage(4, getIDToken()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeUInt32(5, connectorId_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeUInt32(6, totalTime_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeUInt32(7, totalCost_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeUInt32(8, energy_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, eventType_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, timestamp_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getTransaction()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getIDToken()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(5, connectorId_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(6, totalTime_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(7, totalCost_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(8, energy_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq)) { return super.equals(obj); } com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq other = (com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq) obj; boolean result = true; result = result && (hasEventType() == other.hasEventType()); if (hasEventType()) { result = result && eventType_ == other.eventType_; } result = result && (hasTimestamp() == other.hasTimestamp()); if (hasTimestamp()) { result = result && getTimestamp() .equals(other.getTimestamp()); } result = result && (hasTransaction() == other.hasTransaction()); if (hasTransaction()) { result = result && getTransaction() .equals(other.getTransaction()); } result = result && (hasIDToken() == other.hasIDToken()); if (hasIDToken()) { result = result && getIDToken() .equals(other.getIDToken()); } result = result && (hasConnectorId() == other.hasConnectorId()); if (hasConnectorId()) { result = result && (getConnectorId() == other.getConnectorId()); } result = result && (hasTotalTime() == other.hasTotalTime()); if (hasTotalTime()) { result = result && (getTotalTime() == other.getTotalTime()); } result = result && (hasTotalCost() == other.hasTotalCost()); if (hasTotalCost()) { result = result && (getTotalCost() == other.getTotalCost()); } result = result && (hasEnergy() == other.hasEnergy()); if (hasEnergy()) { result = result && (getEnergy() == other.getEnergy()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasEventType()) { hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; hash = (53 * hash) + eventType_; } if (hasTimestamp()) { hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + getTimestamp().hashCode(); } if (hasTransaction()) { hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getTransaction().hashCode(); } if (hasIDToken()) { hash = (37 * hash) + IDTOKEN_FIELD_NUMBER; hash = (53 * hash) + getIDToken().hashCode(); } if (hasConnectorId()) { hash = (37 * hash) + CONNECTORID_FIELD_NUMBER; hash = (53 * hash) + getConnectorId(); } if (hasTotalTime()) { hash = (37 * hash) + TOTALTIME_FIELD_NUMBER; hash = (53 * hash) + getTotalTime(); } if (hasTotalCost()) { hash = (37 * hash) + TOTALCOST_FIELD_NUMBER; hash = (53 * hash) + getTotalCost(); } if (hasEnergy()) { hash = (37 * hash) + ENERGY_FIELD_NUMBER; hash = (53 * hash) + getEnergy(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code transactionEventReq} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:transactionEventReq) com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReqOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_fieldAccessorTable .ensureFieldAccessorsInitialized( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.class, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.Builder.class); } // Construct using com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTransactionFieldBuilder(); getIDTokenFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); eventType_ = 0; bitField0_ = (bitField0_ & ~0x00000001); timestamp_ = ""; bitField0_ = (bitField0_ & ~0x00000002); if (transactionBuilder_ == null) { transaction_ = null; } else { transactionBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); if (iDTokenBuilder_ == null) { iDToken_ = null; } else { iDTokenBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); connectorId_ = 0; bitField0_ = (bitField0_ & ~0x00000010); totalTime_ = 0; bitField0_ = (bitField0_ & ~0x00000020); totalCost_ = 0; bitField0_ = (bitField0_ & ~0x00000040); energy_ = 0; bitField0_ = (bitField0_ & ~0x00000080); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventReq_descriptor; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq getDefaultInstanceForType() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.getDefaultInstance(); } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq build() { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq buildPartial() { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq result = new com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.eventType_ = eventType_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.timestamp_ = timestamp_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } if (transactionBuilder_ == null) { result.transaction_ = transaction_; } else { result.transaction_ = transactionBuilder_.build(); } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } if (iDTokenBuilder_ == null) { result.iDToken_ = iDToken_; } else { result.iDToken_ = iDTokenBuilder_.build(); } if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.connectorId_ = connectorId_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.totalTime_ = totalTime_; if (((from_bitField0_ & 0x00000040) == 0x00000040)) { to_bitField0_ |= 0x00000040; } result.totalCost_ = totalCost_; if (((from_bitField0_ & 0x00000080) == 0x00000080)) { to_bitField0_ |= 0x00000080; } result.energy_ = energy_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq) { return mergeFrom((com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq other) { if (other == com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.getDefaultInstance()) return this; if (other.hasEventType()) { setEventType(other.getEventType()); } if (other.hasTimestamp()) { bitField0_ |= 0x00000002; timestamp_ = other.timestamp_; onChanged(); } if (other.hasTransaction()) { mergeTransaction(other.getTransaction()); } if (other.hasIDToken()) { mergeIDToken(other.getIDToken()); } if (other.hasConnectorId()) { setConnectorId(other.getConnectorId()); } if (other.hasTotalTime()) { setTotalTime(other.getTotalTime()); } if (other.hasTotalCost()) { setTotalCost(other.getTotalCost()); } if (other.hasEnergy()) { setEnergy(other.getEnergy()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { if (!hasEventType()) { return false; } if (!hasTimestamp()) { return false; } if (!hasTransaction()) { return false; } if (hasIDToken()) { if (!getIDToken().isInitialized()) { return false; } } return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int eventType_ = 0; /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ public boolean hasEventType() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType getEventType() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType.valueOf(eventType_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType.Ended : result; } /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ public Builder setEventType(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionEventEnumType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; eventType_ = value.getNumber(); onChanged(); return this; } /** * <pre> *事件类型 * </pre> * * <code>required .transactionEventReq.transactionEventEnumType eventType = 1;</code> */ public Builder clearEventType() { bitField0_ = (bitField0_ & ~0x00000001); eventType_ = 0; onChanged(); return this; } private java.lang.Object timestamp_ = ""; /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public boolean hasTimestamp() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public java.lang.String getTimestamp() { java.lang.Object ref = timestamp_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { timestamp_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public com.google.protobuf.ByteString getTimestampBytes() { java.lang.Object ref = timestamp_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); timestamp_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public Builder setTimestamp( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; timestamp_ = value; onChanged(); return this; } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public Builder clearTimestamp() { bitField0_ = (bitField0_ & ~0x00000002); timestamp_ = getDefaultInstance().getTimestamp(); onChanged(); return this; } /** * <pre> *时间 * </pre> * * <code>required string timestamp = 2;</code> */ public Builder setTimestampBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; timestamp_ = value; onChanged(); return this; } private com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType transaction_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder> transactionBuilder_; /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public boolean hasTransaction() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType getTransaction() { if (transactionBuilder_ == null) { return transaction_ == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance() : transaction_; } else { return transactionBuilder_.getMessage(); } } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public Builder setTransaction(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType value) { if (transactionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } transaction_ = value; onChanged(); } else { transactionBuilder_.setMessage(value); } bitField0_ |= 0x00000004; return this; } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public Builder setTransaction( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder builderForValue) { if (transactionBuilder_ == null) { transaction_ = builderForValue.build(); onChanged(); } else { transactionBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000004; return this; } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public Builder mergeTransaction(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType value) { if (transactionBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && transaction_ != null && transaction_ != com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance()) { transaction_ = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.newBuilder(transaction_).mergeFrom(value).buildPartial(); } else { transaction_ = value; } onChanged(); } else { transactionBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; return this; } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public Builder clearTransaction() { if (transactionBuilder_ == null) { transaction_ = null; onChanged(); } else { transactionBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder getTransactionBuilder() { bitField0_ |= 0x00000004; onChanged(); return getTransactionFieldBuilder().getBuilder(); } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder getTransactionOrBuilder() { if (transactionBuilder_ != null) { return transactionBuilder_.getMessageOrBuilder(); } else { return transaction_ == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.getDefaultInstance() : transaction_; } } /** * <pre> *订单信息 * </pre> * * <code>required .transactionEventReq.transactionType transaction = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder> getTransactionFieldBuilder() { if (transactionBuilder_ == null) { transactionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionType.Builder, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq.transactionTypeOrBuilder>( getTransaction(), getParentForChildren(), isClean()); transaction_ = null; } return transactionBuilder_; } private com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType iDToken_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType, com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.Builder, com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenTypeOrBuilder> iDTokenBuilder_; /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public boolean hasIDToken() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType getIDToken() { if (iDTokenBuilder_ == null) { return iDToken_ == null ? com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.getDefaultInstance() : iDToken_; } else { return iDTokenBuilder_.getMessage(); } } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public Builder setIDToken(com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType value) { if (iDTokenBuilder_ == null) { if (value == null) { throw new NullPointerException(); } iDToken_ = value; onChanged(); } else { iDTokenBuilder_.setMessage(value); } bitField0_ |= 0x00000008; return this; } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public Builder setIDToken( com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.Builder builderForValue) { if (iDTokenBuilder_ == null) { iDToken_ = builderForValue.build(); onChanged(); } else { iDTokenBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; return this; } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public Builder mergeIDToken(com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType value) { if (iDTokenBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008) && iDToken_ != null && iDToken_ != com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.getDefaultInstance()) { iDToken_ = com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.newBuilder(iDToken_).mergeFrom(value).buildPartial(); } else { iDToken_ = value; } onChanged(); } else { iDTokenBuilder_.mergeFrom(value); } bitField0_ |= 0x00000008; return this; } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public Builder clearIDToken() { if (iDTokenBuilder_ == null) { iDToken_ = null; onChanged(); } else { iDTokenBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); return this; } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.Builder getIDTokenBuilder() { bitField0_ |= 0x00000008; onChanged(); return getIDTokenFieldBuilder().getBuilder(); } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ public com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenTypeOrBuilder getIDTokenOrBuilder() { if (iDTokenBuilder_ != null) { return iDTokenBuilder_.getMessageOrBuilder(); } else { return iDToken_ == null ? com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.getDefaultInstance() : iDToken_; } } /** * <pre> *身份 * </pre> * * <code>optional .IDTokenType IDToken = 4;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType, com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.Builder, com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenTypeOrBuilder> getIDTokenFieldBuilder() { if (iDTokenBuilder_ == null) { iDTokenBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType, com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenType.Builder, com.zhicheng.wukongcharge.models.IDTokenTypeProto.IDTokenTypeOrBuilder>( getIDToken(), getParentForChildren(), isClean()); iDToken_ = null; } return iDTokenBuilder_; } private int connectorId_ ; /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ public boolean hasConnectorId() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ public int getConnectorId() { return connectorId_; } /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ public Builder setConnectorId(int value) { bitField0_ |= 0x00000010; connectorId_ = value; onChanged(); return this; } /** * <pre> *插头�? * </pre> * * <code>optional uint32 connectorId = 5;</code> */ public Builder clearConnectorId() { bitField0_ = (bitField0_ & ~0x00000010); connectorId_ = 0; onChanged(); return this; } private int totalTime_ ; /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ public boolean hasTotalTime() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ public int getTotalTime() { return totalTime_; } /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ public Builder setTotalTime(int value) { bitField0_ |= 0x00000020; totalTime_ = value; onChanged(); return this; } /** * <pre> *总时�? * </pre> * * <code>optional uint32 totalTime = 6;</code> */ public Builder clearTotalTime() { bitField0_ = (bitField0_ & ~0x00000020); totalTime_ = 0; onChanged(); return this; } private int totalCost_ ; /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ public boolean hasTotalCost() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ public int getTotalCost() { return totalCost_; } /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ public Builder setTotalCost(int value) { bitField0_ |= 0x00000040; totalCost_ = value; onChanged(); return this; } /** * <pre> *总金�? * </pre> * * <code>optional uint32 totalCost = 7;</code> */ public Builder clearTotalCost() { bitField0_ = (bitField0_ & ~0x00000040); totalCost_ = 0; onChanged(); return this; } private int energy_ ; /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ public boolean hasEnergy() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ public int getEnergy() { return energy_; } /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ public Builder setEnergy(int value) { bitField0_ |= 0x00000080; energy_ = value; onChanged(); return this; } /** * <pre> *总电�? * </pre> * * <code>optional uint32 energy = 8;</code> */ public Builder clearEnergy() { bitField0_ = (bitField0_ & ~0x00000080); energy_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:transactionEventReq) } // @@protoc_insertion_point(class_scope:transactionEventReq) private static final com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq(); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<transactionEventReq> PARSER = new com.google.protobuf.AbstractParser<transactionEventReq>() { public transactionEventReq parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new transactionEventReq(input, extensionRegistry); } }; public static com.google.protobuf.Parser<transactionEventReq> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<transactionEventReq> getParserForType() { return PARSER; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventReq getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface transactionEventRespOrBuilder extends // @@protoc_insertion_point(interface_extends:transactionEventResp) com.google.protobuf.MessageOrBuilder { /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ boolean hasStatus(); /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType getStatus(); /** * <code>optional string transactionId = 2;</code> */ boolean hasTransactionId(); /** * <code>optional string transactionId = 2;</code> */ java.lang.String getTransactionId(); /** * <code>optional string transactionId = 2;</code> */ com.google.protobuf.ByteString getTransactionIdBytes(); /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ boolean hasBalance(); /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ int getBalance(); } /** * Protobuf type {@code transactionEventResp} */ public static final class transactionEventResp extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:transactionEventResp) transactionEventRespOrBuilder { private static final long serialVersionUID = 0L; // Use transactionEventResp.newBuilder() to construct. private transactionEventResp(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private transactionEventResp() { status_ = 0; transactionId_ = ""; balance_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private transactionEventResp( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType value = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(1, rawValue); } else { bitField0_ |= 0x00000001; status_ = rawValue; } break; } case 18: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000002; transactionId_ = bs; break; } case 24: { bitField0_ |= 0x00000004; balance_ = input.readUInt32(); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventResp_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventResp_fieldAccessorTable .ensureFieldAccessorsInitialized( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.class, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.Builder.class); } /** * Protobuf enum {@code transactionEventResp.transactionStatusEnumType} */ public enum transactionStatusEnumType implements com.google.protobuf.ProtocolMessageEnum { /** * <code>Accepted = 0;</code> */ Accepted(0), /** * <code>TranssctionProcing = 1;</code> */ TranssctionProcing(1), /** * <code>TransactionIdExist = 2;</code> */ TransactionIdExist(2), /** * <code>TransactionIdNotExist = 3;</code> */ TransactionIdNotExist(3), ; /** * <code>Accepted = 0;</code> */ public static final int Accepted_VALUE = 0; /** * <code>TranssctionProcing = 1;</code> */ public static final int TranssctionProcing_VALUE = 1; /** * <code>TransactionIdExist = 2;</code> */ public static final int TransactionIdExist_VALUE = 2; /** * <code>TransactionIdNotExist = 3;</code> */ public static final int TransactionIdNotExist_VALUE = 3; public final int getNumber() { return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static transactionStatusEnumType valueOf(int value) { return forNumber(value); } public static transactionStatusEnumType forNumber(int value) { switch (value) { case 0: return Accepted; case 1: return TranssctionProcing; case 2: return TransactionIdExist; case 3: return TransactionIdNotExist; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<transactionStatusEnumType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< transactionStatusEnumType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<transactionStatusEnumType>() { public transactionStatusEnumType findValueByNumber(int number) { return transactionStatusEnumType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.getDescriptor().getEnumTypes().get(0); } private static final transactionStatusEnumType[] VALUES = values(); public static transactionStatusEnumType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } private final int value; private transactionStatusEnumType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:transactionEventResp.transactionStatusEnumType) } private int bitField0_; public static final int STATUS_FIELD_NUMBER = 1; private int status_; /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ public boolean hasStatus() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType getStatus() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType.valueOf(status_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType.Accepted : result; } public static final int TRANSACTIONID_FIELD_NUMBER = 2; private volatile java.lang.Object transactionId_; /** * <code>optional string transactionId = 2;</code> */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>optional string transactionId = 2;</code> */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } return s; } } /** * <code>optional string transactionId = 2;</code> */ public com.google.protobuf.ByteString getTransactionIdBytes() { java.lang.Object ref = transactionId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); transactionId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int BALANCE_FIELD_NUMBER = 3; private int balance_; /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ public boolean hasBalance() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ public int getBalance() { return balance_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasStatus()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, status_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeUInt32(3, balance_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, status_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(3, balance_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp)) { return super.equals(obj); } com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp other = (com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp) obj; boolean result = true; result = result && (hasStatus() == other.hasStatus()); if (hasStatus()) { result = result && status_ == other.status_; } result = result && (hasTransactionId() == other.hasTransactionId()); if (hasTransactionId()) { result = result && getTransactionId() .equals(other.getTransactionId()); } result = result && (hasBalance() == other.hasBalance()); if (hasBalance()) { result = result && (getBalance() == other.getBalance()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasStatus()) { hash = (37 * hash) + STATUS_FIELD_NUMBER; hash = (53 * hash) + status_; } if (hasTransactionId()) { hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; hash = (53 * hash) + getTransactionId().hashCode(); } if (hasBalance()) { hash = (37 * hash) + BALANCE_FIELD_NUMBER; hash = (53 * hash) + getBalance(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code transactionEventResp} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:transactionEventResp) com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventRespOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventResp_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventResp_fieldAccessorTable .ensureFieldAccessorsInitialized( com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.class, com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.Builder.class); } // Construct using com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); status_ = 0; bitField0_ = (bitField0_ & ~0x00000001); transactionId_ = ""; bitField0_ = (bitField0_ & ~0x00000002); balance_ = 0; bitField0_ = (bitField0_ & ~0x00000004); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.zhicheng.wukongcharge.models.TransactionEventProto.internal_static_transactionEventResp_descriptor; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp getDefaultInstanceForType() { return com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.getDefaultInstance(); } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp build() { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp buildPartial() { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp result = new com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.status_ = status_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.transactionId_ = transactionId_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.balance_ = balance_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp) { return mergeFrom((com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp other) { if (other == com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.getDefaultInstance()) return this; if (other.hasStatus()) { setStatus(other.getStatus()); } if (other.hasTransactionId()) { bitField0_ |= 0x00000002; transactionId_ = other.transactionId_; onChanged(); } if (other.hasBalance()) { setBalance(other.getBalance()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { if (!hasStatus()) { return false; } return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int status_ = 0; /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ public boolean hasStatus() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType getStatus() { @SuppressWarnings("deprecation") com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType result = com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType.valueOf(status_); return result == null ? com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType.Accepted : result; } /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ public Builder setStatus(com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp.transactionStatusEnumType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; status_ = value.getNumber(); onChanged(); return this; } /** * <code>required .transactionEventResp.transactionStatusEnumType status = 1;</code> */ public Builder clearStatus() { bitField0_ = (bitField0_ & ~0x00000001); status_ = 0; onChanged(); return this; } private java.lang.Object transactionId_ = ""; /** * <code>optional string transactionId = 2;</code> */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>optional string transactionId = 2;</code> */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string transactionId = 2;</code> */ public com.google.protobuf.ByteString getTransactionIdBytes() { java.lang.Object ref = transactionId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); transactionId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string transactionId = 2;</code> */ public Builder setTransactionId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; transactionId_ = value; onChanged(); return this; } /** * <code>optional string transactionId = 2;</code> */ public Builder clearTransactionId() { bitField0_ = (bitField0_ & ~0x00000002); transactionId_ = getDefaultInstance().getTransactionId(); onChanged(); return this; } /** * <code>optional string transactionId = 2;</code> */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; transactionId_ = value; onChanged(); return this; } private int balance_ ; /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ public boolean hasBalance() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ public int getBalance() { return balance_; } /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ public Builder setBalance(int value) { bitField0_ |= 0x00000004; balance_ = value; onChanged(); return this; } /** * <pre> *账户余额 * </pre> * * <code>optional uint32 balance = 3;</code> */ public Builder clearBalance() { bitField0_ = (bitField0_ & ~0x00000004); balance_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:transactionEventResp) } // @@protoc_insertion_point(class_scope:transactionEventResp) private static final com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp(); } public static com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<transactionEventResp> PARSER = new com.google.protobuf.AbstractParser<transactionEventResp>() { public transactionEventResp parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new transactionEventResp(input, extensionRegistry); } }; public static com.google.protobuf.Parser<transactionEventResp> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<transactionEventResp> getParserForType() { return PARSER; } public com.zhicheng.wukongcharge.models.TransactionEventProto.transactionEventResp getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor internal_static_transactionEventReq_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_transactionEventReq_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_transactionEventReq_transactionType_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_transactionEventReq_transactionType_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_transactionEventResp_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_transactionEventResp_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\026transactionEvent.proto\032\021IDTokenType.pr" + "oto\"\201\007\n\023transactionEventReq\022@\n\teventType" + "\030\001 \002(\0162-.transactionEventReq.transaction" + "EventEnumType\022\021\n\ttimestamp\030\002 \002(\t\0229\n\013tran" + "saction\030\003 \002(\0132$.transactionEventReq.tran" + "sactionType\022\035\n\007IDToken\030\004 \001(\0132\014.IDTokenTy" + "pe\022\023\n\013connectorId\030\005 \001(\r\022\021\n\ttotalTime\030\006 \001" + "(\r\022\021\n\ttotalCost\030\007 \001(\r\022\016\n\006energy\030\010 \001(\r\032\373\001" + "\n\017transactionType\022A\n\rchargingState\030\001 \001(\016" + "2*.transactionEventReq.chargingStateEnum" + "Type\022\031\n\021timeSpentCharging\030\002 \001(\r\022\033\n\023energ" + "ySpentCharging\030\003 \001(\r\022\032\n\022moneySpentChargi" + "ng\030\004 \001(\r\022:\n\rstoppedReason\030\005 \001(\0162#.transa" + "ctionEventReq.reasonEnumType\022\025\n\rtransact" + "ionId\030\006 \001(\t\"?\n\030transactionEventEnumType\022" + "\t\n\005Ended\020\000\022\013\n\007Started\020\001\022\013\n\007Updated\020\002\"4\n\025" + "chargingStateEnumType\022\014\n\010Charging\020\000\022\r\n\tS" + "uspended\020\001\"\372\001\n\016reasonEnumType\022\020\n\014DeAutho" + "rized\020\000\022\t\n\005Local\020\001\022\026\n\022EnergyLimitReached" + "\020\002\022\022\n\016EVDisconnected\020\003\022\017\n\013GroundFault\020\004\022" + "\025\n\021OvercurrrendFault\020\005\022\r\n\tPowerLoss\020\006\022\020\n" + "\014PowerQuality\020\007\022\n\n\006Remote\020\010\022\024\n\020TimeLimit" + "Reached\020\t\022\013\n\007Timeout\020\n\022\023\n\017SOCLimitReache" + "d\020\013\022\022\n\016ImmediateReset\020\014\"\365\001\n\024transactionE" + "ventResp\022?\n\006status\030\001 \002(\0162/.transactionEv" + "entResp.transactionStatusEnumType\022\025\n\rtra" + "nsactionId\030\002 \001(\t\022\017\n\007balance\030\003 \001(\r\"t\n\031tra" + "nsactionStatusEnumType\022\014\n\010Accepted\020\000\022\026\n\022" + "TranssctionProcing\020\001\022\026\n\022TransactionIdExi" + "st\020\002\022\031\n\025TransactionIdNotExist\020\003B9\n com.c" + "harge.protocol.tomda.modelsB\025Transaction" + "EventProto" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; return null; } }; com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.zhicheng.wukongcharge.models.IDTokenTypeProto.getDescriptor(), }, assigner); internal_static_transactionEventReq_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_transactionEventReq_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_transactionEventReq_descriptor, new java.lang.String[] { "EventType", "Timestamp", "Transaction", "IDToken", "ConnectorId", "TotalTime", "TotalCost", "Energy", }); internal_static_transactionEventReq_transactionType_descriptor = internal_static_transactionEventReq_descriptor.getNestedTypes().get(0); internal_static_transactionEventReq_transactionType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_transactionEventReq_transactionType_descriptor, new java.lang.String[] { "ChargingState", "TimeSpentCharging", "EnergySpentCharging", "MoneySpentCharging", "StoppedReason", "TransactionId", }); internal_static_transactionEventResp_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_transactionEventResp_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_transactionEventResp_descriptor, new java.lang.String[] { "Status", "TransactionId", "Balance", }); com.zhicheng.wukongcharge.models.IDTokenTypeProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
[ "1295263075@qq.com" ]
1295263075@qq.com
b485f4b3742baf7fa7daddccf58f26662da70c12
94f33a2b06c1013a53e5fd986116e8b4d9f67e4e
/src/main/java/org/thymeleaf/DialectConfiguration.java
28a92f5b2916a3ca8f29e8a131b4b746e73cc7f2
[ "Apache-2.0" ]
permissive
lukosan/thymeleaf
83cc5dd6971e2ea3337f17503c4e6f4a2ec19bca
cbaafa11b1f8f6027eb30db044933e5370920f02
refs/heads/3.0-master
2021-04-30T22:13:14.732375
2015-09-30T23:04:27
2015-09-30T23:04:27
43,484,487
0
0
null
2015-10-01T07:50:13
2015-10-01T07:50:13
null
UTF-8
Java
false
false
2,987
java
/* * ============================================================================= * * Copyright (c) 2011-2014, The THYMELEAF team (http://www.thymeleaf.org) * * 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.thymeleaf; import org.thymeleaf.dialect.IDialect; import org.thymeleaf.dialect.IProcessorDialect; import org.thymeleaf.util.Validate; /** * <p> * Configuration class for a specific {@link org.thymeleaf.dialect.IDialect}. Objects of this class * specify a dialect to be used at a template engine, along with the prefix to be applied to it. * </p> * <p> * When a dialect is specified WITH a prefix, this means we want that dialect's processors to match on * attributes and elements that have such prefix in their names. This configured prefix will override the * default prefix specified by the dialect instance itself. If the specified prefix is null, this will mean * the processors will apply on elements/attributes with no prefix. * </p> * <p> * When a dialect is specified WITHOUT a prefix, this means we will just use the default prefix returned by * the dialect instance itself, if it applies (i.e. if it implements * {@link IProcessorDialect}). * </p> * * @author Daniel Fern&aacute;ndez * * @since 1.0 (reimplemented in 3.0.0) * */ public final class DialectConfiguration { private final boolean prefixSpecified; private final String prefix; private final IDialect dialect; public DialectConfiguration(final IDialect dialect) { super(); // Prefix CAN be null Validate.notNull(dialect, "Dialect cannot be null"); this.prefixSpecified = false; this.prefix = null; this.dialect = dialect; } public DialectConfiguration(final String prefix, final IDialect dialect) { super(); // Prefix CAN be null - that will mean the dialect's processors will apply to elements/attributes without prefix Validate.notNull(dialect, "Dialect cannot be null"); this.prefixSpecified = true; this.prefix = prefix; this.dialect = dialect; } public IDialect getDialect() { return this.dialect; } public String getPrefix() { return this.prefix; } public boolean isPrefixSpecified() { return this.prefixSpecified; } }
[ "daniel.fernandez@11thlabs.org" ]
daniel.fernandez@11thlabs.org
806b63691f8cce4e038fb9e82ff64231df44f92b
80f8e40622bfcd5b1f4b316b5aa6af574bbf610d
/subList_search.java
2320d8cb1a2b9b18b74ee61bd90b7b32af0ff28d
[]
no_license
chaudharyritesh947/Searching-techniques
48a0b64178dc02879a84954a44d7606ac8001cfb
af07ff04bb3651f0e6a247763be83221e7ddbc98
refs/heads/master
2021-09-27T18:36:38.170201
2018-11-10T17:19:04
2018-11-10T17:19:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,705
java
#include <bits/stdc++.h> using namespace std; // A Linked List node struct Node { int data; Node* next; }; // Returns true if first list is present in second // list bool findList(Node* first, Node* second) { Node* ptr1 = first, *ptr2 = second; // If both linked lists are empty, return true if (first == NULL && second == NULL) return true; // Else If one is empty and other is not return // false if ( first == NULL || (first != NULL && second == NULL)) return false; // Traverse the second list by picking nodes // one by one while (second != NULL) { // Initialize ptr2 with current node of second ptr2 = second; // Start matching first list with second list while (ptr1 != NULL) { // If second list becomes empty and first // not then return false if (ptr2 == NULL) return false; // If data part is same, go to next // of both lists else if (ptr1->data == ptr2->data) { ptr1 = ptr1->next; ptr2 = ptr2->next; } // If not equal then break the loop else break; } // Return true if first list gets traversed // completely that means it is matched. if (ptr1 == NULL) return true; // Initialize ptr1 with first again ptr1 = first; // And go to next node of second list second = second->next; } return false; } /* Function to print nodes in a given linked list */ void printList(Node* node) { while (node != NULL) { printf("%d ", node->data); node = node->next; } } // Function to add new node to linked lists Node *newNode(int key) { Node *temp = new Node; temp-> data= key; temp->next = NULL; return temp; } /* Driver program to test above functions*/ int main() { /* Let us create two linked lists to test the above functions. Created lists shall be a: 1->2->3->4 b: 1->2->1->2->3->4*/ Node *a = newNode(1); a->next = newNode(2); a->next->next = newNode(3); a->next->next->next = newNode(4); Node *b = newNode(1); b->next = newNode(2); b->next->next = newNode(1); b->next->next->next = newNode(2); b->next->next->next->next = newNode(3); b->next->next->next->next->next = newNode(4); findList(a,b) ? cout << "LIST FOUND" : cout << "LIST NOT FOUND"; return 0; }
[ "chaudharyritesh947@gmail.com" ]
chaudharyritesh947@gmail.com
2be7a09543533d6a510d73907848111fcb32a060
c36452689924d861ba0d910854758f3f70fd0227
/src/main/java/org/jellylab/vit/agent/AgentServerMain.java
b8d028f03e3a40b21e603092a2cd44a9f3210518
[]
no_license
stone2083/vit
de1daa4da59d871522087b8b43e77f41b7720a5c
6a4075b12e64cab3055e3c12c9e07411b59102a3
refs/heads/master
2020-05-29T20:55:58.211417
2015-04-09T09:43:23
2015-04-09T09:43:23
32,782,987
0
0
null
null
null
null
UTF-8
Java
false
false
2,490
java
package org.jellylab.vit.agent; import java.io.File; import java.net.InetSocketAddress; import org.jellylab.vit.agent.AgentConfiguration.AgentAddress; import org.jellylab.vit.agent.AgentConfiguration.ServerAddress; import org.jellylab.vit.agent.AgentConfiguration.TunnelServerAddress; import org.jellylab.vit.utils.IoUtil; import com.alibaba.fastjson.JSON; /** * @author jinli Apr 3, 2015 */ public class AgentServerMain { public static void main(String[] args) { String conf = "agent.conf"; if (System.getProperty("agent.conf") != null) { conf = System.getProperty("agent.conf"); } File fconf = new File(conf); if (!fconf.isFile()) { System.out.println("agent.conf not found. [conf=" + conf + "]"); return; } AgentConfiguration configuration; try { configuration = JSON.parseObject(IoUtil.read(fconf, "utf-8"), AgentConfiguration.class); } catch (Exception e) { System.out.println("agent.conf invalid formats."); return; } Agent agent = new Agent(); for (AgentAddress aa : configuration.getAgentAddresses()) { AgentConnectionGroup group = new AgentConnectionGroup(); group.setEhost(aa.getEhost()); group.setEport(aa.getEport()); group.setSign(aa.getSign()); group.setMaxConns(aa.getMaxConns()); for (ServerAddress sa : aa.getServerAddresses()) { group.getServerAddresses().add(new InetSocketAddress(sa.getHost(), sa.getPort())); } agent.addAgentConnectionGroup(group); } AgentServer agentServer = new AgentServer(); agentServer.setAgent(agent); agentServer.setNworker(configuration.getNworker()); for (TunnelServerAddress tsa : configuration.getTunnelServerAddresses()) { agentServer.getTunnelAddresses().add(new InetSocketAddress(tsa.getHost(), tsa.getPort())); } try { agentServer.init(); agentServer.start(); } catch (Exception e) { System.out.println("init and start fail."); } Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { agentServer.shutdown(); } catch (Exception e) { } } })); } }
[ "li.jinl@taobao.com" ]
li.jinl@taobao.com
f573b8e56b019b049deac7ac24c9c78270f837a7
720538c1941587ffbe000c7f7d123dc6ebfa0f0a
/domain/src/main/java/com/example/domain/question/service/QuestionService.java
f637ab931d9b016955ee1a2e065f3542fb5e46dd
[]
no_license
changyuchun/ddd-lite-example
decc62a8034cc01411343387a40b1edd86985fed
efd7eb0d3769967fbba40d097c9467e7dce2b5e3
refs/heads/main
2023-08-23T08:48:09.744559
2021-10-29T00:21:33
2021-10-29T00:21:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,058
java
package com.example.domain.question.service; import com.example.domain.group.model.GroupMember; import com.example.domain.group.model.GroupOperator; import com.example.domain.question.exception.QuestionException; import com.example.domain.question.model.Answer; import com.example.domain.question.model.Question; import com.example.domain.question.repository.AnswerRepository; import com.example.domain.question.repository.QuestionRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import java.time.Instant; import java.util.List; import java.util.Optional; @Service public class QuestionService { @Autowired private QuestionRepository repository; @Autowired private AnswerRepository answerRepository; public Question get(String id) { return _get(id); } private Question _get(String id) { return repository.findById(id).orElseThrow(QuestionException::notFound); } public Page<Question> findAll(Specification<Question> spec, Pageable pageable) { return repository.findAll(spec, pageable); } public List<Question> findAll(Specification<Question> spec) { return repository.findAll(spec); } public Question create(String title, String description, GroupOperator operator) { Question question = Question.builder() .title(title) .description(description) .groupId(operator.getGroupId()) .status(Question.Status.OPENED) .createdBy(operator.getUserId()) .createdAt(Instant.now()) .updatedAt(Instant.now()) .build(); return repository.save(question); } public Question update(String id, String title, String description, GroupOperator operator) { Question question = this._get(id); if (!question.getCreatedBy().equals(operator.getUserId())) { throw QuestionException.forbidden(); } question.setTitle(title); question.setDescription(description); question.setUpdatedAt(Instant.now()); return repository.save(question); } public Question updateStatus(String id, Question.Status status, GroupOperator operator) { Question question = this._get(id); if (operator.getRole().compareTo(GroupMember.Role.ADMIN) < 0 && !question.getCreatedBy().equals(operator.getUserId())) { throw QuestionException.forbidden(); } question.setStatus(status); question.setUpdatedAt(Instant.now()); return repository.save(question); } public void delete(String id, GroupOperator operator) { Optional<Question> optionalQuestion = repository.findById(id); if (!optionalQuestion.isPresent()) { return; } Question question = optionalQuestion.get(); if (operator.getRole().compareTo(GroupMember.Role.ADMIN) < 0 && !question.getCreatedBy().equals(operator.getUserId())) { throw QuestionException.forbidden(); } answerRepository.deleteAll(question.getAnswers()); repository.deleteById(id); } private Answer _getAnswer(String answerId) { return answerRepository.findById(answerId).orElseThrow(QuestionException::answerNotFound); } public Answer addAnswer(String id, String content, GroupOperator operator) { Question question = _get(id); Answer answer = Answer.builder() .questionId(id) .content(content) .createdBy(operator.getUserId()) .createdAt(Instant.now()) .updatedAt(Instant.now()) .build(); return answerRepository.save(answer); } public Page<Answer> findAllAnswers(Specification<Answer> spec, Pageable pageable) { return answerRepository.findAll(spec, pageable); } public Answer updateAnswer(String id, String answerId, String content, GroupOperator operator) { Question question = _get(id); Answer answer = _getAnswer(answerId); if (!answer.getCreatedBy().equals(operator.getUserId())) { throw QuestionException.answerForbidden(); } answer.setContent(content); answer.setUpdatedAt(Instant.now()); return answerRepository.save(answer); } public void deleteAnswer(String id, String answerId, GroupOperator operator) { Optional<Answer> optionalAnswer = answerRepository.findById(answerId); if (!optionalAnswer.isPresent()) { return; } if (operator.getRole().compareTo(GroupMember.Role.ADMIN) < 0 && !optionalAnswer.get().getCreatedBy().equals(operator.getUserId())) { throw QuestionException.answerForbidden(); } answerRepository.deleteById(answerId); } }
[ "isixline@qq.com" ]
isixline@qq.com
d77d66db1931de2274a28e76a19006a317c44d26
2b06ce32740b67e23c2499c5a269f5235af23b32
/app/src/main/java/com/example/alatelektronik/model/Kulkas.java
b4a5979efbcebf5ffd3e4d95242c4a3d735a7950
[]
no_license
chalsiaishaqiah/UTS-PEMROGRAMAN-MOBILE
88b49609a67b193acfd7a005861f573d3a1fa8d0
1516257698d298bb49aceb9fac037f831f132c28
refs/heads/master
2023-01-21T12:56:46.279908
2020-12-04T12:27:32
2020-12-04T12:27:32
318,501,992
0
0
null
null
null
null
UTF-8
Java
false
false
207
java
package com.example.alatelektronik.model; public class Kulkas extends Alat { public Kulkas(String nama,String deskripsi, int drawableRes) { super("Kulkas",nama,deskripsi,drawableRes); } }
[ "ihqchalsia@gmail.com" ]
ihqchalsia@gmail.com
c2ac48169a104ffe06cd1edbec3b12e82dbab542
b15d453a3b12759a033065a326ac7386d604306e
/src/main/java/com/cisc181/exception/PersonException.java
335ced1b3a39a653b97ddce3e7e11559c3661488
[]
no_license
821754556/midterm
375207f2fe77c931e7460efd20b209febd02f970
f42f7242bec2e48c7505ad69f8798bda2b12a35c
refs/heads/master
2021-07-15T21:15:22.607446
2017-10-17T21:54:43
2017-10-17T21:54:43
107,299,460
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.cisc181.exception; import com.cisc181.core.Person; public class PersonException extends Exception{ private Person person; public PersonException(Person person){ super(); this.person = person; } public Person getPerson(){ return person; } }
[ "EdwardXie@10.180.68.52" ]
EdwardXie@10.180.68.52
6a86e24ae929c25e485c04c7005a141375c0d396
9b6825d057bfdd7f68246dd302d27421753eeae2
/src/com/Studence/BasicServlets/DBInfo.java
d67b472ccaa26e22e3658b351be2f213da8893d3
[]
no_license
hashtagfo/demoProd
7c14704f4feff1a4ac0b0c2bd297db62bde050e7
53f4ff19c7c109668f9f58139ffe272fe57937e4
refs/heads/master
2020-04-05T17:24:53.362796
2018-11-17T16:43:01
2018-11-17T16:43:01
157,059,598
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package com.Studence.BasicServlets; public class DBInfo { static String host = "studence-app-mysql"; // The standard name in Tomcat+ MySQL on openshift static String DBname = "studencedatabse"; static int port = 3306; // This is for MySQL static String mySQLdbURL = "jdbc:mysql://" + host + ":" + port + "/" + DBname; static String user = "studence"; static String password = "redbinoutyou"; static String driver = "com.mysql.jdbc.Driver"; public DBInfo() { } static String getDBURL() { return mySQLdbURL; } static String getOrganisationTable() { return "organisation"; } public static String getUser() { return user; } public static String getPassword() { return password; } public static String getDriver() { return driver; } }
[ "shubhamtiwaricr07@gmail.com" ]
shubhamtiwaricr07@gmail.com
e1fa585936b15b5df083f08b60d331d88a151543
04f7e1cb0e208e034c1930ff258020af2130760f
/ShopE/src/main/java/ua/artcode/listener/InitSpringContextListener.java
1327062aeeea1df22780868b386147d1d7a4912a
[]
no_license
presly808/ACP5
7142325c6456c2805975e8486876cdaa90fdb0f5
3ec8dde49fd964f19597e01929a95c1d672b227b
refs/heads/master
2021-01-01T16:19:29.046825
2015-06-28T08:21:31
2015-06-28T08:21:31
29,540,516
0
3
null
null
null
null
UTF-8
Java
false
false
817
java
package ua.artcode.listener; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; /** * Created by serhii on 22.03.15. */ public class InitSpringContextListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { String location = sce.getServletContext().getInitParameter("springLocation"); ApplicationContext applicationContext = new ClassPathXmlApplicationContext(location); sce.getServletContext().setAttribute("applicationContext", applicationContext); } @Override public void contextDestroyed(ServletContextEvent sce) { } }
[ "presly808@gmail.com" ]
presly808@gmail.com
9efd7eafcacd4691fa392e063e480956b336bf06
4688d19282b2b3b46fc7911d5d67eac0e87bbe24
/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/transform/DeleteClassifierRequestMarshaller.java
cf754768c3fa45cbf411cc40b3f1151062e7ceef
[ "Apache-2.0" ]
permissive
emilva/aws-sdk-java
c123009b816963a8dc86469405b7e687602579ba
8fdbdbacdb289fdc0ede057015722b8f7a0d89dc
refs/heads/master
2021-05-13T17:39:35.101322
2018-12-12T13:11:42
2018-12-12T13:11:42
116,821,450
1
0
Apache-2.0
2018-09-19T04:17:41
2018-01-09T13:45:39
Java
UTF-8
Java
false
false
2,002
java
/* * Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.glue.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.glue.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * DeleteClassifierRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class DeleteClassifierRequestMarshaller { private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Name").build(); private static final DeleteClassifierRequestMarshaller instance = new DeleteClassifierRequestMarshaller(); public static DeleteClassifierRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(DeleteClassifierRequest deleteClassifierRequest, ProtocolMarshaller protocolMarshaller) { if (deleteClassifierRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteClassifierRequest.getName(), NAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
376cdb6d4e9d1a86f8ea1ae94f54f401163ca200
068657a04a5950f0dabcbc2d53bfa8105b2ac304
/Ders20/src/entity/Personel.java
8b217eeed997d7d0783cacf6cf1be29de673b7b1
[]
no_license
cimcoz/BilgeAdam
e9c09da33663e13d34b18cc13e44953be8217be9
4d4b0c2be1b19cca3140dd45e9b52bed190334f9
refs/heads/master
2022-01-05T11:24:50.054568
2019-04-21T06:59:09
2019-04-21T06:59:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,701
java
package entity; //entitiy db'deki veriler import java.sql.Date; public class Personel { private Long id; private String adi; private String soyadi; private String tcNo; private String tel; private Date dogumTarihi; public Personel(){ } public Personel(Long id, String adi, String soyadi, String tcNo, String tel, Date dogumTarihi) { this.id = id; this.adi = adi; this.soyadi = soyadi; this.tcNo = tcNo; this.tel = tel; this.dogumTarihi = dogumTarihi; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getAdi() { return adi; } public void setAdi(String adi) { this.adi = adi; } public String getSoyadi() { return soyadi; } public void setSoyadi(String soyadi) { this.soyadi = soyadi; } public String getTcNo() { return tcNo; } public void setTcNo(String tcNo) { this.tcNo = tcNo; } public String getTel() { return tel; } public void setTel(String tel) { this.tel = tel; } public Date getDogumTarihi() { return dogumTarihi; } public void setDogumTarihi(Date dogumTarihi) { this.dogumTarihi = dogumTarihi; } @Override public String toString() { return "Personel{" + "id=" + id + ", adi='" + adi + '\'' + ", soyadi='" + soyadi + '\'' + ", tcNo='" + tcNo + '\'' + ", tel='" + tel + '\'' + ", dogumTarihi=" + dogumTarihi + '}'; } }
[ "mugeeebaydar@gmail.com" ]
mugeeebaydar@gmail.com
79d11e819671ed9360daeccd8e42dee835ed6366
f4b95871a91465297a84c0d0f56a4aa25e85f6fc
/src/main/java/com/midorlo/k11/security/DomainUserDetailsService.java
0deeb71d33ea41669f35967d3bea8c971c57dc7a
[]
no_license
midorlo/k11
862f27bad6cb665e7b328b8355ae72c93b991a84
8d45aae60cb81dc9bf25850c40d956ab1ccb460f
refs/heads/master
2023-08-25T13:39:22.872483
2021-10-02T22:00:24
2021-10-02T22:00:24
412,916,878
0
0
null
null
null
null
UTF-8
Java
false
false
2,700
java
package com.midorlo.k11.security; import com.midorlo.k11.domain.User; import com.midorlo.k11.repository.UserRepository; import java.util.*; import java.util.stream.Collectors; import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; /** * Authenticate a user from the database. */ @Component("userDetailsService") public class DomainUserDetailsService implements UserDetailsService { private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class); private final UserRepository userRepository; public DomainUserDetailsService(UserRepository userRepository) { this.userRepository = userRepository; } @Override @Transactional public UserDetails loadUserByUsername(final String login) { log.debug("Authenticating {}", login); if (new EmailValidator().isValid(login, null)) { return userRepository .findOneWithAuthoritiesByEmailIgnoreCase(login) .map(user -> createSpringSecurityUser(login, user)) .orElseThrow(() -> new UsernameNotFoundException("User with email " + login + " was not found in the database")); } String lowercaseLogin = login.toLowerCase(Locale.ENGLISH); return userRepository .findOneWithAuthoritiesByLogin(lowercaseLogin) .map(user -> createSpringSecurityUser(lowercaseLogin, user)) .orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the database")); } private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) { if (!user.isActivated()) { throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated"); } List<GrantedAuthority> grantedAuthorities = user .getAuthorities() .stream() .map(authority -> new SimpleGrantedAuthority(authority.getName())) .collect(Collectors.toList()); return new org.springframework.security.core.userdetails.User(user.getLogin(), user.getPassword(), grantedAuthorities); } }
[ "dorloechter@gmail.com" ]
dorloechter@gmail.com
b6edde74ca2167f8d994f04253aaccc4ebb03e8f
c5f73cc30d2375bda4be817e6c971f81fec5cbcd
/SistemaNatacao/src/View/Mainn.java
b7ef769b9d25715b447fec058c709dedc61069dc
[]
no_license
daniLima/grupo1_ne3a_2012_2
9cc95eee763892a567145d14ded3dc77bb5c5af0
eecf82e417908b7c71b901d38b972c429b5b7676
refs/heads/master
2021-01-20T05:07:40.132058
2013-04-14T20:38:32
2013-04-14T20:38:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,595
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package View; import java.awt.FlowLayout; import java.lang.reflect.Method; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JTextField; import org.netbeans.lib.awtextra.AbsoluteLayout; /** * * @author Daniele */ public class Mainn { public static void main(String[] args) { Cliente c = new Cliente(); c.setId(1); c.setNome("dani"); showObject(c); } public static void showObject(Object obj) { JDialog dialog = new JDialog(); // dialog.setSize(obj.getClass().getAnnotation(ClassProperty.class).width(), 300); //width q esta a na classe classproperty dialog.setLocationRelativeTo(null); dialog.setTitle("V" + obj.getClass().getSimpleName());//invez de get simple name via seer get label pegar nom simples//agora é getAnnotATION(ClassProperty.class).label());//para aparecer o nome dialog.setLayout(new FlowLayout()); for (Method m : obj.getClass().getMethods()) { if (m.getName().startsWith("get")) { MethodProperty anot = m.getAnnotation(MethodProperty.class); // dialog.add(new JLabel(anot.label() + ",")); try { dialog.add(new JTextField(m.invoke(obj, null).toString(), 15));//invocando metodo m } catch (Exception ex) { dialog.add(new JTextField(ex.getMessage())); } } } dialog.setVisible(true); } }
[ "danielelyma@gmail.com" ]
danielelyma@gmail.com
1ff4aed4ad294b69028799f61f102f6f60ba8cba
670953f3bc550008a0cc4b1ceff3509525f0b206
/src/main/java/org/zaproxy/libs/DownloadTools.java
6be60f237a1c331e5205f9aea3deef42d2a1dee5
[ "Apache-2.0" ]
permissive
psiinon/zap-libs
a26f71bac2dbff4390226052fcc445e7ab80e05e
4400147f1f4db6be06d18af5a539044f20fac2d0
refs/heads/master
2021-01-14T02:37:53.794517
2019-01-16T16:31:12
2019-01-16T17:39:23
81,844,027
0
0
null
2017-02-13T16:10:26
2017-02-13T16:10:26
null
UTF-8
Java
false
false
4,706
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2017 The ZAP Development Team * * 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.zaproxy.libs; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.util.zip.GZIPInputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.apache.commons.compress.archivers.ArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; public class DownloadTools { public static void downloadDriver(String urlStr, String destDir, String destFile) { File dest = new File(destDir + destFile); if (dest.exists()) { System.out.println("Already exists: " + dest.getAbsolutePath()); return; } File parent = dest.getParentFile(); if (!parent.exists() && !parent.mkdirs()) { System.out.println( "Failed to create directory : " + dest.getParentFile().getAbsolutePath()); } byte[] buffer = new byte[1024]; if (urlStr.endsWith(".zip")) { try { URL url = new URL(urlStr); ZipInputStream zipIn = new ZipInputStream(url.openStream()); ZipEntry entry; boolean isFound = false; while ((entry = zipIn.getNextEntry()) != null) { if (destFile.equals(entry.getName())) { isFound = true; FileOutputStream out = new FileOutputStream(dest); int read = 0; while ((read = zipIn.read(buffer)) != -1) { out.write(buffer, 0, read); } out.close(); System.out.println("Updated: " + dest.getAbsolutePath()); } else { System.out.println("Found " + entry.getName()); } zipIn.closeEntry(); entry = zipIn.getNextEntry(); } zipIn.close(); if (!isFound) { System.out.println("Failed to find " + destFile); System.exit(1); } } catch (IOException ex) { ex.printStackTrace(); System.exit(1); } } else if (urlStr.endsWith(".tar.gz")) { try { URL url = new URL(urlStr); GZIPInputStream gzis = new GZIPInputStream(url.openStream()); File tarFile = new File(dest.getAbsolutePath() + ".tar"); FileOutputStream out = new FileOutputStream(tarFile); int len; while ((len = gzis.read(buffer)) > 0) { out.write(buffer, 0, len); } gzis.close(); out.close(); TarArchiveInputStream tar = new TarArchiveInputStream(new FileInputStream(tarFile)); ArchiveEntry entry; boolean isFound = false; while ((entry = tar.getNextEntry()) != null) { if (destFile.equals(entry.getName())) { out = new FileOutputStream(dest); isFound = true; int read = 0; while ((read = tar.read(buffer)) != -1) { out.write(buffer, 0, read); } out.close(); System.out.println("Updated: " + dest.getAbsolutePath()); } } tar.close(); tarFile.delete(); if (!isFound) { System.out.println("Failed to find " + destFile); System.exit(1); } } catch (IOException ex) { ex.printStackTrace(); System.exit(1); } } } }
[ "thc202@gmail.com" ]
thc202@gmail.com
799ec188c95815d56604dde32adf5554a42a2f86
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-sas/src/main/java/com/aliyuncs/sas/transform/v20181203/GetCheckRiskStatisticsResponseUnmarshaller.java
818e4809de92591f9af2e5010b347eecd8cf6cae
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-java-sdk
a263fa08e261f12d45586d1b3ad8a6609bba0e91
e19239808ad2298d32dda77db29a6d809e4f7add
refs/heads/master
2023-09-03T12:28:09.765286
2023-09-01T09:03:00
2023-09-01T09:03:00
39,555,898
1,542
1,317
NOASSERTION
2023-09-14T07:27:05
2015-07-23T08:41:13
Java
UTF-8
Java
false
false
3,666
java
/* * 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.aliyuncs.sas.transform.v20181203; import java.util.ArrayList; import java.util.List; import com.aliyuncs.sas.model.v20181203.GetCheckRiskStatisticsResponse; import com.aliyuncs.sas.model.v20181203.GetCheckRiskStatisticsResponse.DataItem; import com.aliyuncs.sas.model.v20181203.GetCheckRiskStatisticsResponse.DataItem.SubStatistic; import com.aliyuncs.transform.UnmarshallerContext; public class GetCheckRiskStatisticsResponseUnmarshaller { public static GetCheckRiskStatisticsResponse unmarshall(GetCheckRiskStatisticsResponse getCheckRiskStatisticsResponse, UnmarshallerContext _ctx) { getCheckRiskStatisticsResponse.setRequestId(_ctx.stringValue("GetCheckRiskStatisticsResponse.RequestId")); getCheckRiskStatisticsResponse.setCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Count")); List<DataItem> data = new ArrayList<DataItem>(); for (int i = 0; i < _ctx.lengthValue("GetCheckRiskStatisticsResponse.Data.Length"); i++) { DataItem dataItem = new DataItem(); dataItem.setSceneName(_ctx.stringValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SceneName")); dataItem.setLowWarningCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].LowWarningCount")); dataItem.setMediumWarningCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].MediumWarningCount")); dataItem.setHighWarningCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].HighWarningCount")); dataItem.setTotalCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].TotalCount")); dataItem.setPassCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].PassCount")); List<SubStatistic> subStatistics = new ArrayList<SubStatistic>(); for (int j = 0; j < _ctx.lengthValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics.Length"); j++) { SubStatistic subStatistic = new SubStatistic(); subStatistic.setTypeName(_ctx.stringValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].TypeName")); subStatistic.setAlias(_ctx.stringValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].Alias")); subStatistic.setLowWarningCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].LowWarningCount")); subStatistic.setMediumWarningCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].MediumWarningCount")); subStatistic.setHighWarningCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].HighWarningCount")); subStatistic.setTotalCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].TotalCount")); subStatistic.setPassCount(_ctx.integerValue("GetCheckRiskStatisticsResponse.Data["+ i +"].SubStatistics["+ j +"].PassCount")); subStatistics.add(subStatistic); } dataItem.setSubStatistics(subStatistics); data.add(dataItem); } getCheckRiskStatisticsResponse.setData(data); return getCheckRiskStatisticsResponse; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
b1e29aadb523531610af079f93212628c6dfbf2d
a50f1923877dd17ec39ba04a31124398e9f28d31
/app/src/main/java/com/jiajia/coco/yumeng/utils/TLog.java
c94f42c10e2c23426d34cadac60f20cc5a216b3e
[]
no_license
jiajiaJerry/YuMeng
377819811ed2d54985623321b43a99a204222faf
fe051091732a71cc8fd4ca555b72de49f8ed1aba
refs/heads/master
2020-05-28T08:48:36.045779
2019-05-28T03:14:35
2019-05-28T03:14:35
188,945,628
0
0
null
null
null
null
UTF-8
Java
false
false
7,197
java
package com.jiajia.coco.yumeng.utils; import android.text.TextUtils; import android.util.Log; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /** * LOG工具 */ public class TLog { private static boolean IS_SHOW_LOG = true; private static final String DEFAULT_MESSAGE = "execute"; private static final String LINE_SEPARATOR = System.getProperty("line.separator"); private static final int JSON_INDENT = 4; private static final int V = 0x1; private static final int D = 0x2; private static final int I = 0x3; private static final int W = 0x4; private static final int E = 0x5; private static final int A = 0x6; private static final int JSON = 0x7; /** * Disable the log output. */ public static void disableLog() { IS_SHOW_LOG = false; } /** * Enable the log output. */ public static void enableLog() { IS_SHOW_LOG = true; } public static void init(boolean isShowLog) { IS_SHOW_LOG = isShowLog; } public static void v() { printLog(V, null, DEFAULT_MESSAGE); } public static void v(Object msg) { printLog(V, null, msg); } public static void v(String tag, String msg) { printLog(V, tag, msg); } public static void d() { printLog(D, null, DEFAULT_MESSAGE); } public static void d(Object msg) { printLog(D, null, msg); } public static void d(String tag, Object msg) { printLog(D, tag, msg); } public static void i() { printLog(I, null, DEFAULT_MESSAGE); } public static void i(Object msg) { printLog(I, null, msg); } public static void i(String tag, Object msg) { printLog(I, tag, msg); } public static void w() { printLog(W, null, DEFAULT_MESSAGE); } public static void w(Object msg) { printLog(W, null, msg); } public static void w(String tag, Object msg) { printLog(W, tag, msg); } public static void e() { printLog(E, null, DEFAULT_MESSAGE); } public static void e(Object msg) { printLog(E, null, msg); } public static void e(String tag, Object msg) { printLog(E, tag, msg); } public static void a() { printLog(A, null, DEFAULT_MESSAGE); } public static void a(Object msg) { printLog(A, null, msg); } public static void a(String tag, Object msg) { printLog(A, tag, msg); } public static void json(String jsonFormat) { printLog(JSON, null, jsonFormat); } public static void json(String tag, String jsonFormat) { printLog(JSON, tag, jsonFormat); } private static void printLog(int type, String tagStr, Object objectMsg) { String msg; if (!IS_SHOW_LOG) { return; } StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); int index = 4; String className = stackTrace[index].getFileName(); String methodName = stackTrace[index].getMethodName(); int lineNumber = stackTrace[index].getLineNumber(); String tag = (tagStr == null ? className : tagStr); methodName = methodName.substring(0, 1).toUpperCase() + methodName.substring(1); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("[ (").append(className).append(":").append(lineNumber).append(")#").append(methodName).append(" ] "); if (objectMsg == null) { msg = "Log with null Object"; } else { msg = objectMsg.toString(); } if (msg != null && type != JSON) { stringBuilder.append(msg); } String logStr = stringBuilder.toString(); switch (type) { case V: Log.v(tag, logStr); break; case D: Log.d(tag, logStr); break; case I: Log.i(tag, logStr); break; case W: Log.w(tag, logStr); break; case E: Log.e(tag, logStr); break; case A: Log.wtf(tag, logStr); break; case JSON: { if (TextUtils.isEmpty(msg)) { Log.d(tag, "Empty or Null json content"); return; } String message = null; try { if (msg.startsWith("{")) { JSONObject jsonObject = new JSONObject(msg); message = jsonObject.toString(JSON_INDENT); } else if (msg.startsWith("[")) { JSONArray jsonArray = new JSONArray(msg); message = jsonArray.toString(JSON_INDENT); } } catch (JSONException e) { e(tag, e.getCause().getMessage() + "\n" + msg); return; } printLine(tag, true); message = logStr + LINE_SEPARATOR + message; String[] lines = message.split(LINE_SEPARATOR); StringBuilder jsonContent = new StringBuilder(); for (String line : lines) { jsonContent.append("║ ").append(line).append(LINE_SEPARATOR); } //Log.i(tag, jsonContent.toString()); if (jsonContent.toString().length() > 3200) { Log.w(tag, "jsonContent.length = " + jsonContent.toString().length()); int chunkCount = jsonContent.toString().length() / 3200; for (int i = 0; i <= chunkCount; i++) { int max = 3200 * (i + 1); if (max >= jsonContent.toString().length()) { Log.w(tag, jsonContent.toString().substring(3200 * i)); } else { Log.w(tag, jsonContent.toString().substring(3200 * i, max)); } } } else { Log.w(tag, jsonContent.toString()); } printLine(tag, false); } break; } } private static void printLine(String tag, boolean isTop) { if (isTop) { Log.w(tag, "╔═══════════════════════════════════════════════════════════════════════════════════════"); } else { Log.w(tag, "╚═══════════════════════════════════════════════════════════════════════════════════════"); } } public static boolean isLogEnable() { return IS_SHOW_LOG; } }
[ "13632357948@163.com" ]
13632357948@163.com
bcb7e709963e42b3241269685bc6b59f40338fc2
3f6b0b5c501cbab85202cdbdb9b37fb7f5e79caf
/app/src/main/java/com/jeff_jeong/shoppingcartapp/ChooseQuantityDialog.java
3254f3b4176fb19ae12fcd2f3dfa881f6dbf33da
[]
no_license
TuenTuenna/ShopperHolic
0f6be35aa70692d6ed1bfdbf855b2f402fd4a348
c36783b7210d4b2c8832eee59199573b9a540dd1
refs/heads/master
2020-05-28T11:14:19.846054
2019-11-18T06:37:41
2019-11-18T06:37:41
188,981,571
0
0
null
null
null
null
UTF-8
Java
false
false
1,806
java
package com.jeff_jeong.shoppingcartapp; // Created by Jeff_Jeong on 2019. 5. 29. import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.DialogFragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import com.jeff_jeong.shoppingcartapp.databinding.DialogChooseQuantityBinding; public class ChooseQuantityDialog extends DialogFragment { private static final String TAG = "ChooseQuantityDialog"; // data binding DialogChooseQuantityBinding mBinding; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mBinding = DialogChooseQuantityBinding.inflate(inflater); mBinding.setIMainActivity((IMainActivity) getActivity()); mBinding.listView.setOnItemClickListener(mOnItemClickListener); mBinding.closeDialog.setOnClickListener(mCloseDialogListener); return mBinding.getRoot(); } public AdapterView.OnItemClickListener mOnItemClickListener = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Log.d(TAG, "onItemSelected: selected: " + adapterView.getItemAtPosition(i)); mBinding.getIMainActivity().setQuantity(Integer.parseInt((String)adapterView.getItemAtPosition(i))); getDialog().dismiss(); } }; public View.OnClickListener mCloseDialogListener = new View.OnClickListener() { @Override public void onClick(View view) { getDialog().dismiss(); } }; }
[ "kor216465@gmail.com" ]
kor216465@gmail.com
ce24401e05deb19ca58ef38e31227ff332ef3883
d59ca78a9dd28ac6593b950e6cd7edbce193ed69
/app/src/main/java/com/barcode/show/TestAdapter.java
977dcf8414eb29d64521c232f778ef9fbc8c62ff
[]
no_license
Liuruiwen/BarCode
e46b12ff6606aa0af7c8500ea1140e619c0bb92a
897a04b48c6fe46e2df7f4d0eb073cd72b6b8b9f
refs/heads/master
2020-07-17T05:12:11.125127
2019-09-28T10:09:37
2019-09-28T10:09:37
205,953,069
0
0
null
null
null
null
UTF-8
Java
false
false
1,907
java
package com.barcode.show; import android.text.SpannableString; import android.text.Spanned; import android.text.style.RelativeSizeSpan; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.load.resource.bitmap.CenterCrop; import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; /** * Created by Amuse * Date:2019/9/28. * Desc: */ public class TestAdapter extends BaseQuickAdapter<String,BaseViewHolder>{ public TestAdapter() { super(R.layout.item_test); } @Override protected void convert(BaseViewHolder helper, String item) { // helper.setText(R.id.tv_price,String.format("¥%1$s",changMoneySize("2666.00"))); helper.setText(R.id.tv_price,changMoneySize(String.format("¥%1.2f",26666.0))); RequestOptions roundOptions = new RequestOptions() .transform(new RoundedCorners(60)); roundOptions.transform(new CenterCrop(), new RoundedCorners(60));//处理CenterCrop的情况 Glide.with(mContext) .load("https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=4121549286,1002358299&fm=26&gp=0.jpg") .apply(roundOptions) .into((ImageView) helper.getView(R.id.iv_goods)); } /** * 改变小数点大小 * @param value * @return */ public SpannableString changMoneySize(String value) { SpannableString spannableString = new SpannableString(value); if (value.contains(".")) { spannableString.setSpan(new RelativeSizeSpan(0.6f), value.indexOf("."), value.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return spannableString; } }
[ "1054750389@qq.com" ]
1054750389@qq.com
010015ccb99676911e8f7b402eaa274eb7c27cc1
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_704461ae86d18374514b8f24cbe8b9e147271369/ExpressionTransformer/7_704461ae86d18374514b8f24cbe8b9e147271369_ExpressionTransformer_t.java
4e7fbc70b9fcf0bce473e5d89ef22b7eaa4d6109
[]
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
39,519
java
package com.redhat.ceylon.compiler.codegen; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; import com.redhat.ceylon.compiler.typechecker.model.Declaration; import com.redhat.ceylon.compiler.typechecker.model.Functional; import com.redhat.ceylon.compiler.typechecker.model.Getter; import com.redhat.ceylon.compiler.typechecker.model.Method; import com.redhat.ceylon.compiler.typechecker.model.Parameter; import com.redhat.ceylon.compiler.typechecker.model.ParameterList; import com.redhat.ceylon.compiler.typechecker.model.ProducedType; import com.redhat.ceylon.compiler.typechecker.model.TypedDeclaration; import com.redhat.ceylon.compiler.typechecker.model.Value; import com.redhat.ceylon.compiler.typechecker.tree.Node; import com.redhat.ceylon.compiler.typechecker.tree.Tree; import com.redhat.ceylon.compiler.typechecker.tree.Tree.StringLiteral; import com.redhat.ceylon.compiler.typechecker.tree.Tree.AndOp; import com.redhat.ceylon.compiler.typechecker.tree.Tree.AssignOp; import com.redhat.ceylon.compiler.typechecker.tree.Tree.BaseMemberOrTypeExpression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.BaseTypeExpression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.BinaryOperatorExpression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.Expression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.InvocationExpression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.NamedArgument; import com.redhat.ceylon.compiler.typechecker.tree.Tree.OrOp; import com.redhat.ceylon.compiler.typechecker.tree.Tree.Outer; import com.redhat.ceylon.compiler.typechecker.tree.Tree.PositionalArgument; import com.redhat.ceylon.compiler.typechecker.tree.Tree.PositionalArgumentList; import com.redhat.ceylon.compiler.typechecker.tree.Tree.Primary; import com.redhat.ceylon.compiler.typechecker.tree.Tree.QualifiedMemberOrTypeExpression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.QualifiedTypeExpression; import com.redhat.ceylon.compiler.typechecker.tree.Tree.SequenceEnumeration; import com.redhat.ceylon.compiler.typechecker.tree.Tree.Super; import com.redhat.ceylon.compiler.typechecker.tree.Tree.Term; import com.redhat.ceylon.compiler.typechecker.tree.Tree.This; import com.redhat.ceylon.compiler.util.Util; import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.code.TypeTags; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.JCBinary; import com.sun.tools.javac.tree.JCTree.JCClassDecl; import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.tree.JCTree.JCLiteral; import com.sun.tools.javac.tree.JCTree.JCMethodInvocation; import com.sun.tools.javac.tree.JCTree.JCNewClass; import com.sun.tools.javac.tree.JCTree.JCStatement; import com.sun.tools.javac.tree.JCTree.JCTypeParameter; import com.sun.tools.javac.tree.JCTree.JCUnary; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; /** * This transformer deals with expressions only */ public class ExpressionTransformer extends AbstractTransformer { public static ExpressionTransformer getInstance(Context context) { ExpressionTransformer trans = context.get(ExpressionTransformer.class); if (trans == null) { trans = new ExpressionTransformer(context); context.put(ExpressionTransformer.class, trans); } return trans; } private ExpressionTransformer(Context context) { super(context); } JCExpression transformExpression(final Tree.Term expr) { CeylonVisitor v = new CeylonVisitor(gen()); if (expr instanceof Tree.Expression) { // Cope with things like ((expr)) Tree.Expression expr2 = (Tree.Expression)expr; while(((Tree.Expression)expr2).getTerm() instanceof Tree.Expression) { expr2 = (Tree.Expression)expr2.getTerm(); } expr2.visitChildren(v); } else { expr.visit(v); } return v.getSingleResult(); } JCExpression transformExpression(final Tree.Term expr, ProducedType targetType) { JCExpression result = transformExpression(expr); ProducedType exprType = determineExpressionType(expr); result = boxUnboxIfNecessary(result, exprType, targetType); return result; } public JCExpression transformStringExpression(Tree.StringTemplate expr) { at(expr); JCExpression builder; builder = make().NewClass(null, null, makeIdent("java.lang.StringBuilder"), List.<JCExpression>nil(), null); java.util.List<StringLiteral> literals = expr.getStringLiterals(); java.util.List<Expression> expressions = expr.getExpressions(); for (int ii = 0; ii < literals.size(); ii += 1) { StringLiteral literal = literals.get(ii); if (!"\"\"".equals(literal.getText())) {// ignore empty string literals at(literal); builder = make().Apply(null, makeSelect(builder, "append"), List.<JCExpression>of(transform(literal))); } if (ii == expressions.size()) { // The loop condition includes the last literal, so break out // after that because we've already exhausted all the expressions break; } Expression expression = expressions.get(ii); at(expression); if (isCeylonBasicType(expression.getTypeModel())) {// TODO: Test should be erases to String, long, int, boolean, char, byte, float, double // If erases to a Java primitive just call append, don't box it just to call format. builder = make().Apply(null, makeSelect(builder, "append"), List.<JCExpression>of(transformExpression(expression))); } else { JCMethodInvocation formatted = make().Apply(null, makeSelect(transformExpression(expression), "getFormatted"), List.<JCExpression>nil()); builder = make().Apply(null, makeSelect(builder, "append"), List.<JCExpression>of(formatted)); } } return make().Apply(null, makeSelect(builder, "toString"), List.<JCExpression>nil()); } private static Map<Class<? extends Tree.UnaryOperatorExpression>, String> unaryOperators; private static Map<Class<? extends Tree.BinaryOperatorExpression>, String> binaryOperators; static { unaryOperators = new HashMap<Class<? extends Tree.UnaryOperatorExpression>, String>(); binaryOperators = new HashMap<Class<? extends Tree.BinaryOperatorExpression>, String>(); // Unary operators unaryOperators.put(Tree.NegativeOp.class, "inverse"); unaryOperators.put(Tree.NotOp.class, "complement"); unaryOperators.put(Tree.FormatOp.class, "string"); // Binary operators that act on types binaryOperators.put(Tree.SumOp.class, "plus"); binaryOperators.put(Tree.DifferenceOp.class, "minus"); binaryOperators.put(Tree.ProductOp.class, "times"); binaryOperators.put(Tree.QuotientOp.class, "divided"); binaryOperators.put(Tree.PowerOp.class, "power"); binaryOperators.put(Tree.RemainderOp.class, "remainder"); binaryOperators.put(Tree.IntersectionOp.class, "and"); binaryOperators.put(Tree.UnionOp.class, "or"); binaryOperators.put(Tree.XorOp.class, "xor"); binaryOperators.put(Tree.EqualOp.class, "equalsXXX"); binaryOperators.put(Tree.IdenticalOp.class, "identical"); binaryOperators.put(Tree.CompareOp.class, "compare"); // Binary operators that act on intermediary Comparison objects binaryOperators.put(Tree.LargerOp.class, "larger"); binaryOperators.put(Tree.SmallerOp.class, "smaller"); binaryOperators.put(Tree.LargeAsOp.class, "largeAs"); binaryOperators.put(Tree.SmallAsOp.class, "smallAs"); } // FIXME: I'm pretty sure sugar is not supposed to be in there public JCExpression transform(Tree.NotEqualOp op) { Tree.EqualOp newOp = new Tree.EqualOp(op.getAntlrTreeNode()); newOp.setLeftTerm(op.getLeftTerm()); newOp.setRightTerm(op.getRightTerm()); Tree.NotOp newNotOp = new Tree.NotOp(op.getAntlrTreeNode()); newNotOp.setTerm(newOp); return transform(newNotOp); } public JCExpression transform(Tree.NotOp op) { JCExpression term = transformExpression(op.getTerm()); JCUnary jcu = at(op).Unary(JCTree.NOT, term); return jcu; } public JCExpression transform(Tree.AssignOp op) { return transformAssignment(op, op.getLeftTerm(), op.getRightTerm()); } JCExpression transformAssignment(Node op, Term leftTerm, Term rightTerm) { JCExpression result = null; // right side is easy JCExpression rhs = transformExpression(rightTerm, determineExpressionType(leftTerm)); // left side depends JCExpression expr = null; CeylonVisitor v = new CeylonVisitor(gen()); leftTerm.visitChildren(v); if (v.hasResult()) { expr = v.getSingleResult(); } // FIXME: can this be anything else than a Primary? Declaration decl = ((Tree.Primary)leftTerm).getDeclaration(); // FIXME: can this be anything else than a Value or a TypedDeclaration? boolean variable = false; if (decl instanceof Value) { variable = ((Value)decl).isVariable(); } else if (decl instanceof TypedDeclaration) { variable = ((TypedDeclaration)decl).isVariable(); } if(decl.isToplevel()){ // must use top level setter result = globalGen().setGlobalValue( makeIdentOrSelect(expr, decl.getContainer().getQualifiedNameString()), decl.getName(), rhs); } else if ((decl instanceof Getter)) { // must use the setter if (decl.getContainer() instanceof Method){ result = at(op).Apply(List.<JCTree.JCExpression>nil(), makeIdentOrSelect(expr, decl.getName() + "$setter", Util.getSetterName(decl.getName())), List.<JCTree.JCExpression>of(rhs)); } else { result = at(op).Apply(List.<JCTree.JCExpression>nil(), makeIdentOrSelect(expr, Util.getSetterName(decl.getName())), List.<JCTree.JCExpression>of(rhs)); } } else if(variable && (Util.isClassAttribute(decl))){ // must use the setter result = at(op).Apply(List.<JCTree.JCExpression>nil(), makeIdentOrSelect(expr, Util.getSetterName(decl.getName())), List.<JCTree.JCExpression>of(rhs)); } else if(variable && decl.isCaptured()){ // must use the qualified setter result = at(op).Apply(List.<JCTree.JCExpression>nil(), makeIdentOrSelect(expr, decl.getName(), Util.getSetterName(decl.getName())), List.<JCTree.JCExpression>of(rhs)); } else { result = at(op).Assign(makeIdentOrSelect(expr, decl.getName()), rhs); } return result; } public JCExpression transform(Tree.IsOp op) { JCExpression type = makeJavaType(op.getType().getTypeModel()); return at(op).TypeTest(transformExpression(op.getTerm()), type); } public JCExpression transform(Tree.RangeOp op) { JCExpression lower = boxType(transformExpression(op.getLeftTerm()), determineExpressionType(op.getLeftTerm())); JCExpression upper = boxType(transformExpression(op.getRightTerm()), determineExpressionType(op.getRightTerm())); ProducedType rangeType = typeFact().makeRangeType(op.getLeftTerm().getTypeModel()); JCExpression typeExpr = makeJavaType(rangeType, CeylonTransformer.CLASS_NEW); return at(op).NewClass(null, null, typeExpr, List.<JCExpression> of(lower, upper), null); } public JCExpression transform(Tree.EntryOp op) { JCExpression key = boxType(transformExpression(op.getLeftTerm()), determineExpressionType(op.getLeftTerm())); JCExpression elem = boxType(transformExpression(op.getRightTerm()), determineExpressionType(op.getRightTerm())); ProducedType entryType = typeFact().makeEntryType(op.getLeftTerm().getTypeModel(), op.getRightTerm().getTypeModel()); JCExpression typeExpr = makeJavaType(entryType, CeylonTransformer.CLASS_NEW); return at(op).NewClass(null, null, typeExpr , List.<JCExpression> of(key, elem), null); } public JCExpression transform(Tree.UnaryOperatorExpression op) { at(op); Tree.Term term = op.getTerm(); if (term instanceof Tree.NaturalLiteral && op instanceof Tree.NegativeOp) { Tree.NaturalLiteral lit = (Tree.NaturalLiteral) term; return makeInteger(-Long.parseLong(lit.getText())); } else if (term instanceof Tree.NaturalLiteral && op instanceof Tree.PositiveOp) { Tree.NaturalLiteral lit = (Tree.NaturalLiteral) term; return makeInteger(Long.parseLong(lit.getText())); } return make().Apply(null, makeSelect(transformExpression(term), unaryOperators.get(op.getClass())), List.<JCExpression> nil()); } public JCExpression transform(Tree.ArithmeticAssignmentOp op){ // desugar it Tree.BinaryOperatorExpression newOp; if(op instanceof Tree.AddAssignOp) newOp = new Tree.SumOp(op.getAntlrTreeNode()); else if(op instanceof Tree.SubtractAssignOp) newOp = new Tree.DifferenceOp(op.getAntlrTreeNode()); else if(op instanceof Tree.MultiplyAssignOp) newOp = new Tree.ProductOp(op.getAntlrTreeNode()); else if(op instanceof Tree.DivideAssignOp) newOp = new Tree.QuotientOp(op.getAntlrTreeNode()); else if(op instanceof Tree.RemainderAssignOp) newOp = new Tree.RemainderOp(op.getAntlrTreeNode()); else throw new RuntimeException("Unsupported operator: "+op); return desugarAssignmentOp(op, newOp); } public JCExpression transform(Tree.BitwiseAssignmentOp op){ // desugar it Tree.BinaryOperatorExpression newOp; if(op instanceof Tree.ComplementAssignOp) newOp = new Tree.ComplementOp(op.getAntlrTreeNode()); else if(op instanceof Tree.UnionAssignOp) newOp = new Tree.UnionOp(op.getAntlrTreeNode()); else if(op instanceof Tree.XorAssignOp) newOp = new Tree.XorOp(op.getAntlrTreeNode()); else if(op instanceof Tree.IntersectAssignOp) newOp = new Tree.IntersectionOp(op.getAntlrTreeNode()); else throw new RuntimeException("Unsupported operator: "+op); return desugarAssignmentOp(op, newOp); } public JCExpression transform(Tree.LogicalAssignmentOp op){ // desugar it Tree.BinaryOperatorExpression newOp; if(op instanceof Tree.AndAssignOp) newOp = new Tree.AndOp(op.getAntlrTreeNode()); else if(op instanceof Tree.OrAssignOp) newOp = new Tree.OrOp(op.getAntlrTreeNode()); else throw new RuntimeException("Unsupported operator: "+op); return desugarAssignmentOp(op, newOp); } // FIXME GET RID OF THIS, IT'S WRONG!! private JCExpression desugarAssignmentOp(Tree.AssignmentOp op, BinaryOperatorExpression newOp) { newOp.setLeftTerm(op.getLeftTerm()); newOp.setRightTerm(op.getRightTerm()); AssignOp assignOp = new Tree.AssignOp(op.getAntlrTreeNode()); assignOp.setLeftTerm(op.getLeftTerm()); assignOp.setRightTerm(newOp); assignOp.setTypeModel(op.getTypeModel()); newOp.setTypeModel(op.getTypeModel()); return transform(assignOp); } public JCExpression transform(Tree.BinaryOperatorExpression op) { JCExpression result = null; Class<? extends Tree.OperatorExpression> operatorClass = op.getClass(); boolean loseComparison = op instanceof Tree.SmallAsOp || op instanceof Tree.SmallerOp || op instanceof Tree.LargerOp || op instanceof Tree.LargeAsOp; if (loseComparison) operatorClass = Tree.CompareOp.class; JCExpression left = transformExpression(op.getLeftTerm()); JCExpression right = transformExpression(op.getRightTerm()); result = at(op).Apply(null, makeSelect(left, binaryOperators.get(operatorClass)), List.of(right)); if (loseComparison) { result = at(op).Apply(null, makeSelect(result, binaryOperators.get(op.getClass())), List.<JCExpression> nil()); } return result; } public JCExpression transform(Tree.LogicalOp op) { JCExpression left = transformExpression(op.getLeftTerm()); JCExpression right = transformExpression(op.getRightTerm()); JCBinary jcb = null; if (op instanceof AndOp) { jcb = at(op).Binary(JCTree.AND, left, right); } if (op instanceof OrOp) { jcb = at(op).Binary(JCTree.OR, left, right); } return jcb; } JCExpression transform(Tree.PostfixOperatorExpression expr) { String methodName; boolean successor; if (expr instanceof Tree.PostfixIncrementOp){ successor = true; methodName = "getPredecessor"; }else if (expr instanceof Tree.PostfixDecrementOp){ successor = false; methodName = "getSuccessor"; }else throw new RuntimeException("Not implemented: " + expr.getNodeType()); JCExpression op = makePrefixOp(expr, expr.getTerm(), successor); return at(expr).Apply(null, makeSelect(op, methodName), List.<JCExpression>nil()); } public JCExpression transform(Tree.PrefixOperatorExpression expr) { boolean successor; if (expr instanceof Tree.IncrementOp) successor = true; else if (expr instanceof Tree.DecrementOp) successor = false; else throw new RuntimeException("Not implemented: " + expr.getNodeType()); return makePrefixOp(expr, expr.getTerm(), successor); } private JCExpression makePrefixOp(Node expr, Term term, boolean successor) { String methodName; if (successor) methodName = "getSuccessor"; else methodName = "getPredecessor"; JCExpression operand = transformExpression(term); return at(expr).Assign(operand, at(expr).Apply(null, makeSelect(operand, methodName), List.<JCExpression>nil())); } JCExpression transform(Tree.InvocationExpression ce) { if (ce.getPositionalArgumentList() != null) { return transformPositionalInvocation(ce); } else if (ce.getNamedArgumentList() != null) { return transformNamedInvocation(ce); } else { throw new RuntimeException("Illegal State"); } } private JCExpression transformNamedInvocation(InvocationExpression ce) { final ListBuffer<JCExpression> callArgs = new ListBuffer<JCExpression>(); final ListBuffer<JCExpression> passArgs = new ListBuffer<JCExpression>(); final String methodName; final java.util.List<ParameterList> parameterLists; final Primary primary = ce.getPrimary(); final Declaration primaryDecl = primary.getDeclaration(); if (primaryDecl instanceof Method) { Method methodDecl = (Method)primaryDecl; methodName = methodDecl.getName(); parameterLists = methodDecl.getParameterLists(); } else if (primaryDecl instanceof com.redhat.ceylon.compiler.typechecker.model.Class) { com.redhat.ceylon.compiler.typechecker.model.Class methodDecl = (com.redhat.ceylon.compiler.typechecker.model.Class)primaryDecl; methodName = methodDecl.getName(); parameterLists = methodDecl.getParameterLists(); } else { throw new RuntimeException("Illegal State: " + (primaryDecl != null ? primaryDecl.getClass() : "null")); } java.util.List<NamedArgument> namedArguments = ce.getNamedArgumentList().getNamedArguments(); java.util.List<Parameter> declaredParams = parameterLists.get(0).getParameters(); for (Parameter declaredParam : declaredParams) { boolean found = false; int index = 0; for (NamedArgument namedArg : namedArguments) { at(namedArg); if (declaredParam.getName().equals(namedArg.getIdentifier().getText())) { JCExpression argExpr = make().Indexed(makeSelect("this", "args"), makeInteger(index)); argExpr = make().TypeCast(makeJavaType(namedArgType(namedArg), this.TYPE_PARAM), argExpr); callArgs.append(unboxType(argExpr, declaredParam.getType())); found = true; break; } index += 1; } if (!found) { throw new RuntimeException("No value specified for argument '" + declaredParam.getName()+ "' and default values not implemented yet"); } } for (NamedArgument namedArg : namedArguments) { at(namedArg); passArgs.append(transformArg(namedArg)); } at(ce); List<JCExpression> typeArgs = transformTypeArguments(ce); JCExpression receiverType; final JCExpression receiver; final boolean generateNew; if (primary instanceof BaseMemberOrTypeExpression) { BaseMemberOrTypeExpression memberExpr = (BaseMemberOrTypeExpression)primary; generateNew = primary instanceof BaseTypeExpression; if (memberExpr.getDeclaration().isToplevel()) { passArgs.prepend(make().Literal(TypeTags.BOT, null)); receiverType = makeIdent("java.lang.Void"); receiver = makeSelect(memberExpr.getDeclaration().getName(), methodName);// TODO encapsulate this } else if (!memberExpr.getDeclaration().isClassMember()) {// local passArgs.prepend(makeIdent(memberExpr.getDeclaration().getName())); // TODO Check it's as simple as this, and encapsulat receiverType = makeIdent(memberExpr.getDeclaration().getName());// TODO: get the generated name somehow receiver = makeSelect("this", "instance", methodName); } else { passArgs.prepend(make().Literal(TypeTags.BOT, null)); receiverType = makeIdent("java.lang.Void"); receiver = makeIdent(methodName); } } else if (primary instanceof QualifiedMemberOrTypeExpression) { QualifiedMemberOrTypeExpression memberExpr = (QualifiedMemberOrTypeExpression)primary; CeylonVisitor visitor = new CeylonVisitor(gen(), typeArgs, callArgs); memberExpr.getPrimary().visit(visitor); passArgs.prepend((JCExpression)visitor.getSingleResult()); receiverType = makeJavaType(memberExpr.getPrimary().getTypeModel(), this.TYPE_PARAM); receiver = makeSelect("this", "instance", methodName); generateNew = primary instanceof QualifiedTypeExpression; } else { throw new RuntimeException("Not Implemented: Named argument calls only implemented on member and type expressions"); } // Construct the call$() method boolean isVoid = ce.getTypeModel().isExactly(typeFact().getVoidDeclaration().getType()); JCExpression resultType = makeJavaType(ce.getTypeModel(), (isTypeParameter(determineExpressionType(ce))) ? this.TYPE_PARAM: 0); final String callMethodName = "call$"; MethodDefinitionBuilder callMethod = MethodDefinitionBuilder.method(gen(), callMethodName); callMethod.modifiers(Flags.PUBLIC); callMethod.resultType(resultType); if (generateNew) { callMethod.body(make().Return(make().NewClass(null, null, resultType, callArgs.toList(), null))); } else { JCExpression expr = make().Apply(null, receiver, callArgs.toList());; if (isVoid) { callMethod.body(List.<JCStatement>of( make().Exec(expr), make().Return(make().Literal(TypeTags.BOT, null)))); } else { callMethod.body(make().Return(expr)); } } // Construct the class JCExpression namedArgsClass = make().TypeApply(makeIdent(syms().ceylonNamedArgumentCall), List.<JCExpression>of(receiverType)); JCClassDecl classDecl = make().ClassDef(make().Modifiers(0), names().empty, List.<JCTypeParameter>nil(), namedArgsClass, List.<JCExpression>nil(), List.<JCTree>of(callMethod.build())); // Create an instance of the class JCNewClass newClass = make().NewClass(null, null, namedArgsClass, passArgs.toList(), classDecl); // Call the call$() method return make().Apply(null, makeSelect(newClass, callMethodName), List.<JCExpression>nil()); } private JCExpression transformPositionalInvocation(InvocationExpression ce) { final ListBuffer<JCExpression> args = new ListBuffer<JCExpression>(); boolean isVarargs = false; Declaration primaryDecl = ce.getPrimary().getDeclaration(); PositionalArgumentList positional = ce.getPositionalArgumentList(); if (primaryDecl instanceof Method) { Method methodDecl = (Method)primaryDecl; java.util.List<Parameter> declaredParams = methodDecl.getParameterLists().get(0).getParameters(); int numDeclared = declaredParams.size(); java.util.List<PositionalArgument> passedArguments = positional.getPositionalArguments(); int numPassed = passedArguments.size(); Parameter lastDeclaredParam = declaredParams.isEmpty() ? null : declaredParams.get(declaredParams.size() - 1); if (lastDeclaredParam != null && lastDeclaredParam.isSequenced() && positional.getEllipsis() == null) {// foo(sequence...) syntax => no need to box // => call to a varargs method isVarargs = true; // first, append the normal args for (int ii = 0; ii < numDeclared - 1; ii++) { Tree.PositionalArgument arg = positional.getPositionalArguments().get(ii); args.append(transformArg(arg)); } JCExpression boxed; // then, box the remaining passed arguments if (numDeclared -1 == numPassed) { // box as Empty boxed = makeEmpty(); } else { // box with an ArraySequence<T> List<Expression> x = List.<Expression>nil(); for (int ii = numDeclared - 1; ii < numPassed; ii++) { Tree.PositionalArgument arg = positional.getPositionalArguments().get(ii); x = x.append(arg.getExpression()); } ProducedType seqElemType = typeFact().getIteratedType(lastDeclaredParam.getType()); boxed = makeSequence(x, seqElemType); } args.append(boxed); } } if (!isVarargs) { for (Tree.PositionalArgument arg : positional.getPositionalArguments()) args.append(transformArg(arg)); } List<JCExpression> typeArgs = transformTypeArguments(ce); CeylonVisitor visitor = new CeylonVisitor(gen(), typeArgs, args); ce.getPrimary().visit(visitor); JCExpression expr = visitor.getSingleResult(); if (expr == null) { throw new RuntimeException(); } else if (expr instanceof JCTree.JCNewClass) { return expr; } else { return at(ce).Apply(typeArgs, expr, args.toList()); } } List<JCExpression> transformTypeArguments(Tree.InvocationExpression def) { List<JCExpression> result = List.<JCExpression> nil(); if (def.getPrimary() instanceof Tree.StaticMemberOrTypeExpression) { Tree.StaticMemberOrTypeExpression expr = (Tree.StaticMemberOrTypeExpression)def.getPrimary(); java.util.List<ProducedType> args = expr.getTypeArguments().getTypeModels(); for (ProducedType arg : args) { result = result.append(makeJavaType(arg, AbstractTransformer.TYPE_PARAM)); } } return result; } JCExpression transformArg(Tree.PositionalArgument arg) { return transformExpression(arg.getExpression(), refinedParameter(arg.getParameter()).getType()); } JCExpression transformArg(Tree.NamedArgument arg) { if (arg instanceof Tree.SpecifiedArgument) { Expression expr = ((Tree.SpecifiedArgument)arg).getSpecifierExpression().getExpression(); return boxType(transformExpression(expr), expr.getTypeModel()); } else if (arg instanceof Tree.TypedArgument) { throw new RuntimeException("Not yet implemented"); } else { throw new RuntimeException("Illegal State"); } } ProducedType namedArgType(Tree.NamedArgument arg) { if (arg instanceof Tree.SpecifiedArgument) { return ((Tree.SpecifiedArgument)arg).getSpecifierExpression().getExpression().getTypeModel(); } else if (arg instanceof Tree.TypedArgument) { throw new RuntimeException("Not yet implemented"); } else { throw new RuntimeException("Illegal State"); } } private Parameter refinedParameter(Parameter parameter) { java.util.List<Parameter> params = ((Functional)parameter.getDeclaration().getRefinedDeclaration()).getParameterLists().get(0).getParameters(); for (Parameter p : params) { if (p.getName().equals(parameter.getName())) { return p; } } throw new RuntimeException("Parameter not found in refined declaration!"); // Should never happen } JCExpression ceylonLiteral(String s) { JCLiteral lit = make().Literal(s); return lit; } public JCExpression transform(Tree.StringLiteral string) { String value = string .getText() .substring(1, string.getText().length() - 1) .replace("\r\n", "\n") .replace("\r", "\n"); at(string); return ceylonLiteral(value); } public JCExpression transform(Tree.CharLiteral lit) { JCExpression expr = make().Literal(TypeTags.CHAR, (int) lit.getText().charAt(1)); // XXX make().Literal(lit.value) doesn't work here... something // broken in javac? return expr; } public JCExpression transform(Tree.FloatLiteral lit) { JCExpression expr = make().Literal(Double.parseDouble(lit.getText())); return expr; } public JCExpression transform(Tree.NaturalLiteral lit) { JCExpression expr = make().Literal(Long.parseLong(lit.getText())); return expr; } public JCExpression transform(final Tree.QualifiedMemberExpression access) { return transformMemberExpression(access, access.getDeclaration()); } private JCExpression makeBox(com.sun.tools.javac.code.Type type, JCExpression expr) { JCExpression result = makeSelect(makeIdent(type), "instance"); result = make().Parens(make().Apply(null, result, List.of(expr))); return result; } public JCExpression transform(Tree.BaseMemberExpression member) { return transformMemberExpression(null, member.getDeclaration()); } private JCExpression transformMemberExpression(Tree.QualifiedMemberExpression expr, Declaration decl) { JCExpression result = null; JCExpression primaryExpr = null; if (expr != null) { Tree.Primary primary = expr.getPrimary(); CeylonVisitor v = new CeylonVisitor(gen()); primary.visit(v); primaryExpr = v.getSingleResult(); if (willEraseToObject(primary.getTypeModel())) { // Erased types need a type cast JCExpression targetType = makeJavaType(expr.getTarget().getQualifyingType()); primaryExpr = make().TypeCast(targetType, primaryExpr); } else if (sameType(syms().ceylonStringType, primary.getTypeModel())) { // Java Strings need to be boxed primaryExpr = makeBox(syms().ceylonStringType, primaryExpr); } else if (sameType(syms().ceylonBooleanType, primary.getTypeModel())) { // Java native types need to be boxed primaryExpr = makeBox(syms().ceylonBooleanType, primaryExpr); } else if (sameType(syms().ceylonIntegerType, primary.getTypeModel())) { // Java native types need to be boxed primaryExpr = makeBox(syms().ceylonIntegerType, primaryExpr); } } if (decl instanceof Getter) { // invoke the getter if (decl.isToplevel()) { result = globalGen().getGlobalValue( makeIdentOrSelect(primaryExpr, decl.getContainer().getQualifiedNameString()), decl.getName(), decl.getName()); } else if (decl.isClassMember()) { result = make().Apply(List.<JCExpression>nil(), makeIdentOrSelect(primaryExpr, Util.getGetterName(decl.getName())), List.<JCExpression>nil()); } else {// method local attr result = make().Apply(List.<JCExpression>nil(), makeIdentOrSelect(primaryExpr, decl.getName() + "$getter", Util.getGetterName(decl.getName())), List.<JCExpression>nil()); } } else if (decl instanceof Value) { if (decl.isToplevel()) { // ERASURE if ("null".equals(decl.getName())) { // FIXME this is a pretty brain-dead way to go about erase I think result = make().Literal(TypeTags.BOT, null); } else if (isBooleanTrue(decl)) { result = makeBoolean(true); } else if (isBooleanFalse(decl)) { result = makeBoolean(false); } else { // it's a toplevel attribute result = globalGen().getGlobalValue( makeIdentOrSelect(primaryExpr, decl.getContainer().getQualifiedNameString()), decl.getName()); } } else if(Util.isClassAttribute(decl)) { // invoke the getter result = make().Apply(List.<JCExpression>nil(), makeIdentOrSelect(primaryExpr, Util.getGetterName(decl.getName())), List.<JCExpression>nil()); } else if(decl.isCaptured()) { // invoke the qualified getter result = make().Apply(List.<JCExpression>nil(), makeIdentOrSelect(primaryExpr, decl.getName(), Util.getGetterName(decl.getName())), List.<JCExpression>nil()); } } else if (decl instanceof Method) { if (Util.isInnerMethod(decl) || decl.isToplevel()) { java.util.List<String> path = new LinkedList<String>(); path.add(decl.getName()); path.add(decl.getName()); result = makeIdent(path); } else { result = makeIdentOrSelect(primaryExpr, Util.quoteMethodName(decl.getName())); } } if (result == null) { if (Util.isErasedAttribute(decl.getName())) { result = make().Apply(null, makeIdentOrSelect(primaryExpr, Util.quoteMethodName(decl.getName())), List.<JCExpression>nil()); } else { result = makeIdentOrSelect(primaryExpr, substitute(decl.getName())); } } return result; } private JCExpression makeIdentOrSelect(JCExpression expr, String... names) { if (expr != null) { return makeSelect(expr, names); } else { return makeIdent(names); } } public JCExpression transform(Tree.Type type, List<JCExpression> typeArgs, List<JCExpression> args) { // A constructor return at(type).NewClass(null, typeArgs, makeJavaType(type.getTypeModel()), args, null); } public JCExpression transform(Tree.BaseTypeExpression typeExp, List<JCExpression> typeArgs, List<JCExpression> args) { // A constructor return at(typeExp).NewClass(null, typeArgs, makeIdent(typeExp.getIdentifier().getText()), args, null); } public JCExpression transform(SequenceEnumeration value) { at(value); if (value.getExpressionList() == null) { return makeEmpty(); } else { java.util.List<Expression> list = value.getExpressionList().getExpressions(); ProducedType seqElemType = value.getTypeModel().getTypeArgumentList().get(0); return makeSequence(list, seqElemType); } } public JCTree transform(This expr) { at(expr); return makeIdent("this"); } public JCTree transform(Super expr) { at(expr); return makeIdent("super"); } public JCTree transform(Outer expr) { at(expr); ProducedType outerClass = com.redhat.ceylon.compiler.typechecker.model.Util.getOuterClassOrInterface(expr.getScope()); return makeIdent(outerClass.getDeclaration().getName(), "this"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
271c04c385de90b65507583d837637bcd4bd2a9b
052f63f5581c2f4638153794349a35bc797af7d5
/app/src/main/java/ye/chilyn/youaccount/base/common/BaseWeakReference.java
a68341a2a880f7ac0153601186c5b67a1380cb79
[ "MIT" ]
permissive
Chilyn/YouAccount
183342190c21067fb7f81073951d0d420b94615f
7f3ed2ee0e5979910b3ae488552d51e7cba7d34c
refs/heads/master
2022-06-29T05:32:39.811456
2022-06-13T02:48:05
2022-06-13T02:48:05
141,388,412
2
0
null
null
null
null
UTF-8
Java
false
false
639
java
package ye.chilyn.youaccount.base.common; import java.lang.ref.Reference; import java.lang.ref.WeakReference; /** * 持有弱引用的基类,防止内存泄漏 * @param <T> 弱引用的泛型 */ public abstract class BaseWeakReference<T> { private Reference<T> mReference; public BaseWeakReference(T t) { mReference = new WeakReference<T>(t); } public boolean isReferenceRecycled() { return (mReference == null) || (mReference.get() == null); } public T getReference() { return mReference.get(); } public void clearReference() { if (mReference != null) { mReference.clear(); mReference = null; } } }
[ "huaxin.ye@shangtv.cn" ]
huaxin.ye@shangtv.cn
b25862d444cb43b457ff401c33401c843b69a9e6
993cae9edae998529d4ef06fc67e319d34ee83ef
/src/cn/edu/sau/javashop/core/model/DeliveryItem.java
05b84c77d6a4944eef277d8705a932bf2a7e21f7
[]
no_license
zhangyuanqiao93/MySAUShop
77dfe4d46d8ac2a9de675a9df9ae29ca3cae1ef7
cc72727b2bc1148939666b0f1830ba522042b779
refs/heads/master
2021-01-25T05:02:20.602636
2017-08-03T01:06:43
2017-08-03T01:06:43
93,504,556
0
0
null
null
null
null
UTF-8
Java
false
false
1,336
java
package cn.edu.sau.javashop.core.model; /** * 货运明细 */ public class DeliveryItem { private Integer item_id; private Integer delivery_id; private Integer goods_id; private Integer product_id; private String sn; private String name; private Integer num; private Integer itemtype; //货物类型 public Integer getItem_id() { return item_id; } public void setItem_id(Integer itemId) { item_id = itemId; } public Integer getDelivery_id() { return delivery_id; } public void setDelivery_id(Integer deliveryId) { delivery_id = deliveryId; } public Integer getProduct_id() { return product_id; } public void setProduct_id(Integer productId) { product_id = productId; } public String getSn() { return sn; } public void setSn(String sn) { this.sn = sn; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getGoods_id() { return goods_id; } public void setGoods_id(Integer goodsId) { goods_id = goodsId; } public Integer getNum() { return num; } public void setNum(Integer num) { this.num = num; } public Integer getItemtype() { return itemtype; } public void setItemtype(Integer itemtype) { this.itemtype = itemtype; } }
[ "zhangyuanqiao0912@163.com" ]
zhangyuanqiao0912@163.com
39c86ba51d1c2470430458a5522caa4109c66c49
077f075f1e4c5e28f263616f6ae593da686a5c83
/src/main/java/de/jcm/discord/chocobot/api/guild/LanguageOverridesEndpoint.java
68e508603f6bf6fe0d0f96e4688c2014bddb94c3
[ "MIT" ]
permissive
JnCrMx/ChocoBot
08a14762b25d42b65d216179adff4b7c33476213
2124257026494a3c0f22e187502fc932bba9865b
refs/heads/master
2022-07-30T11:03:38.640157
2022-06-06T18:35:58
2022-06-06T18:35:58
237,515,710
1
1
MIT
2022-07-04T19:34:07
2020-01-31T21:03:24
Java
UTF-8
Java
false
false
6,876
java
package de.jcm.discord.chocobot.api.guild; import de.jcm.discord.chocobot.ChocoBot; import de.jcm.discord.chocobot.DatabaseUtils; import de.jcm.discord.chocobot.GuildSettings; import de.jcm.discord.chocobot.api.ApiUser; import de.jcm.discord.chocobot.api.GuildParam; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Member; import javax.ws.rs.*; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; @Path("/{guild}/guild/settings/language_overrides") public class LanguageOverridesEndpoint { @GET @Produces(MediaType.APPLICATION_JSON) public Map<String, String> getLanguageOverrides(@BeanParam GuildParam guildParam, @Context ContainerRequestContext request) { ApiUser user = (ApiUser) request.getProperty("user"); if(!guildParam.checkAccess(user)) throw new ForbiddenException(); Guild guild = guildParam.toGuild(); GuildSettings settings = DatabaseUtils.getSettings(guild); Member member = guild.retrieveMemberById(user.getUserId()).onErrorMap(t -> null).complete(); if(member == null || (settings == null && !member.isOwner()) || (settings != null && !settings.isOperator(member))) throw new ForbiddenException(); assert settings != null; return settings.getLanguageOverrides(); } @GET @Path("/all") @Produces(MediaType.APPLICATION_JSON) public Map<String, String> getAllTranslations(@BeanParam GuildParam guildParam, @Context ContainerRequestContext request) { ApiUser user = (ApiUser) request.getProperty("user"); if(!guildParam.checkAccess(user)) throw new ForbiddenException(); Guild guild = guildParam.toGuild(); GuildSettings settings = DatabaseUtils.getSettings(guild); Member member = guild.retrieveMemberById(user.getUserId()).onErrorMap(t -> null).complete(); if(member == null || (settings == null && !member.isOwner()) || (settings != null && !settings.isOperator(member))) throw new ForbiddenException(); assert settings != null; Map<String, String> map = new HashMap<>(ChocoBot.languages.get(settings.getLanguage())); map.putAll(settings.getLanguageOverrides()); return map; } @PUT @Path("/{key}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void addLanguageOverride(@BeanParam GuildParam guildParam, @PathParam("key") String key, @FormParam("value") String value, @Context ContainerRequestContext request) { ApiUser user = (ApiUser) request.getProperty("user"); if(!guildParam.checkAccess(user)) throw new ForbiddenException(); Guild guild = guildParam.toGuild(); GuildSettings settings = DatabaseUtils.getSettings(guild); Member member = guild.retrieveMemberById(user.getUserId()).onErrorMap(t->null).complete(); if(member == null || (settings == null && !member.isOwner()) || (settings != null && !settings.isOperator(member))) throw new ForbiddenException(); try(Connection connection = ChocoBot.getDatabase(); PreparedStatement statement = connection.prepareStatement("INSERT INTO guild_language_overrides (guild, `key`, value) VALUES (?, ?, ?)")) { statement.setLong(1, guild.getIdLong()); statement.setString(2, key); statement.setString(3, value); if(statement.executeUpdate() != 1) { throw new InternalServerErrorException("cannot add language override"); } DatabaseUtils.deleteCached(guild.getIdLong()); } catch(SQLException throwables) { throw new InternalServerErrorException("cannot add language override", throwables); } } @PATCH @Path("/{key}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void updateLanguageOverride(@BeanParam GuildParam guildParam, @PathParam("key") String oldKey, @FormParam("key") String key, @FormParam("value") String value, @Context ContainerRequestContext request) { ApiUser user = (ApiUser) request.getProperty("user"); if(!guildParam.checkAccess(user)) throw new ForbiddenException(); Guild guild = guildParam.toGuild(); GuildSettings settings = DatabaseUtils.getSettings(guild); Member member = guild.retrieveMemberById(user.getUserId()).onErrorMap(t->null).complete(); if(member == null || (settings == null && !member.isOwner()) || (settings != null && !settings.isOperator(member))) throw new ForbiddenException(); if(key == null || key.isBlank()) key = oldKey; try(Connection connection = ChocoBot.getDatabase(); PreparedStatement statement = connection.prepareStatement("UPDATE guild_language_overrides SET `key` = ?, value = ? WHERE guild = ? AND `key` = ?")) { statement.setString(1, key); statement.setString(2, value); statement.setLong(3, guild.getIdLong()); statement.setString(4, oldKey); if(statement.executeUpdate() != 1) { throw new InternalServerErrorException("cannot patch language override"); } DatabaseUtils.deleteCached(guild.getIdLong()); } catch(SQLException throwables) { throw new InternalServerErrorException("cannot update language override", throwables); } } @DELETE @Path("/{key}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void removeLanguageOverride(@BeanParam GuildParam guildParam, @PathParam("key") String key, @Context ContainerRequestContext request) { ApiUser user = (ApiUser) request.getProperty("user"); if(!guildParam.checkAccess(user)) throw new ForbiddenException(); Guild guild = guildParam.toGuild(); GuildSettings settings = DatabaseUtils.getSettings(guild); Member member = guild.retrieveMemberById(user.getUserId()).onErrorMap(t->null).complete(); if(member == null || (settings == null && !member.isOwner()) || (settings != null && !settings.isOperator(member))) throw new ForbiddenException(); try(Connection connection = ChocoBot.getDatabase(); PreparedStatement statement = connection.prepareStatement("DELETE FROM guild_language_overrides WHERE guild = ? AND `key` = ?")) { statement.setLong(1, guild.getIdLong()); statement.setString(2, key); if(statement.executeUpdate() != 1) { throw new InternalServerErrorException("cannot remove language override"); } DatabaseUtils.deleteCached(guild.getIdLong()); } catch(SQLException throwables) { throw new InternalServerErrorException("cannot remove language override", throwables); } } }
[ "jacama2009@gmail.com" ]
jacama2009@gmail.com
803ebde9d2b04b446994f0b549bcd0272f200d18
b9709bfb228920938c117f6f24c2d487de74b1a5
/BuranIntInterface/src/main/java/com/dcrux/buran/common/inRelations/where/InRelWhereClassId.java
976532804d9453f12121d9e2de8620e6d20872e2
[]
no_license
silvergate/Buran2
f86b51d45d83094cd8740dd59283d3d61cace008
d8cc9da5e5a0ff5edc70e9bf59f5548d6823bdf5
refs/heads/master
2020-04-02T01:06:28.653580
2013-08-05T00:48:28
2013-08-05T00:48:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,202
java
package com.dcrux.buran.common.inRelations.where; import com.dcrux.buran.common.classes.ClassId; import com.dcrux.buran.common.fields.FieldIndex; import com.google.common.base.Optional; /** * Buran. * * @author: ${USER} Date: 04.08.13 Time: 22:52 */ public class InRelWhereClassId implements IInRelationWhere { private ClassId sourceClassId; private Optional<FieldIndex> startIndex; private Optional<FieldIndex> endIndex; public InRelWhereClassId(ClassId sourceClassId, Optional<FieldIndex> startIndex, Optional<FieldIndex> endIndex) { this.sourceClassId = sourceClassId; this.startIndex = startIndex; this.endIndex = endIndex; } public static InRelWhereClassId withFieldIndex(ClassId sourceClassId, FieldIndex fieldIndex) { return new InRelWhereClassId(sourceClassId, Optional.of(fieldIndex), Optional.of(fieldIndex)); } private InRelWhereClassId() { } public ClassId getSourceClassId() { return sourceClassId; } public Optional<FieldIndex> getStartIndex() { return startIndex; } public Optional<FieldIndex> getEndIndex() { return endIndex; } }
[ "silvergate@gmail.com" ]
silvergate@gmail.com
76c74c5eba1754c7a0e5e1e07811831ea0100230
78001e4c67fc25acbbd0d088d9014da353c66272
/app/src/main/java/com/bravvura/gourmet/models/ProductCategory.java
07c43bd98a5fb32f45870ffa9887f746d72e72ec
[]
no_license
Chitrasen1984/androidApp
78d66957119670a55806dcc6d4ea8be1b3a054f6
9db4bbefc05ed51c158ffbbd48cd7593ece6c864
refs/heads/master
2021-01-20T02:01:27.822348
2017-05-01T13:11:00
2017-05-01T13:11:00
89,359,348
0
0
null
null
null
null
UTF-8
Java
false
false
4,484
java
package com.bravvura.gourmet.models; import android.content.Context; import android.support.v4.app.Fragment; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.bravvura.gourmet.R; import com.bravvura.gourmet.listeners.OnProductRefreshListener; import com.bravvura.gourmet.utils.ScreenUtils; import java.util.ArrayList; import java.util.List; import io.github.luizgrp.sectionedrecyclerviewadapter.StatelessSection; /** * Created by munchado on 26/4/17. */ public class ProductCategory extends StatelessSection { public String header; public List<ProductBean> productBean = new ArrayList<>(); public Context context; public Fragment fragment; public ProductCategory(String title, List<ProductBean> list, Context context, Fragment fragment) { super(R.layout.product_list_row, R.layout.product_view_row); this.context = context; this.header = title; this.productBean = list; this.fragment = fragment; } @Override public int getContentItemsTotal() { return productBean.size(); } @Override public RecyclerView.ViewHolder getItemViewHolder(View view) { return new ItemViewHolder(view); } @Override public void onBindItemViewHolder(RecyclerView.ViewHolder holder, int position) { final ItemViewHolder itemHolder = (ItemViewHolder) holder; itemHolder.cardView.setLayoutParams(new RecyclerView.LayoutParams(ScreenUtils.getScreenWidth(context) / 2, LinearLayout.LayoutParams.WRAP_CONTENT)); String name = productBean.get(position).productTitle; double price = productBean.get(position).productPrice; //String currency = productBean.get(position).currency; String quantity = productBean.get(position).quantity; itemHolder.tvItem.setText(name); itemHolder.tvPrice.setText(price + ""); itemHolder.tvQuantity.setText(quantity); itemHolder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (fragment instanceof OnProductRefreshListener) { ((OnProductRefreshListener) fragment).onClickProduct(); } /* Toast.makeText(getContext(), String.format("Clicked on position #%s of Section %s", sectionAdapter.getPositionInSection(itemHolder.getAdapterPosition()), title), Toast.LENGTH_SHORT).show();*/ } }); } @Override public RecyclerView.ViewHolder getHeaderViewHolder(View view) { return new HeaderViewHolder(view); } @Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder holder) { HeaderViewHolder headerHolder = (HeaderViewHolder) holder; headerHolder.tvTitle.setText(header); /* headerHolder.btnMore.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getContext(), String.format("Clicked on more button from the header of Section %s", title), Toast.LENGTH_SHORT).show(); } });*/ } class HeaderViewHolder extends RecyclerView.ViewHolder { private final TextView tvTitle; //private final Button btnMore; public HeaderViewHolder(View view) { super(view); tvTitle = (TextView) view.findViewById(R.id.product_list_row_tv_heading); //btnMore = (Button) view.findViewById(R.id.btnMore); } } class ItemViewHolder extends RecyclerView.ViewHolder { private CardView cardView; private final View rootView; private final TextView tvItem; private final TextView tvQuantity; private final TextView tvPrice; public ItemViewHolder(View view) { super(view); rootView = view; cardView = (CardView) view.findViewById(R.id.product_view_row_card_view); tvItem = (TextView) view.findViewById(R.id.product_view_row_tv_product_title); tvQuantity = (TextView) view.findViewById(R.id.product_view_row_tv_product_quantity); tvPrice = (TextView) view.findViewById(R.id.product_view_row_tv_product_price); } } }
[ "lkhatri@bravvura.in" ]
lkhatri@bravvura.in
d546ff021e9b0719b34870d183152034a2c7e324
a8b27ce45ec09dca3604a902ef90e8521b3dcfac
/src/main/java/com/yhshao/springboot/service/UserService.java
eb3e878f9a90b45f38652c294a29d77ef99afc9f
[]
no_license
shaozitx/springboot
47231add2b0316ca0ea93cba1a9f3139885385de
40f4a6c9fb1975e0ab14b4cfdfb07d58e13f56a0
refs/heads/master
2021-05-11T17:50:45.238980
2018-03-20T05:50:55
2018-03-20T05:50:55
117,806,413
0
0
null
null
null
null
UTF-8
Java
false
false
266
java
package com.yhshao.springboot.service; import com.yhshao.springboot.entity.User; import java.util.List; /** * Created by shaoqi on 18/1/20. */ public interface UserService { public User getUserById(Integer id); public List<User> select(String name);}
[ "1511989705@qq.com" ]
1511989705@qq.com
6d73ac7c0b425e0ae42a5156ff52ec3c663176e3
3d2f8fe9e8863c73ed32db069585513311e1bb97
/src/main/java/mx/com/dxesoft/dxesoft/web/filter/CsrfCookieGeneratorFilter.java
96a3825e22020b11a3b5232a089efbacc3769f64
[]
no_license
ernestomendez/dxesoft
53898b3a4d0c8feab413a24fbdc065ba66046e86
83802cf14ffe68e4ce6ab5a532ec618bc90c1211
refs/heads/master
2016-09-10T20:29:49.082539
2015-05-30T19:11:07
2015-05-30T19:11:07
34,143,496
0
0
null
null
null
null
UTF-8
Java
false
false
1,478
java
package mx.com.dxesoft.dxesoft.web.filter; import org.springframework.security.web.csrf.CsrfToken; import org.springframework.web.filter.OncePerRequestFilter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Filter used to put the CSRF token generated by Spring Security in a cookie for use by AngularJS. */ public class CsrfCookieGeneratorFilter extends OncePerRequestFilter { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { // Spring put the CSRF token in session attribute "_csrf" CsrfToken csrfToken = (CsrfToken) request.getAttribute("_csrf"); // Send the cookie only if the token has changed String actualToken = request.getHeader("X-CSRF-TOKEN"); if (actualToken == null || !actualToken.equals(csrfToken.getToken())) { // Session cookie that will be used by AngularJS String pCookieName = "CSRF-TOKEN"; Cookie cookie = new Cookie(pCookieName, csrfToken.getToken()); cookie.setMaxAge(-1); cookie.setHttpOnly(false); cookie.setPath("/"); response.addCookie(cookie); } filterChain.doFilter(request, response); } }
[ "nernesto@gmail.com" ]
nernesto@gmail.com
aefc958e6a013f366df15c606d945f8bba1dbfbc
75c4712ae3f946db0c9196ee8307748231487e4b
/src/main/java/com/alipay/api/response/AlipayEcoTextDetectResponse.java
49818d5df5ce66e121b89ce89e85b7c7479da85b
[ "Apache-2.0" ]
permissive
yuanbaoMarvin/alipay-sdk-java-all
70a72a969f464d79c79d09af8b6b01fa177ac1be
25f3003d820dbd0b73739d8e32a6093468d9ed92
refs/heads/master
2023-06-03T16:54:25.138471
2021-06-25T14:48:21
2021-06-25T14:48:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.domain.SpiDetectionDetail; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.eco.text.detect response. * * @author auto create * @since 1.0, 2019-09-06 17:57:54 */ public class AlipayEcoTextDetectResponse extends AlipayResponse { private static final long serialVersionUID = 5776477629445125155L; /** * 检测结果 */ @ApiListField("data") @ApiField("spi_detection_detail") private List<SpiDetectionDetail> data; public void setData(List<SpiDetectionDetail> data) { this.data = data; } public List<SpiDetectionDetail> getData( ) { return this.data; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
03499806fe81b968c66b3e46b05fba5bf86e5af5
575b5e0b11611e96a31d746f6759ceebb6bda216
/SpMVC_27_SecureV5/src/main/java/com/biz/sec/controller/AdminController.java
be431a6a54c67337e43327c33c5bf2b409629d01
[]
no_license
bjmin17/2020_02_Spring
e1aa48c16ec149ad67c1cebb295076933abdb23b
8ddc1943e3f6cb6c18bf5c9c4d9508e6f26f0ab4
refs/heads/master
2022-12-27T13:01:53.923272
2020-06-05T00:44:03
2020-06-05T00:44:03
240,148,922
0
0
null
2022-12-16T15:42:05
2020-02-13T01:06:38
Java
UTF-8
Java
false
false
1,972
java
package com.biz.sec.controller; import java.security.Principal; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.biz.sec.domain.UserDetailsVO; import com.biz.sec.service.UserService; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @Controller @RequestMapping(value="/admin") public class AdminController { private final UserService userService; // @ResponseBody @RequestMapping(value="",method=RequestMethod.GET) public String admin(Principal principal) { return "admin/admin_main"; } @RequestMapping(value="user_list",method=RequestMethod.GET) public String user_list(Model model) { List<UserDetailsVO> userList = userService.selectAll(); model.addAttribute("userList", userList); return "admin/user_list"; } @RequestMapping(value="/user_detail_view/{username}",method=RequestMethod.GET) public String user_detail_view(@PathVariable("username") String username, Model model) { UserDetailsVO userVO = userService.findByUserName(username); model.addAttribute("userVO", userVO); return "admin/user_detail_view"; } @RequestMapping(value="/user_detail_view",method=RequestMethod.POST) public String mypage( String username, UserDetailsVO userVO, String[] auth, Model model) { int ret = userService.update(userVO, auth); return "redirect:/admin/user_detail_view/" + userVO.getUsername(); } @RequestMapping(value="/delete",method=RequestMethod.GET) public String auth_delete(@RequestParam("id") long id, UserDetailsVO userVO) { int ret = userService.delete(id); // return "redirect:/admin"; return "redirect:/admin/user_detail_view/" + userVO.getUsername(); } }
[ "bjmin17@naver.com" ]
bjmin17@naver.com
1fe4f51614e25fe20a8a0520b28bae4b08a79adf
86f209c62e6122915e1354e634eab9016fe42db4
/LearnFlink/src/main/java/com/test/jsonFotmats/TestJsonS.java
4ea0160a2fd36d614f2f182d6c4b85f05226201c
[ "BSD-3-Clause", "MIT", "OFL-1.1", "ISC", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ReformSun/flink-master
85999151245bd42eaea7d6b248e65547b615ecba
5110f80e68ae21d3432580c6cbb0da4bd08d4878
refs/heads/master
2022-11-04T02:36:29.912291
2019-04-11T14:05:28
2019-04-11T14:05:28
144,118,208
1
0
Apache-2.0
2022-10-06T01:50:53
2018-08-09T07:44:42
Java
UTF-8
Java
false
false
1,123
java
package com.test.jsonFotmats; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.api.common.typeinfo.Types; import org.apache.flink.api.java.typeutils.RowTypeInfo; import org.apache.flink.formats.json.JsonRowSerializationSchema; import org.apache.flink.types.Row; /** * 序列化 */ public class TestJsonS { public static void main(String[] args) { testMethod2(); } public static void testMethod1() { RowTypeInfo rowTypeInfo = new RowTypeInfo(Types.INT,Types.SQL_TIMESTAMP); JsonRowSerializationSchema jsonRowSerializationSchema = new JsonRowSerializationSchema(rowTypeInfo); } public static void testMethod2() { TypeInformation[] typeInformations = {Types.INT,Types.STRING}; String[] fieldNames = {"a","b"}; TypeInformation<Row> rowSchema = new RowTypeInfo(typeInformations,fieldNames); JsonRowSerializationSchema jsonRowSerializationSchema = new JsonRowSerializationSchema(rowSchema); Row row = new Row(2); row.setField(0,1); row.setField(1,"ddd"); byte[] bytes = jsonRowSerializationSchema.serialize(row); System.out.println(new String(bytes)); } }
[ "sjh13592513537githup**" ]
sjh13592513537githup**
f7c1aca9a894c64d9b60dfe8cf4af8d34084cf40
4a50d3268c470c5215983ebaa32ef7bd79cfc418
/edu.usc.cssl.tacit.topicmodel.slda/src/edu/usc/cssl/tacit/topicmodel/slda/services/NaiveBayesTest.java
54d97b24959cce69dbfe297ba5edb8a729fc041d
[]
no_license
USC-CSSL/TACIT
1ade10a4901e1940b49ef1c4a49f5dd0c7d84332
ba7ae1cb0ca0a7f5c0ea72cd0ac3902cfed6c798
refs/heads/tacit-master
2023-05-31T01:05:50.561983
2019-03-27T19:47:46
2019-03-27T19:47:46
21,968,039
123
19
null
2017-10-04T18:03:53
2014-07-18T04:48:37
Java
UTF-8
Java
false
false
6,053
java
package edu.usc.cssl.tacit.topicmodel.slda.services; import java.io.BufferedWriter; import java.io.File; import java.io.FileFilter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Iterator; import cc.mallet.classify.Classifier; import cc.mallet.classify.ClassifierTrainer; import cc.mallet.classify.NaiveBayesTrainer; import cc.mallet.pipe.iterator.CsvIterator; import cc.mallet.pipe.iterator.FileIterator; import cc.mallet.types.InstanceList; import cc.mallet.types.Labeling; import edu.usc.cssl.tacit.common.ui.views.ConsoleView; public class NaiveBayesTest { public Classifier trainClassifier(InstanceList trainingInstances) { ClassifierTrainer trainer = new NaiveBayesTrainer(); return trainer.train(trainingInstances); } public InstanceList formatData(String dir){ ImportExample importer = new ImportExample(); InstanceList instances = importer.readDirectory(new File(dir)); return instances; } public void printLabelings(Classifier classifier, File[] directories, String output) throws IOException { // Create a new iterator that will read raw instance data from // the lines of a file. // Lines should be formatted as: // // [name] [label] [data ... ] // // in this case, "label" is ignored. // CsvIterator reader = new CsvIterator(new FileReader(file), "(\\w+)\\s+(\\w+)\\s+(.*)", 3, 2, 1); // (data, label, name) field indices File out = new File(output+File.separator+"predictions"); BufferedWriter bw = new BufferedWriter(new FileWriter(out)); FileIterator iterator = new FileIterator(directories,new TxtFilter(),FileIterator.LAST_DIRECTORY); // Create an iterator that will pass each instance through // the same pipe that was used to create the training data // for the classifier. Iterator instances = classifier.getInstancePipe().newIteratorFrom(iterator); // Classifier.classify() returns a Classification object // that includes the instance, the classifier, and the // classification results (the labeling). Here we only // care about the Labeling. String files[] = directories[0].list(); int count= 0; while (instances.hasNext()) { Labeling labeling = classifier.classify(instances.next()).getLabeling(); // print the labels with their weights in descending order (ie best // first) bw.write(files[count]); bw.newLine(); for (int rank = 0; rank < labeling.numLocations(); rank++) { bw.write(labeling.getLabelAtRank(rank) + ":" + labeling.getValueAtRank(rank) + " "); } bw.newLine(); count++; } bw.flush(); bw.close(); } public void printLabelingsCSV(Classifier classifier, File file) throws IOException { // Create a new iterator that will read raw instance data from // the lines of a file. // Lines should be formatted as: // // [name] [label] [data ... ] // // in this case, "label" is ignored. CsvIterator reader = new CsvIterator(new FileReader(file), "(\\w+)\\s+(\\w+)\\s+(.*)", 3,2,1); // (data, label, name) field indices // Create an iterator that will pass each instance through // the same pipe that was used to create the training data // for the classifier. Iterator instances = classifier.getInstancePipe().newIteratorFrom(reader); // Classifier.classify() returns a Classification object // that includes the instance, the classifier, and the // classification results (the labeling). Here we only // care about the Labeling. while (instances.hasNext()) { Labeling labeling = classifier.classify(instances.next()).getLabeling(); // print the labels with their weights in descending order (ie best first) for (int rank = 0; rank < labeling.numLocations(); rank++){ ConsoleView.printlInConsole(labeling.getLabelAtRank(rank) + ":" + labeling.getValueAtRank(rank) + " "); } ConsoleView.printlInConsoleln(); } } /** This class illustrates how to build a simple file filter */ class TxtFilter implements FileFilter { /** Test whether the string representation of the file * ends with the correct extension. Note that {@ref FileIterator} * will only call this filter if the file is not a directory, * so we do not need to test that it is a file. */ public boolean accept(File file) { if(file.toString().contains(".DS_Store")) return false; // return file.toString().endsWith(".txt"); return true; } } public static void main(String args[]){ NaiveBayesTest nb = new NaiveBayesTest(); System.out.println("333444444"); Classifier trainer = nb.trainClassifier(nb.formatData(args[0])); File dir = new File(args[0]); // try { // nb.printLabelings(trainer, new File[] {dir}); // } catch (IOException e) { // e.printStackTrace(); // } } }
[ "dnishant93@gmail.com" ]
dnishant93@gmail.com
6ccd273b76cde872c2a1dcb28cc81221edd990f6
9bb557d4e28e9744d626e5ecc0abbffdb1158e52
/src/main/java/com/andband/profiles/web/profiles/ProfileDTO.java
32ea94b450aa97de27039ac3afc0bf3bb16150c9
[]
no_license
andband-network/web-profiles
381c0de9278768ea9464bbc59d634efe68f75d5d
8e5ea136eed1d7f6a5d0545d2122a2786c2d33ba
refs/heads/master
2020-05-02T08:51:35.983834
2019-05-12T20:29:49
2019-05-12T20:29:49
177,853,798
0
0
null
null
null
null
UTF-8
Java
false
false
1,199
java
package com.andband.profiles.web.profiles; import javax.validation.constraints.NotBlank; public class ProfileDTO { @NotBlank private String id; @NotBlank private String name; @NotBlank private String imageId; private String bio; private boolean showLocation; private LocationDTO location; 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 getImageId() { return imageId; } public void setImageId(String imageId) { this.imageId = imageId; } public String getBio() { return bio; } public void setBio(String bio) { this.bio = bio; } public boolean isShowLocation() { return showLocation; } public void setShowLocation(boolean showLocation) { this.showLocation = showLocation; } public LocationDTO getLocation() { return location; } public void setLocation(LocationDTO location) { this.location = location; } }
[ "finnhoulihan@email.com" ]
finnhoulihan@email.com
f2bd02430d58c0e516caa3fa148540aa9b79f8c6
9145de64ce1c18a7357922bbf9bc8407382e24a7
/source/ServerSource/liferay-plugins-sdk-6.1.1/portlets/DishStore-portlet/docroot/WEB-INF/src/irestads/model/impl/CategoryCacheModel.java
8ac4d9b091d07b922914e72ab90e9d5fa4fb62ee
[]
no_license
vuhunghb/do-an-tot-nghiep
c28c363eaf80050a5257003ee6f8d0828c3ca495
34d6c1879486d93dd2ee5841bbb6a84d1186193c
refs/heads/master
2021-01-02T23:14:53.176520
2013-03-24T15:18:07
2013-03-24T15:18:07
37,311,078
0
1
null
null
null
null
UTF-8
Java
false
false
2,590
java
/** * Copyright (c) 2000-2012 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 irestads.model.impl; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.model.CacheModel; import irestads.model.Category; import java.io.Serializable; import java.util.Date; /** * The cache model class for representing Category in entity cache. * * @author Be * @see Category * @generated */ public class CategoryCacheModel implements CacheModel<Category>, Serializable { @Override public String toString() { StringBundler sb = new StringBundler(15); sb.append("{categoryId="); sb.append(categoryId); sb.append(", companyId="); sb.append(companyId); sb.append(", userId="); sb.append(userId); sb.append(", userName="); sb.append(userName); sb.append(", createDate="); sb.append(createDate); sb.append(", modifiedDate="); sb.append(modifiedDate); sb.append(", categoryName="); sb.append(categoryName); sb.append("}"); return sb.toString(); } public Category toEntityModel() { CategoryImpl categoryImpl = new CategoryImpl(); categoryImpl.setCategoryId(categoryId); categoryImpl.setCompanyId(companyId); categoryImpl.setUserId(userId); if (userName == null) { categoryImpl.setUserName(StringPool.BLANK); } else { categoryImpl.setUserName(userName); } if (createDate == Long.MIN_VALUE) { categoryImpl.setCreateDate(null); } else { categoryImpl.setCreateDate(new Date(createDate)); } if (modifiedDate == Long.MIN_VALUE) { categoryImpl.setModifiedDate(null); } else { categoryImpl.setModifiedDate(new Date(modifiedDate)); } if (categoryName == null) { categoryImpl.setCategoryName(StringPool.BLANK); } else { categoryImpl.setCategoryName(categoryName); } categoryImpl.resetOriginalValues(); return categoryImpl; } public long categoryId; public long companyId; public long userId; public String userName; public long createDate; public long modifiedDate; public String categoryName; }
[ "08130002@st.hcmuaf.edu.vn" ]
08130002@st.hcmuaf.edu.vn
db2d9c9e71d66f39b8d3fa1badffb424eeebbdfb
b88108faa19755c6051e21839cb716fcda4a168f
/cloud-config-client-3355/src/main/java/com/yang/springcloud/controller/ConfigClientController.java
b97de5aca532e0fc8835a3c7cb1dc6d1516a2816
[]
no_license
qweryx666/cloudfather
04f5dbc292e7ca68a81b171a55d8e78a9ea9a0f7
da43cbb9b8f259c0cf649852230ca9eabb4cb44d
refs/heads/master
2023-07-13T13:08:26.950472
2021-08-20T04:00:24
2021-08-20T04:00:24
398,131,473
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package com.yang.springcloud.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RefreshScope public class ConfigClientController { @Value("${config.info}") private String configInfo; @GetMapping("/configInfo") public String getConfigInfo() { return configInfo; } }
[ "renhaiyangnp@gmail.com" ]
renhaiyangnp@gmail.com
7f45a92bfd67f5b64f4cd6f12d5a43f4c553584b
383b85101fd2df1cfbbb92c6d47c6aaa73d521cf
/src/main/java-gen/org/openmuc/jdlms/internal/asn1/cosem/Integer8.java
dc90d0eda8f58fbdd278538ef9a1131c58b3d4cc
[]
no_license
xdom/jdlms
9cb46589f4819ab241c92226f454461eab897200
968f7232a0876df39cc05209fce7850ec9c1beca
refs/heads/master
2022-03-19T08:07:55.165320
2022-03-03T12:17:13
2022-03-03T12:25:00
101,627,683
4
4
null
null
null
null
UTF-8
Java
false
false
1,275
java
/** * Copyright 2012-17 Fraunhofer ISE * * This file is part of jDLMS. * For more information visit http://www.openmuc.org * * jDLMS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jDLMS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with jDLMS. If not, see <http://www.gnu.org/licenses/>. */ /** * This class file was automatically generated by the AXDR compiler that is part of jDLMS (http://www.openmuc.org) */ package org.openmuc.jdlms.internal.asn1.cosem; import org.openmuc.jdlms.internal.asn1.axdr.types.AxdrInteger; public class Integer8 extends AxdrInteger { public Integer8() { super(-128, 127, -128); } public Integer8(byte[] code) { super(-128, 127, -128); this.code = code; } public Integer8(long val) { super(-128, 127, val); } }
[ "dominik.matta@student.tuke.sk" ]
dominik.matta@student.tuke.sk
286696cdae9a8078b97b66329bc0f503dde0f936
2d9f850d2435df545ceb8526ad85b21efdb5a79a
/cclab_wk6_day3/src/test/java/CardTest.java
70109026539e8918cb1d0566bbe43b8797da523f
[]
no_license
mikethorpe/java_codeclan_course
7a3a6a8ca07c0463fe276fb14a1a8536e23107d2
23d4f03754dc53b6c213d9cc9bd7114741e35b8d
refs/heads/master
2020-04-06T14:55:42.806649
2018-11-14T14:30:45
2018-11-14T14:30:45
157,559,516
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
import org.junit.Before; import org.junit.Test; import static junit.framework.TestCase.assertEquals; public class CardTest { Card aceOfSpades; @Before public void before(){ aceOfSpades = new Card(SuitType.SPADES, NumberType.ACE); } @Test public void canGetSuit(){ assertEquals(SuitType.SPADES, aceOfSpades.getSuit()); } @Test public void canGetNumber(){ assertEquals(NumberType.ACE, aceOfSpades.getNumber()); } }
[ "michael.a.thorpe@gmail.com" ]
michael.a.thorpe@gmail.com
fee327ca8750dffcbd413d12337247bd0a463faa
4d1299aaa19831ba8127df405aee613ff11f0777
/src/main/java/com/rollbar/utilities/Validate.java
5e8ccc5b68626ef9c94460dcdf9277d5ef2ddfb8
[ "MIT" ]
permissive
Sunconure11/Minecraft-Flux
fbe30b0c9e645a88c63896ffd5888099227606ab
91e6fed878c7ce7397e14c4447decf367341a00c
refs/heads/master
2021-01-21T06:30:11.295536
2017-02-26T15:27:22
2017-02-26T15:27:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,122
java
package com.rollbar.utilities; /** * Validates arguments. Throws runtime exceptions when the validation fails. */ public class Validate { /** * Asserts that the String is not null or purely whitespace. * @param x the string to validate * @param name the name of the argument that's being tested. * @throws ArgumentNullException if {@code x} is null or whitespace. */ public static void isNotNullOrWhitespace(String x, String name) throws ArgumentNullException { if (x == null || x.trim().isEmpty()) { throw new ArgumentNullException(name); } } /** * Asserts that the String is not longer than {@code max}. * @param x The string to test * @param max the maximum length * @param name the name of the argument that's being tested. * @throws InvalidLengthException if {@code x} is longer than {@code max} */ public static void maxLength(String x, int max, String name) throws InvalidLengthException { if (x.length() > max) { throw InvalidLengthException.TooLong(name, max); } } /** * Asserts that the String is not shorter than {@code max}. * @param x The string to test * @param min the minimum length * @param name the name of the argument that's being tested. * @param <T> the type of the array * @throws InvalidLengthException if {@code x} is shorter than {@code max} */ public static <T> void minLength(T[] x, int min, String name) throws InvalidLengthException { if (x.length < min) { throw InvalidLengthException.TooShort(name, min); } } /** * Asserts that the argument is not null. * @param data the object to test * @param name the name of the argument that's being tested * @param <T> the type of the object being tested * @throws ArgumentNullException if {@code data} is null */ public static <T> void isNotNull(T data, String name) throws ArgumentNullException { if (data == null) { throw new ArgumentNullException(name); } } }
[ "shevkpl@gmail.com" ]
shevkpl@gmail.com
b980c1415b0dacb2b3d1c6d0ee1e4d90f4c41e35
2c60115b4f4fd8e37f84c512d0aa702ff8806ff9
/src/main/java/com/spleefleague/core/chat/ChatChannel.java
bdbaebaed57507e9a8b166d0fa2ab9fa9c6cac6d
[]
no_license
SpleefLeague/SLCore_new
4a0ef569edb9e151aba48d9c1316558ad20cc118
da142eeda6a8e4a3820ca0b8fc155190718cc61d
refs/heads/master
2022-10-03T05:25:47.537595
2022-09-17T21:03:15
2022-09-17T21:03:15
252,939,009
0
0
null
2022-09-17T21:03:16
2020-04-04T07:45:06
Java
UTF-8
Java
false
false
5,532
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 com.spleefleague.core.chat; import com.google.common.collect.Sets; import com.spleefleague.core.Core; import com.spleefleague.core.player.CorePlayer; import com.spleefleague.core.player.Rank; import java.util.HashMap; import java.util.Set; import java.util.function.BiConsumer; import java.util.function.Function; import org.bukkit.ChatColor; /** * @author NickM13 */ public class ChatChannel { public enum Channel { GLOBAL, PARTY, VIP, BUILD, STAFF, ADMIN, GAMES, TICKET, SPLEEF, SUPERJUMP } private static ChatChannel DEFAULT_CHANNEL; private static HashMap<Channel, ChatChannel> channels = new HashMap<>(); private final String name; private final ChatColor color; private final Function<CorePlayer, Boolean> availableFun; private final Function<CorePlayer, Set<CorePlayer>> playerListFun; private enum PlayerNameFormat { NONE, BRACKET, COLON } private final PlayerNameFormat playerNameFormat; public ChatChannel(String name) { this.name = name; this.color = null; this.availableFun = null; this.playerNameFormat = PlayerNameFormat.BRACKET; this.playerListFun = null; } public ChatChannel(String name, ChatColor color, Function<CorePlayer, Boolean> availableFun) { this.name = name; this.color = color; this.availableFun = availableFun; this.playerNameFormat = PlayerNameFormat.COLON; this.playerListFun = null; } public ChatChannel(String name, ChatColor color, Function<CorePlayer, Boolean> availableFun, Function<CorePlayer, Set<CorePlayer>> playerListFun) { this.name = name; this.color = color; this.availableFun = availableFun; this.playerNameFormat = PlayerNameFormat.COLON; this.playerListFun = playerListFun; } public String formatMessage(CorePlayer sender, String msg) { String message = ""; switch (playerNameFormat) { case BRACKET: message += Chat.BRACKET + "<"; if (sender.getRank().getDisplayNameUnformatted().length() > 0) { message += Chat.BRACE + "[" + sender.getRank().getDisplayName() + Chat.BRACE + "] "; } message += sender.getDisplayName() + Chat.BRACKET + "> "; break; case COLON: message += Chat.BRACE + "[" + color + name + Chat.BRACE + "] "; message += sender.getDisplayName() + Chat.BRACKET + ": "; break; default: break; } message += Chat.PLAYER_CHAT + Chat.colorize(msg); return message; } public String formatMessage(String msg) { String message = ""; message += "[" + name + "] "; message += Chat.colorize(msg); return message; } public String getName() { return name; } public boolean isAvailable(CorePlayer cp) { if (availableFun == null) return true; return availableFun.apply(cp); } public Set<CorePlayer> getPlayers(CorePlayer cp) { if (playerListFun == null) return Sets.newHashSet(Core.getInstance().getPlayers().getAll()); return playerListFun.apply(cp); } public static ChatChannel createTempChannel(String name) { return new ChatChannel(name); } public static ChatChannel getChannel(Channel name) { // Create a tagless chat channel if one doesnt exist return channels.get(name); } public static ChatChannel getDefaultChannel() { return getChannel(Channel.GLOBAL); } public static void addChatChannel(Channel id, String name, ChatColor color, Function<CorePlayer, Boolean> availableFun) { channels.put(id, new ChatChannel(name, color, availableFun)); } public static void addChatChannel(Channel id, String name, ChatColor color, Function<CorePlayer, Boolean> availableFun, Function<CorePlayer, Set<CorePlayer>> playerListFun) { channels.put(id, new ChatChannel(name, color, availableFun, playerListFun)); } public static void init() { channels.put(Channel.GLOBAL, new ChatChannel("Global")); addChatChannel(Channel.PARTY, "Party", ChatColor.AQUA, cp -> cp.getParty() != null, cp -> cp.getParty().getPlayers()); addChatChannel(Channel.VIP, "VIP", ChatColor.DARK_PURPLE, cp -> cp.getRank().hasPermission(Rank.getRank("VIP"))); addChatChannel(Channel.BUILD, "Build", ChatColor.GREEN, cp -> cp.getRank().hasPermission(Rank.getRank("BUILDER"))); addChatChannel(Channel.STAFF, "Staff", ChatColor.LIGHT_PURPLE, cp -> cp.getRank().hasPermission(Rank.getRank("MODERATOR"))); addChatChannel(Channel.ADMIN, "Admin", ChatColor.RED, cp -> cp.getRank().hasPermission(Rank.getRank("DEVELOPER"))); addChatChannel(Channel.GAMES, "Games", ChatColor.AQUA, null); addChatChannel(Channel.TICKET, "Ticket", ChatColor.GOLD, cp -> cp.getRank().hasPermission(Rank.getRank("MODERATOR"))); addChatChannel(Channel.SPLEEF, "Spleef", ChatColor.GOLD, null); addChatChannel(Channel.SUPERJUMP, "SuperJump", ChatColor.GOLD, null); } }
[ "NickMead0313@outlook.com" ]
NickMead0313@outlook.com
6669996208ad22b1cff036aa92783429efca1aa1
1e0129957dcc71d87995097f37ce745d745a899d
/back/src/main/java/zavrsni/web/controller/KlubController.java
279f816cb2f9f6776ecf2070d41d81d383fcd1b1
[]
no_license
dusan-cloud/transferPlayers
99f2cf1f43dce14fca8a9f42c56c46acbfa51930
777bd2b1c6fd4e1584d079f0900396b98708cbf6
refs/heads/main
2023-06-16T16:48:18.515733
2021-07-13T17:31:19
2021-07-13T17:31:19
380,002,453
0
0
null
null
null
null
UTF-8
Java
false
false
992
java
package zavrsni.web.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import zavrsni.model.Klub; import zavrsni.service.KlubService; import zavrsni.support.KlubToKlubDto; import zavrsni.web.dto.KlubDTO; @RestController @RequestMapping(value = "/api/klubovi", produces = MediaType.APPLICATION_JSON_VALUE) public class KlubController { @Autowired private KlubService klubService; @Autowired private KlubToKlubDto toKlubDto; @GetMapping public ResponseEntity<List<KlubDTO>> getAll() { List<Klub> klub = klubService.findAll(); return new ResponseEntity<>(toKlubDto.convert(klub), HttpStatus.OK); } }
[ "d.ilisic@yahoo.com" ]
d.ilisic@yahoo.com
53820a99fa6eba83627ae66345971e2c489814e7
1dead5a825c6253ff6b7e07c623e1a001bc30c12
/src/test/java/io/bunnyblue/android/sdk/mirror/HelloTesat.java
a0c8bce8e03f77eacd273f9fea8f70a6aa41dee7
[ "ICU", "MIT" ]
permissive
bunnyblueair/AndroidSDKMirror
546e14169f5693e7489fdf801d7a683e755dfb6a
61e43dd9250623ff0044b6fb06a9026c458ae618
refs/heads/master
2020-03-28T10:21:22.570829
2019-04-02T08:07:07
2019-04-02T08:07:07
148,102,148
1
0
null
null
null
null
UTF-8
Java
false
false
300
java
/* * Copyright (c) 2018. * AndroidSDKMirror */ package io.bunnyblue.android.sdk.mirror; import org.junit.Test; /** * @author bunnyblue */ public class HelloTesat { @Test public void txxxTest(){ System.err.println("cae5a211131168bb9b1945db9922a1ba30f096e6".length()); } }
[ "bunnyblueair@gmail.com" ]
bunnyblueair@gmail.com
9341689efe5be1afe110202609459adc934e6d81
05cd8639ab747ab239bc0d98c4b4dd0ead20a275
/src/Exercicio07.java
dddd3003d3b808a48c63f1be7e41ea0ce4c58c2d
[]
no_license
alexanmm/Tarefa01
2720fe0a281a84e2ff52ac5b0d1c5247e6bb7576
e1c216ea283134b152ef458bff7a7a9965c266a9
refs/heads/master
2020-05-05T05:20:17.061561
2019-04-05T20:16:50
2019-04-05T20:16:50
179,747,075
0
0
null
null
null
null
UTF-8
Java
false
false
919
java
public class Exercicio07 { public static void main(String[] arqs) { //7) Definir o método: listaDeNumerosEntre(Integer mínimo, Integer máximo) //que receba dois inteiros e gere um Array com os valores dentro desse //intervalo. Integer numMinimo = 100; Integer numMaximo = 200; Integer[] arrayNumeros = new Integer[numMaximo - numMinimo + 1]; arrayNumeros = listaDeNumerosEntre(numMinimo,numMaximo); for (int i = 0; i < arrayNumeros.length; i++){ System.out.println(arrayNumeros[i]); } } public static Integer[] listaDeNumerosEntre(Integer minimo, Integer maximo){ Integer[] arrayNumeros = new Integer[maximo - minimo + 1]; Integer cont = 0; for (int i = minimo; i <= maximo; i++){ arrayNumeros[cont] = i; cont++; } return arrayNumeros; } }
[ "alexandre.moreira.medeiros@gmail.com" ]
alexandre.moreira.medeiros@gmail.com
e39a540ff00413c53d1625b639c56eda706b899b
c95ca5eeeb81f492383514d4a54e5f066d2ac08f
/xiaoyaoji-web/src/main/java/cn/com/xiaoyaoji/data/bean/ProjectGlobal.java
a8fee8f6979b758adc4213cd0ad3a8f3aaaddd05
[]
no_license
Jsonlu/api
679bc5fa6a54f732d98cadf3c07c0a4cfbcaaa58
a6695c46c5af22be06b4cfcc95286d3181e57b81
refs/heads/master
2021-01-01T19:38:09.510476
2017-07-29T07:25:44
2017-07-29T07:25:44
98,634,690
0
0
null
null
null
null
UTF-8
Java
false
false
1,185
java
package cn.com.xiaoyaoji.data.bean; import cn.com.xiaoyaoji.core.annotations.Alias; import cn.com.xiaoyaoji.utils.JsonUtils; /** * @author: zhoujingjie * @Date: 17/4/25 */ @Alias("project_global") public class ProjectGlobal { private String id; private String environment; private String http; private String status; private String projectId; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getEnvironment() { return environment; } public void setEnvironment(String environment) { this.environment = environment; } public String getHttp() { return http; } public void setHttp(String http) { this.http = http; } public String getProjectId() { return projectId; } public void setProjectId(String projectId) { this.projectId = projectId; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Override public String toString() { return JsonUtils.toString(this); } }
[ "a12345678" ]
a12345678
5d70f59844dc828ca1468dc8f73e6701067c87da
7f786c40d0853da08c25687bceacf8032d870523
/app/src/main/java/com/app/elixir/makkhankitchens/fcm/MyFirebaseMessagingService.java
f54c45700a974d9cdb6f68d0277ee02d1db8a5a3
[]
no_license
Ravikumawat1990/MakkhanKitchen
1338577c14d8f715b2bcd9420080124f5f3dbd52
478709b75c8f17a8328a9481297570b83b245a3c
refs/heads/master
2020-12-03T00:44:11.609069
2017-07-03T06:08:15
2017-07-03T06:08:15
96,075,420
0
0
null
null
null
null
UTF-8
Java
false
false
5,373
java
package com.app.elixir.makkhankitchens.fcm; import android.annotation.TargetApi; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.media.RingtoneManager; import android.net.Uri; import android.os.Build; import android.support.v7.app.NotificationCompat; import android.util.Log; import com.app.elixir.makkhankitchens.Model.NotiModel; import com.app.elixir.makkhankitchens.R; import com.app.elixir.makkhankitchens.activity.ViewDeliveryBoy; import com.app.elixir.makkhankitchens.activity.ViewSplash; import com.app.elixir.makkhankitchens.database.tbl_notification; import com.app.elixir.makkhankitchens.database.tbl_notificationNew; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; import java.util.Set; public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = "MyFirebaseMsgService"; private static final String TAG1 = "logout"; Context context; @Override public void onStart(Intent intent, int startId) { super.onStart(intent, startId); } @TargetApi(Build.VERSION_CODES.KITKAT) @Override public void onMessageReceived(RemoteMessage remoteMessage) { // TODO(developer): Handle FCM messages here. context = getApplicationContext(); Map data = remoteMessage.getData(); Set keys = data.keySet(); Iterator itr = keys.iterator(); String key; String value = ""; while (itr.hasNext()) { key = (String) itr.next(); value = (String) data.get(key); System.out.println(key + " - " + value); } Log.d(TAG, "From: " + remoteMessage.getFrom()); sendNotification(remoteMessage.getNotification().getBody()); if (remoteMessage.getNotification().getBody().equals("Delivery")) { Intent intent = new Intent("Delivery"); // put whatever data you want to send, if any intent.putExtra("message", value.toString()); //send broadcast sendBroadcast(intent); sendNotificationDelivery(remoteMessage.getNotification().getBody()); } else if (remoteMessage.getNotification().getBody().equals("Customer")) { Intent intent = new Intent("Customer"); intent.putExtra("message", value.toString()); //send broadcast sendBroadcast(intent); sendNotification(remoteMessage.getNotification().getBody()); } else { } } private void sendNotificationDelivery(String messageBody) { int requestID = (int) System.currentTimeMillis(); Intent intent = new Intent(this, ViewDeliveryBoy.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, requestID, intent, PendingIntent.FLAG_UPDATE_CURRENT); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this) .setContentTitle(getString(R.string.app_name)) .setContentText(messageBody) .setAutoCancel(true) .setSound(defaultSoundUri) .setContentIntent(pendingIntent); notificationBuilder.setSmallIcon(R.drawable.applogo); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(requestID, notificationBuilder.build()); ArrayList<NotiModel> notiModels = new ArrayList<>(); NotiModel notiModel = new NotiModel(); notiModel.setKey(String.valueOf(requestID)); notiModel.setIsViewed("0"); notiModels.add(notiModel); tbl_notificationNew.Insert(notiModels); } private void sendNotification(String messageBody) { int requestID = (int) System.currentTimeMillis(); Intent intent = new Intent(this, ViewSplash.class); ArrayList<NotiModel> notiModels = new ArrayList<>(); NotiModel notiModel = new NotiModel(); notiModel.setKey(String.valueOf(requestID)); notiModel.setIsViewed("0"); notiModels.add(notiModel); tbl_notification.Insert(notiModels); PendingIntent pendingIntent = PendingIntent.getActivity(this, requestID, intent, PendingIntent.FLAG_UPDATE_CURRENT); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this) .setContentTitle(getString(R.string.app_name)) .setContentText(messageBody) .setAutoCancel(true) .setSound(defaultSoundUri) .setContentIntent(pendingIntent); notificationBuilder.setSmallIcon(R.drawable.applogo); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(requestID, notificationBuilder.build()); } }
[ "kravi@elixirinfo.com" ]
kravi@elixirinfo.com
3fb53e8570dd18e4fa02a153810c8316c6d1531f
038995b05c6cb9642197e2c5263ef7cc9f6cb4f7
/sopo-example/src/main/java/com/kazge/sopoexample/common/query/VirtualQueryResult.java
88a0854821678119267b7a4b6e90fa5b3c5daef7
[ "MIT" ]
permissive
imhazige/sopo
069d09b5e12597c71ab199b4adf2f8d253eaaee5
5b46059820e2b32c19b670bfc059da8398d828a5
refs/heads/master
2020-12-30T10:49:26.622926
2017-08-10T09:46:30
2017-08-10T09:46:30
98,858,698
0
0
null
null
null
null
UTF-8
Java
false
false
691
java
package com.kazge.sopoexample.common.query; import java.io.Serializable; public class VirtualQueryResult implements Serializable{ private static final long serialVersionUID = -510679961099454044L; private int totalCount; private Object results; public VirtualQueryResult() { } public VirtualQueryResult(Object argResults,int count) { results = argResults; totalCount = count; } public int getTotalCount() { return this.totalCount; } public void setTotalCount(int count) { this.totalCount = count; } public Object getResults() { return this.results; } public void setResults(Object results) { this.results = results; } }
[ "imhazige@gmail.com" ]
imhazige@gmail.com
a9554eb95b8cbfc7cb71058af2a3c5f14440bebd
4497f9e8b1dcc057668412bf5e4793e6ddf6699c
/ch5/src/main/java/com/dao/TestDao.java
0b078f080b437fdaa66c6b9f6505e358e36402aa
[]
no_license
lwh-code/j2ee-exp
f4bd424aea64e5b700db5a0afaaadbdbf99fb8b3
aff235fdd8cd53f0fc550c8d74c06e65d583182f
refs/heads/main
2023-05-23T10:04:30.754759
2021-06-06T08:05:58
2021-06-06T08:05:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
/* * Date: 2021/3/26 * Author: <https://www.github.com/shaozk> */ package com.dao; import pojo.MyUser; import java.util.List; /** * @author shaozk * @Description: TODO */ public interface TestDao { public int update(String sql, Object[] param); public List<MyUser> query(String sql, Object [] param); }
[ "913667678@qq.com" ]
913667678@qq.com
8b0d35521e4b7a371eb7b495b974debc35d5b9e1
4b096aa9c0035a5926dc4a5fdbd84aab311528b1
/code/library management system/src/LMS/BOOKDETAILS.java
5d07c5de0c76e459fb5f7daf3ed266d19743b869
[]
no_license
mukotso/LIBRARY-MANAGEMENT-SYSTEM
b5e84c2b5868e99dbfd797d1c474119ef0c9589f
0dc42a930ff622bbef03d4bcdbd4b824ed5a870a
refs/heads/master
2020-09-15T05:10:24.494675
2019-11-22T08:05:42
2019-11-22T08:05:42
223,354,698
0
1
null
null
null
null
UTF-8
Java
false
false
8,540
java
package LMS; import java.awt.Color; import java.awt.EventQueue; import java.awt.Font; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JTextField; public class BOOKDETAILS extends JFrame { private JPanel contentPane; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { BOOKDETAILS frame = new BOOKDETAILS(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } Connection connection=null; private JTextField TF_accessNo; private JTextField TF_isbn; private JTextField TF_callNo; private JTextField TF_subject; private JTextField TF_title; private JTextField TF_author; private JTextField TF_publisher; private JTextField TF_edition; /** * Create the frame. */ public BOOKDETAILS() { super("Library Management System"); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { LIBRARIANMAINMENU logout = new LIBRARIANMAINMENU(); logout.logLogoutTime(); } }); //Database connection. initialize(); connection=dbConnection.dbConnector(); setIconImage(Toolkit.getDefaultToolkit().getImage(LMSMAINMENU.class.getResource("/images/images (7).jpeg"))); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(75, 75, 1200, 600); contentPane = new JPanel(); contentPane.setBackground(new Color(0, 153, 153)); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblBooksInformation = new JLabel("BOOK DETAILS"); lblBooksInformation.setFont(new Font("Tahoma", Font.BOLD, 14)); lblBooksInformation.setBounds(415, 11, 247, 44); contentPane.add(lblBooksInformation); JLabel lblBookCoverPhoto = new JLabel("BOOK COVER PHOTO"); lblBookCoverPhoto.setBounds(128, 74, 255, 31); contentPane.add(lblBookCoverPhoto); JLabel imageLabel = new JLabel(""); imageLabel.setBounds(44, 116, 399, 395); contentPane.add(imageLabel); JLabel lblAccessionNumber = new JLabel("ACCESSION NUMBER"); lblAccessionNumber.setBounds(494, 95, 148, 37); contentPane.add(lblAccessionNumber); JLabel lblIsbn = new JLabel("ISBN"); lblIsbn.setBounds(494, 145, 148, 37); contentPane.add(lblIsbn); JLabel lblCallNumber = new JLabel("CALL NUMBER"); lblCallNumber.setBounds(494, 195, 148, 39); contentPane.add(lblCallNumber); JLabel lblSubject = new JLabel("SUBJECT"); lblSubject.setBounds(494, 245, 148, 37); contentPane.add(lblSubject); JLabel lblTitle = new JLabel("TITLE"); lblTitle.setBounds(494, 295, 148, 37); contentPane.add(lblTitle); JLabel lblAuthor = new JLabel("AUTHOR"); lblAuthor.setBounds(494, 345, 148, 37); contentPane.add(lblAuthor); JLabel lblPublisher = new JLabel("PUBLISHER"); lblPublisher.setBounds(494, 395, 148, 37); contentPane.add(lblPublisher); JLabel lblEditionNumber = new JLabel("EDITION NUMBER"); lblEditionNumber.setBounds(494, 445, 148, 37); contentPane.add(lblEditionNumber); TF_accessNo = new JTextField(); TF_accessNo.setEditable(false); TF_accessNo.setBounds(685, 95, 390, 37); contentPane.add(TF_accessNo); TF_accessNo.setColumns(10); SEARCHBOOKS accessNumber=new SEARCHBOOKS(); TF_accessNo.setText(accessNumber.getAccessionNo()); TF_isbn = new JTextField(); TF_isbn.setEditable(false); TF_isbn.setColumns(10); TF_isbn.setBounds(685, 145, 390, 37); contentPane.add(TF_isbn); TF_callNo = new JTextField(); TF_callNo.setEditable(false); TF_callNo.setColumns(10); TF_callNo.setBounds(685, 195, 390, 37); contentPane.add(TF_callNo); TF_subject = new JTextField(); TF_subject.setEditable(false); TF_subject.setColumns(10); TF_subject.setBounds(685, 245, 390, 37); contentPane.add(TF_subject); TF_title = new JTextField(); TF_title.setEditable(false); TF_title.setColumns(10); TF_title.setBounds(685, 295, 390, 37); contentPane.add(TF_title); TF_author = new JTextField(); TF_author.setEditable(false); TF_author.setColumns(10); TF_author.setBounds(685, 345, 390, 37); contentPane.add(TF_author); TF_publisher = new JTextField(); TF_publisher.setEditable(false); TF_publisher.setColumns(10); TF_publisher.setBounds(685, 395, 390, 37); contentPane.add(TF_publisher); TF_edition = new JTextField(); TF_edition.setEditable(false); TF_edition.setColumns(10); TF_edition.setBounds(685, 445, 390, 37); contentPane.add(TF_edition); readBookDetails(); readPicture(TF_accessNo.getText(), "System.Environment.SpecialFolder.LocalApplicationData"); imageLabel.setIcon(new ImageIcon(new javax.swing.ImageIcon("System.Environment.SpecialFolder.LocalApplicationData").getImage().getScaledInstance(464,455, Image.SCALE_SMOOTH))); JButton btnBack = new JButton("BACK"); btnBack.setBounds(880, 508, 195, 42); contentPane.add(btnBack); btnBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SEARCHBOOKS accessNumber=new SEARCHBOOKS(); accessNumber.clearSearchedAccessNo(); dispose(); SEARCHBOOKS.main(new String[]{}); } }); } private void readBookDetails() { String isbn=""; String callNo=""; String subject=""; String title=""; String author=""; String publisher=""; String edition=""; try { String queryReadDb="select * from BOOKS where ACCESSION_NUMBER = '"+TF_accessNo.getText()+"' "; PreparedStatement pstReadDb=connection.prepareStatement(queryReadDb); ResultSet rsReadDb=pstReadDb.executeQuery(); while(rsReadDb.next()) { isbn=rsReadDb.getString("ISBN"); callNo=rsReadDb.getString("CALL_NUMBER"); subject=rsReadDb.getString("SUBJECT"); title=rsReadDb.getString("TITLE"); author=rsReadDb.getString("AUTHOR"); publisher=rsReadDb.getString("PUBLISHER"); edition=rsReadDb.getString("EDITION_NUMBER"); } TF_isbn.setText(isbn); TF_callNo.setText(callNo); TF_subject.setText(subject); TF_title.setText(title); TF_author.setText(author); TF_publisher.setText(publisher); TF_edition.setText(edition); pstReadDb.close(); rsReadDb.close(); }catch(Exception exRead) { exRead.printStackTrace(); } } public void readPicture(String access, String filename) { // update sql String selectSQL = "SELECT COVER_PHOTO FROM BOOKS WHERE ACCESSION_NUMBER=?"; ResultSet rs = null; FileOutputStream fos = null; PreparedStatement pstmt = null; try { pstmt = connection.prepareStatement(selectSQL); pstmt.setString(1, access); rs = pstmt.executeQuery(); // write binary stream into file File file = new File(filename); fos = new FileOutputStream(file); //System.out.println("Writing BLOB to file " + file.getAbsolutePath()); while (rs.next()) { InputStream input = rs.getBinaryStream("COVER_PHOTO"); byte[] buffer = new byte[1024]; while (input.read(buffer) > 0) { fos.write(buffer); } } } catch (SQLException | IOException e) { System.out.println(e.getMessage()); } finally { try { if (rs != null) { rs.close(); } if (pstmt != null) { pstmt.close(); } /*if (connection != null) { connection.close(); }*/ if (fos != null) { fos.close(); } } catch (SQLException | IOException e) { System.out.println(e.getMessage()); } } } private void initialize() { // TODO Auto-generated method stub } }
[ "kelvinmukotso@gmail.com" ]
kelvinmukotso@gmail.com
9a05ab3c960cbf777b5d3716128aab1ed84684f2
4c4727ae6acb85c0c6cdabcb9b549bc385d31797
/Root.java
7ca484f41946c8461c179fe13b8662a598d55775
[]
no_license
JeremyBallard/Approximating-any-irrational-root
4c006b40d33439e9737a138cfb4e1c11a5ed3f06
f623dd83d759ef96532fd40c8447d0ae6b55002b
refs/heads/master
2020-05-23T06:56:07.233986
2019-08-14T00:18:56
2019-08-14T00:18:56
186,669,086
0
0
null
null
null
null
UTF-8
Java
false
false
2,984
java
import java.util.*; import java.lang.Math; import java.math.BigDecimal; import java.math.RoundingMode; public class Root { //meant to remove dividing by 0, also useless to use algorithm to check for perfect squares public static BigDecimal approxRoot(BigDecimal x, BigDecimal y, int rootFactor, int userCount){ if (y == BigDecimal.valueOf(0.0)){ System.out.println("Error - Cannot divide by 0"); return BigDecimal.valueOf(-1.0); } //assumed to round down irrational roots such that when multiplied by itself it will not equal rootFactor if ((int)Math.sqrt(rootFactor) * (int)Math.sqrt(rootFactor) == rootFactor){ System.out.println("Has to be an irrational root for this to work"); return BigDecimal.valueOf(Math.sqrt(rootFactor)); } return approxRoot(x, y, 0, BigDecimal.valueOf(0.0), rootFactor, userCount); } private static BigDecimal approxRoot(BigDecimal x, BigDecimal y, int count, BigDecimal approx, int rootFactor, int userCount){ for(int i = 0; i < userCount; i++){ //meant to store x and y for new iteration BigDecimal oldX = x; BigDecimal oldY = y; oldX.setScale(100, RoundingMode.HALF_UP); oldY.setScale(100, RoundingMode.HALF_UP); approx = oldX.divide(oldY, 100, RoundingMode.HALF_UP); x = oldX.add(oldY.multiply(BigDecimal.valueOf(rootFactor))); y = oldY.add(oldX); //meant to show user changes through the algorithm switch(count){ case 1: case 2: case 5: case 8: case 10: case 15: case 25: case 50: case 100: case 250: case 500: case 1000: case 1500: case 2000: case 2500: case 5000: case 10000: System.out.println("Count @ " + count); System.out.println("x = " + x); System.out.println("y = " + y); System.out.println("approx = " + approx); } count++; } System.out.println("Count @ " + count); System.out.println("x = " + x); System.out.println("y = " + y); return approx; } public static void main(String[] args){ Scanner in = new Scanner(System.in); Root approx = new Root(); BigDecimal root = new BigDecimal(0); root.setScale(100, RoundingMode.HALF_UP); System.out.println("This system will approximate any irrational positive root through any x and y"); System.out.println("Pick your irrational root"); int rootFactor = in.nextInt(); System.out.println("Type in how many times you want to iterate this algorithm"); int userCount = in.nextInt(); System.out.println("Type in an x value"); BigDecimal x = new BigDecimal(0); x = BigDecimal.valueOf(in.nextDouble()); x.setScale(100, RoundingMode.HALF_UP); System.out.println("Type in a y value"); BigDecimal y = new BigDecimal(0); y = BigDecimal.valueOf(in.nextDouble()); y.setScale(100, RoundingMode.HALF_UP); root = Root.approxRoot(x, y, rootFactor, userCount); root.setScale(10, RoundingMode.HALF_UP); System.out.println("sqrt "+ rootFactor +" is approx = " + root); //closes the scanner in.close(); } }
[ "46586431+JeremyBallard@users.noreply.github.com" ]
46586431+JeremyBallard@users.noreply.github.com
da3db2adf05a273d57708fac628a498e1dbb5524
57fdba3d199c1bf5ea7fc31208fdcc6532e4016d
/src/main/java/enumerated/menu/Meal.java
adb1a2828f511e598babaa80c98377e239eafff6
[]
no_license
yujmh/thinking-in-java
c8ec89f757fab079dc22e87cd49eeaf8be0e3c24
9c3620f7a919ac0c7c68cbeca5cf034dea9dbcfc
refs/heads/master
2020-03-26T21:36:01.506688
2018-09-17T14:13:53
2018-09-17T14:13:53
145,397,329
0
1
null
null
null
null
UTF-8
Java
false
false
345
java
package enumerated.menu; public class Meal { public static void main(String[] args) { for (int i = 0; i < 5; i++) { for (Course course : Course.values()) { Food food = course.randSelection(); System.out.println(food); } System.out.println("---"); } } }
[ "cheng.cheng@shatacloud.com" ]
cheng.cheng@shatacloud.com
35ccd79538106f9b4fe675033cc98a6af56c3c5f
b2ac1ac2ba57770ef05e0c9b665aa4234be87461
/TowerProxy/server/server-api/src/main/java/com/playtech/ptargame4/api/table/GetUsersResponse.java
0d821a378bb237a0d70bc3c0ec697ee4197958a0
[]
no_license
jannoholm/pt-ar-game-4
5e74b26b71c79e5a209446a65c480d1fccc6a80a
fa720d45aa31c42daa9d3643d824c096c4414b22
refs/heads/master
2022-12-12T07:52:12.309590
2019-09-26T18:14:26
2019-09-26T18:14:26
152,259,114
1
1
null
2022-12-09T20:13:12
2018-10-09T13:48:52
Java
UTF-8
Java
false
false
1,505
java
package com.playtech.ptargame4.api.table; import com.playtech.ptargame4.api.AbstractResponse; import com.playtech.ptargame.common.message.MessageHeader; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class GetUsersResponse extends AbstractResponse { private List<GetUsersUser> users=new ArrayList<>(); public GetUsersResponse(MessageHeader header) { super(header); } public void parse(ByteBuffer messageData) { super.parse(messageData); int numberOfUsers=messageData.getInt(); for (int i=0; i < numberOfUsers; ++i) { GetUsersUser user = new GetUsersUser(); user.parse(messageData); users.add(user); } } public void format(ByteBuffer messageData) { super.format(messageData); messageData.putInt(users.size()); for (GetUsersUser user : users) { user.format(messageData); } } protected void toStringImpl(StringBuilder s) { super.toStringImpl(s); s.append(", users={"); for (int i = 0; i < users.size(); ++i) { GetUsersUser user = users.get(i); if (i > 0) s.append(","); user.toStringImpl(s); } s.append("}"); } public List<GetUsersUser> getUsers() { return Collections.unmodifiableList(users); } public void addUser(GetUsersUser user) { this.users.add(user); } }
[ "janno.holm@playtech.com" ]
janno.holm@playtech.com
5dcceae345dc01180823a594dca10a9647307287
9e9b8aa2caa05292613f8569c005b23c493f13ff
/Project5_2A/app/src/main/java/com/example/project5_2a/MainActivity.java
fd3e4a9985d7236acbbf3234fceaab144056b020
[]
no_license
ChoiSuhyeonA/AndroidStudio
c59cb99f49510dc4381b8a53352c3d45fe0bde34
0b9f28cedee5bb10643b51ecd1370210b34961a1
refs/heads/master
2022-09-21T11:39:05.726199
2020-05-24T05:11:10
2020-05-24T05:11:10
266,474,062
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package com.example.project5_2a; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "suhyeon1137@gmail.com" ]
suhyeon1137@gmail.com
a8aea09f6c951c007aecfca96556c0f38685e1f2
9834c6e15c807929900fe997e14d7272a16b9b44
/src/dungda5/controller/PersonInsertServlet.java
635012019c5f47132c207a79b06a460060e505eb
[]
no_license
dungda1112/ATJBProject
aa555c2d596c60481815fc65c2494d9641bca83d
c6cdd6ef9f2be49829e1f52509f59dca19db8bc9
refs/heads/master
2023-01-07T18:42:18.934943
2020-08-10T01:29:30
2020-08-10T01:29:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,021
java
package dungda5.controller; import java.io.IOException; import java.sql.SQLException; import java.util.Arrays; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import dungda5.entities.Person; import dungda5.utils.PersonUtils; @WebServlet(urlPatterns = { "/InsertPerson" }) public class PersonInsertServlet extends HttpServlet { private static final long serialVersionUID = 1L; public PersonInsertServlet() { super(); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher = request.getServletContext().getRequestDispatcher("/WEB-INF/views/Person.jsp"); dispatcher.forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String firstName = (String) request.getParameter("FirstName"); String lastName = (String) request.getParameter("LastName"); String gender = (String) request.getParameter("Gender"); String phoneNumber = (String) request.getParameter("PhoneNumber"); String email = (String) request.getParameter("Email"); String address = (String) request.getParameter("Address"); String[] temp = request.getParameterValues("Hobbies"); String hobbies = Arrays.deepToString(temp); hobbies = hobbies.substring(1, hobbies.length() - 1); String description = (String) request.getParameter("Description"); Person person = new Person(0, firstName, lastName, gender, phoneNumber, email, address, hobbies, description); request.setAttribute("person", person); try { PersonUtils.insertPerson(person); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } response.sendRedirect(request.getContextPath() + "/ListPerson"); } }
[ "danganhdung1298@gmail.com" ]
danganhdung1298@gmail.com
bb8b0158088662229ba8a1fc5fb288789206b2a7
9040cd9b31643997b8836f3a4ee315d5fcb9617f
/src/main/java/org/cloudifysource/cloudformation/converter/api/json/Lifecycle.java
9ebe37d4d34f61e436dcfdb951e94fd01d2357df
[]
no_license
fastconnect/json-recipe-converter
5b33fe513a6ed40a1dcfa9b4dae43124f90d59b4
a5dbafb73f589022b6397f07414ce4f6d3af7216
refs/heads/master
2021-01-18T09:17:13.712374
2013-10-30T11:08:15
2013-10-30T11:08:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,783
java
/******************************************************************************* * Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. ******************************************************************************/ package org.cloudifysource.cloudformation.converter.api.json; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.cloudifysource.cloudformation.converter.api.json.filetype.ScriptType; import org.codehaus.jackson.annotate.JsonProperty; /** * Bean which represents the Lifecycle's node. * * @author victor * @since 2.7.0 */ public class Lifecycle { @JsonProperty("postStart") private ScriptType postStart; @JsonProperty("preStop") private ScriptType preStop; @JsonProperty("stop") private ScriptType stop; @JsonProperty("postStop") private ScriptType postStop; public ScriptType getPostStart() { return postStart; } public ScriptType getPreStop() { return preStop; } public ScriptType getStop() { return stop; } public ScriptType getPostStop() { return postStop; } @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); } }
[ "victor@fastconnect.fr" ]
victor@fastconnect.fr
012ac269893b798064c000154241247e2e3a01c4
4b9a05af7a67644c8529632bae51dc84c03654ec
/app/src/main/java/com/idolmedia/yzy/ui/activity/WelcomeActivity.java
be547d8c2775ec6e395bd4bec3a20f18bcadec29
[]
no_license
13041230559/yzy_master
cbaa5eed33e34d23a2709c992779a469c37683dc
26ba12de3c565859c1ffc58c316ec68c422bd4a9
refs/heads/master
2020-03-06T21:10:39.941124
2018-03-28T02:39:08
2018-03-28T02:39:08
127,071,792
0
0
null
null
null
null
UTF-8
Java
false
false
3,128
java
package com.idolmedia.yzy.ui.activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.idolmedia.yzy.MainActivity; import com.idolmedia.yzy.R; import com.idolmedia.yzy.utlis.SharedUtil; import com.mumu.common.base.BaseActivity; import com.mumu.common.widget.StatusBarCompat; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; /** * 项目名称:com.idolmedia.yzy.ui.activity * 创建人:JOKER.WANG * 创建时间:2017/12/12 10:36 * 描述: 引导页 */ public class WelcomeActivity extends BaseActivity { @BindView(R.id.view_page) ViewPager viewPage; private List<View> viewList = new ArrayList<View>(); PageAdapter pageAdapter; @Override public int getLayoutId() { return R.layout.activity_welcome; } @Override public void initPresenter() { } @Override public void initView() { StatusBarCompat.translucentStatusBar(this); LayoutInflater inflater = LayoutInflater.from(this); viewList.add(inflater.inflate(R.layout.w1,null)); viewList.add(inflater.inflate(R.layout.w2,null)); viewList.add(inflater.inflate(R.layout.w3,null)); viewList.add(inflater.inflate(R.layout.w4,null)); viewList.add(inflater.inflate(R.layout.w5,null)); viewList.get(viewList.size()-1).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SharedUtil.setBoolean("WelcomeActivity",true); Intent intent=new Intent(WelcomeActivity.this, MainActivity.class); startActivity(intent); finish(); } }); pageAdapter=new PageAdapter(); viewPage.setAdapter(pageAdapter); // viewPage.setPageTransformer(true, new DepthPageTransformer()); viewPage.setOffscreenPageLimit(viewList.size());// 加载缓存的页面个数 } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TODO: add setContentView(...) invocation ButterKnife.bind(this); } class PageAdapter extends PagerAdapter { @Override public int getCount() { return viewList.size(); } // 销毁某个元素时候调用 @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView(viewList.get(position)); } // 更新视图 @Override public Object instantiateItem(ViewGroup container, int position) { container.addView(viewList.get(position)); return viewList.get(position); } // 判断是否是生成的对象 @Override public boolean isViewFromObject(View view, Object object) { return view == object; } } }
[ "604293733@qq.com" ]
604293733@qq.com
e798e2c9331d27a5af5df23a71d275f78e8c5973
d5ef9cc4f2b088ba7ce3ba539bd72e7f0a490b64
/PRÁCTICA 2/opcional/src/alumnos/Profesor.java
077c7d43b9de03e9c90f3af0b634d1765d79ac39
[]
no_license
lucicolpe/ADSOFT
4e09fce9e6fb6642fad68286f18b7df4e3fda5cb
f86e61ff20da03e110a4a34d61a651f67fd179ac
refs/heads/master
2021-04-27T21:01:44.716992
2018-02-21T20:54:29
2018-02-21T20:54:29
122,392,293
0
0
null
null
null
null
UTF-8
Java
false
false
4,208
java
package eps.uam.ads.p2.alumnos; import eps.uam.ads.p2.autoescuela.Actividad; import eps.uam.ads.p2.autoescuela.Autoescuela; import eps.uam.ads.p2.autoescuela.ClasePractica; /** * Contiene los atributos y métodos de la clase Profesor * * @author Miguel García Moya y Lucía Colmenarejo * */ public class Profesor extends Persona { private int seguridaSocial; private int antiguedad; private int sueldoMin; private Actividad[] actividades; private int numActividades; private ClasePractica[] clases; private int numClasesPracticas; public Profesor(int dni, String nombre, String apellidos, int telefono, int seguridaSocial, int antiguedad, int sueldoMin) { this.setDni(dni); this.setNombre(nombre); this.setApellidos(apellidos); this.setTelefono(telefono); this.seguridaSocial = seguridaSocial; this.antiguedad = antiguedad; this.sueldoMin = sueldoMin; this.actividades = new Actividad[10]; this.numActividades = 0; this.clases = new ClasePractica[20]; this.numClasesPracticas = 0; } /** * Devuelve el n. de seguridad social. * * Este método devuelve el n. de seguridad social del profesor sobre el que se aplica. * * @return N. de seguridad social del profesor. */ public int getSeguridaSocial() { return seguridaSocial; } /** * Cambia el n. de seg. social. * * Este método cambia el n. de seg. social del profesor sobre el que se aplica. * * @param N. de seg. social del profesor. */ public void setSeguridaSocial(int seguridaSocial) { this.seguridaSocial = seguridaSocial; } /** * Devuelve la antigüedad. * * Este método devuelve la antigüedad del profesor sobre el que se aplica. * * @return Antigüedad del profesor. */ public int getAntiguedad() { return antiguedad; } /** * Cambia la antigüedad. * * Este método cambia la antigüedad del profesor sobre el que se aplica. * * @param Antigüedad del profesor. */ public void setAntiguedad(int antiguedad) { this.antiguedad = antiguedad; } /** * Devuelve el sueldo mínimo. * * Este método devuelve el sueldo mínimo del profesor sobre el que se aplica. * * @return Sueldo mínimo del profesor. */ public int getSueldoMin() { return sueldoMin; } /** * Cambia el sueldo mínimo. * * Este método cambia el sueldo mínimo del profesor sobre el que se aplica. * * @param Sueldo mínimo del profesor. */ public void setSueldoMin(int sueldoMin) { this.sueldoMin = sueldoMin; } /** * Cambia la autoescuela. * * Este método cambia la autoescuela del profesor sobre el que se aplica. * * @param Autoescuela del profesor. * @param Fecha del cambio. */ public void cambiarAutoescuela(Autoescuela autoescuela, Fecha fecha) { if(this.numActividades != 0) { (this.actividades[this.numActividades-1]).setFechaFinActividad(fecha); } this.actividades[this.numActividades] = new Actividad(autoescuela, fecha); this.numActividades++; } /** * Añade una clase. * * Este método añade una clase al profesor sobre el que se aplica. * * @param Clase a añadir. */ public void añadirClase(ClasePractica clase) { this.clases[this.numClasesPracticas] = clase; this.numActividades = this.numActividades + 1; } /** * Devuelve el sueldo. * * Este método calcula y devuelve el sueldo del profesor sobre el que se aplica. * * @return Sueldo del profesor. */ public int obtenerSueldoProfesor() { return this.sueldoMin + 20*this.numClasesPracticas; } /** * Devuelve el n. de clases prácticas. * * Este método devuelve el n. de clases prácticas del profesor sobre el que se aplica. * * @return N. de clases prácticas del profesor. */ public int numeroClasesPracticas() { return this.numClasesPracticas; } /** * Devuelve la actividad de un profesor en una autoescuela. * * Este método devuelve la actividad del profesor sobre el que se aplica en una autoescuela. * * @param Autoescuela. * @return Actividad del profesor en la autoescuela. */ public Actividad obtenerActividadEnAutoescuela(Autoescuela a) { for(int i = 0; i < this.numActividades; i++) { if(this.actividades[i].getAutoescuela() == a) { return this.actividades[i]; } } return null; } }
[ "lucia.colmenarejo@estudiante.uam.es" ]
lucia.colmenarejo@estudiante.uam.es
95180ef527cea1084b1dc992570e4f5a80f5aaa9
6390821be997352fe3e1c7c27cb26971e2c3d38f
/app/src/main/java/com/enachescurobert/googlemaps2019/util/MyClusterManagerRenderer.java
306f8bb21ee6a7c733003936dd16efbee27a0132
[]
no_license
enachescurobert/Licenta-GoogleMaps
7080e19f497ee7d8109bea4d771619f27b52722f
1d4aad77ce478e67d56a4e7bc80507a9cdcdebd2
refs/heads/master
2020-05-26T13:05:38.963263
2020-02-18T20:55:07
2020-02-18T20:55:07
188,241,321
0
0
null
2020-02-18T20:55:08
2019-05-23T13:38:07
Java
UTF-8
Java
false
false
3,626
java
package com.enachescurobert.googlemaps2019.util; import android.content.Context; import android.graphics.Bitmap; import android.view.ViewGroup; import android.widget.ImageView; import com.enachescurobert.googlemaps2019.R; import com.enachescurobert.googlemaps2019.models.ClusterMarker; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.maps.android.clustering.Cluster; import com.google.maps.android.clustering.ClusterManager; import com.google.maps.android.clustering.view.DefaultClusterRenderer; import com.google.maps.android.ui.IconGenerator; public class MyClusterManagerRenderer extends DefaultClusterRenderer<ClusterMarker> { private final IconGenerator iconGenerator; private final ImageView imageView; private final int markerWidth; private final int markerHeight; // GoogleMap map; // private float currentZoomLevel, maxZoomLevel; //public MyClusterManagerRenderer(Context context, GoogleMap map, ClusterManager<ClusterMarker> clusterManager, IconGenerator iconGenerator, ImageView imageView, int markerWidth, int markerHeight) { public MyClusterManagerRenderer(Context context, GoogleMap map, ClusterManager<ClusterMarker> clusterManager) { super(context, map, clusterManager); // this.iconGenerator = iconGenerator; // this.imageView = imageView; // this.markerWidth = markerWidth; // this.markerHeight = markerHeight; iconGenerator = new IconGenerator(context.getApplicationContext()); imageView = new ImageView(context.getApplicationContext()); markerWidth = (int) context.getResources().getDimension(R.dimen.custom_marker_image); markerHeight = (int) context.getResources().getDimension(R.dimen.custom_marker_image); imageView.setLayoutParams(new ViewGroup.LayoutParams(markerWidth, markerHeight)); int padding = (int) context.getResources().getDimension(R.dimen.custom_marker_padding); imageView.setPadding(padding, padding, padding, padding); iconGenerator.setContentView(imageView); } @Override protected void onBeforeClusterItemRendered(ClusterMarker item, MarkerOptions markerOptions) { imageView.setImageResource(item.getIconPicture()); Bitmap icon = iconGenerator.makeIcon(); markerOptions.icon(BitmapDescriptorFactory.fromBitmap(icon)).title(item.getTitle()); } @Override protected boolean shouldRenderAsCluster(Cluster<ClusterMarker> cluster) { return false; //return true; //return cluster.getSize() > 2; // float zoomLevel = (float) 18.0; // float zoom = map.getCameraPosition().zoom; // float currentZoom = map.getCameraPosition().zoom; // float currentMaxZoom = map.getMaxZoomLevel(); // // return currentZoom < currentMaxZoom && cluster.getSize() > 1; // if(cluster.getSize() > 1 && currentZoom < currentMaxZoom) { // return true; // } else { // return false; // } } //This is the method we will use to actually update the position of the markers on the map /** * Update the GPS coordinate of a ClusterItem * @param clusterMarker */ public void setUpdateMarker(ClusterMarker clusterMarker) { Marker marker = getMarker(clusterMarker); if (marker != null) { marker.setPosition(clusterMarker.getPosition()); } } }
[ "Robert.Enachescu@hogarthww.com" ]
Robert.Enachescu@hogarthww.com
e035485dc1529b79f4446472d07c443e41452039
e34b493b98dce3d89b0db6d115be51ce83058959
/src/main/java/com/group_finity/mascot/win/jna/User32.java
43ce196eff5cd411b1c3f572cdf0e9143b2f9409
[ "Apache-2.0" ]
permissive
a1098832322/shimeji
e7911b5c33986fd278baa597147933c1aba0eafe
882286a31fcba6fd6e2ef7c0904a030bb988a1d0
refs/heads/master
2023-07-29T09:46:00.909020
2022-09-05T06:52:55
2022-09-05T06:52:55
156,833,567
85
16
Apache-2.0
2023-07-13T17:03:29
2018-11-09T08:36:58
Java
UTF-8
Java
false
false
1,975
java
package com.group_finity.mascot.win.jna; import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.win32.StdCallLibrary; /** * Original Author: Yuki Yamada of Group Finity (http://www.group-finity.com/Shimeji/) * Currently developed by Shimeji-ee Group. */ public interface User32 extends StdCallLibrary{ User32 INSTANCE = (User32) Native.loadLibrary("User32", User32.class); int SM_CXSCREEN = 0; int SM_CYSCREEN = 1; int GetSystemMetrics(int nIndex); int SPI_GETWORKAREA = 48; int SystemParametersInfoW(int uiAction, int uiParam, RECT pvParam, int fWinIni); Pointer GetForegroundWindow(); int GW_HWNDFIRST = 0; int GW_HWNDNEXT = 2; Pointer GetWindow(Pointer hWnd, int uCmd); int IsWindow(Pointer hWnd); int IsWindowVisible(Pointer hWnd); int GWL_STYLE = -16; int GWL_EXSTYLE = -20; int GetWindowLongW(Pointer hWnd, int nIndex); int SetWindowLongW(Pointer hWnd, int nIndex, int dwNewLong); int WS_MAXIMIZE = 0x01000000; int WS_EX_LAYERED = 0x00080000; int IsIconic(Pointer hWnd); int GetWindowTextW(Pointer hWnd, char[] lpString, int nMaxCount); int GetClassNameW(Pointer hWnd, char[] lpString, int nMaxCount); int GetWindowRect(Pointer hWnd, RECT lpRect); int ERROR = 0; int GetWindowRgn(Pointer hWnd, Pointer hRgn); int MoveWindow(Pointer hWnd, int X, int Y, int nWidth, int nHeight, int bRepaint); int BringWindowToTop(Pointer hWnd); Pointer GetDC(Pointer hWnd); int ReleaseDC(Pointer hWnd, Pointer hDC); int ULW_ALPHA = 2; int UpdateLayeredWindow(Pointer hWnd, Pointer hdcDst, POINT pptDst, SIZE psize, Pointer hdcSrc, POINT pptSrc, int crKey, BLENDFUNCTION pblend, int dwFlags); interface WNDENUMPROC extends StdCallCallback { /** Return whether to continue enumeration. */ boolean callback(Pointer hWnd, Pointer arg); } boolean EnumWindows(WNDENUMPROC lpEnumFunc, Pointer arg); }
[ "1098832322@qq.com" ]
1098832322@qq.com
16fa0739fe5e4762304c5349afa9292dbac60daf
0a04ae5d108d1c8e8e0cd1db886ee25508f60cfd
/SillyChildMerchant/app/src/main/java/com/yinglan/scm/constant/URLConstants.java
eecddcdcbf9a73cc012ba957392f3071e03b6b59
[ "Apache-2.0" ]
permissive
921668753/SillyChildMerchant-Android
fdb376da9320a3349fe0b10e0584430bab638194
5285935dbfed1d4f2fb08bda99337377bc4910d1
refs/heads/master
2021-08-08T14:58:01.228053
2018-09-30T12:00:23
2018-09-30T12:00:23
132,315,538
1
0
null
null
null
null
UTF-8
Java
false
false
6,938
java
package com.yinglan.scm.constant; /** * 用于存放url常量的类 * Created by ruitu ck on 2016/9/14. */ public class URLConstants { /** * 正式服务器地址URL */ // public static String SERVERURL = "http://user.api.shahaizi.shop/"; // public static String SERVERURLBUS = "http://business.api.shahaizi.shop/"; // public static String SERVERURLADMIN = "http://admin.shahaizi.shop/"; /** * 测试服务器地址URL */ // public static String SERVERURL = "http://192.168.1.247:8080/"; public static String SERVERURL = "http://store.api.shahaizhi.com/"; public static String SERVERURL1 = "http://www.shahaizhi.tech/"; /** * 请求地址URL */ public static String APIURL = SERVERURL + "api/seller/"; /** * 获取七牛云key-ok */ public static String QINIUKEY = SERVERURL + "api/public/key/qiniu.do"; /** * 应用配置参数 */ public static String APPCONFIG = APIURL + "appConfig"; /** * 根据融云token获取头像性别昵称 */ public static String SYSRONGCLOUD = APIURL + "sys/rongCloud.do"; /** * 置换Token get请求 */ public static String REFRESHTOKEN = APIURL + "m=Api&c=User&a=flashToken"; /** * 登录 */ public static String USERLOGIN = APIURL + "sys/login.do"; /** * 获取会员登录状态 */ public static String ISLOGIN = APIURL + "sys/islogin.do"; /** * 退出登录 */ public static String LOGOUT = APIURL + "sys/exit.do"; /** * 第三方登录 */ public static String USERTHIRDLOGIN = APIURL + "sys/third.do"; /** * 获取第三方登录验证码 */ public static String THIRDCODE = APIURL + "sys/thirdCode.do"; /** * 短信验证码【手机号注册】 * 验证码类型 reg=注册 resetpwd=找回密码 login=登陆 bind=绑定手机号. */ public static String SENDREGISTER = APIURL + "sys/code.do"; /** * 短信验证码【找回、修改密码】 * 验证码类型 reg=注册 resetpwd=找回密码 login=登陆 bind=绑定手机号. */ public static String SENDFINFDCODE = APIURL + "sys/find.do"; /** * 用户注册 */ public static String REGISTER = APIURL + "sys/regist.do"; /** * 用户注册协议 */ public static String REGISTPROTOOL = SERVERURL1 + "dist/pages/registProtocol.html"; /** * 更改密码【手机】 */ public static String USERRESTPWD = APIURL + "sys/edit.do"; /** * 申请成为店长 */ public static String HOMEPAGE = APIURL + "member/post.do"; /** * 重新申请成为店长 */ public static String REHOMEPAGE = APIURL + "member/rePost.do"; /** * 获取系统消息首页 */ public static String NEWLISTBUYTITLE = APIURL + "news/listByTitle.do"; /** * 获取消息列表 */ public static String NEWTITLE = APIURL + "news/title.do"; /** * 选中某条消息并设为已读 */ public static String NEWSELECT = APIURL + "news/select.do"; /** * 获取订单信息列表 */ public static String ORDERLIST = APIURL + "order/list.do"; /** * 获取快递公司接口 */ public static String ORDERLOGIS = APIURL + "order/logis.do"; /** * 确认发货 */ public static String ORDERSHIP = APIURL + "order/ship.do"; /** * 获取物流详情 */ public static String ORDERLOGISTICS = SERVERURL1 + "html/order_logistics.html?orderid="; /** * 查看评价 */ public static String ORDERRATE = APIURL + "order/rate.do"; /** * 售后详情 */ public static String SELLBACKDETAIL = APIURL + "order/sellBack/detail.do"; /** * 订单售后 */ public static String ORDERBACK = APIURL + "order/back.do"; /** * 获取订单详情 */ public static String ORDERDETAIL = APIURL + "order/detail.do"; /** * 批量填写快递单信息 */ public static String ORDERSHOPNO = APIURL + "order/shopNo.do"; /** * 获取商家店铺信息 */ public static String STOREINFO = APIURL + "member/store/get.do"; /** * 修改个人信息 */ public static String MEMBEREDIT = APIURL + "member/edit.do"; /** * 获取个人信息 */ public static String MEMBERINFO = APIURL + "member/get.do"; /** * 获取商品分类列表 */ public static String GOODSTYPE = APIURL + "goods/types.do"; /** * 获取品牌列表 */ public static String GOODSBRANDS = APIURL + "goods/brands.do"; /** * 获取商品分类参数列表 */ public static String GOODSPARAMS = APIURL + "goods/params.do"; /** * 获取商品列表 */ public static String GOODLIST = APIURL + "goods/list.do"; /** * 商品上下架 */ public static String GOODUPANDDOWN = APIURL + "goods/upAndDown.do"; /** * 获取商品详情 */ public static String GOODGET = APIURL + "goods/get.do"; /** * 新增修改商品 */ public static String GOODADDANDEDIT = APIURL + "goods/addAndEdit.do"; /** * 获取钱包余额 */ public static String PURSEGET = APIURL + "purse/get.do"; /** * 获取账户钱包明细 */ public static String PURSEDETAIL = APIURL + "purse/detail.do"; /** * 提现 */ public static String PURSECASH = APIURL + "purse/cash.do"; /** * 银行卡列表 */ public static String PURSELIST = APIURL + "purse/list.do"; /** * 银行卡列表 */ public static String PURSEBANK = APIURL + "purse/banks.do"; /** * 删除银行卡 */ public static String PURSEREMOVE = APIURL + "purse/remove.do"; /** * 设置默认银行卡 */ public static String PURSEDEFAULT = APIURL + "purse/default.do"; /** * 添加银行卡(可添加支付宝账号) */ public static String PURSEADD = APIURL + "purse/add.do"; /** * 提交意见反馈 */ public static String ADVICEPOST = APIURL + "advice/post.do"; /** * 关于我们 */ public static String ABOUTUS = SERVERURL1 + "dist/pages/about_us.html"; /** * 帮助中心 */ public static String HELP = SERVERURL1 + "dist/pages/help.html"; /** * 帮助中心详情 */ public static String HELPDETAIL = SERVERURL1 + "dist/pages/helpDetal.html"; /** * 分享有礼 */ public static String SHARE = SERVERURL1 + "html/share.html?icode="; /** * 分享有礼分享网址 */ public static String REGISTERHTML = SERVERURL1 + "html/login.html?icode="; /** * 傻孩子学院 */ public static String COLLEGE = SERVERURL1 + "dist/pages/college.html"; }
[ "921668753@qq.com" ]
921668753@qq.com
76f23dc42c9bf7521f047ebff21a4730ed30802d
cad76c1ef464458f7daa269159bb70c03ef62f6f
/src/main/java/com/dawn/pojo/User.java
c1bd5dafbdcc4be60f5250e666a356bd4aa33144
[]
no_license
chenyuvip/tgwl-xd
2e41ae20fe7ab73feaf8d621e282074b4d80e665
631c573bad5a361a73f6faeec7c4b6f937398c35
refs/heads/master
2021-01-19T17:45:17.398194
2017-04-15T11:48:20
2017-04-15T11:48:20
88,341,205
0
0
null
null
null
null
UTF-8
Java
false
false
679
java
package com.dawn.pojo; public class User { private String username; private String password; private String roleid; public String getUsername() { return username; } public void setUsername(String username) { this.username = username == null ? null : username.trim(); } public String getPassword() { return password; } public void setPassword(String password) { this.password = password == null ? null : password.trim(); } public String getRoleid() { return roleid; } public void setRoleid(String roleid) { this.roleid = roleid == null ? null : roleid.trim(); } }
[ "m18502793390@icloud.com" ]
m18502793390@icloud.com
4dc5fb6da936681c0cf6037985b59af856dbbffb
8404fee8ac870d0e98765bdefebcb1deb7728dbb
/app/src/main/java/com/sand_corporation/www/uthaopartner/RoomDataBase/Table/ScannedRegPaperTable/RegPaperDao.java
03b4ab6ecee5b5c68d03888bb46ff7c59703c406
[]
no_license
mujahid7292/Rider
ff1044ae51211ba3f9906249bba57e201441ddb0
b3cf9d3cc1ff3aa5df2a98fd5adc6968712bac1e
refs/heads/master
2020-03-28T05:48:03.007631
2018-09-07T09:07:01
2018-09-07T09:07:14
147,795,205
0
0
null
null
null
null
UTF-8
Java
false
false
615
java
package com.sand_corporation.www.uthaopartner.RoomDataBase.Table.ScannedRegPaperTable; import android.arch.lifecycle.LiveData; import android.arch.persistence.room.Dao; import android.arch.persistence.room.Insert; import android.arch.persistence.room.OnConflictStrategy; import android.arch.persistence.room.Query; /** * Created by HP on 2/27/2018. */ @Dao public interface RegPaperDao { @Query("select * from RegPaper where :driverUid = :driverUid") LiveData<RegPaper> loadRegPaper(String driverUid); @Insert(onConflict = OnConflictStrategy.REPLACE) long insertRegPaper(RegPaper regPaper); }
[ "mujahid7292@gmail.com" ]
mujahid7292@gmail.com
f573aac96a3ac256592996a4a618b165f2fac422
3b67441dda891371bae565b5914c5742b7e2dc84
/pet-clinic-data/src/main/java/guru/springframework/sfgpetclinic/services/OwnerService.java
0086ac790469425ffd61c1d8048b76e051dafbf0
[]
no_license
edsonjdl/sfg-pet-clinic
37f6342ac357f0a0b6246dd38aefd9b092b7c7d8
d490ade507e7ea69553300156930363a00ee15b7
refs/heads/master
2022-11-07T19:06:50.954601
2020-06-19T15:02:16
2020-06-19T15:02:16
272,539,349
0
0
null
null
null
null
UTF-8
Java
false
false
275
java
package guru.springframework.sfgpetclinic.services; import org.springframework.stereotype.Service; import guru.springframework.sfgpetclinic.model.Owner; @Service public interface OwnerService extends CrudService<Owner, Long>{ Owner findByLastName(String lastName); }
[ "edsonjl@hotmail.com" ]
edsonjl@hotmail.com
508f64df9a4268f4af48a9dbb77237c4393bed15
e8e1793c50fbe0d9811e50f34466860edaedf096
/com.br_automation.buoat.xddeditor.edit/src/com/br_automation/buoat/xddeditor/XDD/provider/LEDstateRefTypeItemProvider.java
a799d8b11a1834283a45f830c2197b5dde1503d7
[]
no_license
Kalycito-open-automation/openCONFIGURATOR_XDD_editor
c502ba840ad13f49fdd1d4c708c15d19fb907dd6
86d207e36d6c45961ca0e3fe63df9d66b1f1a158
refs/heads/master
2021-01-02T15:38:53.853205
2016-12-02T08:00:53
2017-04-04T13:38:53
99,305,792
0
0
null
2017-08-04T05:19:31
2017-08-04T05:19:31
null
UTF-8
Java
false
false
5,318
java
/** */ package com.br_automation.buoat.xddeditor.XDD.provider; import com.br_automation.buoat.xddeditor.XDD.LEDstateRefType; import com.br_automation.buoat.xddeditor.XDD.XDDPackage; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a * {@link com.br_automation.buoat.xddeditor.XDD.LEDstateRefType} object. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ public class LEDstateRefTypeItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ public LEDstateRefTypeItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addStateIDRefPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the State ID Ref feature. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected void addStateIDRefPropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_LEDstateRefType_stateIDRef_feature"), getString( "_UI_PropertyDescriptor_description", "_UI_LEDstateRefType_stateIDRef_feature", "_UI_LEDstateRefType_type"), XDDPackage.eINSTANCE.getLEDstateRefType_StateIDRef(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This returns LEDstateRefType.gif. <!-- begin-user-doc --> <!-- * end-user-doc --> * * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/LEDstateRefType")); } /** * This returns the label text for the adapted class. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @generated */ @Override public String getText(Object object) { String label = ((LEDstateRefType) object).getStateIDRef(); return label == null || label.length() == 0 ? getString("_UI_LEDstateRefType_type") : getString("_UI_LEDstateRefType_type") + " " + label; } /** * This handles model notifications by calling {@link #updateChildren} to * update any cached children and by creating a viewer notification, which * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- * end-user-doc --> * * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(LEDstateRefType.class)) { case XDDPackage.LE_DSTATE_REF_TYPE__STATE_ID_REF: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s * describing the children that can be created under this object. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } /** * Return the resource locator for this item provider's resources. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public ResourceLocator getResourceLocator() { return XDDEditPlugin.INSTANCE; } }
[ "joris.lueckenga@br-automation.com" ]
joris.lueckenga@br-automation.com
0b55485ea735d88147def74245e5ae0a44015818
7ea11b0c1a7ce09025323b8c663debe18e1d72b6
/src/单双链表/SortedCirDoublyList.java
649d01ecb7a3a4ce62e3b84a9954ded7c4886f73
[]
no_license
weizai666/CARD_24
2a160de3bf98aaf2cc52a541aa67510fb9e22aa9
6dda407b1f0588016bd5c123f39bd45aa631bc00
refs/heads/master
2020-12-15T11:04:10.481434
2020-01-20T11:13:43
2020-01-20T11:13:43
231,724,893
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package 单双链表; public class SortedCirDoublyList<T extends Comparable<? super T>> extends CirDoublyList<T> { public DoubleNode<T>insert(T x) { if(this.isEmpty()||x.compareTo(this.head.prev.data)>0) return super.insert(x); DoubleNode<T>p=this.head.next; while(p!=head&&x.compareTo(p.data)>0) p=p.next; DoubleNode<T>q=new DoubleNode<T>(x,p.prev,p); p.prev.next=q; p.prev=q; return q; } }
[ "1025941300@qq.com" ]
1025941300@qq.com
5baf8a75bc5581914f9235a5be1ea7409ca7a48b
9eec8574e953598429d4562055b1957b2d5583c5
/jfluentvalidation-core/src/test/java/jfluentvalidation/validators/rulefor/localtime/IsAfterOrEqualToLocalTimeTest.java
2fe1dacc4b35a7e1d69fc9c041067b5443e26d21
[ "MIT" ]
permissive
seancarroll/jfluentvalidation
f9e04753931af90da775e6a4ecc0e3312f91cc1c
67f581aa50b1efa52a461345982856503b04e987
refs/heads/master
2023-06-22T00:27:58.078302
2020-08-27T02:43:10
2020-08-27T02:43:10
146,148,457
2
1
MIT
2023-06-20T16:05:52
2018-08-26T03:32:04
Java
UTF-8
Java
false
false
2,471
java
package jfluentvalidation.validators.rulefor.localtime; import jfluentvalidation.ValidationResult; import jfluentvalidation.validators.DefaultValidator; import org.junit.jupiter.api.Test; import java.time.LocalTime; import java.time.ZonedDateTime; import static jfluentvalidation.TimeZones.TZ_CHICAGO; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; class IsAfterOrEqualToLocalTimeTest extends AbstractLocalTimeTest { IsAfterOrEqualToLocalTimeTest() { super(ZonedDateTime.of( 2019, 6, 15, 8, 0, 0, 0, TZ_CHICAGO)); } @Test void shouldNotReturnFailureWhenActualEqualsGivenDate() { Target t = new Target(reference); DefaultValidator<Target> validator = getValidator(); validator.ruleForLocalTime(Target::getTime).isAfterOrEqualTo(reference); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldNotReturnFailureWhenActualDateIsAfterGivenDate() { Target t = new Target(reference); DefaultValidator<Target> validator = getValidator(); validator.ruleForLocalTime(Target::getTime).isAfterOrEqualTo(before); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldNotReturnFailureWhenActualIsNull() { Target t = new Target(null); DefaultValidator<Target> validator = getValidator(); validator.ruleForLocalTime(Target::getTime).isAfterOrEqualTo(LocalTime.now()); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldReturnFailureWhenActualIsNotStrictlyAfterGivenDate() { Target t = new Target(reference); DefaultValidator<Target> validator = getValidator(); validator.ruleForLocalTime(Target::getTime).isAfterOrEqualTo(after); ValidationResult validationResult = validator.validate(t); assertFalse(validationResult.isValid()); } @Test void shouldThrowExceptionWhenGivenDateIsNull() { DefaultValidator<Target> validator = getValidator(); assertThrows(NullPointerException.class, () -> validator.ruleForLocalTime(Target::getTime).isAfterOrEqualTo(null)); } }
[ "seanc28@gmail.com" ]
seanc28@gmail.com
67212e2c4690e99d3e57d2841595a5a9b0b4a73e
57e336ee001e59a350c919877d79886b2af8f2ef
/app/src/main/java/com/gsatechworld/spexkart/adapter/HomeBannerAdapter.java
c1e10769a7a10dee638b93f00d5749d26c418005
[]
no_license
dprasad554/Spexkart
e3588d516cbc92aa0a2050e239c08b23612902ae
e964d0bd8d699eadd7495a8e3811da426adc9c21
refs/heads/master
2023-04-20T00:25:27.455758
2021-05-03T09:04:05
2021-05-03T09:04:05
363,872,584
0
0
null
null
null
null
UTF-8
Java
false
false
1,796
java
package com.gsatechworld.spexkart.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import androidx.annotation.NonNull; import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; import com.gsatechworld.spexkart.R; import java.util.ArrayList; public class HomeBannerAdapter extends PagerAdapter { private Context context; private LayoutInflater layoutInflater; ArrayList<Integer> iplImages; //Constructor Created public HomeBannerAdapter(Context context, ArrayList<Integer> iplImages) { this.context = context; layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.iplImages = iplImages; } @Override public int getCount() { return iplImages.size(); } @Override public boolean isViewFromObject(@NonNull View view, @NonNull Object object) { return view == ((View)object); //object parameter } @NonNull @Override public Object instantiateItem(@NonNull ViewGroup container, final int position) { View itemView = layoutInflater.inflate(R.layout.adapter_home_banner,container, false); ImageView imageView = (ImageView)itemView.findViewById(R.id.iv_category); imageView.setImageResource(iplImages.get(position)); container.addView(itemView,0); return itemView; } @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { //container.removeView((View) object); ViewPager viewPager = (ViewPager)container; View view = (View)object; viewPager.removeView(view); } }
[ "rohitkumar.kr92@gmail.com" ]
rohitkumar.kr92@gmail.com
437326cdaaafc42ef3df1dd96d0f895af8c40b24
86db07a13949b55e1348913293bdb3f06af70618
/core-app/src/main/java/com/revature/model/StudentQuiz.java
cbcc3a33b6ae8506fc7524f19b3c1d1f084594f6
[]
no_license
AiswaryaRavi/SampleLeaderBoard
632d2e3932d53cd5397f5cbecceaaa3aa088d909
c655a6c7d5a3cea70a077791d1af9d9801a9c6f6
refs/heads/master
2021-01-20T13:03:49.346083
2017-03-14T14:06:43
2017-03-14T14:06:43
82,675,317
0
0
null
null
null
null
UTF-8
Java
false
false
1,106
java
package com.revature.model; import java.sql.Time; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; //import javax.persistence.Temporal; //import javax.persistence.TemporalType; import lombok.Data; @Data @Entity @Table(name = "student_quizes") public class StudentQuiz { private StudentQuiz(){ } @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; @ManyToOne @JoinColumn(name = "STUDENT_ID",nullable=false) private Student student; @ManyToOne @JoinColumn(name = "QUIZ_ID",nullable=false) private Quiz quiz; @Column(name = "STARTED_ON") //@Temporal(TemporalType.TIME) private Time startedOn; @Column(name = "COMPLETED_ON") //@Temporal(TemporalType.TIME) private Time completedOn; @Column(nullable=false) private Integer score; @ManyToOne @JoinColumn(name = "STATUS_ID") private SeedStatus statusId; }
[ "aiswaryaravindran240@gmail.com" ]
aiswaryaravindran240@gmail.com
759cc300bd7c085ff23b59e3bf259b3990a23c51
77ee12545c738bacdd823ec894a2b544976c4304
/src/screenShot/Selenium/Alerts.java
5c7eae93b6e549aab6cb4d72a1f6f8479a5facef
[]
no_license
jayanthan03/Project9AM
e00c2cc827f6424ae07ef1dbefba2c7d078dafbd
cc25e750e937a235143f79341e0d465c30d18975
refs/heads/master
2020-12-07T13:55:13.959526
2020-01-09T06:20:31
2020-01-09T06:20:31
232,733,047
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package screenShot.Selenium; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Alerts { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\\Users\\Jayanthan\\eclipse-workspace\\Selenium\\driver\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("http://demo.automationtesting.in/Alerts.html"); driver.manage().window().maximize(); driver.findElement(By.xpath("//button[@onclick='alertbox()']")).click(); Alert ai=driver.switchTo().alert(); ai.accept(); driver.quit(); } }
[ "jayanthan03@gmail.com" ]
jayanthan03@gmail.com
b9278ea5b73be9b573fc87ccf7cfa03702b82a42
b5ec3357ac1321af5810fb72ee63c6163b06bf22
/1.JavaSyntax/src/javarush/tasks/task07/task0707/Solution.java
c071ec6f766841f37fdd7b92652ba4207dbbb177
[]
no_license
miau-miau777/JavaRushHomeTasks
2aa36d1c40edb4157213d1c3f11104dddf228c2d
457fec5569eeb26d45c4cc7ad93057fc868250bf
refs/heads/master
2020-08-14T22:31:59.899041
2019-10-15T08:02:16
2019-10-15T08:02:16
215,241,221
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
package javarush.tasks.task07.task0707; import java.util.ArrayList; /* Что за список такой? */ public class Solution { public static void main(String[] args) { ArrayList<String> list = new ArrayList<>(); list.add("One"); list.add("Two"); list.add("Three"); list.add("Four"); list.add("Five"); System.out.println(list.size()); for(int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); } } }
[ "tatianakelba@ukr.net" ]
tatianakelba@ukr.net
c72f4e900712ea2c4abb453a28bf30ef40ba1d69
7611c20b36bac5382c6fef7d8efc214a4e2c7d5d
/mgbxAD/src/main/java/com/zinsupark/security/AjaxSessionTimeoutFilter.java
2ab11d755ea09c7278353440558bc11c648ea795
[]
no_license
DongChul-Joo/megaboxuzinAD
f7c4ca8adfebc06eb749d2e7d32d25d507622591
40374c4ad6f5b4da6c92a4df9c853aee4e22b9a0
refs/heads/master
2022-12-25T04:59:45.479025
2020-01-17T09:32:31
2020-01-17T09:32:31
227,055,136
0
0
null
null
null
null
UTF-8
Java
false
false
2,263
java
package com.zinsupark.security; import java.io.IOException; 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.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.AuthenticationException; /* - isAjaxRequest() 메소드를 이용, 변수 ajaxHeader가 가지고 있는 문자열과 같은 이름이 요청헤더에 포함되어 있고 "AJAX"라는 요청헤더가 가지고 있는 값이 true 이면 try~catch 문이 있는 영역을 실행한다. - AJAX에서 스프링 시큐리티에 의해 예외가 발생하면 catch문에서 응답에러를 사용자 측에 보낸다. */ public class AjaxSessionTimeoutFilter implements Filter { private String ajaxHeader; @Override public void init(FilterConfig config) throws ServletException { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; if (isAjaxRequest(req)) { try { chain.doFilter(req, resp); } catch (AccessDeniedException e) { // 권한이 없거나 로그인이 되지 않는경우 모두 AccessDeniedException이 발생 resp.sendError(HttpServletResponse.SC_FORBIDDEN); // 403 } catch (AuthenticationException e) { resp.sendError(HttpServletResponse.SC_UNAUTHORIZED); // 401 } } else { chain.doFilter(req, resp); } } @Override public void destroy() { } public void setAjaxHeader(String ajaxHeader) { this.ajaxHeader = ajaxHeader; } private boolean isAjaxRequest(HttpServletRequest req) { return req.getHeader(ajaxHeader) != null && req.getHeader(ajaxHeader).equals(Boolean.TRUE.toString()); } }
[ "sist@DESKTOP-DLDPQET" ]
sist@DESKTOP-DLDPQET
6159e0460728b03a89763fc3bab4792042b2d614
684e6ca35f6d4b7b84b34c8bd3aa6f03a04cbc3f
/app/src/main/java/com/example/taruc/simpleasynctask/MainActivity.java
8cde6fc33a78760e4f4495342ec85953ac8841da
[]
no_license
michelleocy/Prac9_Mobile
a03a9dea748b374e91d95d65d801fe1dd5cd3f86
9ace96bf52e8e9717117cf8eb6f58cd0a1fe6220
refs/heads/master
2020-04-09T22:02:05.932603
2018-12-06T04:26:20
2018-12-06T04:26:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,931
java
package com.example.taruc.simpleasynctask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { //Key for saving the state of the TextView private static final String TEXT_STATE = "currentText"; // The TextView where we will show results private TextView mTextView = null; /** * Initializes the activity. * @param savedInstanceState The current state data */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize mTextView mTextView = (TextView) findViewById(R.id.textView1); // Restore TextView if there is a savedInstanceState if(savedInstanceState!=null){ mTextView.setText(savedInstanceState.getString(TEXT_STATE)); } } /**` * Handles the onCLick for the "Start Task" button. Launches the AsyncTask * which performs work off of the UI thread. * * @param view The view (Button) that was clicked. */ public void startTask (View view) { // Put a message in the text view mTextView.setText(R.string.napping); // Start the AsyncTask. // The AsyncTask has a callback that will update the text view. new SimpleAsyncTask(mTextView).execute(); } /** * Saves the contents of the TextView to restore on configuration change. * @param outState The bundle in which the state of the activity is saved * when it is spontaneously destroyed. */ @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // Save the state of the TextView outState.putString(TEXT_STATE, mTextView.getText().toString()); } }
[ "anurehka@gmail.com" ]
anurehka@gmail.com