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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
250ce996071600fe137cd91cfe7ada556cc69c81 | ddc070f261ab2fc2615d02eb6723be798ee7d978 | /src/main/java/com/atguigu/day08/Flink02_TableAPI_Agg_Demo.java | 10bd02d8b5d55605dc50059fdafcc58ff8b74446 | [] | no_license | atguiguyueyue/flink-0225 | 15da48243a51ec5dde1e9a1ce4f3b64c9937d44a | 4fd9c56a6c01d4c87dc5aef3f2218f3cc0881f05 | refs/heads/master | 2023-06-20T10:34:11.761049 | 2021-07-22T08:34:30 | 2021-07-22T08:34:30 | 385,109,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,061 | java | package com.atguigu.day08;
import com.atguigu.bean.WaterSensor;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.Table;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.types.Row;
import static org.apache.flink.table.api.Expressions.$;
public class Flink02_TableAPI_Agg_Demo {
public static void main(String[] args) throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1);
DataStreamSource<WaterSensor> waterSensorStream =
env.fromElements(new WaterSensor("sensor_1", 1000L, 10),
new WaterSensor("sensor_1", 2000L, 20),
new WaterSensor("sensor_2", 3000L, 30),
new WaterSensor("sensor_1", 4000L, 40),
new WaterSensor("sensor_1", 5000L, 50),
new WaterSensor("sensor_2", 6000L, 60));
//TODO 获取表的执行环境
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
//TODO 将流转为动态表
Table table = tableEnv.fromDataStream(waterSensorStream);
/**
*select
* id,
* sum(vc)
* from table
* group by id
*/
//TODO 查询表
// Table result = table
// .groupBy($("id"))
// .aggregate($("vc").sum().as("vcSum"))
// .select($("id"), $("vcSum"));
Table result = table
.groupBy($("id"))
.select($("id"), $("vc").sum());
//TODO 将动态表转为流
DataStream<Tuple2<Boolean, Row>> rowDataStream = tableEnv.toRetractStream(result, Row.class);
rowDataStream.print();
env.execute();
}
}
| [
"bigdata0225@guigu.com"
] | bigdata0225@guigu.com |
3cc19a306e9893a8ea555ec4be4c2d832c0aa385 | a5d88bb11bdcb980bfbdb9155d4045d4c9483bc5 | /ControlPoint/src/main/java/com/garden/cp/sevices/StatusService.java | 3ac7e31c138cdf3a8d5ade6f21f828c8b2b78b7b | [] | no_license | KristijanPostolov/GardenExpert | 8327fbaca20e96d9f23809e5017c8760d547cef3 | 3c2cc48d617e97f27ca012e780eba5edfc066f6f | refs/heads/master | 2020-03-26T18:40:39.407200 | 2018-09-27T02:03:15 | 2018-09-27T02:03:15 | 145,224,694 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,383 | java | package com.garden.cp.sevices;
import com.garden.cp.model.HubStatusMessage;
import com.garden.cp.mqtt.publishers.HeaterPublisher;
import com.garden.cp.mqtt.publishers.SprinklerPublisher;
import com.garden.cp.repository.SensorHubRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@Service
public class StatusService {
private static final Logger log = LoggerFactory.getLogger(StatusService.class);
private final SensorHubRepository repository;
private final HeaterPublisher heaterPublisher;
private final SprinklerPublisher sprinklerPublisher;
public StatusService(SensorHubRepository repository, HeaterPublisher heaterPublisher,
SprinklerPublisher sprinklerPublisher) {
this.repository = repository;
this.heaterPublisher = heaterPublisher;
this.sprinklerPublisher = sprinklerPublisher;
}
public void updateStatus(String mac, HubStatusMessage statusMessage) {
log.info("Updating status for [{}]", mac);
repository.putStatus(mac, statusMessage);
heaterPublisher.publishHeaterStatus(mac, statusMessage.heaterActive);
sprinklerPublisher.publishSprinklerStatus(mac, statusMessage.sprinklerActive);
}
public HubStatusMessage getStatus(String mac) {
return repository.getStatus(mac);
}
}
| [
"postolovkristijan@gmail.com"
] | postolovkristijan@gmail.com |
dddf3db145b219d5fa334d91de63d3d24a165a42 | 3ac2e1e32e9e3a5c8cdb607ec349386af958dbae | /src/test/java/com/qa/test/PagesPageTest.java | 52b347b5c595ae89905493d52905430706973197 | [] | no_license | b7satapathy/TestngDataDrivenFramework | 1f16a219acac0fc6a760e0c01e2fda79cf3dc18c | f65ba7eb28adfb9f00632875abb0e05f1a26b7f4 | refs/heads/master | 2020-03-26T02:37:39.613186 | 2018-08-12T11:00:58 | 2018-08-12T11:00:58 | 144,417,907 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | package com.qa.test;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
import com.qa.base.TestBase;
import com.qa.utility.Screenshot;
@Listeners(Screenshot.class)
public class PagesPageTest extends TestBase{
@BeforeMethod
public void setUp() {
initializeBrowser();
login();
}
@AfterMethod
public void closeBrowser() {
tearDown();
}
}
| [
"b7satapathy@gmail.com"
] | b7satapathy@gmail.com |
a695a4ac18bce206710810b390be2a215ee8b1b8 | 54960189c9de77f1bf6972972fd6e674243890ed | /src/skeleton/DefaultDnDSupport.java | a8efb72f5fe177bb939d19369cde2eb2f7339762 | [] | no_license | radgeur/ihm_Drag-Drop | aa1df4e13b4767acd05f52827f42b79c56ca02a6 | a76ecfd3788a44a5c8b987bf9d007f6c36a94dbd | refs/heads/master | 2021-01-10T05:37:08.902674 | 2016-03-22T16:40:22 | 2016-03-22T16:40:22 | 53,931,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,715 | java | package skeleton;
/**
* @author <a href="mailto:gery.casiez@lifl.fr">Gery Casiez</a>
*/
import javax.swing.*;
import java.awt.*;
import java.io.IOException;
import java.net.MalformedURLException;
import javax.swing.tree.DefaultMutableTreeNode;
public class DefaultDnDSupport {
public DefaultDnDSupport() {
JFrame fen = new JFrame("DnD et CCP");
fen.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER));
fen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Panel gauche
JPanel panelgauche = new JPanel();
panelgauche.setLayout(new BoxLayout(panelgauche, BoxLayout.Y_AXIS));
// JTextField
JTextField textField = new JTextField(10);
textField.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JTextField"),
BorderFactory.createEmptyBorder(5,5,5,5)));
textField.setDragEnabled(true);
// JPasswordField
JPasswordField passwordField = new JPasswordField(10);
passwordField.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JPasswordField"),
BorderFactory.createEmptyBorder(5,5,5,5)));
passwordField.setDragEnabled(true);
// JFormattedTextField
JFormattedTextField ftf = new JFormattedTextField("Universite de Lille 1");
ftf.setFont(new Font("Courier",Font.ITALIC,12));
ftf.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JFormattedTextField"),
BorderFactory.createEmptyBorder(5,5,5,5)));
ftf.setDragEnabled(true);
// JTextArea
JTextArea jta = new JTextArea("Master 1 informatique");
jta.setFont(new Font("Arial",Font.BOLD,12));
jta.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JTextArea"),
BorderFactory.createEmptyBorder(5,5,5,5)));
jta.setDragEnabled(true);
// JEditorPane
JEditorPane editorPane = createEditorPane();
editorPane.setDragEnabled(true);
JScrollPane editorScrollPane = new JScrollPane(editorPane);
editorScrollPane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JEditorPane"),
BorderFactory.createEmptyBorder(5,5,5,5)));
// JColorChooser
JColorChooser cc = new JColorChooser();
cc.setDragEnabled(true);
cc.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JColorChooser"),
BorderFactory.createEmptyBorder(5,5,5,5)));
// Panel droit
JPanel paneldroit = new JPanel();
paneldroit.setLayout(new BoxLayout(paneldroit, BoxLayout.Y_AXIS));
// JList
String[] data = {"AAC", "AEV", "ANG", "ASE", "COA", "PJE",
"CAR", "PJI", "AeA", "BDA", "CALP","FDD", "HECI", "IHM","M3DS","PAC","PPD","RdF","SVL","TI"};
JList liste = new JList(data);
JScrollPane jscrollListe = new JScrollPane(liste);
jscrollListe.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JList"),
BorderFactory.createEmptyBorder(5,5,5,5)));
liste.setDragEnabled(true);
// JTree
DefaultMutableTreeNode m1 = new DefaultMutableTreeNode("M1");
DefaultMutableTreeNode s1 = new DefaultMutableTreeNode("S1");
m1.add(s1);
s1.add(new DefaultMutableTreeNode("AAC"));
s1.add(new DefaultMutableTreeNode("AEV"));
s1.add(new DefaultMutableTreeNode("ANG"));
s1.add(new DefaultMutableTreeNode("ASE"));
s1.add(new DefaultMutableTreeNode("COA"));
s1.add(new DefaultMutableTreeNode("PJE"));
DefaultMutableTreeNode s2 = new DefaultMutableTreeNode("S2");
m1.add(s2);
s2.add(new DefaultMutableTreeNode("CAR"));
s2.add(new DefaultMutableTreeNode("PJI"));
s2.add(new DefaultMutableTreeNode("AeA"));
s2.add(new DefaultMutableTreeNode("BDA"));
s2.add(new DefaultMutableTreeNode("CALP"));
s2.add(new DefaultMutableTreeNode("FDD"));
s2.add(new DefaultMutableTreeNode("HECI"));
s2.add(new DefaultMutableTreeNode("IHM"));
s2.add(new DefaultMutableTreeNode("M3DS"));
s2.add(new DefaultMutableTreeNode("PAC"));
s2.add(new DefaultMutableTreeNode("PPD"));
s2.add(new DefaultMutableTreeNode("RdF"));
s2.add(new DefaultMutableTreeNode("SVL"));
s2.add(new DefaultMutableTreeNode("TI"));
JTree tree = new JTree(m1);
tree.setDragEnabled(true);
JScrollPane jscrollTree = new JScrollPane(tree);
jscrollTree.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JTree"),
BorderFactory.createEmptyBorder(5,5,5,5)));
jscrollTree.setPreferredSize(new Dimension(200,200));
// JTable
String[] columnNames = {"S1",
"S2"};
Object[][] data2 = {
{"AAC", "CAR"},
{"AEV", "PJI"},
{"ANG", "AeA"},
{"ASE", "BDA"},
{"COA", "CALP"},
{"PJE", "FDD"},
{"","HECI"},
{"","IHM"},
{"","M3DS"},
{"","PAC"},
{"","PPD"},
{"","RdF"},
{"","SVL"},
{"","TI"}
};
JTable table = new JTable(data2, columnNames);
JScrollPane scrollPaneTable = new JScrollPane(table);
table.setDragEnabled(true);
// JFileChooser
JFileChooser fc = new JFileChooser();
fc.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("JFileChooser"),
BorderFactory.createEmptyBorder(5,5,5,5)));
fc.setDragEnabled(true);
panelgauche.add(textField);
panelgauche.add(passwordField);
panelgauche.add(ftf);
panelgauche.add(jta);
panelgauche.add(cc);
panelgauche.add(editorScrollPane);
fen.getContentPane().add(panelgauche);
paneldroit.add(fc);
paneldroit.add(jscrollListe);
paneldroit.add(jscrollTree);
paneldroit.add(scrollPaneTable);
fen.getContentPane().add(paneldroit);
fen.pack();
fen.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
new DefaultDnDSupport();
}
});
}
private static JEditorPane createEditorPane() {
JEditorPane editorPane = new JEditorPane();
editorPane.setEditable(false);
System.setProperty("http.proxyHost", "cache.univ-lille1.fr");
System.setProperty("http.proxyPort", "3128");
editorPane.setPreferredSize(new Dimension (300, 200));
java.net.URL lille1URL = null;
try {
lille1URL = new java.net.URL("http://www.google.com");
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (lille1URL != null) {
try {
editorPane.setPage(lille1URL);
} catch (IOException e) {
System.err.println("Attempted to read a bad URL: " + lille1URL);
}
} else {
System.err.println("Couldn't find file: http://www.google.com");
}
return editorPane;
}
}
| [
"remy2112@hotmail.fr"
] | remy2112@hotmail.fr |
af3dbc4d5c12d9a2065ff8aba12a37a1b998f7d9 | c998cb66cc1b31ff1b369239a63bebf95f5fa208 | /src/main/java/bexysuttx/blog/entity/Account.java | 1cd153ab2acfb7e7bc703374cb69dc803e0331cd | [] | no_license | bexysuttx/blog | f796d75768c848c1cec1fb048be2660cdb7e863b | 1a4fdd3c0701db279f43a513a6e5f9b7f4423f71 | refs/heads/master | 2023-03-22T12:28:37.659492 | 2021-03-08T17:04:50 | 2021-03-08T17:04:50 | 340,433,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 883 | java | package bexysuttx.blog.entity;
import java.sql.Timestamp;
public class Account extends AbstractEntity<Long> {
private static final long serialVersionUID = -3865731793445948201L;
private String email;
private String name;
private String avatar;
private Timestamp created;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public Timestamp getCreated() {
return created;
}
public void setCreated(Timestamp created) {
this.created = created;
}
public boolean isAvatarExists() {
return avatar != null;
}
public String getNotAvatar() {
return "/static/img/no_avatar.png";
}
}
| [
"andrei_rodionov@inbox.ru"
] | andrei_rodionov@inbox.ru |
eda740f806c60e727b2cb9f815c35fbb193e2ff3 | 4aaf1a9fc4137bf133843f64e69ad49bbca2face | /geisa/src/main/java/co/id/app/geisa/config/package-info.java | 6d166d0c6b0c2bdcdc574f77e60cfa5b729d4027 | [] | no_license | denagus007/semesta | 75d2be4bebd252403fe7f8ff53f3e037842afd3a | 838ed8101d2f1fc9b725f1bce32c4754bb2a8a8c | refs/heads/master | 2020-05-21T05:55:07.386138 | 2018-11-30T10:18:24 | 2018-11-30T10:18:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 81 | java | /**
* Spring Framework configuration files.
*/
package co.id.app.geisa.config;
| [
"cipta.ageung@xlplanet.co.id"
] | cipta.ageung@xlplanet.co.id |
2a1449e616421dc98473b6aa0fe56c620a1f1522 | 6c1938e39040bb122607af1e6f7adf46ed4221dc | /app/src/main/java/com/smartplugapp/adapter/LeDeviceListAdapter.java | a48b202df2b97181efb648539df0979f8153d6e6 | [] | no_license | vinkalp/SmartPlugApp | 12688f5001fa36684f25a705b9c748695123486a | 684f724b256e5d4e7f355d5cf5451ebc89d3febd | refs/heads/master | 2021-04-30T02:51:07.289428 | 2018-02-14T13:10:08 | 2018-02-14T13:10:08 | 121,508,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,777 | java | package com.smartplugapp.adapter;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import com.smartplugapp.R;
/**
* Created by vinayts on 12-02-2018.
*/
public class LeDeviceListAdapter extends BaseAdapter {
private ArrayList<BluetoothDevice> mLeDevices;
private LayoutInflater mInflator;
public LeDeviceListAdapter(Context context) {
super();
mLeDevices = new ArrayList<BluetoothDevice>();
mInflator = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public void addDevice(BluetoothDevice device) {
if (!mLeDevices.contains(device)) {
synchronized (device) {
// mLeDevices.add(device);
if(device==null|| device.getName()==null)
return;
if(!mLeDevices.contains(device)&&device.getName().startsWith("Smart") ) {
mLeDevices.add(device);
}
notifyDataSetChanged();
}
/*mLeDevices.add(device);
notifyDataSetChanged();*/
}
}
public BluetoothDevice getDevice(int position) {
return mLeDevices.get(position);
}
public void clear() {
mLeDevices.clear();
}
@Override
public int getCount() {
return mLeDevices.size();
}
@Override
public Object getItem(int i) {
return mLeDevices.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
// General ListView optimization code.
if (view == null) {
view = mInflator.inflate(R.layout.listitem_device, null);
viewHolder = new ViewHolder();
viewHolder.deviceAddress = (TextView) view.findViewById(R.id.device_address);
viewHolder.deviceName = (TextView) view.findViewById(R.id.device_name);
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
}
BluetoothDevice device = mLeDevices.get(i);
final String deviceName = device.getName();
if (deviceName != null && deviceName.length() > 0)
viewHolder.deviceName.setText(deviceName);
else
viewHolder.deviceName.setText(R.string.unknown_device);
viewHolder.deviceAddress.setText(device.getAddress());
return view;
}
public class ViewHolder {
TextView deviceName;
TextView deviceAddress;
}
} | [
"tn14hosur@gmail.com"
] | tn14hosur@gmail.com |
faa370f1b6cdeeef47c7b35ae500e38f3401fc04 | 1b93c225881895f97bb48ae0232bf3c4700dcc31 | /src/main/java/net/gnisio/client/event/SIOReconnectedEvent.java | 6665112d7608f2debbcabae047d3c750a17f5435 | [] | no_license | leonnard/gnisio | 4e86d7adf37f970c5cbec0405ae0126aa7af1129 | 9c5a2f9ab8d1dfa53245f5b24901d008262f8d3b | refs/heads/master | 2021-01-01T16:14:11.376563 | 2012-08-07T16:15:25 | 2012-08-07T16:15:25 | 35,213,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,382 | java | package net.gnisio.client.event;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
public class SIOReconnectedEvent extends GwtEvent<SIOReconnectedEvent.SIOReconnectedHandler> {
public interface HasSIOReconnectedHandlers extends HasHandlers {
HandlerRegistration addSIOReconnectedHandler(SIOReconnectedHandler handler);
}
public interface SIOReconnectedHandler extends EventHandler {
public void onSIOReconnected(SIOReconnectedEvent event);
}
private static final Type<SIOReconnectedHandler> TYPE = new Type<SIOReconnectedHandler>();
public static void fire(HasHandlers source, java.lang.String transportName, int resonnectionAttempts, net.gnisio.client.wrapper.SocketIOClient.ConnectionState connectionState) {
source.fireEvent(new SIOReconnectedEvent(transportName, resonnectionAttempts, connectionState));
}
public static Type<SIOReconnectedHandler> getType() {
return TYPE;
}
java.lang.String transportName;
int resonnectionAttempts;
net.gnisio.client.wrapper.SocketIOClient.ConnectionState connectionState;
public SIOReconnectedEvent(java.lang.String transportName, int resonnectionAttempts, net.gnisio.client.wrapper.SocketIOClient.ConnectionState connectionState) {
this.transportName = transportName;
this.resonnectionAttempts = resonnectionAttempts;
this.connectionState = connectionState;
}
protected SIOReconnectedEvent() {
// Possibly for serialization.
}
@Override
public Type<SIOReconnectedHandler> getAssociatedType() {
return TYPE;
}
public java.lang.String getTransportName() {
return transportName;
}
public int getResonnectionAttempts() {
return resonnectionAttempts;
}
public net.gnisio.client.wrapper.SocketIOClient.ConnectionState getConnectionState() {
return connectionState;
}
@Override
protected void dispatch(SIOReconnectedHandler handler) {
handler.onSIOReconnected(this);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SIOReconnectedEvent other = (SIOReconnectedEvent) obj;
if (transportName == null) {
if (other.transportName != null)
return false;
} else if (!transportName.equals(other.transportName))
return false;
if (resonnectionAttempts != other.resonnectionAttempts)
return false;
if (connectionState == null) {
if (other.connectionState != null)
return false;
} else if (!connectionState.equals(other.connectionState))
return false;
return true;
}
@Override
public int hashCode() {
int hashCode = 23;
hashCode = (hashCode * 37) + (transportName == null ? 1 : transportName.hashCode());
hashCode = (hashCode * 37) + new Integer(resonnectionAttempts).hashCode();
hashCode = (hashCode * 37) + (connectionState == null ? 1 : connectionState.hashCode());
return hashCode;
}
@Override
public String toString() {
return "SIOReconnectedEvent["
+ transportName
+ ","
+ resonnectionAttempts
+ ","
+ connectionState
+ "]";
}
}
| [
"viiv.c58@localhost"
] | viiv.c58@localhost |
2cc31fa05fd216fa0bf38c97f3b8fa0d39916193 | f74e79e309ee19f935f580172ea46c616c8e85d4 | /demo1006/src/main/java/com/kgc/pojo/BillsExample.java | 686918c1e40be20966a7e3082fdf87192b3a6a18 | [
"Apache-2.0"
] | permissive | ssy1208/1006 | b734e32a600ca6a562667954e5fa136f31519264 | e0894bf9ae38e674604fbfb690074500ccf85e8b | refs/heads/main | 2022-12-22T18:33:47.660378 | 2020-10-06T13:33:54 | 2020-10-06T13:33:54 | 301,736,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,327 | java | package com.kgc.pojo;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class BillsExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public BillsExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andBillTimeIsNull() {
addCriterion("bill_time is null");
return (Criteria) this;
}
public Criteria andBillTimeIsNotNull() {
addCriterion("bill_time is not null");
return (Criteria) this;
}
public Criteria andBillTimeEqualTo(Date value) {
addCriterionForJDBCDate("bill_time =", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("bill_time <>", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeGreaterThan(Date value) {
addCriterionForJDBCDate("bill_time >", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("bill_time >=", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeLessThan(Date value) {
addCriterionForJDBCDate("bill_time <", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("bill_time <=", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeIn(List<Date> values) {
addCriterionForJDBCDate("bill_time in", values, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("bill_time not in", values, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("bill_time between", value1, value2, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("bill_time not between", value1, value2, "billTime");
return (Criteria) this;
}
public Criteria andTypeIdIsNull() {
addCriterion("type_id is null");
return (Criteria) this;
}
public Criteria andTypeIdIsNotNull() {
addCriterion("type_id is not null");
return (Criteria) this;
}
public Criteria andTypeIdEqualTo(Integer value) {
addCriterion("type_id =", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdNotEqualTo(Integer value) {
addCriterion("type_id <>", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdGreaterThan(Integer value) {
addCriterion("type_id >", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdGreaterThanOrEqualTo(Integer value) {
addCriterion("type_id >=", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdLessThan(Integer value) {
addCriterion("type_id <", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdLessThanOrEqualTo(Integer value) {
addCriterion("type_id <=", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdIn(List<Integer> values) {
addCriterion("type_id in", values, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdNotIn(List<Integer> values) {
addCriterion("type_id not in", values, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdBetween(Integer value1, Integer value2) {
addCriterion("type_id between", value1, value2, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdNotBetween(Integer value1, Integer value2) {
addCriterion("type_id not between", value1, value2, "typeId");
return (Criteria) this;
}
public Criteria andPriceIsNull() {
addCriterion("price is null");
return (Criteria) this;
}
public Criteria andPriceIsNotNull() {
addCriterion("price is not null");
return (Criteria) this;
}
public Criteria andPriceEqualTo(String value) {
addCriterion("price =", value, "price");
return (Criteria) this;
}
public Criteria andPriceNotEqualTo(String value) {
addCriterion("price <>", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThan(String value) {
addCriterion("price >", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThanOrEqualTo(String value) {
addCriterion("price >=", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThan(String value) {
addCriterion("price <", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThanOrEqualTo(String value) {
addCriterion("price <=", value, "price");
return (Criteria) this;
}
public Criteria andPriceLike(String value) {
addCriterion("price like", value, "price");
return (Criteria) this;
}
public Criteria andPriceNotLike(String value) {
addCriterion("price not like", value, "price");
return (Criteria) this;
}
public Criteria andPriceIn(List<String> values) {
addCriterion("price in", values, "price");
return (Criteria) this;
}
public Criteria andPriceNotIn(List<String> values) {
addCriterion("price not in", values, "price");
return (Criteria) this;
}
public Criteria andPriceBetween(String value1, String value2) {
addCriterion("price between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andPriceNotBetween(String value1, String value2) {
addCriterion("price not between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andExplaiIsNull() {
addCriterion("explai is null");
return (Criteria) this;
}
public Criteria andExplaiIsNotNull() {
addCriterion("explai is not null");
return (Criteria) this;
}
public Criteria andExplaiEqualTo(String value) {
addCriterion("explai =", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiNotEqualTo(String value) {
addCriterion("explai <>", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiGreaterThan(String value) {
addCriterion("explai >", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiGreaterThanOrEqualTo(String value) {
addCriterion("explai >=", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiLessThan(String value) {
addCriterion("explai <", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiLessThanOrEqualTo(String value) {
addCriterion("explai <=", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiLike(String value) {
addCriterion("explai like", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiNotLike(String value) {
addCriterion("explai not like", value, "explai");
return (Criteria) this;
}
public Criteria andExplaiIn(List<String> values) {
addCriterion("explai in", values, "explai");
return (Criteria) this;
}
public Criteria andExplaiNotIn(List<String> values) {
addCriterion("explai not in", values, "explai");
return (Criteria) this;
}
public Criteria andExplaiBetween(String value1, String value2) {
addCriterion("explai between", value1, value2, "explai");
return (Criteria) this;
}
public Criteria andExplaiNotBetween(String value1, String value2) {
addCriterion("explai not between", value1, value2, "explai");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"2983664989@qq.com"
] | 2983664989@qq.com |
068430c7495a1345852fd229d19ac74d33acb5ad | 83b9eed94f1641e4c99b7d1445183f98caf819f7 | /src/test/java/releasecut/buildserver/TestBuildServer.java | 4bcde9433d290f676e8a47944ebfcea71d55b159 | [] | no_license | ghbrown60640/ReleaseCut | 9ac26edabbd1c7a2aa739b11a42dddff252521d6 | 351e3db8558764d1befab2dba3e5bc64d3582acc | refs/heads/master | 2016-09-06T11:21:28.858305 | 2014-03-28T20:59:06 | 2014-03-28T20:59:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,366 | java | package releasecut.buildserver;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import releasecut.buildserver.bamboo.BambooBuildServer;
import releasecut.rest.RESTClient;
import java.util.LinkedHashMap;
import java.util.Map;
import static org.powermock.api.mockito.PowerMockito.when;
import static org.powermock.api.support.membermodification.MemberMatcher.method;
/**
* Tests for the @BuildServer interface
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest(BambooBuildServer.class)
public class TestBuildServer {
@Mock
RESTClient restClient;
@Test
public void testIsActive() {
String url = "http://bamboo.url.com";
BuildServer buildServer = PowerMockito.spy(new BambooBuildServer(url));
Map<String,String> map = new LinkedHashMap<String, String>();
map.put("state","RUNNING");
try {
when(buildServer,method(BambooBuildServer.class,"makeRESTClient")).withNoArguments().thenReturn(restClient);
when(restClient.JSONGet(url + "server")).thenReturn(map);
assert(buildServer.isActive());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"ghbrown60640@gmail.com"
] | ghbrown60640@gmail.com |
a9097c90ebebfe104b0499440f0b2ac6e0d6c6e7 | ccd6896172057fc8e8919341a7b7964ab47f373c | /app/src/main/java/com/pulse/roomdemo/helper/DateConverter.java | 121ef45ffdf7a1a31aa7770846f35ce8ed79d323 | [] | no_license | NikhilVadoliya/Room_ViewModel_LiveData-_And_MutableLiveData | d3754510166beb64ea0a4b706b8e8895a5c3e3b6 | 35e14345eeefd3000ee984c2ea404cd8f984a729 | refs/heads/master | 2020-04-07T20:49:40.917071 | 2018-11-29T11:10:29 | 2018-11-29T11:10:29 | 158,704,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package com.pulse.roomdemo.helper;
import android.arch.persistence.room.TypeConverter;
import java.sql.Date;
/**
* Created by nikhil.vadoliya on 12-04-2018.
*/
public class DateConverter {
@TypeConverter
public static Date toDate(Long timestamp) {
return timestamp == null ? null : new Date(timestamp);
}
@TypeConverter
public static Long toTimestamp(Date date) {
return date == null ? null : date.getTime();
}
}
| [
"nikhil.vadoliya@sftpl.com"
] | nikhil.vadoliya@sftpl.com |
e0bd375834c802247835ee3c70ea7e2e6ce90e16 | 76c240a76e3a197561582a0a2dfcd8d102168c63 | /customer/src/main/java/com/jiangxiacollege/canteenwebsite/customer/controller/SellController.java | 9dbeca69eea0f4165310fa7303203917bc700155 | [] | no_license | xiaoqian8705/CollegeCanteenWebsite | 778be6d609588037c850cb4c8b56952bb6a97756 | 5cc693a92f771a56f96bf9968372d8a85a17c815 | refs/heads/master | 2022-07-13T16:10:50.195419 | 2020-03-10T02:13:34 | 2020-03-10T02:13:34 | 232,042,387 | 0 | 1 | null | 2022-06-21T02:46:50 | 2020-01-06T06:54:22 | JavaScript | UTF-8 | Java | false | false | 1,074 | java | package com.jiangxiacollege.canteenwebsite.customer.controller;
import com.jiangxiacollege.canteenwebsite.customer.common.ResponseBase;
import com.jiangxiacollege.canteenwebsite.customer.service.db.SellerUserService;
import com.jiangxiacollege.canteenwebsite.customer.table.SellerUserInfo;
import com.jiangxiacollege.canteenwebsite.customer.utils.JsonUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/sell")
public class SellController {
@Resource
SellerUserService sellerUserService;
@RequestMapping("/listByKeyWord")
public String getListByKeyWord(Model model , String fkeyword){
List<SellerUserInfo> list = (List<SellerUserInfo>) sellerUserService.sellerList(fkeyword).getData();
model.addAttribute("sellList",list);
return "search_s" ;
}
}
| [
"1045043267@qq.com"
] | 1045043267@qq.com |
4b2f4595325de024f9adf6169340e8e0b0ab1236 | 3f2fe92f11fe6a012ea87936bedbeb08fd392a1a | /dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/registries/DeleteMetadataSchemaConfirm.java | b558c526b388cf9531c42ac7e6574ae0cfd0ceb7 | [] | no_license | pulipulichen/dspace-dlll | bbb61aa528876e2ce4908fac87bc9b2323baac3c | e9379176291c171c19573f7f6c685b6dc995efe1 | refs/heads/master | 2022-08-22T21:15:12.751565 | 2022-07-12T14:50:10 | 2022-07-12T14:50:10 | 9,954,185 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,179 | java | /*
* DeleteMetadataSchemaConfirm.java
*
* Version: $Revision: 1.0 $
*
* Date: $Date: 2006/07/13 23:20:54 $
*
* Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
* Institute of Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Hewlett-Packard Company nor the name of the
* Massachusetts Institute of Technology nor the names of their
* 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.
*/
package org.dspace.app.xmlui.aspect.administrative.registries;
import java.sql.SQLException;
import java.util.ArrayList;
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
import org.dspace.app.xmlui.wing.Message;
import org.dspace.app.xmlui.wing.WingException;
import org.dspace.app.xmlui.wing.element.Body;
import org.dspace.app.xmlui.wing.element.Division;
import org.dspace.app.xmlui.wing.element.PageMeta;
import org.dspace.app.xmlui.wing.element.Para;
import org.dspace.app.xmlui.wing.element.Row;
import org.dspace.app.xmlui.wing.element.Table;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.MetadataSchema;
/**
* Prompt the user to determin if they really want to delete the displayed schemas.
*
* @author Scott phillips
*/
public class DeleteMetadataSchemaConfirm extends AbstractDSpaceTransformer
{
/** Language Strings */
private static final Message T_dspace_home =
message("xmlui.general.dspace_home");
private static final Message T_title =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.title");
private static final Message T_metadata_registry_trail =
message("xmlui.administrative.registries.general.metadata_registry_trail");
private static final Message T_trail =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.trail");
private static final Message T_head =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.head");
private static final Message T_para1 =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.para1");
private static final Message T_warning =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.warning");
private static final Message T_para2 =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.para2");
private static final Message T_column1 =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.column1");
private static final Message T_column2 =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.column2");
private static final Message T_column3 =
message("xmlui.administrative.registries.DeleteMetadataSchemaConfirm.column3");
private static final Message T_submit_delete =
message("xmlui.general.delete");
private static final Message T_submit_cancel =
message("xmlui.general.cancel");
public void addPageMeta(PageMeta pageMeta) throws WingException
{
pageMeta.addMetadata("title").addContent(T_title);
pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
pageMeta.addTrailLink(contextPath + "/admin/metadata-registry",T_metadata_registry_trail);
pageMeta.addTrail().addContent(T_trail);
}
public void addBody(Body body) throws WingException, SQLException, AuthorizeException
{
// Get all our parameters
String idsString = parameters.getParameter("schemaIDs", null);
ArrayList<MetadataSchema> schemas = new ArrayList<MetadataSchema>();
for (String id : idsString.split(","))
{
MetadataSchema schema = MetadataSchema.find(context,Integer.valueOf(id));
schemas.add(schema);
}
// DIVISION: metadata-schema-confirm-delete
Division deleted = body.addInteractiveDivision("metadata-schema-confirm-delete",contextPath+"/admin/metadata-registry",Division.METHOD_POST,"primary administrative metadata-registry");
deleted.setHead(T_head);
deleted.addPara(T_para1);
Para warning = deleted.addPara();
warning.addHighlight("bold").addContent(T_warning);
warning.addContent(T_para2);
Table table = deleted.addTable("schema-confirm-delete",schemas.size() + 1, 3);
Row header = table.addRow(Row.ROLE_HEADER);
header.addCell().addContent(T_column1);
header.addCell().addContent(T_column2);
header.addCell().addContent(T_column3);
for (MetadataSchema schema : schemas)
{
Row row = table.addRow();
row.addCell().addContent(schema.getSchemaID());
row.addCell().addContent(schema.getNamespace());
row.addCell().addContent(schema.getName());
}
Para buttons = deleted.addPara();
buttons.addButton("submit_confirm").setValue(T_submit_delete);
buttons.addButton("submit_cancel").setValue(T_submit_cancel);
deleted.addHidden("administrative-continue").setValue(knot.getId());
}
}
| [
"pulipuli.chen@gmail.com"
] | pulipuli.chen@gmail.com |
aa5e2327288c80fc755c4af245b3a4695fe7072f | 2125fefae7e7caca0a0bdf45371d730d20be8f34 | /app/src/main/java/jlyv/upeu/edu/pe/asistencia/utils/EventoRecyclerAdapter.java | cb0276d9d250185e4eb6c6d5299f46bc370e0247 | [] | no_license | JorgeYapo/LoginSocialGF | 2a848ced46f7997397d0c461a61995591f6b1c7d | f6d5876e0d5257dfed81460f0853c2e11a4b9adb | refs/heads/master | 2020-03-14T05:06:58.363458 | 2018-04-29T21:19:42 | 2018-04-29T21:19:42 | 131,457,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,225 | java | package jlyv.upeu.edu.pe.asistencia.utils;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import jlyv.upeu.edu.pe.asistencia.R;
import jlyv.upeu.edu.pe.asistencia.to.EventoTO;
import jlyv.upeu.edu.pe.asistencia.upeuasistenciaqr.EventoViewHolder;
public class EventoRecyclerAdapter extends RecyclerView.Adapter<EventoViewHolder> {
List<EventoTO> eventos;
public EventoRecyclerAdapter(List<EventoTO> eventos){
this.eventos=eventos;
}
@Override
public EventoViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Context context =parent.getContext();
View view= LayoutInflater.from(context).inflate(R.layout.listaevento,parent,false);
EventoViewHolder eventoViewHolder = new EventoViewHolder(view);
return eventoViewHolder;
}
@Override
public void onBindViewHolder(EventoViewHolder holder, int position) {
EventoTO eventox =eventos.get(position);
holder.setEvento(eventox);
}
@Override
public int getItemCount() {
return eventos.size();
}
}
| [
"you@example.com"
] | you@example.com |
4ab4c098e7a6da192c11d90e36d1c57460cdc383 | 5e84ab306f355650a20d2df7d91f1895c0345e73 | /proc-de-imagenes/src/main/java/untref/service/functions/DynamicRangeFunction.java | 429d6c23be337b4a8f2831326b64e3aed58b2deb | [] | no_license | Mariani88/proc-imagenes | e20a57dce4f932c6a1b3223316f2d0c488762477 | 16743df53c6549902b1335b7372e684d54c1972d | refs/heads/master | 2021-01-18T01:32:35.331525 | 2017-07-19T18:08:58 | 2017-07-19T18:08:58 | 84,263,254 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | package untref.service.functions;
import java.util.function.Function;
public class DynamicRangeFunction implements Function<Integer, Integer> {
private static final int AMOUNT_COLORS = 256;
private final double c;
private boolean shouldApply;
public DynamicRangeFunction(int maxGrayValue) {
c = (double) (AMOUNT_COLORS - 1) / Math.log10(1 + maxGrayValue);
shouldApply = maxGrayValue >= AMOUNT_COLORS || maxGrayValue < 0;
}
@Override
public Integer apply(Integer grayValue) {
int transformed = grayValue;
if (shouldApply) {
transformed = (int) (c * Math.log10(grayValue + 1));
}
return transformed;
}
} | [
"pm_mariani@hotmail.com"
] | pm_mariani@hotmail.com |
01e58354389b5be9fa5acd04346c7e78464eefc0 | 9b4bc6b396d77557ebac12424ecb4564d54a3126 | /src/main/java/com/drender/eventprocessors/HeartbeatVerticle.java | b17da98a940caab20ba15fcfa764f8c3793d5351 | [] | no_license | CMU-BRDS-DRender/master | 4bc90d77f83b92890612956b78b6ec8b7ad32666 | 8cf3142a891cc3d6f396bc2bbaf8df77bd847ed5 | refs/heads/master | 2022-02-19T00:47:18.104215 | 2022-02-11T06:34:42 | 2022-02-11T06:34:42 | 153,331,917 | 0 | 0 | null | 2022-02-11T06:34:43 | 2018-10-16T18:09:03 | Java | UTF-8 | Java | false | false | 3,037 | java | package com.drender.eventprocessors;
import com.drender.model.instance.DRenderInstanceAction;
import com.drender.model.instance.InstanceHeartbeat;
import com.drender.utils.HttpUtils;
import com.drender.model.Channels;
import com.drender.model.job.JobResponse;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.eventbus.EventBus;
import io.vertx.core.json.Json;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
public class HeartbeatVerticle extends AbstractVerticle {
private HttpUtils httpUtils;
private Logger logger = LoggerFactory.getLogger(HeartbeatVerticle.class);
private final int TIMEOUT = 10000; // 10 secs
@Override
public void start() throws Exception {
logger.info("Starting...");
httpUtils = new HttpUtils(vertx);
EventBus eventBus = vertx.eventBus();
eventBus.consumer(Channels.HEARTBEAT)
.handler(message -> {
InstanceHeartbeat instanceHeartbeat = Json.decodeValue(message.body().toString(), InstanceHeartbeat.class);
httpUtils.get(instanceHeartbeat.getInstance().getIp(), "/nodeStatus", 8080, JobResponse.class, 2)
.setHandler(ar -> {
if (!ar.succeeded()) {
logger.info("Heartbeat failed for: " + instanceHeartbeat.getInstance());
DRenderInstanceAction nextAction = DRenderInstanceAction.START_NEW_MACHINE;
// status check failed. Try pinging the machine
if (isReachable(instanceHeartbeat.getInstance().getIp())) {
logger.info("Machine " + instanceHeartbeat.getInstance().getIp() + " reachable");
nextAction = DRenderInstanceAction.RESTART_MACHINE;
} else {
logger.info("Could not reach machine for instance: " + message.body().toString());
}
// send appropriate message for job to DRenderDriver
logger.info("Sending action " + nextAction + " for Instance: " + instanceHeartbeat.getInstance());
instanceHeartbeat.setAction(nextAction);
eventBus.send(Channels.DRIVER_INSTANCE, Json.encode(instanceHeartbeat));
}
});
});
}
private boolean isReachable(String address) {
try {
try (Socket soc = new Socket()) {
soc.connect(new InetSocketAddress(address, 22), TIMEOUT);
}
return true;
} catch (IOException ex) {
return false;
}
}
}
| [
"shantanu27.bits@gmail.com"
] | shantanu27.bits@gmail.com |
cf3bd5976cf08abb542aa2683bee2bf7e43863d2 | 38a952af8dc481e0415ff6563aa2b0300ce02d07 | /BackEnd/src/main/java/com/B305/ogym/domain/mappingTable/PTStudentPTTeacherCustomImpl.java | 133bc0c8081fca3b473dacd5164ca000943b8d83 | [] | no_license | KJH-Sun/O-GYM | a586e0940ac4b86f79e5f059c6767f195314005b | bcb3569a9d12324e84b201e0a80ccfe04b06d53d | refs/heads/master | 2023-08-15T11:43:33.122363 | 2021-10-17T23:48:35 | 2021-10-17T23:48:35 | 403,553,915 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,578 | java | package com.B305.ogym.domain.mappingTable;
import static com.B305.ogym.domain.mappingTable.QPTStudentPTTeacher.pTStudentPTTeacher;
import static com.B305.ogym.domain.users.ptStudent.QPTStudent.pTStudent;
import static com.B305.ogym.domain.users.ptTeacher.QPTTeacher.pTTeacher;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
public class PTStudentPTTeacherCustomImpl implements PTStudentPTTeacherCustom {
private final EntityManager em;
private final JPAQueryFactory queryFactory;
Map<String, Expression> check = new HashMap<>();
public PTStudentPTTeacherCustomImpl(EntityManager em) {
this.em = em;
queryFactory = new JPAQueryFactory(em);
}
/*
* 사용자의 예약정보 중 현재 들어가야하는 방이 있는 경우 해당하는 studentNickname, teacherNickname을
* 반환하는 메서드 (방정보를 teacherNickname, studentNickname으로 생성)
*/
@Override
public List<String> getNowReservation(String teacherEmail, String studentEmail,
LocalDateTime now) {
LocalDateTime from = now.minusMinutes(10);
LocalDateTime to = now.plusMinutes(10);
PTStudentPTTeacher ptStudentPTTeacher = queryFactory.select(pTStudentPTTeacher)
.from(pTStudentPTTeacher)
.join(pTStudentPTTeacher.ptTeacher, pTTeacher)
.join(pTStudentPTTeacher.ptStudent, pTStudent)
.where(pTStudentPTTeacher.reservationDate.between(from, to),
eqStudentEmail(studentEmail),
eqTeacherEmail(teacherEmail))
.fetchOne();
List<String> result = new ArrayList<>();
if (ptStudentPTTeacher == null) {
return null;
}
result.add(ptStudentPTTeacher.getPtTeacher().getNickname());
result.add(ptStudentPTTeacher.getPtStudent().getNickname());
return result;
}
private BooleanExpression eqTeacherEmail(String teacherEmail) {
if (teacherEmail == null) {
return null;
} else {
return pTTeacher.email.eq(teacherEmail);
}
}
private BooleanExpression eqStudentEmail(String studentEmail) {
if (studentEmail == null) {
return null;
} else {
return pTStudent.email.eq(studentEmail);
}
}
}
| [
"nodayst@naver.com"
] | nodayst@naver.com |
a2a562530e74de96839f6078d6501f63fbcbe139 | 8bdf5592599cb908cfc4b8e27dcd669834de6825 | /mycustombanner/src/main/java/bone/com/mycustombanner/transformer/ZoomOutTranformer.java | 536c598822fa20910189f4b570e870d767baa6de | [
"Apache-2.0"
] | permissive | bonebug/BannerView | 8f12350072090405c0157ab8f073ddbbb2055ff2 | 0b6e710d8d6be3ca1b6e25c3c73d06116a508024 | refs/heads/master | 2021-05-11T11:34:07.219080 | 2018-01-16T08:29:54 | 2018-01-16T08:29:54 | 108,616,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,135 | java | /*
* Copyright 2014 Toxic Bakery
*
* 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 bone.com.mycustombanner.transformer;
import android.view.View;
public class ZoomOutTranformer extends ABaseTransformer {
@Override
protected void onTransform(View view, float position) {
final float scale = 1f + Math.abs(position);
view.setScaleX(scale);
view.setScaleY(scale);
view.setPivotX(view.getWidth() * 0.5f);
view.setPivotY(view.getHeight() * 0.5f);
view.setAlpha(position < -1f || position > 1f ? 0f : 1f - (scale - 1f));
if(position == -1){
view.setTranslationX(view.getWidth() * -1);
}
}
}
| [
"zhaoran-ds3@gomeplus.com"
] | zhaoran-ds3@gomeplus.com |
fe1c3559b2c7daeb72b42eb040fc32a451c5666d | 441b9755e7ab5231364a495cc83e0152ee581302 | /WEB-INF/src/jym/sim/parser/ItemBase.java | b38c8009ea40e1892ad9bad93f6536937fdb10af | [] | no_license | VijayEluri/sim | bdf110a0eb9644365461be89ef7bb78f0c1a430a | 4edd8f3d2e27b4d1dde4dba6eccfa789a9c4e60c | refs/heads/master | 2020-05-20T11:05:03.956120 | 2013-08-19T01:05:40 | 2013-08-19T01:05:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | // CatfoOD 2012-2-27 上午11:26:27 yanming-sohu@sohu.com/@qq.com
package jym.sim.parser;
public abstract class ItemBase implements IItem {
public String toString() {
return getText();
}
public Object originalObj() {
return filter();
}
}
| [
"yanming-sohu@sohu.com"
] | yanming-sohu@sohu.com |
48ab5ecc777b2597cdbb573ad403ce2c3e39fe99 | 2b6348196097064ed94b1ff721995a6c84952fa4 | /src/main/java/Reports/Transporte.java | a985b39209cfc267ee6d886dca6996d84a13bfa9 | [] | no_license | RichardFuentes369/ProyectoGrado | c440723e4a84e8aa5bfa6c63ca169e19fc0d8727 | 5a17eab60514af22dfc8f8b4bd9ccecae3bd690b | refs/heads/master | 2022-01-29T06:45:23.980316 | 2019-01-11T07:21:05 | 2019-01-11T07:21:05 | 165,195,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,098 | 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 Reports;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
/**
*
* @author richard
*/
public class Transporte extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Connection con = null;
try {
Class.forName("org.postgresql.Driver");
con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/Bdtrazabilidad", "postgres", "1098785729");//dbpassword
String jrxmlFile = "/home/richard/NetBeansProjects/ProyectoGrado/src/main/java/Reports/Transporte.jrxml";
Entity.Usuario usr = (Entity.Usuario) request.getSession().getAttribute("userFinCC");
HashMap map = new HashMap();
map.put("usuario", usr.getCcUsuario());
System.out.println(usr.getCcUsuario());
JasperReport jasperReport = JasperCompileManager.compileReport(jrxmlFile);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, map, con);
OutputStream outStream = response.getOutputStream();
JasperExportManager.exportReportToPdfStream(jasperPrint, outStream);
response.getOutputStream().flush();
response.getOutputStream().close();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException ex) {
Logger.getLogger(Usuarios.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"javierbaron6@gmail.com"
] | javierbaron6@gmail.com |
4042afd10c586c152ef5ba277814814559e71af5 | 65cb1cf67e8645be0eaaf50497ceee5b28fc714b | /src/com/mytest/design/abstractfactory/ServerFactory.java | e1bc5ca948c5539954ef529cfb88797f0ee687d9 | [] | no_license | arunds/javasamples | 72a7fac8e0c3c82ac71a00588f17db939d1a0bb2 | cd89c16047081618e9b8c87d414d6d2d4b104d36 | refs/heads/master | 2020-03-18T22:12:22.928228 | 2018-06-10T22:56:05 | 2018-06-10T22:56:05 | 135,331,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 429 | java | package com.mytest.design.abstractfactory;
public class ServerFactory implements ComputerAbstractFactory {
private String ram;
private String hdd;
private String cpu;
public ServerFactory(String ram, String hdd, String cpu){
this.ram=ram;
this.hdd=hdd;
this.cpu=cpu;
}
@Override
public Computer createComputer() {
return new Server(ram,hdd,cpu);
}
} | [
"arunds.mail@gmail.com"
] | arunds.mail@gmail.com |
b914de9b6aa1e43128ee62d1fa6dd4b58c6d1e3a | bbe3cbba431395b223de88b759ad2694ed9b508b | /app/src/main/java/android/niky/mahem_final/Search_Filter/Estekhdami_menu.java | 732b36af9793fa3f80751912ebf9ed2cc5202c9e | [] | no_license | Nicky1377/Mahem_final | d44095eec91b0a107a320d5930cc8e46897131d8 | 4764c878e938087171ef31b8c1c2cf0def8ab227 | refs/heads/master | 2020-03-31T17:48:56.942898 | 2019-07-13T12:36:29 | 2019-07-13T12:36:29 | 152,435,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,987 | java | package android.niky.mahem_final.Search_Filter;
import android.niky.mahem_final.R;
import android.content.Intent;
import android.niky.mahem_final.other.Page1;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;
import android.niky.mahem_final.Add.SabtAgahi;
import android.niky.mahem_final.Groups.Group;
import android.niky.mahem_final.MenuItems.Menu1;
import android.niky.mahem_final.OffFinder.Off;
import java.util.ArrayList;
import java.util.List;
public class Estekhdami_menu extends AppCompatActivity {
View navigationBar;
ImageView Home,Add,Menu,MenuLine,Search;
ImageView Filter;
ListView listView;
List<Advertising> AdvList;
AdvAdapter adapter;
String ThumbnailUrl;
//fill this variables with information
private String title, describtion, time;
//private int image;
///////////
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
AdvList=new ArrayList<>();
listView=(ListView) findViewById(R.id.RecyclerView);
// recyclerView.setHasFixedSize(true);
// recyclerView.setLayoutManager(new LinearLayoutManager(this));
///this line add search views to the list:
AdvList.add(new Advertising(title,describtion,time,ThumbnailUrl));
adapter=new AdvAdapter(this,AdvList);
listView.setAdapter(adapter);
Filter=(ImageView)findViewById(R.id.filter);
Filter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(getBaseContext(),Filter_other.class);
startActivity(i);
}
});
Toast.makeText(this, getLocalClassName().toString() + "\nMohadese Salem", Toast.LENGTH_LONG).show();
map();
}
public void map() {
navigationBar=findViewById(R.id.rr);
Home = (ImageView) navigationBar.findViewById(R.id.home);
Add = (ImageView) navigationBar.findViewById(R.id.add);
Menu = (ImageView) navigationBar.findViewById(R.id.menu_f);
MenuLine = (ImageView) navigationBar.findViewById(R.id.menuLine_f);
Search =(ImageView)navigationBar.findViewById(R.id.search_f);
Search.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(getBaseContext(), android.niky.mahem_final.Search_Filter.Search.class);
i.putExtra("title",getResources().getString(R.string.title_search));
startActivity(i);
}
});
Menu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(getBaseContext(), Group.class);
startActivity(i);
}
});
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(getBaseContext(), SabtAgahi.class);
startActivity(i);
}
});
MenuLine.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(getBaseContext(), Menu1.class);
startActivity(i);
}
});
Home.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(getBaseContext(), Page1.class);
startActivity(i);
}
});
}
}
| [
"fatemeh.nickaeen@gmail.com"
] | fatemeh.nickaeen@gmail.com |
18c1ac40550765621ccf25ee13c1fe0303161325 | f8b8b43dc4b6d4cffcd3d1328ddec0c26034a16b | /cc.coolcoder/src/main/java/lru/ArrayListLru.java | bc68e14b845b44a29d56437ae06a1420a28d4583 | [] | no_license | xyhhttwan/examples-java | 60261d612b8cd61a4920d47d963bb55a8adf90ed | fc471d2f84c8bd33c6c19cf7aee2aaadf3c80863 | refs/heads/master | 2020-03-31T00:04:51.252030 | 2019-07-15T00:24:32 | 2019-07-15T00:24:32 | 151,724,825 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 181 | java | package lru;
public class ArrayListLru<E> {
Object[] elementData;
class Node {
private Node pre;
private Node next;
private int size;
}
}
| [
"baixiaobin@imzhiliao.com"
] | baixiaobin@imzhiliao.com |
f3ed01711fc804fcb44c031fb5a5f5e72c6dc7c3 | 2cd434cfb1b6c0dd366700c6cb901747e6396073 | /FibonacciCommon/fibonaccicom/src/androidTest/java/fibonacci/com/fibonaccicom/ApplicationTest.java | d9fb1c62a471814502a367f3b845884e4233504a | [] | no_license | robinwils/android-homework | 569b850183a9cdb6b560e3e1d404b9e42a7b7d61 | 6ef87504221e944558897beec273233f4d30cdec | refs/heads/master | 2020-05-28T05:02:00.972136 | 2014-12-17T15:13:28 | 2014-12-17T15:13:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package fibonacci.com.fibonaccicom;
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);
}
} | [
"robin.wilz@gmail.com"
] | robin.wilz@gmail.com |
1f42b6bfb96b3d49b536479d50cabb0d2aa1d048 | 01b72bdc73c618fc62a745eadd641b344c871e27 | /app/src/main/java/io/github/at19990/Time_Keeper/MainActivity.java | 897203368d2194cd11bee7dd003eed94c4dd311b | [] | no_license | at19990/Time_Keeper | 1693eb80ad6a06c02aedcf28060eae242e1a412b | 52c6d4db42dae9095c41e4ff40e517cf14106669 | refs/heads/master | 2020-07-27T02:54:28.110577 | 2019-09-22T11:05:20 | 2019-09-22T11:05:20 | 208,844,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,049 | java | package io.github.at19990.Time_Keeper;
import android.graphics.Color;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.media.AudioAttributes;
import android.media.SoundPool;
import android.widget.EditText;
import android.widget.Toast;
import android.view.inputmethod.InputMethodManager;
import android.content.Context;
import java.util.Locale;
public class MainActivity extends AppCompatActivity {
private static long START_TIME_IN_MILLIS = 10 * 60 * 1000; //タイマー設定 単位 ミリ秒 初期設定: 10分
private TextView mTextViewCountDown;
private Button mButtonStartPause;
private Button mButtonReset;
private Button mButtonSet;
private View mView;
private SoundPool soundPool;
private int bell_1;
private int bell_2;
private int bell_3;
private String errorMessage;
private EditText set_time;
private EditText firstbell_time;
private EditText secondbell_time;
private CountDownTimer mCountDownTimer;
private CountDownTimer mCountDownTimer_first;
private CountDownTimer mCountDownTimer_second;
private TextView mTimerText;
private boolean mTimerRunning;
private long mTimeLeftInMillis = START_TIME_IN_MILLIS;
private double time_length; // 初期設定: 10分
private double first_bell; // 初期設定: 5分前
private double second_bell; // 初期設定: 3分前
private double stored_time_length = 10;
private double stored_first_bell = 5;
private double stored_second_bell = 3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTextViewCountDown = findViewById(R.id.text_view_countdown);
set_time = findViewById(R.id.set_time_value);
firstbell_time = findViewById(R.id.set_firstbell_value);
secondbell_time = findViewById(R.id.set_secondbell_value);
mButtonStartPause = findViewById(R.id.button_start_pause);
mButtonReset = findViewById(R.id.buttonreset);
mButtonSet = findViewById(R.id.button_set);
mView = findViewById(R.id.view);
mTimerText = findViewById(R.id.text_view_countdown);
errorMessage = "値が無効です";
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ALARM)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build();
soundPool = new SoundPool.Builder()
.setAudioAttributes(audioAttributes)
// ストリーム数に応じて
.setMaxStreams(3)
.build();
bell_1 = soundPool.load(this, R.raw.firstbell, 1);
bell_2 = soundPool.load(this, R.raw.secondbell, 1);
bell_3 = soundPool.load(this, R.raw.thirdbell, 1);
mButtonSet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/* セットボタンを押すとキーボードを格納 */
InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
mTimerText.setTextColor(Color.BLACK);
/* テキストフォームに入力されているか判定 */
if((TextUtils.isEmpty(set_time.getText().toString())) || (TextUtils.isEmpty(firstbell_time.getText().toString())) || (TextUtils.isEmpty(secondbell_time.getText().toString()))){
toastMake(errorMessage, 0, 500); // 無効な入力の警告
}else{
time_length = Double.parseDouble(set_time.getText().toString());
first_bell = Double.parseDouble(firstbell_time.getText().toString());
second_bell = Double.parseDouble(secondbell_time.getText().toString());
/* 入力フォームの強調・カーソル表示を解除 */
set_time.clearFocus();
firstbell_time.clearFocus();
secondbell_time.clearFocus();
set_time.setCursorVisible(false);
firstbell_time.setCursorVisible(false);
secondbell_time.setCursorVisible(false);
/* 不正な入力値を検出 */
if((second_bell < first_bell) && (first_bell < time_length) && (second_bell > 0)){
mTimeLeftInMillis = (long)time_length * 60 * 1000;
stored_time_length = time_length;
stored_first_bell = first_bell;
stored_second_bell = second_bell;
updateCountDownText();
}else{
toastMake(errorMessage, 0, 500);
}
}
}
});
/* スタート・ストップボタンの動作定義 */
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mTimerRunning){
pauseTimer();
} else {
startTimer();
}
}
});
/* リセットボタンの動作定義 */
mButtonReset.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
resetTimer();
}
});
/* フォーム・ボタン以外の部分をタッチしたときの動作定義 */
mView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
mView.requestFocus();
/* キーボード格納 */
InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
});
updateCountDownText();
}
private void startTimer(){
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis,100) { // 100ミリ秒単位でカウント
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
soundPool.play(bell_3, 1.0f, 1.0f, 1, 0, 1);
/* 1鈴と2鈴のカウントを終了 */
mCountDownTimer_first.cancel();
mCountDownTimer_second.cancel();
mButtonStartPause.setText("スタート");
mButtonReset.setVisibility(View.VISIBLE); // 表示
mTimerText.setTextColor(Color.BLACK);
}
}.start();
/* 1鈴のカウント */
if((mTimeLeftInMillis - (long)first_bell * 60 * 1000) >= 0){
mCountDownTimer_first = new CountDownTimer(mTimeLeftInMillis - (long)first_bell * 60 * 1000,100) {
@Override
public void onTick(long millisUntilFinished) {
// mTimeLeftInMillis = millisUntilFinished;
}
@Override
public void onFinish() {
soundPool.play(bell_1, 1.0f, 1.0f, 1, 0, 1);
}
}.start();
}
/* 2鈴のカウント */
if((mTimeLeftInMillis - (long)second_bell * 60* 1000) >= 0){
mCountDownTimer_second = new CountDownTimer(mTimeLeftInMillis - (long)second_bell * 60 * 1000,100) {
@Override
public void onTick(long millisUntilFinished) {
// mTimeLeftInMillis = millisUntilFinished;
}
@Override
public void onFinish() {
soundPool.play(bell_2, 1.0f, 1.0f, 1, 0, 1);
mTimerText.setTextColor(Color.RED);
}
}.start();
}
mTimerRunning = true; // タイマー作動中
mButtonStartPause.setText("一時停止");
mButtonReset.setVisibility(View.INVISIBLE);
}
private void toastMake(String message, int x, int y){
Toast toast = Toast.makeText(this, message, Toast.LENGTH_LONG);
toast.setGravity(android.view.Gravity.CENTER, x, y);
toast.show();
}
private void pauseTimer(){
mTimerRunning = false;
mCountDownTimer.cancel();
mCountDownTimer_first.cancel();
// mCountDownTimer_first = null;
mCountDownTimer_second.cancel();
// mCountDownTimer_second = null;
mButtonStartPause.setText("スタート");
mButtonReset.setVisibility(View.VISIBLE);
}
private void resetTimer(){
time_length = stored_time_length;
mTimeLeftInMillis = (long)time_length * 1000 * 60;
first_bell = stored_first_bell;
second_bell = stored_second_bell;
updateCountDownText();
mButtonStartPause.setVisibility(View.VISIBLE);
mButtonReset.setVisibility(View.INVISIBLE);
mTimerText.setTextColor(Color.BLACK);
}
// タイマー表示
private void updateCountDownText(){
int minutes = (int)(mTimeLeftInMillis/1000)/60;
int seconds = (int)(mTimeLeftInMillis/1000)%60;
String timeLeftFormatted = String.format(Locale.getDefault(), "%02d:%02d",minutes,seconds);
mTextViewCountDown.setText(timeLeftFormatted);
}
}
| [
"a.tsuda19990@gmail.com"
] | a.tsuda19990@gmail.com |
297684f1967fad7fce3a72a20750361f2eb89bda | 5914c190d0625338fce050562a3f4e242b69d219 | /app/src/androidTest/java/com/rbmhz/dagger2/ExampleInstrumentedTest.java | 0db42888ead9cda9851bafe34475fe806514dc20 | [] | no_license | bikrammhz1/dagger2_di | 24e0bcee6a616e5474e1a4f98024422a37235712 | e5ee9ff28bf94e609e382aa22751fb1f2b6d3f85 | refs/heads/master | 2020-05-03T22:59:58.352458 | 2019-04-01T12:15:25 | 2019-04-01T12:15:25 | 178,854,894 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 718 | java | package com.rbmhz.dagger2;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.rbmhz.dagger2", appContext.getPackageName());
}
}
| [
"bikram.maharjan@infodevelopers.com.np"
] | bikram.maharjan@infodevelopers.com.np |
9605f6885c27cda92af4e6ed94fec28897190cf5 | e08314b8c22df72cf3aa9e089624fc511ff0d808 | /src/sdk4.0/ces/sdk/util/PropertyUtil.java | 7bae22ea35de0a8b4238c5f79035819f3d371805 | [] | no_license | quxiongwei/qhzyc | 46acd4f6ba41ab3b39968071aa114b24212cd375 | 4b44839639c033ea77685b98e65813bfb269b89d | refs/heads/master | 2020-12-02T06:38:21.581621 | 2017-07-12T02:06:10 | 2017-07-12T02:06:10 | 96,864,946 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,017 | java | package ces.sdk.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
import java.util.Properties;
/**
* 属性文件解析类
* */
public class PropertyUtil {
private static PropertyUtil instance = null;
private PropertyUtil(){}
public static PropertyUtil getInstance() {
instance = null==instance?new PropertyUtil():instance;
return instance;
}
private Properties ces_initProperties ; //ces_init.properties
private Properties db_Properties ; //数据源的配置文件
private Properties sql_Properties ; //当前的数据库配置文件
private Properties commonSql_Properties ; //通用的sql配置文件
public Properties getCes_initProperties(){
if(null==ces_initProperties){
ces_initProperties = new Properties();
String ces_initFilePath = CesGlobals.getInstance().getClassesPath()+"/ces_init.properties";
FileInputStream fis = null;
try {
fis = new FileInputStream(new File(ces_initFilePath));
ces_initProperties.load(fis);
} catch (FileNotFoundException e) {
throw new RuntimeException(e.getMessage()+"/n/n ces_init.properties 配置文件没有找到!");
} catch (IOException e) {
e.printStackTrace();
} finally{
if(null!=fis) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return ces_initProperties;
}
/**
* 根据数据库类型获取当前sql配置文件
* */
public Properties getSql_Properties(){
if(null==sql_Properties){
sql_Properties = new Properties();
String sql_FilePath = "/sql_config/"+ConnectionUtil.getDataBaseType()+"/"+ConnectionUtil.getDataBaseType()+".properties";
InputStream fis = getClass().getResourceAsStream(sql_FilePath);
try {
sql_Properties.load(fis);
} catch (IOException e) {
throw new RuntimeException(e.getMessage()+"/n/n sql配置文件没有找到或者读取错误!");
}
}
return sql_Properties;
}
/**
* 根据数据库类型获取当前sql配置文件
* */
public Properties getCommonSql_Properties(){
if(null==commonSql_Properties){
commonSql_Properties = new Properties();
String sql_FilePath = "/sql_config/common/common_sql.properties";
InputStream fis = getClass().getResourceAsStream(sql_FilePath);
try {
commonSql_Properties.load(fis);
} catch (IOException e) {
throw new RuntimeException(e.getMessage()+"/n/n sql配置文件没有找到或者读取错误!");
}
}
return commonSql_Properties;
}
public Properties getDB_Properties(){
if(null==db_Properties){
db_Properties = new Properties();
String ces_initFilePathString = CesGlobals.getInstance().getClassesPath()+"/db_config.properties";
FileInputStream fis = null;
try {
fis = new FileInputStream(new File(ces_initFilePathString));
db_Properties.load(fis);
} catch (FileNotFoundException e) {
throw new RuntimeException(e.getMessage()+"/n/n db_config.properties 配置文件没有找到");
} catch (IOException e) {
e.printStackTrace();
} finally{
if(null!=fis) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return db_Properties;
}
public String getPropertyValueByKey(Properties properties,String key){
String result = properties.getProperty(key);
// if(null!=result)
// try {
// result = new String(result.getBytes("ISO8859-1"),"UTF-8");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
return result;
}
public static void main(String[] args) {
//System.out.println(getInstance().getSql_Properties().getProperty("userInfoFacade_getMoreInfoByCondition"));
System.out.println(MessageFormat.format(
getInstance().getSql_Properties().getProperty("DBOpLogInfoFacade_queryOpLogInfo"),
"管理","请求","2012-1-1","2015-1-1"));
}
}
| [
"qu.xiongwei@cesgroup.com.cn"
] | qu.xiongwei@cesgroup.com.cn |
fac7b6432500f0d665e74100e38b62ff173b43e6 | 966299b1506b2c6b9c117f3972b4e35f2e86a8e2 | /src/com/windern/algorithmlearning/Main.java | 7d7a431976500aa21bc27e6c63460f484e6c840f | [] | no_license | windern/AlgorithmLearning | 0dbceebc227b953843c22a1509aa614491459c5c | 81de809258b4d877f0f34ebb241a7d6a677b9881 | refs/heads/master | 2021-07-05T05:49:21.374532 | 2020-11-22T16:28:55 | 2020-11-22T16:28:55 | 204,234,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | package com.windern.algorithmlearning;
public class Main {
public static void main(String[] args) {
// write your code here
System.out.println("hello world");
}
}
| [
"windern0712@126.com"
] | windern0712@126.com |
0041de9a5d9b4f23b5b1e17d8574d61dd155f484 | d539103b6a3e57f89c97052c0e50d513abfeeb21 | /article/Util.java | bb03a9236f672301e553f9fe4782f5d845fa795f | [] | no_license | chacha86/210717DB | baf1b30de6c1e973d8b9a8d76f9d6d89ee3d0f27 | 15abb70d5e164276d94b3997f0980e8821d97b3b | refs/heads/master | 2023-08-06T09:11:39.645834 | 2021-09-08T06:12:57 | 2021-09-08T06:12:57 | 391,519,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 144 | java | package article;
public class Util {
public static int getIntByCeil(int num1, int num2) {
return (int)Math.ceil((double)num1 / num2);
}
}
| [
"taejincha0619@gmail.com"
] | taejincha0619@gmail.com |
1a0a4badfdff3c99bad578748e1e7014f9561cd6 | 08c17ec05b4ed865c2b9be53f19617be7562375d | /aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/transform/PutAutoScalingPolicyResultJsonUnmarshaller.java | b37af3a1cb99734def14c33febabbe4cc52e1f31 | [
"Apache-2.0"
] | permissive | shishir2510GitHub1/aws-sdk-java | c43161ac279af9d159edfe96dadb006ff74eefff | 9b656cfd626a6a2bfa5c7662f2c8ff85b7637f60 | refs/heads/master | 2020-11-26T18:13:34.317060 | 2019-12-19T22:41:44 | 2019-12-19T22:41:44 | 229,156,587 | 0 | 1 | Apache-2.0 | 2020-02-12T01:52:47 | 2019-12-19T23:45:32 | null | UTF-8 | Java | false | false | 3,714 | java | /*
* Copyright 2014-2019 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.elasticmapreduce.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.elasticmapreduce.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* PutAutoScalingPolicyResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PutAutoScalingPolicyResultJsonUnmarshaller implements Unmarshaller<PutAutoScalingPolicyResult, JsonUnmarshallerContext> {
public PutAutoScalingPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
PutAutoScalingPolicyResult putAutoScalingPolicyResult = new PutAutoScalingPolicyResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return putAutoScalingPolicyResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("ClusterId", targetDepth)) {
context.nextToken();
putAutoScalingPolicyResult.setClusterId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("InstanceGroupId", targetDepth)) {
context.nextToken();
putAutoScalingPolicyResult.setInstanceGroupId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("AutoScalingPolicy", targetDepth)) {
context.nextToken();
putAutoScalingPolicyResult.setAutoScalingPolicy(AutoScalingPolicyDescriptionJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("ClusterArn", targetDepth)) {
context.nextToken();
putAutoScalingPolicyResult.setClusterArn(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return putAutoScalingPolicyResult;
}
private static PutAutoScalingPolicyResultJsonUnmarshaller instance;
public static PutAutoScalingPolicyResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new PutAutoScalingPolicyResultJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
83d7544dd893c8562a4ad58e172065af4839e6dd | 4b256bf15e0f24d76fa747e5d663b43231ab79cc | /src/main/java/com/wonders/demo/StringTest.java | 80de6f52c35d70235acd2170cdc9bd0c5162cb90 | [] | no_license | huangsanyeah/springboot-huangsanyeah | 7fd986d87d4efb357f256a3a3d5d75000adad2ab | c8e0ad8b33b874d3534f33a2cd40613798f31076 | refs/heads/master | 2022-02-18T04:03:37.401398 | 2019-08-18T15:14:32 | 2019-08-18T15:14:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,319 | java | package com.wonders.demo;
/**
* @Description String "ab"和"a"+"b"是否==
* @Author huangweiyue
* @Date Created in 2018-07-04 19:05
* @ModifiedBy
* @Version v1.0
*/
public class StringTest {
public static void main(String[] args) {
/* String s = "abcdef";
String s1 = "abc";
char[] chars = s.toCharArray();
System.out.println(s.compareTo(s1));
String str1 = "ab";
String str2 = "a" + "b";
//相等
System.out.println(str1 == str2);*/
String a = "abc";
String b = "abc";
String c = new String("abc");
String d = "ab" + "c";
//"a == b" + a == b中的+ 相当于拼接字符串了 要注意优先级
/* System.out.println("a == b" + a == b); //false
System.out.println("a == c" + a == c); //false
System.out.println("a == d" + a == d); //false
System.out.println("b == c" + b == c); //false
System.out.println("b == d" + b == d); //false
System.out.println("c == d" + c == d); //false*/
System.out.println(a == b); //true
System.out.println(a == c); //false
System.out.println(a == d); //true
System.out.println(b == c); //false
System.out.println(b == d); //true
System.out.println(c == d); //false
}
}
| [
"huangweiyue@quyiyuan.com"
] | huangweiyue@quyiyuan.com |
47818d57c6526846e3add62016a3c85b021d32dc | 7f414ee6a20874ebf33f51a79f26367c72ddda98 | /src/modelo/Edge.java | eae4c30f339deac61f4bb8151b3a97a17958220a | [] | no_license | low23/TallerFinal | 6401d621849909af9498f72437835f5819fde53c | 4e50f447b098987c62c04b89c0dfede8a81c83be | refs/heads/master | 2021-03-12T20:09:26.186560 | 2014-06-03T10:31:04 | 2014-06-03T10:31:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 729 | java | package modelo;
import control.IEdge;
import control.IVertex;
public class Edge implements IEdge{
private Vertex initialVertex;
private Vertex terminalVertex;
private double weight;
private final static double DEFAULT_WEIGHT=1;
public Edge(Vertex iv, Vertex tv){
initEdge(iv, tv, DEFAULT_WEIGHT);
}
public Edge(Vertex iv, Vertex tv, double w){
initEdge(iv, tv, w);
}
private void initEdge(Vertex iv, Vertex tv, double w){
initialVertex = iv;
terminalVertex = tv;
weight = w;
}
public IVertex getInitialVertex() {
return initialVertex;
}
public IVertex getTerminalVertex() {
return terminalVertex;
}
public double getWeight() {
return weight;
}
}
| [
"andrestor2@gmail.com"
] | andrestor2@gmail.com |
fc9ba7f473f345ea9878aa2df04cbad4baf0e754 | 19b2339916cfa1c67064bd1bcb596b90176cbe09 | /webbeans-impl/src/test/java/org/apache/webbeans/test/portable/scopeextension/ExternalTestScopeExtension.java | a525f83169ae9031bda997cccb2ec6ce40e3a8dc | [
"Apache-2.0"
] | permissive | tomitribe/openwebbeans | 11bc241ed4057076ea34904f6f0bfc5520349b7d | c59d327f49f59bb6cf59eb5c62a34758bcea9e1c | refs/heads/trunk | 2023-03-17T21:36:10.567187 | 2018-11-07T15:53:10 | 2018-11-07T15:53:10 | 156,701,071 | 0 | 2 | Apache-2.0 | 2022-06-08T21:50:31 | 2018-11-08T12:06:38 | Java | UTF-8 | Java | false | false | 1,797 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.webbeans.test.portable.scopeextension;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.enterprise.inject.spi.Extension;
import org.junit.Assert;
public class ExternalTestScopeExtension implements Extension
{
public void addViewScoped(@Observes BeforeBeanDiscovery beforeBeanDiscovery, BeanManager beanManager)
{
// see OWB-622 it's expected that the BeanManager already exists even in BeforeBeanDiscovery.
Assert.assertNotNull(beanManager);
beforeBeanDiscovery.addScope(ExternalTestScoped.class, true, true);
}
public void registerViewContext(@Observes AfterBeanDiscovery afterBeanDiscovery)
{
afterBeanDiscovery.addContext(new ExternalTestScopeContext(true));
afterBeanDiscovery.addContext(new ExternalTestScopeContext(false));
}
}
| [
"struberg@apache.org"
] | struberg@apache.org |
69f789441e2b5144f7439e4cfbc387ceed4c506c | 73267be654cd1fd76cf2cb9ea3a75630d9f58a41 | /services/eihealth/src/main/java/com/huaweicloud/sdk/eihealth/v1/model/SubscribeAppReq.java | ab570d80de50d76ae58835934566b0bfaf7f001d | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-java-v3 | 51b32a451fac321a0affe2176663fed8a9cd8042 | 2f8543d0d037b35c2664298ba39a89cc9d8ed9a3 | refs/heads/master | 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 | NOASSERTION | 2023-09-08T12:24:55 | 2020-05-08T02:27:00 | Java | UTF-8 | Java | false | false | 4,528 | java | package com.huaweicloud.sdk.eihealth.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* 订阅应用请求体
*/
public class SubscribeAppReq {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "asset_id")
private String assetId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "asset_version")
private String assetVersion;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "destination_app_name")
private String destinationAppName;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "destination_app_version")
private String destinationAppVersion;
public SubscribeAppReq withAssetId(String assetId) {
this.assetId = assetId;
return this;
}
/**
* 资产id。长度1-128,只能包含字母、数字、下划线和中划线
* @return assetId
*/
public String getAssetId() {
return assetId;
}
public void setAssetId(String assetId) {
this.assetId = assetId;
}
public SubscribeAppReq withAssetVersion(String assetVersion) {
this.assetVersion = assetVersion;
return this;
}
/**
* 资产版本。长度1-128,字母或数字开头,后面跟小写字母、数字、小数点、斜杠、下划线或中划线
* @return assetVersion
*/
public String getAssetVersion() {
return assetVersion;
}
public void setAssetVersion(String assetVersion) {
this.assetVersion = assetVersion;
}
public SubscribeAppReq withDestinationAppName(String destinationAppName) {
this.destinationAppName = destinationAppName;
return this;
}
/**
* 目标应用名称 取值范围:长度为[1,56],以大小写字母开头,允许出现中划线(-)、下划线(_)、小写字母和数字,且必须以大小写字母或数字结尾。
* @return destinationAppName
*/
public String getDestinationAppName() {
return destinationAppName;
}
public void setDestinationAppName(String destinationAppName) {
this.destinationAppName = destinationAppName;
}
public SubscribeAppReq withDestinationAppVersion(String destinationAppVersion) {
this.destinationAppVersion = destinationAppVersion;
return this;
}
/**
* 目标应用版本。取值范围:长度[1,24],以小写字母或数字或大写字母开头,允许出现中划线,必须以小写字母或数字或大写字母结尾。
* @return destinationAppVersion
*/
public String getDestinationAppVersion() {
return destinationAppVersion;
}
public void setDestinationAppVersion(String destinationAppVersion) {
this.destinationAppVersion = destinationAppVersion;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
SubscribeAppReq that = (SubscribeAppReq) obj;
return Objects.equals(this.assetId, that.assetId) && Objects.equals(this.assetVersion, that.assetVersion)
&& Objects.equals(this.destinationAppName, that.destinationAppName)
&& Objects.equals(this.destinationAppVersion, that.destinationAppVersion);
}
@Override
public int hashCode() {
return Objects.hash(assetId, assetVersion, destinationAppName, destinationAppVersion);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SubscribeAppReq {\n");
sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n");
sb.append(" assetVersion: ").append(toIndentedString(assetVersion)).append("\n");
sb.append(" destinationAppName: ").append(toIndentedString(destinationAppName)).append("\n");
sb.append(" destinationAppVersion: ").append(toIndentedString(destinationAppVersion)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
b785412c4222ad4eb93fdf872172c798a6be3f59 | 31ed5796c960e4efb142c7556aa4876041290d6c | /Notes2/app/src/main/java/com/example/notes/LoginActivity.java | dfe324929d3893d6308f794e06aed8b78374b1af | [] | no_license | Sarang681/Notes | e6ba98aea670e0516181a904c1f6112f3ee48c8a | 1276882d31cd1d741fd7732325c296ed05b5a2d3 | refs/heads/master | 2023-05-27T19:50:30.372737 | 2020-01-03T08:40:34 | 2020-01-03T08:40:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,587 | java | package com.example.notes;
/****************************************************************************************************************************************************************************************************
THIS IS THE LOGIN SCREEN OF THE APP. IT CONTAINS THE CODE FOR THE FIREBASE AUTHENTICATION UI THAT CONTAINS THE VARIOUS LOGIN METHODS
***************************************************************************************************************************************************************************************************/
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.firebase.ui.auth.AuthUI;
import com.firebase.ui.auth.IdpResponse;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;
import javax.annotation.Nullable;
public class LoginActivity extends AppCompatActivity {
int AUTHUI_REQUEST_CODE = 1001;
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+5:30"));
Date currentLocalTime = calendar.getTime();
DateFormat dateFormat = new SimpleDateFormat("HH");
int timeHour;
LinearLayout layout;
TextView head;
//TextView subtitle = findViewById(R.id.textView_subtitle);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
String localTime = dateFormat.format(currentLocalTime);
layout = findViewById(R.id.login_layout);
head = findViewById(R.id.textView_heading);
timeHour = Integer.parseInt(localTime);
if(timeHour>=5&&timeHour<=12) {
layout.setBackgroundResource(R.drawable.background_morning);
head.setText("Good Morning!");
}
else if(timeHour>12&&timeHour<=17) {
layout.setBackgroundResource(R.drawable.background_afternoon);
head.setText("Good Afternoon!");
}
else if(timeHour>17&&timeHour<=20) {
layout.setBackgroundResource(R.drawable.background_evening);
head.setText("Good Evening!");
}
else if(timeHour>20&&timeHour<=24) {
layout.setBackgroundResource(R.drawable.background_night);
head.setText("Good Evening!");
}
else if(timeHour>=0&&timeHour<5) {
layout.setBackgroundResource(R.drawable.background_night);
head.setText("Good Evening!");
}
//Checks if the user is already logged on or not. If he is, it takes him to the MainActivity.
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
startActivity(new Intent(this,MainActivity.class));
this.finish();
}
}
//Method that handles the Login processes.
public void handleLoginRegister(View view) {
//This list contains the various ways a user can login.
List<AuthUI.IdpConfig> provider = Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build()
);
//Builds the Firebase Authentication (LOGIN) UI
Intent intent = AuthUI.getInstance()
.createSignInIntentBuilder()//Creates the Sign in builders that build the sign in methods
.setAvailableProviders(provider)//Sets the available login methods to the ones mentioned in the above list
.setTosAndPrivacyPolicyUrls("https://firebase@notes.example.com","https://firebase@notes.example.com")//Handle the PRIVACY POLICY and TOS hyperlinks
.setLogo(R.drawable.app_icon)//Sets the logo that appears on the top
.setAlwaysShowSignInMethodScreen(true)//Method to always show the login screen, whenever the user is logged out.
.build();
startActivityForResult(intent,AUTHUI_REQUEST_CODE);
}
//Handles the login processes
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode,resultCode,data);
//Check if the sign in is successful.
if(requestCode == AUTHUI_REQUEST_CODE) {
//Check if the user is a new user or a returning one.
if(resultCode == RESULT_OK) {
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if(user.getMetadata().getCreationTimestamp()==user.getMetadata().getLastSignInTimestamp()) {
Toast.makeText(this,"Welcome New User!!",Toast.LENGTH_SHORT).show();
}
else {
Toast.makeText(this, "Welcome back Returning User!!", Toast.LENGTH_SHORT).show();
}
Intent intent = new Intent(this,MainActivity.class);
startActivity(intent);
this.finish();
}
else {
Toast.makeText(this, "Login/Registration Failed", Toast.LENGTH_SHORT).show();
}
}
}
}
| [
"sarang0608.desai@gmail.com"
] | sarang0608.desai@gmail.com |
ed571bb305004710f4aa26f6a8cc799b018a1c87 | 882501c65d6e852f432932b2a0f5cfb48511f002 | /app/src/androidTest/java/com/tnt/homestay/ExampleInstrumentedTest.java | a75599ac33cd19065f36bbe3b4b73cc50b830f0e | [] | no_license | namng360/HomeStay | b2ed873c5abf3795c19692c479eff2bcd6e3c490 | f5e48bbc19e63de8936b5fcda62b7e200a287221 | refs/heads/master | 2020-08-27T02:42:22.050583 | 2019-10-24T06:22:20 | 2019-10-24T06:22:20 | 217,222,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 748 | java | package com.tnt.homestay;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.tnt.homestay", appContext.getPackageName());
}
}
| [
"giangnam365@gmail.com"
] | giangnam365@gmail.com |
57df3175b34939afc5736b4b51721d2e819bd2eb | 061889d386351fa0d149cd38d6781acbf53b87d5 | /NiaGUI/.svn/pristine/57/57df3175b34939afc5736b4b51721d2e819bd2eb.svn-base | b8c8585e9cad1cce608ae9af35b9302c74ce7d3e | [] | no_license | Sebisnow/NiagaCanvas | b19e65be8c1edc0c5efabd8ff2083c0c96bc3719 | 9b21b86e603a850d75ac0201e03adea13633e677 | refs/heads/master | 2021-01-01T05:42:32.040847 | 2016-05-10T07:53:57 | 2016-05-10T07:53:57 | 56,078,885 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,549 | package niagaCanvas;
import java.awt.geom.RectangularShape;
import java.util.Objects;
import jkanvas.Canvas;
import jkanvas.animation.AnimatedPosition;
import jkanvas.nodelink.layout.AbstractLayouter;
import jkanvas.nodelink.layout.LayoutedView;
/**
* A simple layouted view.
*
* @author Joschi <josua.krause@gmail.com>
* @param <T>
* The node position type.
*/
public class SimpleLayoutedView<T extends AnimatedPosition> extends SimpleNodeLinkView<T> implements LayoutedView<T> {
/** The canvas. */
private final Canvas canvas;
/** The layouter. */
private AbstractLayouter<T> layouter;
/**
* Creates a layouted view.
*
* @param canvas
* The canvas.
* @param isDirected
* Whether the graph is directed.
*/
public SimpleLayoutedView(final Canvas canvas, final boolean isDirected) {
super(isDirected);
this.canvas = Objects.requireNonNull(canvas);
layouter = null;
}
@Override
protected void onChange() {
super.onChange();
if (layouter != null) {
layouter.layout(false);
}
}
@Override
public void setLayouter(final AbstractLayouter<T> layouter) {
if (this.layouter != null) {
this.layouter.deregister();
}
this.layouter = layouter;
if (layouter != null) {
layouter.register(canvas, this);
layouter.layout(false);
}
}
@Override
public AbstractLayouter<T> getLayouter() {
return layouter;
}
@Override
public void getBoundingBox(final RectangularShape bbox) {
Objects.requireNonNull(layouter);
layouter.getBoundingBox(bbox);
}
}
| [
"sebastian.2.schneider@uni.kn"
] | sebastian.2.schneider@uni.kn | |
84bce9578a67fdb0038fe6efbad14dfb26150a2b | 7291823ec40df1e74ac2ae0ef5f240d2344c01ce | /ch03/ch03_3/android/app/src/main/java/com/ch03_3/MainApplication.java | 8fb889131244cb722459ddfa7f1a8691f14f88fc | [] | no_license | dantae923/Doit_Reactnative | d8bd782a4490d5f8a0e42c385dd4c68d20eae5e1 | f8dec0fba2f7b016abb6b9a49c2fd074bc9ab376 | refs/heads/master | 2023-08-31T14:10:57.886033 | 2021-10-11T07:51:02 | 2021-10-11T07:51:02 | 410,544,600 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,646 | java | package com.ch03_3;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.ch03_3.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"youngjoonkim94@gmail.com"
] | youngjoonkim94@gmail.com |
f1fd0436d7374b887f83d51d9774dc3b31445103 | 4e96ad1fbfea7f18729c7b5f754e1ad8a106598d | /src/main/java/genericitems/Tuple4.java | 409d5f516b6e3ef56c2d6ba96c9ef333204e4b42 | [] | no_license | LRuffati/ing-sw-2019-9 | 298b864e7d370dd0514294291a99ec2d529400da | 0a799e9da042808a2bf6319ba7b58e57b7748ff0 | refs/heads/master | 2022-05-28T22:30:23.272515 | 2019-07-07T15:25:51 | 2019-07-07T15:25:51 | 173,973,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package genericitems;
import actions.ActionInfo;
import java.io.Serializable;
/**
*
* Tuple should be immutable or a deep copy should be implemented in
* {@link ActionInfo#getActionRequirements()} and others
*
* @param <X>
* @param <Y>
* @param <Z>
* @param <T>
*/
public class Tuple4<X, Y, Z, T> implements Serializable {
public final X x;
public final Y y;
public final Z z;
public final T t;
public Tuple4(X x, Y y, Z z, T t){
this.x = x;
this.y = y;
this.z = z;
this.t = t;
}
}
| [
"pietro.tenani@hotmail.it"
] | pietro.tenani@hotmail.it |
59f231328618a2d2315e39e694367e6f190aeb43 | fe2ef5d33ed920aef5fc5bdd50daf5e69aa00ed4 | /jbpm.bpel/test/bpel/org/jbpm/bpel/integration/def/ReplierTest.java | 70055b61e49b6989cb28c20b88d39b52866b7abe | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | sensui74/legacy-project | 4502d094edbf8964f6bb9805be88f869bae8e588 | ff8156ae963a5c61575ff34612c908c4ccfc219b | refs/heads/master | 2020-03-17T06:28:16.650878 | 2016-01-08T03:46:00 | 2016-01-08T03:46:00 | null | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 12,139 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
* published by JBoss Inc.; either version 1.0 of the License, or
* (at your option) any later version.
*
* This software 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.
*/
package org.jbpm.bpel.integration.def;
import java.io.StringReader;
import java.util.Map;
import javax.jms.MessageConsumer;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.Session;
import javax.naming.InitialContext;
import javax.naming.LinkRef;
import javax.wsdl.Definition;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.jbpm.bpel.app.AppDescriptor;
import org.jbpm.bpel.db.AbstractDbTestCase;
import org.jbpm.bpel.def.BpelDefinition;
import org.jbpm.bpel.def.ImportsDefinition;
import org.jbpm.bpel.def.Receive;
import org.jbpm.bpel.def.Reply;
import org.jbpm.bpel.def.Sequence;
import org.jbpm.bpel.integration.def.Correlations;
import org.jbpm.bpel.integration.def.PartnerLinkDefinition;
import org.jbpm.bpel.integration.def.Receiver;
import org.jbpm.bpel.integration.def.Replier;
import org.jbpm.bpel.integration.exe.CorrelationSetInstance;
import org.jbpm.bpel.integration.jms.OutstandingRequest;
import org.jbpm.bpel.integration.jms.IntegrationConstants;
import org.jbpm.bpel.integration.jms.IntegrationControl;
import org.jbpm.bpel.integration.jms.IntegrationControlHelper;
import org.jbpm.bpel.variable.exe.MessageValue;
import org.jbpm.bpel.wsdl.util.WsdlUtil;
import org.jbpm.bpel.xml.BpelReader;
import org.jbpm.bpel.xml.util.XmlUtil;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
/**
* @author Alejandro Guízar
* @version $Revision: 1.6 $ $Date: 2006/09/11 09:32:37 $
*/
public class ReplierTest extends AbstractDbTestCase {
private BpelDefinition process;
private Token token;
private IntegrationControl integrationControl;
private Queue portQueue;
private static final String WSDL_TEXT =
"<definitions targetNamespace='http://jbpm.org/wsdl'" +
" xmlns:tns='http://jbpm.org/wsdl'" +
" xmlns:sns='http://jbpm.org/xsd'" +
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'" +
" xmlns:bpws='http://schemas.xmlsoap.org/ws/2004/03/business-process/'" +
" xmlns:plnk='http://schemas.xmlsoap.org/ws/2004/03/partner-link/'" +
" xmlns='http://schemas.xmlsoap.org/wsdl/'>" +
" <message name='request'>" +
" <part name='simplePart' type='xsd:string'/>" +
" <part name='elementPart' element='sns:surpriseElement'/>" +
" </message>" +
" <message name='response'>" +
" <part name='intPart' type='xsd:int'/>" +
" <part name='complexPart' type='sns:complexType'/>" +
" </message>" +
" <message name='failure'>" +
" <part name='faultPart' element='sns:faultElement'/>" +
" </message>" +
" <portType name='pt'>" +
" <operation name='op'>" +
" <input message='tns:request'/>" +
" <output message='tns:response'/>" +
" <fault name='flt' message='tns:failure'/>" +
" </operation>" +
" </portType>" +
" <plnk:partnerLinkType name='plt'>" +
" <plnk:role name='r1' portType='tns:pt'/>" +
" </plnk:partnerLinkType>" +
" <bpws:property name='nameProperty' type='xsd:string'/>" +
" <bpws:property name='idProperty' type='xsd:int'/>" +
" <bpws:propertyAlias propertyName='tns:nameProperty' messageType='tns:request' part='elementPart'>" +
" <bpws:query>c/@name</bpws:query>" +
" </bpws:propertyAlias>" +
" <bpws:propertyAlias propertyName='tns:idProperty' messageType='tns:request' part='elementPart'>" +
" <bpws:query>e</bpws:query>" +
" </bpws:propertyAlias>" +
" <bpws:propertyAlias propertyName='tns:nameProperty' messageType='tns:response' part='complexPart'>" +
" <bpws:query>c/@name</bpws:query>" +
" </bpws:propertyAlias>" +
" <bpws:propertyAlias propertyName='tns:idProperty' messageType='tns:response' part='intPart' />" +
"</definitions>";
private static final String BPEL_TEXT =
"<process name='testProcess' xmlns:def='http://jbpm.org/wsdl'" +
" xmlns='http://schemas.xmlsoap.org/ws/2004/03/business-process/'>" +
" <partnerLinks>" +
" <partnerLink name='pl' partnerLinkType='def:plt' myRole='r1'/>" +
" </partnerLinks>" +
" <variables>" +
" <variable name='req' messageType='def:request'/>" +
" <variable name='rsp' messageType='def:response'/>" +
" <variable name='flt' messageType='def:failure'/>" +
" </variables>" +
" <correlationSets>" +
" <correlationSet name='csId' properties='def:idProperty'/>" +
" <correlationSet name='csName' properties='def:nameProperty'/>" +
" </correlationSets>" +
" <sequence>" +
" <receive name='rec' partnerLink='pl' operation='op' variable='req'" +
" messageExchange='swing' createInstance='yes'>" +
" <correlations>" +
" <correlation set='csId' initiate='yes'/>" +
" </correlations>" +
" </receive>" +
" <reply name='rep-out' partnerLink='pl' operation='op' variable='rsp' " +
" messageExchange='swing'>" +
" <correlations>" +
" <correlation set='csId'/>" +
" <correlation set='csName' initiate='yes'/>" +
" </correlations>" +
" </reply>" +
" <reply name='rep-flt' partnerLink='pl' operation='op' variable='flt'" +
" messageExchange='swing' faultName='def:flt'/>" +
" </sequence>" +
"</process>";
private static final String NS_DEF = "http://jbpm.org/wsdl";
private static final String PARTNER_LINK_HANDLE = "pl";
public void setUp() throws Exception {
// set up db
super.setUp();
// create process definition
process = new BpelDefinition();
BpelReader bpelReader = BpelReader.getInstance();
// read wsdl
Definition def = WsdlUtil.readText(WSDL_TEXT);
ImportsDefinition imports = process.getImports();
imports.addImport(WsdlUtil.createImport(def));
bpelReader.registerPropertyAliases(imports);
// read bpel
bpelReader.read(process, new InputSource(new StringReader(BPEL_TEXT)));
// deploy process definition and commit changes
jbpmContext.deployProcessDefinition(process);
newTransaction();
// create process instance
ProcessInstance pi = process.createProcessInstance();
token = pi.getRootToken();
// app descriptor
AppDescriptor appDescriptor = new AppDescriptor();
appDescriptor.setName(process.getName());
// link jms administered objects
InitialContext initialContext = new InitialContext();
initialContext.bind(PARTNER_LINK_HANDLE, new LinkRef("queue/testQueue"));
initialContext.bind(IntegrationControl.CONNECTION_FACTORY_NAME,
new LinkRef("ConnectionFactory"));
// configure relation context
integrationControl = IntegrationControl.getInstance(jbpmConfiguration);
integrationControl.setAppDescriptor(appDescriptor);
IntegrationControlHelper.setUp(integrationControl, jbpmContext);
// unlink jms administered objects
initialContext.unbind(PARTNER_LINK_HANDLE);
initialContext.unbind(IntegrationControl.CONNECTION_FACTORY_NAME);
initialContext.close();
// retrieve the partner link destination
PartnerLinkDefinition partnerLink = process.getGlobalScope().getPartnerLink(PARTNER_LINK_HANDLE);
portQueue = (Queue) integrationControl.getPartnerLinkEntry(partnerLink).getDestination();
}
public void tearDown() throws Exception {
// unbind port entries
IntegrationControlHelper.tearDown(integrationControl);
// tear down db
super.tearDown();
}
public void testReply_response() throws Exception {
// get the replier
Sequence seq = (Sequence) process.getGlobalScope().getRoot();
Replier replier = ((Reply) seq.getNode("rep-out")).getReplier();
// init message variable
String complexPartValue =
"<complexPart>" +
" <c name='venus'/>" +
" <e>30</e>" +
"</complexPart>";
MessageValue responseValue = (MessageValue) replier.getVariable().getValueForAssign(token);
responseValue.setPart("intPart", "30");
responseValue.setPart("complexPart", XmlUtil.parseElement(complexPartValue));
// init correlation set
CorrelationSetInstance idSet = replier.getCorrelations().getCorrelation("csId").getSet().getInstance(token);
idSet.initialize(responseValue);
// create outstanding request
OutstandingRequest request = new OutstandingRequest(portQueue, null);
Receiver receiver = ((Receive) seq.getNode("rec")).getReceiver();
integrationControl.addOutstandingRequest(receiver, token, request);
// send reply
Receiver.getIntegrationService(jbpmContext).reply(replier, token);
// response content
Map outputParts = (Map) receiveResponse().getObject();
// simple part
Element intPart = (Element) outputParts.get("intPart");
assertNull(intPart.getNamespaceURI());
assertEquals("intPart", intPart.getLocalName());
assertEquals("30", XmlUtil.getStringValue(intPart));
// complex part
Element complexPart = (Element) outputParts.get("complexPart");
assertEquals(null, complexPart.getNamespaceURI());
assertEquals("complexPart", complexPart.getLocalName());
assertNotNull(XmlUtil.getElement(complexPart, "c"));
assertNotNull(XmlUtil.getElement(complexPart, "e"));
// correlation sets
Correlations correlations = replier.getCorrelations();
// id set
idSet = correlations.getCorrelation("csId").getSet().getInstance(token);
Map properties = idSet.getProperties();
assertEquals(1, properties.size());
assertEquals("30", properties.get(new QName(NS_DEF, "idProperty")));
// name set
idSet = correlations.getCorrelation("csName").getSet().getInstance(token);
properties = idSet.getProperties();
assertEquals(1, properties.size());
assertEquals("venus", properties.get(new QName(NS_DEF, "nameProperty")));
}
public void testReply_fault() throws Exception {
// get the replier
Sequence seq = (Sequence) process.getGlobalScope().getRoot();
Replier replier = ((Reply) seq.getNode("rep-flt")).getReplier();
// init message variable
String faultPartValue =
"<sns:faultElement xmlns:sns='http://jbpm.org/xsd'>" +
" <code>100</code>" +
" <description>unknown problem</description>" +
"</sns:faultElement>";
MessageValue faultValue = (MessageValue) replier.getVariable().getValueForAssign(token);
faultValue.setPart("faultPart", faultPartValue);
// create outstanding request
OutstandingRequest request = new OutstandingRequest(portQueue, null);
Receiver receiver = ((Receive) seq.getNode("rec")).getReceiver();
integrationControl.addOutstandingRequest(receiver, token, request);
// send reply
Receiver.getIntegrationService(jbpmContext).reply(replier, token);
// response content
ObjectMessage response = receiveResponse();
Map outputParts = (Map) response.getObject();
// fault part
Element faultPart = (Element) outputParts.get("faultPart");
assertEquals("http://jbpm.org/xsd", faultPart.getNamespaceURI());
assertEquals("faultElement", faultPart.getLocalName());
// fault name
assertEquals(new QName("http://jbpm.org/wsdl", "flt").toString(), response.getStringProperty(IntegrationConstants.FAULT_NAME_PROP));
}
private ObjectMessage receiveResponse() throws Exception {
Session jmsSession = integrationControl.getJmsConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
MessageConsumer consumer = jmsSession.createConsumer(portQueue);
return (ObjectMessage) consumer.receiveNoWait();
}
finally {
jmsSession.close();
}
}
}
| [
"wow_fei@163.com"
] | wow_fei@163.com |
bc1647535a624dd1d1fd7a6d49fc8e2a60921f5c | 11622501f403df318ad5436cbda22b3454ca2358 | /tusharroy/src/main/java/com/interview/tusharroy/tree/ClosestValueBinaryTree.java | 570a757e5d1469a1dd9f331f8dcdaddc2d1cdef3 | [] | no_license | aanush/copy-of-mission-peace | fe13d6bcfb84c1657e15e578643eb93945a5a047 | 4da7e551bea04b7335cece08f73f598bf579b438 | refs/heads/master | 2020-03-14T14:02:48.514727 | 2018-04-30T21:00:25 | 2018-04-30T21:00:25 | 131,645,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 981 | java | package com.interview.tusharroy.tree;
/**
* Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.
* https://leetcode.com/problems/closest-binary-search-tree-value/
*/
public class ClosestValueBinaryTree {
public int closestValue(Node root, double target) {
int r = target > 0 ? Integer.MIN_VALUE : Integer.MAX_VALUE;
return closestValueUtil(root, target, r);
}
private int closestValueUtil(Node root, double target, int result) {
if (root == null) {
return (int) result;
}
if (target == root.data) {
return root.data;
}
if (Math.abs(root.data - target) < Math.abs(result - target)) {
result = root.data;
}
if (target < root.data) {
return closestValueUtil(root.left, target, result);
} else {
return closestValueUtil(root.right, target, result);
}
}
}
| [
"anish.anushang@outlook.com"
] | anish.anushang@outlook.com |
153bb19409ad7354a38a8db6ba1982000847c92d | bfc7a4cda00a0b89d4b984c83976770b0523f7f5 | /OA/JavaSource/com/icss/oa/commsite/admin/DeleteWebPageServlet.java | ed1ee617f9fc0512e688b337603218ec39b9211d | [] | no_license | liveqmock/oa | 100c4a554c99cabe0c3f9af7a1ab5629dcb697a6 | 0dfbb239210d4187e46a933661a031dba2711459 | refs/heads/master | 2021-01-18T05:02:00.704337 | 2015-03-03T06:47:30 | 2015-03-03T06:47:30 | 35,557,095 | 0 | 1 | null | 2015-05-13T15:26:06 | 2015-05-13T15:26:06 | null | GB18030 | Java | false | false | 1,740 | java | /*
* 创建日期 2004-4-1
*
* 更改所生成文件模板为
* 窗口 > 首选项 > Java > 代码生成 > 代码和注释
*/
package com.icss.oa.commsite.admin;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.icss.common.log.ConnLog;
import com.icss.j2ee.servlet.ServletBase;
import com.icss.j2ee.util.Globals;
import com.icss.oa.commsite.handler.*;
/**
* @author Administrator
*
* 更改所生成类型注释的模板为
* 窗口 > 首选项 > Java > 代码生成 > 代码和注释
*/
public class DeleteWebPageServlet extends ServletBase {
/* (非 Javadoc)
* @see com.icss.j2ee.servlet.ServletBase#performTask(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected void performTask(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
Connection conn = null;
try {
conn = this.getConnection(Globals.DATASOURCEJNDI);
ConnLog.open("DeleteWebPageServlet");
CommsiteHandler handler = new CommsiteHandler(conn);
Integer ocsId = new Integer(request.getParameter("ocsId"));
handler.delete(ocsId);
response.sendRedirect(
"ListWebPageServlet?_page_num="
+ request.getParameter("_page_num"));
} catch (Exception e) {
e.printStackTrace();
handleError(e);
} finally {
try {
if (conn != null) {
conn.close();
ConnLog.close("DeleteWebPageServlet");
}
} catch (SQLException sqle) {
sqle.printStackTrace();
}
}
}
}
| [
"peijn1026@gmail.com"
] | peijn1026@gmail.com |
4e032cfbaae611af6bc080ab1336aa53e48b9056 | 3d5c1b074740bc57bd0764bb2f980a7e6714253f | /app/src/main/java/com/abomko/tesslatrwifi/SyncAdapter.java | 958409e95ec94d5af0d67306ceac6cc2277da5ca | [] | no_license | balex13/TesslaTRWiFi | 7cb64ea799f3a7ac95857c45e75170770804b062 | 8d72427f386c18cf94035a9716f811560516754d | refs/heads/master | 2021-01-11T15:52:09.897648 | 2017-02-22T12:33:47 | 2017-02-22T12:33:47 | 79,944,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,596 | java | /*
* Copyright 2013 The Android Open Source Project
*
* 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.abomko.tesslatrwifi;
import android.accounts.Account;
import android.annotation.TargetApi;
import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SyncResult;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
/**
* Define a sync adapter for the app.
* <p>
* <p>This class is instantiated in {@link SyncService}, which also binds SyncAdapter to the system.
* SyncAdapter should only be initialized in SyncService, never anywhere else.
* <p>
* <p>The system calls onPerformSync() via an RPC call through the IBinder object supplied by
* SyncService.
*/
class SyncAdapter extends AbstractThreadedSyncAdapter {
public static final String TAG = "SyncAdapter";
/**
* URL to fetch content from during a sync.
* <p>
* <p>This points to the Android Developers Blog. (Side note: We highly recommend reading the
* Android Developer Blog to stay up to date on the latest Android platform developments!)
*/
private static final String PROVIDER_URL = "http://my.tessla.com.ua";
/**
* Network connection timeout, in milliseconds.
*/
private static final int NET_CONNECT_TIMEOUT_MILLIS = 15000; // 15 seconds
/**
* Network read timeout, in milliseconds.
*/
private static final int NET_READ_TIMEOUT_MILLIS = 10000; // 10 seconds
/**
* Content resolver, for performing database operations.
*/
private final ContentResolver mContentResolver;
private SharedPreferences prefs;
private static CookieManager cookieManager = new CookieManager();
/**
* Constructor. Obtains handle to content resolver for later use.
*/
public SyncAdapter(Context context, boolean autoInitialize) {
super(context, autoInitialize);
mContentResolver = context.getContentResolver();
}
/**
* Constructor. Obtains handle to content resolver for later use.
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public SyncAdapter(Context context, boolean autoInitialize, boolean allowParallelSyncs) {
super(context, autoInitialize, allowParallelSyncs);
mContentResolver = context.getContentResolver();
}
@Override
public void onPerformSync(Account account, Bundle extras, String authority,
ContentProviderClient provider, SyncResult syncResult) {
this.prefs = PreferenceManager.getDefaultSharedPreferences(
this.getContext()
);
Log.i(TAG, "Beginning network synchronization");
CookieHandler.setDefault(cookieManager);
Log.i(TAG, "Streaming data from network");
boolean authenticated = this.getDevices();
if (!authenticated) {
authenticated = this.authenticateUser();
if (authenticated) {
authenticated = this.getDevices();
}
}
if (authenticated) {
int devices = this.prefs.getInt("device_count", 0);
for (int i=1; i<=devices; i++) {
String deviceId = this.prefs.getString("device_id_" + i, "");
if (!deviceId.isEmpty()) {
String[] temperatures = this.readData(deviceId);
if (temperatures.length == 2) {
String oldValue = prefs.getString("temperature_" + i, "");
if (!oldValue.isEmpty()) {
prefs.edit().putString("temperature_" + i + "_prev", oldValue).apply();
}
prefs.edit().putString("temperature_" + i, String.valueOf(temperatures[0])).apply();
prefs.edit().putString("temperature_" + i + "_switch", String.valueOf(temperatures[1])).apply();
Log.i(TAG, "Temperature is: " + String.valueOf(temperatures[0]));
}
}
}
} else {
syncResult.stats.numIoExceptions++;
}
DateFormat df = new SimpleDateFormat("EEE, d MMM yyyy, HH:mm:ss", Locale.getDefault());
String date = df.format(Calendar.getInstance().getTime());
Log.i(TAG, date + " Network synchronization complete");
}
/**
* Given a string representation of a URL, sets up a connection and gets an input stream.
*/
private HttpURLConnection makeRequest(
final URL url,
final Map<String, String> requestParams,
Boolean isPost
) throws IOException {
String postData = "";
Boolean first = true;
for (Map.Entry<String, String> entry : requestParams.entrySet()) {
postData += (first ? "" : "&") + URLEncoder.encode(entry.getKey(), "UTF-8");
postData += "=" + URLEncoder.encode(entry.getValue(), "UTF-8");
first = false;
}
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setReadTimeout(NET_READ_TIMEOUT_MILLIS /* milliseconds */);
urlConnection.setConnectTimeout(NET_CONNECT_TIMEOUT_MILLIS /* milliseconds */);
urlConnection.setDoInput(true);
urlConnection.setChunkedStreamingMode(0);
urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
urlConnection.setInstanceFollowRedirects(false);
if (isPost) {
urlConnection.setDoOutput(true);
OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream());
out.write(postData);
out.flush();
out.close();
}
return urlConnection;
}
@NonNull
private Boolean authenticateUser()
{
String login = this.prefs.getString("login", "--");
String password = this.prefs.getString("password", "--");
if (login.isEmpty() || password.isEmpty()) {
return false;
}
try {
final URL authUrl = new URL(PROVIDER_URL + "/?login=yes");
Map<String, String> postData = new HashMap<String, String>();
postData.put("backurl", "/");
postData.put("AUTH_FORM", "Y");
postData.put("TYPE", "AUTH");
postData.put("USER_LOGIN", login);
postData.put("USER_PASSWORD", password);
postData.put("Login", "Войти");
HttpURLConnection urlConnection = makeRequest(authUrl, postData, true);
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
StringBuilder sb = new StringBuilder();
String line = null;
try {
// Read Server Response
while((line = reader.readLine()) != null)
{
// Append server response in string
sb.append(line).append("\n");
}
} finally {
reader.close();
}
int status = urlConnection.getResponseCode();
String text = sb.toString();
if (status>= 300 && status<= 399) {
String location = urlConnection.getHeaderField("Location");
return location.matches(PROVIDER_URL + "(:80)?/devices/");
//text = (String) this.makeRequest(new URL(location), new HashMap<String, String>(), false);
}
String stringResult = sb.toString();
} catch (MalformedURLException e) {
Log.e(TAG, "Feed URL is malformed", e);
return false;
} catch (IOException e) {
Log.e(TAG, "Error reading from network: " + e.toString());
return false;
}
return true;
}
@NonNull
private String[] readData(String deviceId)
{
String[] result = new String[2];
try {
final URL apiUrl = new URL(PROVIDER_URL + "/ajax/get_items_data.php");
Map<String, String> postData = new HashMap<String, String>();
postData.put("list_id[]", deviceId);
postData.put("sessid", this.prefs.getString("sessid", ""));
HttpURLConnection urlConnectionApi = makeRequest(apiUrl, postData, true);
BufferedReader readerApi = new BufferedReader(new InputStreamReader(urlConnectionApi.getInputStream()));
StringBuilder sbApi = new StringBuilder();
String lineApi = null;
try {
// Read Server Response
while((lineApi = readerApi.readLine()) != null)
{
// Append server response in string
sbApi.append(lineApi).append("\n");
}
} finally {
readerApi.close();
}
int statusApi = urlConnectionApi.getResponseCode();
String textApi = sbApi.toString();
JSONArray jsonReader = new JSONArray(textApi);
JSONObject values = jsonReader.getJSONObject(0);
result[0] = values.getString("PROPERTY_T_U_VALUE");
result[1] = values.getString("PROPERTY_SET_TEMPERATURE_VALUE");
} catch (MalformedURLException e) {
Log.e(TAG, "Feed URL is malformed", e);
return result;
} catch (IOException e) {
Log.e(TAG, "Error reading from network: " + e.toString());
return result;
} catch (JSONException e) {
Log.e(TAG, "Error reading from network: " + e.toString());
return result;
}
return result;
}
private boolean getDevices()
{
Map<String, String> devices = new HashMap<String, String>();
try {
final URL sessidUrl = new URL(PROVIDER_URL + "/devices/");
HttpURLConnection urlConnection = makeRequest(sessidUrl, new HashMap<String, String>(), false);
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
StringBuilder sb = new StringBuilder();
String line = null;
try {
// Read Server Response
while((line = reader.readLine()) != null)
{
// Append server response in string
sb.append(line).append("\n");
}
} finally {
reader.close();
}
int status = urlConnection.getResponseCode();
String text = sb.toString();
String sessid = "";
Pattern pattern = Pattern.compile("sessid:\"([a-z0-9]+)\"");
Matcher matcher = pattern.matcher(text);
if (matcher.find()) {
sessid = matcher.group(1);
}
if (sessid.isEmpty()) {
return false;
}
this.prefs.edit().putString("sessid", sessid).apply();
pattern = Pattern.compile("data-device-id=\"([0-9]+)\"");
matcher = pattern.matcher(text);
int i = 0;
while (matcher.find()) {
i++;
this.prefs.edit().putString("device_id_" + i, matcher.group(1)).apply();
devices.put(matcher.group(1), "" + i);
}
this.prefs.edit().putInt("device_count", i).apply();
Document doc = Jsoup.parse(text);
Elements elements = doc.select("[data-device-id] td a[href~=/devices/]");
for (Element element: elements) {
String id = element.parent().parent().attr("data-device-id");
this.prefs.edit().putString("device_label_" + devices.get(id), element.text()).apply();
}
} catch (MalformedURLException e) {
Log.e(TAG, "Feed URL is malformed", e);
return false;
} catch (IOException e) {
Log.e(TAG, "Error reading from network: " + e.toString());
return false;
}
return true;
}
}
| [
"abomko@magento.com"
] | abomko@magento.com |
9c1b617ee759c278ff52c8738d8bb8f5ef6ff4ed | fa3637d0d91295c1eeed4e0993a8243ffc2f5a5f | /app/src/main/java/com/yatuhasiumai/newbomproject/Enemy.java | 08e83f6d2cc51f1ed07f947881653475d95b68e7 | [] | no_license | kawakam/BomberGirl | 6dbd0da5e9b830186cd78ed0e56f559dcf138588 | c61215820b85e0a16d859039bcd28ae52aa44e2b | refs/heads/master | 2020-12-10T08:06:25.414240 | 2016-11-11T19:05:25 | 2016-11-11T19:05:25 | 73,501,198 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 811 | java | package com.yatuhasiumai.newbomproject;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.DisplayMetrics;
public class Enemy {
public Bitmap enemyPanel;
private int panelWidth;
private int panelHeight;
public int x;
public int y;
Enemy(Resources res, int x, int y) {
//ディスプレイサイズの取得
DisplayMetrics dm = Resources.getSystem().getDisplayMetrics();
panelWidth = dm.widthPixels / 15;
panelHeight = dm.heightPixels / 11 - 4;
this.x = x;
this.y = y;
Bitmap tmpEnemyPanel= BitmapFactory.decodeResource(res, R.drawable.ene_top);
enemyPanel = Bitmap.createScaledBitmap(tmpEnemyPanel, panelWidth, panelHeight, false);
}
}
| [
"kw10.85km.tofu@gmail.com"
] | kw10.85km.tofu@gmail.com |
e8152e7e23b2a1926cd9cb35b706bbd9e4a6046e | bd3d037d1d2a37697cf900089ab1f26de2f35de5 | /src/com/vuseniordesign/safekey/Main.java | 519925335ab08bfa0c4f74a331ad939dfc0d2b4c | [] | no_license | bogunjobi/SafeKey | ba18d0f9dad1f5886161198737d650d8f541109f | fade2adbbc1519aa72069d7ceb87b4bd306b1c95 | refs/heads/master | 2021-01-23T07:04:06.715001 | 2014-04-14T05:01:50 | 2014-04-14T05:01:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,898 | java | package com.vuseniordesign.safekey;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Map;
import java.util.Set;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.ContactsContract;
import android.provider.MediaStore;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import android.widget.TextView;
import android.widget.Toast;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class Main extends Activity {
public static SQLiteDatabase userDB = null;
public final String db_name = "userTracker";
public final String table_name = "userTracker";
final String TAG = "Main";
static Uri fileUri = null;
String username;
View callingView = null;
SharedPreferences contacts = null;
SharedPreferences admin = null;
Editor editor = null;
boolean adminEnabled = false;
//emergency contact info
String contact1, contact2, number1, number2;
//textviews and separators
TextView mContact1, mContact2, mAddContact, view, share;
View sep1, sep2, sep3;
//??
DevicePolicyManager mDPM;
ComponentName mDeviceAdminSample;
LockScreen mActivity;
AlertDialog.Builder alertDialog;
///
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
startBT();
//load emergency contact information
contacts = getSharedPreferences("Contacts", Context.MODE_PRIVATE);
contact1 = contacts.getString("contact1", "");
contact2 = contacts.getString("contact2", "");
number1 = contacts.getString("number1", "");
number2 = contacts.getString("number2", "");
admin = getSharedPreferences("admin", Context.MODE_PRIVATE);
adminEnabled = admin.getBoolean("adminEnabled", false);
//load user image
SharedPreferences user_pic = getSharedPreferences("UserPic", Context.MODE_PRIVATE);
String map = user_pic.getString("image", null);
if (map != null){
Bitmap btmap = BitmapFactory.decodeFile(map);
ImageView imageView = (ImageView) findViewById(R.id.imageView1);
imageView.setImageBitmap(btmap);
}
//??
//mActivity = (LockScreen)getActivity();
mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
mDeviceAdminSample = new ComponentName(Main.this, MyAdmin.class);
//check if device admin has been activated
//??
if (!isActiveAdmin()){
showDialog(this);
Intent i = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
//i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminSample);
Log.d("Admin", "Activate");
startActivityForResult(i, 3);
//startActivity(i);
}
//??
TextView mName = (TextView) findViewById(R.id.hello_name);
SharedPreferences auth_pref = getSharedPreferences("Login", Context.MODE_PRIVATE);
username = auth_pref.getString("name", "user");
mName.setText("HELLO " + username.split(" ")[0].toUpperCase() + "!");
mContact1 = (TextView) findViewById(R.id.contacts2);
mContact2 = (TextView) findViewById(R.id.contacts3);
mAddContact = (TextView) findViewById(R.id.addcontacts);
view = (TextView) findViewById(R.id.view);
share = (TextView) findViewById(R.id.share);
sep1 = (View)findViewById(R.id.separator2);
sep2 = (View)findViewById(R.id.separator3);
sep3 = (View)findViewById(R.id.separator4);
Button bn = (Button) findViewById(R.id.button1);
bn.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Main.this, UserData.class));
}
});
if (adminEnabled){
mContact1.setTextColor(Color.BLACK);
mContact2.setTextColor(Color.BLACK);
mAddContact.setTextColor(Color.BLACK);
}
findViewById(R.id.imageView1).setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(
Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i,2);
}
});
if (!contact1.equals("")){
mContact1.setVisibility(View.VISIBLE);
sep1.setVisibility(View.VISIBLE);
mContact1.setText(contact1);
}else {
mAddContact.setVisibility(View.VISIBLE);
sep3.setVisibility(View.VISIBLE);
}
if (!contact2.equals("")){
mContact2.setVisibility(View.VISIBLE);
sep2.setVisibility(View.VISIBLE);
mContact2.setText(contact2);
} else {
mAddContact.setVisibility(View.VISIBLE);
sep3.setVisibility(View.VISIBLE);
}
mContact1.setOnClickListener(tvlistener);
mContact2.setOnClickListener(tvlistener);
view.setOnClickListener(tvlistener);
share.setOnClickListener(tvlistener);
/*new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Main.this, DriverTracking.class));
}
}); */
mAddContact.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!adminEnabled){
Toast.makeText(Main.this, "Tip: Enable Admin to add contacts", Toast.LENGTH_SHORT).show();
return;
}
if (mContact1.getVisibility() != View.VISIBLE){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
// BoD con't: CONTENT_TYPE instead of CONTENT_ITEM_TYPE
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
startActivityForResult(intent, 0);
}
else if (mContact2.getVisibility() != View.VISIBLE){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
startActivityForResult(intent, 1);
}
}
});
/*Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);*/
}
/**
* This function shows the warning dialog
*/
private void showDialog(Context context){
alertDialog = new AlertDialog.Builder(this);
alertDialog.create();
alertDialog.setTitle("Warning!");
alertDialog.setIcon(R.drawable.ic_action_warning);
alertDialog.setMessage("Enabling Device Admin ensures that this app works as intended");
alertDialog.setPositiveButton("Enable Device Admin", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//??
Intent i = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
i.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminSample);
Log.d("Admin", "Activate");
startActivityForResult(i, 3);
//startActivity(i);
//??
}
});
}
private boolean isActiveAdmin() {
return mDPM.isAdminActive(mDeviceAdminSample);
}
OnClickListener tvlistener = new OnClickListener(){
@Override
public void onClick(View v) {
if (v.getId() == mContact1.getId() || v.getId() == mContact2.getId()){
if (adminEnabled)
showPopup(v);
else
Toast.makeText(Main.this, "Tip: Enable Admin to edit or delete contacts", Toast.LENGTH_SHORT).show();
} else if (v.getId() == view.getId()){
//startActivity(new Intent(Main.this, DriverTracking.class));
startActivity(new Intent(Main.this, UserData.class));
} else if (v.getId() == share.getId()){
new CreateFilesTask().execute();
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, fileUri);
sendIntent.setType("file/*");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Driver Information from Safekey");
startActivity(Intent.createChooser(sendIntent, "Share usage data"));
}
}
};
OnMenuItemClickListener listener = new OnMenuItemClickListener()
{
public boolean onMenuItemClick(MenuItem item){
switch (item.getItemId()){
case R.id.edit:
edit();
return true;
case R.id.delete:
delete();
default:
return false;
}
}
};
public void edit(){
// user BoD suggests using Intent.ACTION_PICK instead of .ACTION_GET_CONTENT to avoid the chooser
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
// BoD con't: CONTENT_TYPE instead of CONTENT_ITEM_TYPE
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
if (callingView.getId() == R.id.contacts2)
startActivityForResult(intent, 0);
else if (callingView.getId() == R.id.contacts3)
startActivityForResult(intent, 1);
}
public void delete(){
editor = contacts.edit();
Log.d("CallingView", callingView.toString());
if (callingView.getId() == R.id.contacts2){
//repopulate the UI such that the first textview is not empty
editor.putString("contact1", contact2);
editor.putString("number1", number2);
Log.d("Contact2", contact2);
}
//Log.d("Outside", contact2);
editor.putString("contact2", "");
editor.putString("number2", "");
//save the shared preferences and refresh the activity
editor.commit();
finish();
startActivity(getIntent());
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 2 ){
if (resultCode == RESULT_OK && data != null) {
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
//store chosen image
SharedPreferences user_pic = getSharedPreferences("UserPic", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = user_pic.edit();
editor.putString("image", picturePath).commit();
Bitmap btmap = BitmapFactory.decodeFile(picturePath);
ImageView imageView = (ImageView) findViewById(R.id.imageView1);
imageView.setImageBitmap(btmap);
}
} else if (requestCode == 3){
if (resultCode == RESULT_CANCELED) {
alertDialog.show();
return;
}
}
else{
editor = contacts.edit();
if (data != null) {
Uri uri = data.getData();
if (uri != null) {
Cursor c = null;
try {
c = getContentResolver().query(uri, new String[]{
ContactsContract.CommonDataKinds.Phone.NUMBER,
ContactsContract.CommonDataKinds.Phone.TYPE,
ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME},
null, null, null);
if (c != null && c.moveToFirst()) {
String name = c.getString(2);
String number = c.getString(0);
if (requestCode == 0){
contact1 = name;
number1 = number;
mContact1.setText(name);
editor.putString("contact1", contact1);
editor.putString("number1", number1);
if (mContact1.getVisibility() != View.VISIBLE)
mContact1.setVisibility(View.VISIBLE);
sep1.setVisibility(View.VISIBLE);
}
else {
contact2 = name;
number2 = number;
mContact2.setText(name);
editor.putString("contact2", contact2);
editor.putString("number2",number2);
if (mContact2.getVisibility() != View.VISIBLE)
mContact2.setVisibility(View.VISIBLE);
sep2.setVisibility(View.VISIBLE);
mAddContact.setVisibility(View.GONE);
sep3.setVisibility(View.GONE);
}
editor.commit();
}
} finally {
if (c != null) {
c.close();
}
}
}
}
}
}
public void showPopup(View v) {
PopupMenu popup = new PopupMenu(this, v);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.actions, popup.getMenu());
popup.setOnMenuItemClickListener(listener);
callingView = v;
popup.show();
}
public void startBT(){
Calendar cal = Calendar.getInstance();
Intent intent = new Intent(this, BTConnection.class);
PendingIntent pintent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarm = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
Log.d("Main",String.valueOf(cal.getTimeInMillis()));
alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 15000, pintent);
startService(intent);
}
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case R.id.action_settings:
startActivity(new Intent(Main.this, SettingsActivity.class));
break;
case R.id.action_help:
startActivity(new Intent(Main.this, Help.class));
break;
default:
return false;
}
return true;
}
//TODO: Only override if previous is setup?
@Override
public void onBackPressed() {
//to ensure that users cannot go back to the setup page
finish();
}
private class CreateFilesTask extends AsyncTask<Void, Integer, Uri> {
@Override
protected Uri doInBackground(Void... params) {
if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))
{
//quit, we can't write to SD
return null;
}
File sd = new File (Environment.getExternalStorageDirectory(), "Android/data/com.vuseniordesign.safekey/usage");
File sdFile = null;
if (!sd.exists())
sd.mkdirs();
if (sd.canWrite()) {
sdFile = new File(sd, "usageData.txt");
DB currentDB = new DB(Main.this);
Object [] obj = DriverTracking.getGraphData(currentDB, null, null);
Map<String, Integer> duration = DriverTracking.aggregateValues((String []) obj[0], (int []) obj[1], 0);
Map<String, Integer> count = DriverTracking.aggregateValues((String []) obj[0], (int []) obj[2], 0);
Set<String> keys = count.keySet();
if (!keys.equals(duration.keySet()))
return null; //corrupted data
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(sdFile);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String title = "USAGE DATA";
if (!username.equals(null))
title += " FOR " + username.toUpperCase();
title += "\n\n";
//write document title
try {
if (!outputStream.equals(null) && !keys.equals(null))
outputStream.write(title.getBytes());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (String s: keys){
int time = duration.get(s);
int minutes = 0;
String strtime;
String str = "Date: " + s + ", Time spent driving: " + Integer.toString(duration.get(s))
+ " seconds, Number of phone usage attempts: " + Integer.toString(count.get(s)) + "\n\n";
if (time >= 3600){
time = (int) (time / 3600.0);
minutes = (int) (time % 3600);
if (time == 1)
strtime = " hour";
else
strtime = " hours";
str = "Date: " + s + ", Time spent driving: " + Integer.toString(time)
+ strtime + " " + Integer.toString(minutes) + " minutes, Number of phone usage attempts: " + Integer.toString(count.get(s)) + "\n\n";
}
else if (time > 60 && time < 3600){
time = (int) time / 60;
if (time == 1)
strtime = " minute";
else
strtime = " minutes";
str = "Date: " + s + ", Time spent driving: " + Integer.toString(time)
+ strtime + ", Number of phone usage attempts: " + Integer.toString(count.get(s)) + "\n\n";
}
try {
if (!outputStream.equals(null))
outputStream.write(str.getBytes());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
try {
outputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (!sdFile.equals(null))
return Uri.fromFile(sdFile);
return null;
}
protected void onPostExecute(Uri result) {
fileUri = result;
}
}
}
| [
"bolutife.ogunjobi@gmail.com"
] | bolutife.ogunjobi@gmail.com |
2b4d1d735a9c15c5d89d97f61eb12b2b2161b65e | 25d052d0aaf04d5c437375772f127e04bc732b3c | /hse/here2/RegistrationIntentService.java | ecf7748be5c31e1e2b0d492a283dbb29e9868f40 | [] | no_license | muhammed-ajmal/HseHere | 6879b87a44b566321365c337c217e92f5c51a022 | 4667fdccc35753999c4f94793a0dbe38845fc338 | refs/heads/master | 2021-09-15T12:33:06.907668 | 2018-06-01T12:07:31 | 2018-06-01T12:07:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,484 | java | package hse.here2;
import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import com.google.android.gms.iid.InstanceID;
public class RegistrationIntentService extends IntentService {
String accion = "A";
String codigo;
int idusu;
String[] usu;
private void sendRegistrationToServer(java.lang.String r12) {
/* JADX: method processing error */
/*
Error: jadx.core.utils.exceptions.JadxRuntimeException: Can't find block by offset: 0x007d in list []
at jadx.core.utils.BlockUtils.getBlockByOffset(BlockUtils.java:42)
at jadx.core.dex.instructions.IfNode.initBlocks(IfNode.java:60)
at jadx.core.dex.visitors.blocksmaker.BlockFinish.initBlocksInIfNodes(BlockFinish.java:48)
at jadx.core.dex.visitors.blocksmaker.BlockFinish.visit(BlockFinish.java:33)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)
at jadx.core.ProcessClass.process(ProcessClass.java:37)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:306)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler$1.run(JadxDecompiler.java:199)
*/
/*
r11 = this;
r8 = r11.idusu;
if (r8 <= 0) goto L_0x007d;
L_0x0004:
r8 = "";
r8 = r12.equals(r8);
if (r8 != 0) goto L_0x007d;
L_0x000c:
r8 = new java.lang.StringBuilder;
r8.<init>();
r9 = "http://srv1.androidcreator.com/srv/guardargcmid.php?idusu=";
r8 = r8.append(r9);
r9 = r11.idusu;
r8 = r8.append(r9);
r9 = "&gcmid=";
r8 = r8.append(r9);
r8 = r8.append(r12);
r9 = "&accion=";
r8 = r8.append(r9);
r9 = r11.accion;
r8 = r8.append(r9);
r2 = r8.toString();
r1 = 0;
r5 = new java.net.URL; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r5.<init>(r2); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = r5.openConnection(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r0 = r8; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r0 = (java.net.HttpURLConnection) r0; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r1 = r0; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = 1; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r1.setDoInput(r8); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = 10000; // 0x2710 float:1.4013E-41 double:4.9407E-320; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r1.setConnectTimeout(r8); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = 10000; // 0x2710 float:1.4013E-41 double:4.9407E-320; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r1.setReadTimeout(r8); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = "User-Agent"; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r9 = "Android Vinebre Software"; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r1.setRequestProperty(r8, r9); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r3 = r1.getInputStream(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r6 = new java.io.BufferedReader; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = new java.io.InputStreamReader; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8.<init>(r3); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r6.<init>(r8); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r7 = new java.lang.StringBuilder; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r7.<init>(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
L_0x006d:
r4 = r6.readLine(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
if (r4 == 0) goto L_0x007e; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
L_0x0073:
r7.append(r4); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
goto L_0x006d;
L_0x0077:
r8 = move-exception;
if (r1 == 0) goto L_0x007d;
L_0x007a:
r1.disconnect();
L_0x007d:
return;
L_0x007e:
r8 = r7.toString(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r9 = "ANDROID:OK"; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = r8.indexOf(r9); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r9 = -1; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
if (r8 == r9) goto L_0x00aa; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
L_0x008b:
r8 = r11.accion; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r9 = "A"; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = r8.equals(r9); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
if (r8 == 0) goto L_0x00aa; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
L_0x0095:
r8 = "sh"; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r9 = 0; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = r11.getSharedPreferences(r8, r9); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = r8.edit(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r9 = "SENT_TOKEN_TO_SERVER"; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r10 = 1; Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8 = r8.putBoolean(r9, r10); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
r8.apply(); Catch:{ Exception -> 0x0077, all -> 0x00b0 }
L_0x00aa:
if (r1 == 0) goto L_0x007d;
L_0x00ac:
r1.disconnect();
goto L_0x007d;
L_0x00b0:
r8 = move-exception;
if (r1 == 0) goto L_0x00b6;
L_0x00b3:
r1.disconnect();
L_0x00b6:
throw r8;
*/
throw new UnsupportedOperationException("Method not decompiled: hse.here2.RegistrationIntentService.sendRegistrationToServer(java.lang.String):void");
}
public RegistrationIntentService() {
super("RegistrationIntentService");
}
protected void onHandleIntent(Intent intent) {
SharedPreferences settings = getSharedPreferences("sh", 0);
this.idusu = settings.getInt("idusu", 0);
this.codigo = settings.getString("cod", "");
if (this.idusu > 0) {
try {
sendRegistrationToServer(InstanceID.getInstance(this).getToken(config.SENDER_ID, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null));
} catch (Exception e) {
settings.edit().putBoolean("SENT_TOKEN_TO_SERVER", false).apply();
}
}
}
}
| [
"dev@ajmalaju.com"
] | dev@ajmalaju.com |
2449aec0a922ebb52dbd8c26a21272ef886c99d0 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/validation/org/apache/hadoop/lib/server/TestServer.java | f575dc078b85f4b02947c8ebb71398821ea30c2c | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 32,472 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.lib.server;
import Server.Status.ADMIN;
import Server.Status.BOOTING;
import Server.Status.NORMAL;
import Server.Status.SHUTDOWN;
import Server.Status.SHUTTING_DOWN;
import Server.Status.UNDEF;
import ServerException.ERROR.S09;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.lib.lang.XException;
import org.apache.hadoop.test.HTestCase;
import org.apache.hadoop.test.TestDir;
import org.apache.hadoop.test.TestDirHelper;
import org.apache.hadoop.test.TestException;
import org.apache.hadoop.util.StringUtils;
import org.junit.Assert;
import org.junit.Test;
public class TestServer extends HTestCase {
@Test
@TestDir
public void constructorsGetters() throws Exception {
Server server = new Server("server", TestServer.getAbsolutePath("/a"), TestServer.getAbsolutePath("/b"), TestServer.getAbsolutePath("/c"), TestServer.getAbsolutePath("/d"), new Configuration(false));
Assert.assertEquals(server.getHomeDir(), TestServer.getAbsolutePath("/a"));
Assert.assertEquals(server.getConfigDir(), TestServer.getAbsolutePath("/b"));
Assert.assertEquals(server.getLogDir(), TestServer.getAbsolutePath("/c"));
Assert.assertEquals(server.getTempDir(), TestServer.getAbsolutePath("/d"));
Assert.assertEquals(server.getName(), "server");
Assert.assertEquals(server.getPrefix(), "server");
Assert.assertEquals(server.getPrefixedName("name"), "server.name");
Assert.assertNotNull(server.getConfig());
server = new Server("server", TestServer.getAbsolutePath("/a"), TestServer.getAbsolutePath("/b"), TestServer.getAbsolutePath("/c"), TestServer.getAbsolutePath("/d"));
Assert.assertEquals(server.getHomeDir(), TestServer.getAbsolutePath("/a"));
Assert.assertEquals(server.getConfigDir(), TestServer.getAbsolutePath("/b"));
Assert.assertEquals(server.getLogDir(), TestServer.getAbsolutePath("/c"));
Assert.assertEquals(server.getTempDir(), TestServer.getAbsolutePath("/d"));
Assert.assertEquals(server.getName(), "server");
Assert.assertEquals(server.getPrefix(), "server");
Assert.assertEquals(server.getPrefixedName("name"), "server.name");
Assert.assertNull(server.getConfig());
server = new Server("server", TestDirHelper.getTestDir().getAbsolutePath(), new Configuration(false));
Assert.assertEquals(server.getHomeDir(), TestDirHelper.getTestDir().getAbsolutePath());
Assert.assertEquals(server.getConfigDir(), ((TestDirHelper.getTestDir()) + "/conf"));
Assert.assertEquals(server.getLogDir(), ((TestDirHelper.getTestDir()) + "/log"));
Assert.assertEquals(server.getTempDir(), ((TestDirHelper.getTestDir()) + "/temp"));
Assert.assertEquals(server.getName(), "server");
Assert.assertEquals(server.getPrefix(), "server");
Assert.assertEquals(server.getPrefixedName("name"), "server.name");
Assert.assertNotNull(server.getConfig());
server = new Server("server", TestDirHelper.getTestDir().getAbsolutePath());
Assert.assertEquals(server.getHomeDir(), TestDirHelper.getTestDir().getAbsolutePath());
Assert.assertEquals(server.getConfigDir(), ((TestDirHelper.getTestDir()) + "/conf"));
Assert.assertEquals(server.getLogDir(), ((TestDirHelper.getTestDir()) + "/log"));
Assert.assertEquals(server.getTempDir(), ((TestDirHelper.getTestDir()) + "/temp"));
Assert.assertEquals(server.getName(), "server");
Assert.assertEquals(server.getPrefix(), "server");
Assert.assertEquals(server.getPrefixedName("name"), "server.name");
Assert.assertNull(server.getConfig());
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S01.*")
@TestDir
public void initNoHomeDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S02.*")
@TestDir
public void initHomeDirNotDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
new FileOutputStream(homeDir).close();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S01.*")
@TestDir
public void initNoConfigDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Assert.assertTrue(homeDir.mkdir());
Assert.assertTrue(new File(homeDir, "log").mkdir());
Assert.assertTrue(new File(homeDir, "temp").mkdir());
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S02.*")
@TestDir
public void initConfigDirNotDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Assert.assertTrue(homeDir.mkdir());
Assert.assertTrue(new File(homeDir, "log").mkdir());
Assert.assertTrue(new File(homeDir, "temp").mkdir());
File configDir = new File(homeDir, "conf");
new FileOutputStream(configDir).close();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S01.*")
@TestDir
public void initNoLogDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Assert.assertTrue(homeDir.mkdir());
Assert.assertTrue(new File(homeDir, "conf").mkdir());
Assert.assertTrue(new File(homeDir, "temp").mkdir());
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S02.*")
@TestDir
public void initLogDirNotDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Assert.assertTrue(homeDir.mkdir());
Assert.assertTrue(new File(homeDir, "conf").mkdir());
Assert.assertTrue(new File(homeDir, "temp").mkdir());
File logDir = new File(homeDir, "log");
new FileOutputStream(logDir).close();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S01.*")
@TestDir
public void initNoTempDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Assert.assertTrue(homeDir.mkdir());
Assert.assertTrue(new File(homeDir, "conf").mkdir());
Assert.assertTrue(new File(homeDir, "log").mkdir());
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S02.*")
@TestDir
public void initTempDirNotDir() throws Exception {
File homeDir = new File(TestDirHelper.getTestDir(), "home");
Assert.assertTrue(homeDir.mkdir());
Assert.assertTrue(new File(homeDir, "conf").mkdir());
Assert.assertTrue(new File(homeDir, "log").mkdir());
File tempDir = new File(homeDir, "temp");
new FileOutputStream(tempDir).close();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = new Server("server", homeDir.getAbsolutePath(), conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S05.*")
@TestDir
public void siteFileNotAFile() throws Exception {
String homeDir = TestDirHelper.getTestDir().getAbsolutePath();
File siteFile = new File(homeDir, "server-site.xml");
Assert.assertTrue(siteFile.mkdir());
Server server = new Server("server", homeDir, homeDir, homeDir, homeDir);
server.init();
}
@Test
@TestDir
public void log4jFile() throws Exception {
InputStream is = Server.getResource("default-log4j.properties");
OutputStream os = new FileOutputStream(new File(TestDirHelper.getTestDir(), "server-log4j.properties"));
IOUtils.copyBytes(is, os, 1024, true);
Configuration conf = new Configuration(false);
Server server = createServer(conf);
server.init();
}
public static class LifeCycleService extends BaseService {
public LifeCycleService() {
super("lifecycle");
}
@Override
protected void init() throws ServiceException {
Assert.assertEquals(getServer().getStatus(), BOOTING);
}
@Override
public void destroy() {
Assert.assertEquals(getServer().getStatus(), SHUTTING_DOWN);
super.destroy();
}
@Override
public Class getInterface() {
return TestServer.LifeCycleService.class;
}
}
@Test
@TestDir
public void lifeCycle() throws Exception {
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.LifeCycleService.class.getName());
Server server = createServer(conf);
Assert.assertEquals(server.getStatus(), UNDEF);
server.init();
Assert.assertNotNull(server.get(TestServer.LifeCycleService.class));
Assert.assertEquals(server.getStatus(), NORMAL);
server.destroy();
Assert.assertEquals(server.getStatus(), SHUTDOWN);
}
@Test
@TestDir
public void startWithStatusNotNormal() throws Exception {
Configuration conf = new Configuration(false);
conf.set("server.startup.status", "ADMIN");
Server server = createServer(conf);
server.init();
Assert.assertEquals(server.getStatus(), ADMIN);
server.destroy();
}
@Test(expected = IllegalArgumentException.class)
@TestDir
public void nonSeteableStatus() throws Exception {
Configuration conf = new Configuration(false);
Server server = createServer(conf);
server.init();
server.setStatus(SHUTDOWN);
}
public static class TestService implements Service {
static List<String> LIFECYCLE = new ArrayList<String>();
@Override
public void init(Server server) throws ServiceException {
TestServer.TestService.LIFECYCLE.add("init");
}
@Override
public void postInit() throws ServiceException {
TestServer.TestService.LIFECYCLE.add("postInit");
}
@Override
public void destroy() {
TestServer.TestService.LIFECYCLE.add("destroy");
}
@Override
public Class[] getServiceDependencies() {
return new Class[0];
}
@Override
public Class getInterface() {
return TestServer.TestService.class;
}
@Override
public void serverStatusChange(Server.Status oldStatus, Server.Status newStatus) throws ServiceException {
TestServer.TestService.LIFECYCLE.add("serverStatusChange");
}
}
public static class TestServiceExceptionOnStatusChange extends TestServer.TestService {
@Override
public void serverStatusChange(Server.Status oldStatus, Server.Status newStatus) throws ServiceException {
throw new RuntimeException();
}
}
@Test
@TestDir
public void changeStatus() throws Exception {
TestServer.TestService.LIFECYCLE.clear();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = createServer(conf);
server.init();
server.setStatus(ADMIN);
Assert.assertTrue(TestServer.TestService.LIFECYCLE.contains("serverStatusChange"));
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S11.*")
@TestDir
public void changeStatusServiceException() throws Exception {
TestServer.TestService.LIFECYCLE.clear();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestServiceExceptionOnStatusChange.class.getName());
Server server = createServer(conf);
server.init();
}
@Test
@TestDir
public void setSameStatus() throws Exception {
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = createServer(conf);
server.init();
TestServer.TestService.LIFECYCLE.clear();
server.setStatus(server.getStatus());
Assert.assertFalse(TestServer.TestService.LIFECYCLE.contains("serverStatusChange"));
}
@Test
@TestDir
public void serviceLifeCycle() throws Exception {
TestServer.TestService.LIFECYCLE.clear();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.TestService.class.getName());
Server server = createServer(conf);
server.init();
Assert.assertNotNull(server.get(TestServer.TestService.class));
server.destroy();
Assert.assertEquals(TestServer.TestService.LIFECYCLE, Arrays.asList("init", "postInit", "serverStatusChange", "destroy"));
}
@Test
@TestDir
public void loadingDefaultConfig() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Server server = new Server("testserver", dir, dir, dir, dir);
server.init();
Assert.assertEquals(server.getConfig().get("testserver.a"), "default");
}
@Test
@TestDir
public void loadingSiteConfig() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
File configFile = new File(dir, "testserver-site.xml");
Writer w = new FileWriter(configFile);
w.write("<configuration><property><name>testserver.a</name><value>site</value></property></configuration>");
w.close();
Server server = new Server("testserver", dir, dir, dir, dir);
server.init();
Assert.assertEquals(server.getConfig().get("testserver.a"), "site");
}
@Test
@TestDir
public void loadingSysPropConfig() throws Exception {
try {
System.setProperty("testserver.a", "sysprop");
String dir = TestDirHelper.getTestDir().getAbsolutePath();
File configFile = new File(dir, "testserver-site.xml");
Writer w = new FileWriter(configFile);
w.write("<configuration><property><name>testserver.a</name><value>site</value></property></configuration>");
w.close();
Server server = new Server("testserver", dir, dir, dir, dir);
server.init();
Assert.assertEquals(server.getConfig().get("testserver.a"), "sysprop");
} finally {
System.getProperties().remove("testserver.a");
}
}
@Test(expected = IllegalStateException.class)
@TestDir
public void illegalState1() throws Exception {
Server server = new Server("server", TestDirHelper.getTestDir().getAbsolutePath(), new Configuration(false));
server.destroy();
}
@Test(expected = IllegalStateException.class)
@TestDir
public void illegalState2() throws Exception {
Server server = new Server("server", TestDirHelper.getTestDir().getAbsolutePath(), new Configuration(false));
server.get(Object.class);
}
@Test(expected = IllegalStateException.class)
@TestDir
public void illegalState3() throws Exception {
Server server = new Server("server", TestDirHelper.getTestDir().getAbsolutePath(), new Configuration(false));
server.setService(null);
}
@Test(expected = IllegalStateException.class)
@TestDir
public void illegalState4() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Server server = new Server("server", dir, dir, dir, dir, new Configuration(false));
server.init();
server.init();
}
private static List<String> ORDER = new ArrayList<String>();
public abstract static class MyService implements XException.ERROR , Service {
private String id;
private Class serviceInterface;
private Class[] dependencies;
private boolean failOnInit;
private boolean failOnDestroy;
protected MyService(String id, Class serviceInterface, Class[] dependencies, boolean failOnInit, boolean failOnDestroy) {
this.id = id;
this.serviceInterface = serviceInterface;
this.dependencies = dependencies;
this.failOnInit = failOnInit;
this.failOnDestroy = failOnDestroy;
}
@Override
public void init(Server server) throws ServiceException {
TestServer.ORDER.add(((id) + ".init"));
if (failOnInit) {
throw new ServiceException(this);
}
}
@Override
public void postInit() throws ServiceException {
TestServer.ORDER.add(((id) + ".postInit"));
}
@Override
public String getTemplate() {
return "";
}
@Override
public void destroy() {
TestServer.ORDER.add(((id) + ".destroy"));
if (failOnDestroy) {
throw new RuntimeException();
}
}
@Override
public Class[] getServiceDependencies() {
return dependencies;
}
@Override
public Class getInterface() {
return serviceInterface;
}
@Override
public void serverStatusChange(Server.Status oldStatus, Server.Status newStatus) throws ServiceException {
}
}
public static class MyService1 extends TestServer.MyService {
public MyService1() {
super("s1", TestServer.MyService1.class, null, false, false);
}
protected MyService1(String id, Class serviceInterface, Class[] dependencies, boolean failOnInit, boolean failOnDestroy) {
super(id, serviceInterface, dependencies, failOnInit, failOnDestroy);
}
}
public static class MyService2 extends TestServer.MyService {
public MyService2() {
super("s2", TestServer.MyService2.class, null, true, false);
}
}
public static class MyService3 extends TestServer.MyService {
public MyService3() {
super("s3", TestServer.MyService3.class, null, false, false);
}
}
public static class MyService1a extends TestServer.MyService1 {
public MyService1a() {
super("s1a", TestServer.MyService1.class, null, false, false);
}
}
public static class MyService4 extends TestServer.MyService1 {
public MyService4() {
super("s4a", String.class, null, false, false);
}
}
public static class MyService5 extends TestServer.MyService {
public MyService5() {
super("s5", TestServer.MyService5.class, null, false, true);
}
protected MyService5(String id, Class serviceInterface, Class[] dependencies, boolean failOnInit, boolean failOnDestroy) {
super(id, serviceInterface, dependencies, failOnInit, failOnDestroy);
}
}
public static class MyService5a extends TestServer.MyService5 {
public MyService5a() {
super("s5a", TestServer.MyService5.class, null, false, false);
}
}
public static class MyService6 extends TestServer.MyService {
public MyService6() {
super("s6", TestServer.MyService6.class, new Class[]{ TestServer.MyService1.class }, false, false);
}
}
public static class MyService7 extends TestServer.MyService {
@SuppressWarnings({ "UnusedParameters" })
public MyService7(String foo) {
super("s6", TestServer.MyService7.class, new Class[]{ TestServer.MyService1.class }, false, false);
}
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S08.*")
@TestDir
public void invalidSservice() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf = new Configuration(false);
conf.set("server.services", "foo");
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S07.*")
@TestDir
public void serviceWithNoDefaultConstructor() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.MyService7.class.getName());
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S04.*")
@TestDir
public void serviceNotImplementingServiceInterface() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf = new Configuration(false);
conf.set("server.services", TestServer.MyService4.class.getName());
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
}
@Test
@TestException(exception = ServerException.class, msgRegExp = "S10.*")
@TestDir
public void serviceWithMissingDependency() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf = new Configuration(false);
String services = StringUtils.join(",", Arrays.asList(TestServer.MyService3.class.getName(), TestServer.MyService6.class.getName()));
conf.set("server.services", services);
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
}
@Test
@TestDir
public void services() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf;
Server server;
// no services
TestServer.ORDER.clear();
conf = new Configuration(false);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
Assert.assertEquals(TestServer.ORDER.size(), 0);
// 2 services init/destroy
TestServer.ORDER.clear();
String services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService3.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
Assert.assertEquals(server.get(TestServer.MyService1.class).getInterface(), TestServer.MyService1.class);
Assert.assertEquals(server.get(TestServer.MyService3.class).getInterface(), TestServer.MyService3.class);
Assert.assertEquals(TestServer.ORDER.size(), 4);
Assert.assertEquals(TestServer.ORDER.get(0), "s1.init");
Assert.assertEquals(TestServer.ORDER.get(1), "s3.init");
Assert.assertEquals(TestServer.ORDER.get(2), "s1.postInit");
Assert.assertEquals(TestServer.ORDER.get(3), "s3.postInit");
server.destroy();
Assert.assertEquals(TestServer.ORDER.size(), 6);
Assert.assertEquals(TestServer.ORDER.get(4), "s3.destroy");
Assert.assertEquals(TestServer.ORDER.get(5), "s1.destroy");
// 3 services, 2nd one fails on init
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService2.class.getName(), TestServer.MyService3.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
try {
server.init();
Assert.fail();
} catch (ServerException ex) {
Assert.assertEquals(TestServer.MyService2.class, ex.getError().getClass());
} catch (Exception ex) {
Assert.fail();
}
Assert.assertEquals(TestServer.ORDER.size(), 3);
Assert.assertEquals(TestServer.ORDER.get(0), "s1.init");
Assert.assertEquals(TestServer.ORDER.get(1), "s2.init");
Assert.assertEquals(TestServer.ORDER.get(2), "s1.destroy");
// 2 services one fails on destroy
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService5.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
Assert.assertEquals(TestServer.ORDER.size(), 4);
Assert.assertEquals(TestServer.ORDER.get(0), "s1.init");
Assert.assertEquals(TestServer.ORDER.get(1), "s5.init");
Assert.assertEquals(TestServer.ORDER.get(2), "s1.postInit");
Assert.assertEquals(TestServer.ORDER.get(3), "s5.postInit");
server.destroy();
Assert.assertEquals(TestServer.ORDER.size(), 6);
Assert.assertEquals(TestServer.ORDER.get(4), "s5.destroy");
Assert.assertEquals(TestServer.ORDER.get(5), "s1.destroy");
// service override via ext
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService3.class.getName()));
String servicesExt = StringUtils.join(",", Arrays.asList(TestServer.MyService1a.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
conf.set("server.services.ext", servicesExt);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
Assert.assertEquals(server.get(TestServer.MyService1.class).getClass(), TestServer.MyService1a.class);
Assert.assertEquals(TestServer.ORDER.size(), 4);
Assert.assertEquals(TestServer.ORDER.get(0), "s1a.init");
Assert.assertEquals(TestServer.ORDER.get(1), "s3.init");
Assert.assertEquals(TestServer.ORDER.get(2), "s1a.postInit");
Assert.assertEquals(TestServer.ORDER.get(3), "s3.postInit");
server.destroy();
Assert.assertEquals(TestServer.ORDER.size(), 6);
Assert.assertEquals(TestServer.ORDER.get(4), "s3.destroy");
Assert.assertEquals(TestServer.ORDER.get(5), "s1a.destroy");
// service override via setService
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService3.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
server.setService(TestServer.MyService1a.class);
Assert.assertEquals(TestServer.ORDER.size(), 6);
Assert.assertEquals(TestServer.ORDER.get(4), "s1.destroy");
Assert.assertEquals(TestServer.ORDER.get(5), "s1a.init");
Assert.assertEquals(server.get(TestServer.MyService1.class).getClass(), TestServer.MyService1a.class);
server.destroy();
Assert.assertEquals(TestServer.ORDER.size(), 8);
Assert.assertEquals(TestServer.ORDER.get(6), "s3.destroy");
Assert.assertEquals(TestServer.ORDER.get(7), "s1a.destroy");
// service add via setService
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService3.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
server.setService(TestServer.MyService5.class);
Assert.assertEquals(TestServer.ORDER.size(), 5);
Assert.assertEquals(TestServer.ORDER.get(4), "s5.init");
Assert.assertEquals(server.get(TestServer.MyService5.class).getClass(), TestServer.MyService5.class);
server.destroy();
Assert.assertEquals(TestServer.ORDER.size(), 8);
Assert.assertEquals(TestServer.ORDER.get(5), "s5.destroy");
Assert.assertEquals(TestServer.ORDER.get(6), "s3.destroy");
Assert.assertEquals(TestServer.ORDER.get(7), "s1.destroy");
// service add via setService exception
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService3.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
try {
server.setService(TestServer.MyService7.class);
Assert.fail();
} catch (ServerException ex) {
Assert.assertEquals(S09, ex.getError());
} catch (Exception ex) {
Assert.fail();
}
Assert.assertEquals(TestServer.ORDER.size(), 6);
Assert.assertEquals(TestServer.ORDER.get(4), "s3.destroy");
Assert.assertEquals(TestServer.ORDER.get(5), "s1.destroy");
// service with dependency
TestServer.ORDER.clear();
services = StringUtils.join(",", Arrays.asList(TestServer.MyService1.class.getName(), TestServer.MyService6.class.getName()));
conf = new Configuration(false);
conf.set("server.services", services);
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
Assert.assertEquals(server.get(TestServer.MyService1.class).getInterface(), TestServer.MyService1.class);
Assert.assertEquals(server.get(TestServer.MyService6.class).getInterface(), TestServer.MyService6.class);
server.destroy();
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
d9ed93017280f1299deabbca5ce371ea6c653617 | d277ee3f92afb29db21b4af3df0b99816d00cc57 | /src/HungQuery/cau7/class7.java | 96353691517362f1f2e7cd5d4dcf01639a399a94 | [] | no_license | hungnv281/CSDL | 584702f5670682bf2849bb368578223ec64a0fa3 | debba54a162436d43e84c52f6b68bcca4f6bee10 | refs/heads/main | 2023-05-14T18:00:04.083222 | 2021-06-10T08:15:35 | 2021-06-10T08:15:35 | 375,621,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,138 | java | package HungQuery.cau7;
import java.sql.Date;
public class class7 {
private String manv, hoten;
private Date ngaysinh;
private String quequan,gioitinh,dantoc,sdt,mapb,macv,matdhv,bacluong;
private Date ngaykt;
public class7(String manv, String hoten, Date ngaysinh, String quequan,
String gioitinh, String dantoc, String sdt,
String mapb, String macv, String matdhv, String bacluong, Date ngaykt) {
this.manv = manv;
this.hoten = hoten;
this.ngaysinh = ngaysinh;
this.quequan = quequan;
this.gioitinh = gioitinh;
this.dantoc = dantoc;
this.sdt = sdt;
this.mapb = mapb;
this.macv = macv;
this.matdhv = matdhv;
this.bacluong = bacluong;
this.ngaykt = ngaykt;
}
public String getManv() {
return manv;
}
public void setManv(String manv) {
this.manv = manv;
}
public String getHoten() {
return hoten;
}
public void setHoten(String hoten) {
this.hoten = hoten;
}
public Date getNgaysinh() {
return ngaysinh;
}
public void setNgaysinh(Date ngaysinh) {
this.ngaysinh = ngaysinh;
}
public String getQuequan() {
return quequan;
}
public void setQuequan(String quequan) {
this.quequan = quequan;
}
public String getGioitinh() {
return gioitinh;
}
public void setGioitinh(String gioitinh) {
this.gioitinh = gioitinh;
}
public String getDantoc() {
return dantoc;
}
public void setDantoc(String dantoc) {
this.dantoc = dantoc;
}
public String getSdt() {
return sdt;
}
public void setSdt(String sdt) {
this.sdt = sdt;
}
public String getMapb() {
return mapb;
}
public void setMapb(String mapb) {
this.mapb = mapb;
}
public String getMacv() {
return macv;
}
public void setMacv(String macv) {
this.macv = macv;
}
public String getMatdhv() {
return matdhv;
}
public void setMatdhv(String matdhv) {
this.matdhv = matdhv;
}
public String getBacluong() {
return bacluong;
}
public void setBacluong(String bacluong) {
this.bacluong = bacluong;
}
public Date getNgaykt() {
return ngaykt;
}
public void setNgaykt(Date ngaykt) {
this.ngaykt = ngaykt;
}
@Override
public String toString() {
return "class7{" +
"manv='" + manv + '\'' +
", hoten='" + hoten + '\'' +
", ngaysinh=" + ngaysinh +
", quequan='" + quequan + '\'' +
", gioitinh='" + gioitinh + '\'' +
", dantoc='" + dantoc + '\'' +
", sdt='" + sdt + '\'' +
", mapb='" + mapb + '\'' +
", macv='" + macv + '\'' +
", matdhv='" + matdhv + '\'' +
", bacluong='" + bacluong + '\'' +
", ngaykt=" + ngaykt +
'}';
}
}
| [
"="
] | = |
d90632577af38fea494d15665085c1bd883d1750 | ee0d3ecbcc1ea1793d7999d785f9211946e04f90 | /validation-service/src/main/java/com/validationservice/restwebservice/validationservice/ValidationServiceApplication.java | 0aaa6330b08099cf950e4d73e277f829a061fe52 | [] | no_license | gargmanit/DataValidationService | 8406d93e4783ba9f5fc808471131b2928fb37ead | 697b2415243b55a6b75a4a195f6b3e2284a9ee05 | refs/heads/master | 2020-05-30T14:16:27.268734 | 2019-06-03T14:17:07 | 2019-06-03T14:17:07 | 189,786,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 763 | java | package com.validationservice.restwebservice.validationservice;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
public class ValidationServiceApplication {
private static final Logger log = LoggerFactory.getLogger(ValidationServiceApplication.class);
public static void main(String[] args) {
//SpringApplication.run(Valida tionServiceApplication.class, args);
RestTemplate restTemplate = new RestTemplate();
Quote quote = restTemplate.getForObject("https://gturnquist-quoters.cfapps.io/api/random", Quote.class);
log.info(quote.toString());
}
} | [
"abhi.trics@gmail.com"
] | abhi.trics@gmail.com |
a632882d82754bf3295b3fd18bf5f8fd23ca7b41 | 8735a2930bb02322e1e3acdb883c86048fd5b3de | /src/main/java/com/av/biv/persintance/mapper/TravelLocationMapper.java | ab16570a7cad1bb360dea30dc69e74b65b5c9c30 | [] | no_license | AlonsoVS/Biv | bbc2fe559e3f7047f494e0d7f429c93fd05f6ecd | 5092e56414acff66b38d3eaf1eb997a11586fd1c | refs/heads/main | 2023-05-14T17:17:13.575059 | 2021-06-08T03:26:28 | 2021-06-08T03:26:28 | 335,677,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 897 | java | package com.av.biv.persintance.mapper;
import com.av.biv.domain.TravelLocation;
import com.av.biv.domain.User;
import com.av.biv.persintance.entity.TravelLocationEntity;
import com.av.biv.persintance.entity.UserEntity;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import java.util.List;
@Mapper(componentModel = "spring", uses = NoteMapper.class)
public interface TravelLocationMapper {
@Mapping(source = "notes", target = "notes")
TravelLocation toTravelLocation(TravelLocationEntity travelLocation);
List<TravelLocation> toTravelLocations(List<TravelLocationEntity> travelLocations);
@InheritInverseConfiguration
TravelLocationEntity toTravelLocationEntity(TravelLocation travelLocation);
@InheritInverseConfiguration
List<TravelLocationEntity> toTravelLocationsEntity(List<TravelLocation> travelLocations);
}
| [
"alonsovillegas2016@gmail.com"
] | alonsovillegas2016@gmail.com |
fe7a41497a39493364339c1b83a6e721b5e50ab5 | 9eebccee9ec3211e98aa85f0b66ac8af3acf8309 | /Dubbo/mydubbodemo/my-dubbo-demo-api/src/main/java/wr1ttenyu/study/dubbo/service/api/DemoService2.java | 96dedb9bc1b4e87728f6c13e87cfbe66836c5a64 | [] | no_license | wr1ttenyu/study-record | db441d14a931acbe220910379d635f3bd0534fa0 | b709a5e445e8fd61c74e8120971763d3a223c25a | refs/heads/master | 2020-03-16T13:13:16.578607 | 2019-02-23T02:37:52 | 2019-02-23T02:37:52 | 132,684,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 112 | java | package wr1ttenyu.study.dubbo.service.api;
public interface DemoService2 {
String sayHello(String name);
}
| [
"xingyu.zhao@bangdao-tech.com"
] | xingyu.zhao@bangdao-tech.com |
82b0fbc796164e892357a88c7a9782555694f6fe | 86b7d9368bbd18785393dda68fdeac0ffb503b3a | /app/src/main/java/com/example/ecss/medicalmapper/network/signInApiCall/SignInRequest.java | d6b5b49fc5d6dee9ac63b9452f7da5a1fffa0e49 | [] | no_license | Ahmad-A-Khalifa/at3aleg-feen | 13875ce54f6a5d5b88965105712cf4ab201fe0be | c92a650c3010e5d5f034e8998eac149abc6af044 | refs/heads/master | 2021-01-19T11:34:43.641398 | 2017-07-18T22:34:13 | 2017-07-18T22:34:13 | 87,977,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | package com.example.ecss.medicalmapper.network.signInApiCall;
import com.google.gson.annotations.SerializedName;
/**
* Created by ecss on 17/05/2017.
*/
public class SignInRequest {
@SerializedName("email")
private String mEmail;
@SerializedName("password")
private String mPassword;
public SignInRequest(String email, String password) {
mEmail = email;
mPassword = password;
}
}
| [
"samuelsamer952@gmail.com"
] | samuelsamer952@gmail.com |
b17b56981e2fb2161dbf01965faea7a8b2777972 | 709b22be3cc1e8286a9579c9fb609a195a6863e6 | /app/src/main/java/sinia/com/entertainer/utils/city/Cityinfo.java | 637314f02b71cc0356114c1645a66d195adb279e | [] | no_license | jackvvv/Entertainer | ad908b21a8e5cd95f33732ea525c36960f0a6c5d | f27231f6b2621899733874c2e7ab583169cb8bed | refs/heads/master | 2021-01-16T02:43:03.271462 | 2017-01-20T11:08:37 | 2017-01-20T11:08:37 | 78,906,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 511 | java | package sinia.com.entertainer.utils.city;
import java.io.Serializable;
public class Cityinfo implements Serializable {
private String id;
private String city_name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCity_name() {
return city_name;
}
public void setCity_name(String city_name) {
this.city_name = city_name;
}
@Override
public String toString() {
return "Cityinfo [id=" + id + ", city_name=" + city_name + "]";
}
}
| [
"954828748@qq.com"
] | 954828748@qq.com |
fea3b661b22d2f12745bbb9a5217dda2d7c6dd83 | 2b69d7124ce03cb40c3ee284aa0d3ce0d1814575 | /p2p-order/p2p-trading/src/main/java/com/zb/txs/p2p/investment/controller/InvestmentController.java | 3988ee4b2a59843794a485464712bd1181a6bd81 | [] | no_license | hhhcommon/fincore_p2p | 6bb7a4c44ebd8ff12a4c1f7ca2cf5cc182b55b44 | 550e937c1f7d1c6642bda948cd2f3cc9feb7d3eb | refs/heads/master | 2021-10-24T12:12:22.322007 | 2019-03-26T02:17:01 | 2019-03-26T02:17:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,168 | java | package com.zb.txs.p2p.investment.controller;
import com.google.common.base.Preconditions;
import com.zb.txs.p2p.business.enums.order.ResponseCodeEnum;
import com.zb.txs.p2p.business.invest.repose.InvestProfitResp;
import com.zb.txs.p2p.business.invest.repose.InvestmentRecordResp;
import com.zb.txs.p2p.business.invest.request.InvestPageReq;
import com.zb.txs.p2p.business.invest.request.InvestmentRecordRequest;
import com.zb.txs.p2p.business.invest.request.InvestmentRequest;
import com.zb.txs.p2p.business.order.response.CommonResponse;
import com.zb.txs.p2p.business.order.response.PageQueryResp;
import com.zb.txs.p2p.investment.service.InvestmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/p2p/trading/investment")
@Slf4j
public class InvestmentController {
@Autowired
InvestmentService investmentService;
/**
* 昨日收益和网贷总额接口
*
* @param investmentRequest
* @return 投资详情
*/
@RequestMapping(value = "/holdTotalAssets", method = RequestMethod.POST)
public CommonResponse<InvestProfitResp> getInvestProfit(@RequestBody InvestmentRequest investmentRequest) {
try {
Preconditions.checkNotNull(investmentRequest, "请求实体investmentRequest为空");
Preconditions.checkNotNull(investmentRequest.getMemberId(), "用户ID为空");
Preconditions.checkNotNull(investmentRequest.getInterestDate(), "收益日期为空");
} catch (NullPointerException e) {
log.warn("请求参数错误: {}", e.getMessage());
return CommonResponse.build(ResponseCodeEnum.RESPONSE_PARAM_FAIL.getCode(), e.getMessage(), null);
}
log.info("getInvestProfit请求参数,investmentRequest:{}", investmentRequest);
return investmentService.getInvestProfit(investmentRequest);
}
/**
* 前端查询交易记录接口(TXS后端)
* @param investmentRecordRequest
* @return 投资详情
*/
@RequestMapping(value = "/tradeRecord", method = RequestMethod.POST)
public CommonResponse<InvestmentRecordResp> getInvestmentRecord(@RequestBody InvestmentRecordRequest investmentRecordRequest) {
try{
Preconditions.checkNotNull(investmentRecordRequest,"请求实体investmentRecordRequest为空");
Preconditions.checkNotNull(investmentRecordRequest.getMemberId(), "用户ID为空");
Preconditions.checkNotNull(investmentRecordRequest.getTransType(), "交易类型为空");
}catch(NullPointerException e){
log.warn("请求参数错误: {}", e.getMessage());
return CommonResponse.build(ResponseCodeEnum.RESPONSE_PARAM_FAIL.getCode(), e.getMessage(), null);
}
try {
log.info("getInvestmentRecord请求参数,investmentRecordRequest:{}", investmentRecordRequest);
return investmentService.getInvestmentRecord(investmentRecordRequest);
} catch (Exception e) {
log.error("系统异常:", e);
return CommonResponse.failure();
}
}
/**
* 运营台查询资金交易记录接口
*
* @param investPageReq
*/
@RequestMapping(value = "/listPageRecord", method = RequestMethod.POST)
public CommonResponse<PageQueryResp> listPageRecord(@RequestBody InvestPageReq investPageReq) {
try {
Preconditions.checkNotNull(investPageReq, "请求实体investPageReq为空");
Preconditions.checkNotNull(investPageReq.getStartDate(), "开始时间为空");
Preconditions.checkNotNull(investPageReq.getEndDate(), "结束时间为空");
Preconditions.checkNotNull(investPageReq.getTransType(), "交易类型为空");
Preconditions.checkNotNull(investPageReq.getMemberId(), "用户ID为空");
Preconditions.checkNotNull(investPageReq.getPageNo(), "页码为空");
Preconditions.checkNotNull(investPageReq.getPageSize(), "每页显示条数为空");
} catch (NullPointerException e) {
log.warn("请求参数错误: {}", e.getMessage());
return CommonResponse.build(ResponseCodeEnum.RESPONSE_PARAM_FAIL.getCode(), e.getMessage(), null);
}
if (investPageReq.getStartDate().getTime() > investPageReq.getEndDate().getTime()) {
return CommonResponse.build(ResponseCodeEnum.RESPONSE_PARAM_FAIL.getCode(), "开始时间不能大于结束时间", null);
}
if (investPageReq.getPageNo() <= 0 || investPageReq.getPageSize() <= 0) {
return CommonResponse.build(ResponseCodeEnum.RESPONSE_PARAM_FAIL.getCode(), "pageNo或pageSize必须大于0", null);
}
log.info("listPageRecord请求参数,investPageReq:{}", investPageReq);
return investmentService.listPageRecord(investPageReq);
}
}
| [
"kaiyun@zillionfortune.com"
] | kaiyun@zillionfortune.com |
6a3eb1eb878bf4c3b85b5ec8f9b24a0f8f8d6b5e | 1fa902646157daf5d8f2e670478682d8bc2e0da3 | /app/src/main/java/com/achmadlutfi/utsku/SessionManagement.java | 0c1edfe24dfbdc5e773046236959548fa8f2ed43 | [] | no_license | alutfir/TI3A_1_UTS_AchmadLutfi | b2c39b8c2a2e7291f5f635ca403ee74b20131458 | b167c7391054af60e5b70272aace2c30c6969228 | refs/heads/master | 2020-04-04T14:08:54.855437 | 2018-11-03T14:13:49 | 2018-11-03T14:13:49 | 155,988,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,050 | java | package com.achmadlutfi.utsku;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import java.util.HashMap;
public class SessionManagement {
private SharedPreferences mSharedPreferences;
private SharedPreferences.Editor mEditor;
private Context mContext;
int PRIVATE_MODE;
private static final String PREF_NAME = "SharedPrefLatihan";
private static final String IS_LOGIN = "IsLoggedIn";
public static final String KEY_EMAIL = "email";
public static final String Key_PASSWORD = "password";
public SessionManagement(Context mContext) {
this.mContext = mContext;
mSharedPreferences = this.mContext.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
mEditor = mSharedPreferences.edit();
}
public void createLoginSession(String email, String password) {
mEditor.putBoolean(IS_LOGIN, true);
mEditor.putString(KEY_EMAIL, email);
mEditor.putString(Key_PASSWORD, password);
mEditor.commit();
}
public HashMap<String, String> getUserInformation() {
HashMap<String, String> user = new HashMap<String, String>();
user.put(KEY_EMAIL, mSharedPreferences.getString(KEY_EMAIL, null));
user.put(Key_PASSWORD, mSharedPreferences.getString(Key_PASSWORD, null));
return user;
}
public boolean isLoggedIn() {
return mSharedPreferences.getBoolean(IS_LOGIN, false);
}
public void checkLogin() {
if (!isLoggedIn()) {
Intent i = new Intent(mContext, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(i);
}
}
public void logoutUser() {
mEditor.clear();
mEditor.commit();
Intent i = new Intent(mContext, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(i);
}
}
| [
"achmad.lutfi50@gmail.com"
] | achmad.lutfi50@gmail.com |
320732724c934c683fbc5e2d942293e47b288f8d | a83c1a3bb4c8ba480860ab8ec6fe33eace286a44 | /app/src/main/java/com/example/hackmate/Fragments/EditProfileFragment.java | 8e93b3014f3832f63ae049bfd0836d141cd205fe | [] | no_license | Kavita1013/Hackmate_personal | 70daa87f4209d41d53c4038e1c495fe2a6c23039 | 7839b828df04d68778ce6634f53e07d193cb2da4 | refs/heads/main | 2023-06-12T05:51:43.646228 | 2021-07-07T15:37:51 | 2021-07-07T15:37:51 | 383,847,656 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package com.example.hackmate.Fragments;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import com.example.hackmate.R;
import com.google.android.material.bottomnavigation.BottomNavigationView;
public class EditProfileFragment extends Fragment {
Button saveButton;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_edit_profile, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
saveButton = view.findViewById(R.id.saveChangeButton);
saveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(), "Changes saved !!!", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
BottomNavigationView bottomNavigation = getActivity().findViewById(R.id.bottom_nav_bar);
bottomNavigation.setVisibility(View.VISIBLE);
}
} | [
"kavitapravin.n2020@vitstudent.ac.in"
] | kavitapravin.n2020@vitstudent.ac.in |
24663efcac0f51381c92de5123108ca6ad4c48da | a0edb984a43269f813aa644b692334a1a85b6e2c | /app/src/main/java/com/huynt75/AppRun/MainActivity_vd_thuoccode_method.java | 5afee85a622f734e6f052f953563a61c66516b41 | [] | no_license | thanhhuydv08/Android_IMIC | a60f03481fa476de36da4215866f75b8a7befbf7 | 6e5af2717cc5666d1aa92e889a76cdaf12931998 | refs/heads/master | 2020-04-05T04:29:37.407632 | 2018-11-11T15:22:37 | 2018-11-11T15:22:37 | 156,553,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,020 | java | package com.huynt75.AppRun;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TabHost;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
import com.huynt75.test_1.R;
import static com.huynt75.test_1.R.color.Blue;
import static com.huynt75.test_1.R.color.background_floating_material_dark;
public class MainActivity_vd_thuoccode_method extends AppCompatActivity {
// Context context;
Button btn_addView ;
LinearLayout layout_root, layout_child;
ScrollView scrollView;
LinearLayout layout_root_one;
TextView txt;
TableLayout tableLayout;
TableRow header,row;
EditText idTxtView;
TextView rowTv;
int cot=0;
int hang =0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vd_thuoccode_method);
AnhXa();
btn_addView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// khi click thi goi toi sinh code view tu dong add vao layout root
// vi du toi muon tao ra 2 liner nam trong scrool view cua layout root
// trong 1 liner thi co 5 cot trong 1 cot mang view cua layout vd_thuoccode_method_ver1
// for (int i=0; i<2;i++){
// CreateLayout();
// for(int j=0;j<5;j++) {
// CallLayout();
// }
// layout_root.addView(layout_root_one);
// }
//////////////thay vi viet nhu tren ta viet table xong add drawble la bai vao tung row
layout_root.addView(CreateTable());
}
});
}
public void AnhXa(){
btn_addView = findViewById(R.id.btn_addView);
layout_root = findViewById(R.id.layout_root);
layout_child = findViewById(R.id.layout_child);
scrollView = findViewById(R.id.scrollView);
}
public void CreateLayout(){
layout_root_one = new LinearLayout(MainActivity_vd_thuoccode_method.this);
layout_root_one.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
layout_root_one.setBackgroundColor(getResources().getColor(R.color.Blue));// bat buoc co getResourcees nhe
layout_root_one.setOrientation(LinearLayout.HORIZONTAL);
layout_root_one.setWeightSum(5);
}
public void CallLayout(){
LayoutInflater inflater = LayoutInflater.from(MainActivity_vd_thuoccode_method.this);
LinearLayout layout_child_one = (LinearLayout) inflater.inflate(R.layout.vd_thuoccode_method_ver1,null);
layout_child_one.setWeightSum(1);
layout_root_one.addView(layout_child_one);
}
public TableLayout CreateTable(){
tableLayout = new TableLayout(MainActivity_vd_thuoccode_method.this);
// tableLayout.setBackgroundColor(getResources().getColor(R.color.Blue));
tableLayout.setBaselineAligned(true);
// vi du du lieu truyen vao la 2 row 5 cot
header = new TableRow(MainActivity_vd_thuoccode_method.this);
for (int i=0;i<2;i++){
row = new TableRow(MainActivity_vd_thuoccode_method.this);
for(int j=0;j<5;j++){
rowTv = new TextView(MainActivity_vd_thuoccode_method.this);
rowTv.setId(j);
rowTv.setWidth(200);
rowTv.setHeight(300);
rowTv.setBackgroundResource(R.drawable.border_labai_ungdung);
row.addView(rowTv);
}
tableLayout.addView(row);
}
return tableLayout;
}
}
| [
"thanhhuydv08@gmail.com"
] | thanhhuydv08@gmail.com |
b2e4bb19e1506c32f42be808b67cea464142e6b1 | 2a73ec76a88059a589897696445e9a363129e47f | /openmeetings-web/src/main/java/org/apache/openmeetings/web/user/MessageDialog.java | e1db8adae553b9c419d88d65bb3338c3fa4b1c4e | [
"Apache-2.0"
] | permissive | qiffang/meeting | 5bd8d214ae28871b89b4a204e6374cca6e42d4a1 | 73280a11bb9ae0eaec0469e4f31fd4849e41bd8c | refs/heads/master | 2021-01-12T07:15:50.453836 | 2016-12-20T09:51:52 | 2016-12-20T09:51:52 | 76,926,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,602 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License") + you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.openmeetings.web.user;
import static org.apache.openmeetings.db.entity.user.PrivateMessage.INBOX_FOLDER_ID;
import static org.apache.openmeetings.db.entity.user.PrivateMessage.SENT_FOLDER_ID;
import static org.apache.openmeetings.web.app.Application.getBean;
import static org.apache.openmeetings.web.app.Application.getContactsLink;
import static org.apache.openmeetings.web.app.Application.getInvitationLink;
import static org.apache.openmeetings.web.app.WebSession.getUserId;
import static org.apache.openmeetings.web.util.CalendarWebHelper.getZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.apache.openmeetings.core.mail.MailHandler;
import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
import org.apache.openmeetings.db.dao.room.IInvitationManager;
import org.apache.openmeetings.db.dao.room.RoomDao;
import org.apache.openmeetings.db.dao.user.PrivateMessageDao;
import org.apache.openmeetings.db.dao.user.UserDao;
import org.apache.openmeetings.db.entity.calendar.Appointment;
import org.apache.openmeetings.db.entity.calendar.MeetingMember;
import org.apache.openmeetings.db.entity.room.Invitation;
import org.apache.openmeetings.db.entity.room.Invitation.Valid;
import org.apache.openmeetings.db.entity.room.Room;
import org.apache.openmeetings.db.entity.user.PrivateMessage;
import org.apache.openmeetings.db.entity.user.User;
import org.apache.openmeetings.db.entity.user.User.Type;
import org.apache.openmeetings.util.CalendarHelper;
import org.apache.openmeetings.web.app.Application;
import org.apache.openmeetings.web.common.OmDateTimePicker;
import org.apache.openmeetings.web.util.CalendarWebHelper;
import org.apache.openmeetings.web.util.RoomTypeDropDown;
import org.apache.openmeetings.web.util.UserMultiChoice;
import org.apache.wicket.ajax.AjaxEventBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.util.CollectionModel;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.temporal.ChronoUnit;
import com.googlecode.wicket.jquery.core.Options;
import com.googlecode.wicket.jquery.ui.plugins.wysiwyg.WysiwygEditor;
import com.googlecode.wicket.jquery.ui.plugins.wysiwyg.toolbar.DefaultWysiwygToolbar;
import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog;
import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton;
import com.googlecode.wicket.kendo.ui.form.datetime.local.DateTimePicker;
import com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel;
public class MessageDialog extends AbstractFormDialog<PrivateMessage> {
private static final long serialVersionUID = 1L;
private final Form<PrivateMessage> form;
private final KendoFeedbackPanel feedback = new KendoFeedbackPanel("feedback", new Options("button", true));
protected DialogButton send = new DialogButton("send", Application.getString(218));
private DialogButton cancel = new DialogButton("cancel", Application.getString(219));
private final WebMarkupContainer roomParamsBlock = new WebMarkupContainer("roomParamsBlock");
private final WebMarkupContainer roomParams = new WebMarkupContainer("roomParams");
private final DateTimePicker start = new OmDateTimePicker("start", Model.of(LocalDateTime.now()));
private final DateTimePicker end = new OmDateTimePicker("end", Model.of(LocalDateTime.now()));
private boolean isPrivate = false;
private final IModel<Collection<User>> modelTo = new CollectionModel<User>(new ArrayList<User>());
@Override
public int getWidth() {
return 650;
}
public void open(IPartialPageRequestHandler handler, Long userId) {
getModelObject().setTo(getBean(UserDao.class).get(userId));
open(handler);
}
public MessageDialog reset(boolean isPrivate) {
//TODO should be 'in sync' with appointment
LocalDateTime now = ZonedDateTime.now(getZoneId()).toLocalDateTime();
start.setModelObject(now);
end.setModelObject(now.plus(1, ChronoUnit.HOURS));
modelTo.setObject(new ArrayList<User>());
PrivateMessage p = new PrivateMessage();
p.setFrom(getBean(UserDao.class).get(getUserId()));
p.setOwner(p.getFrom());
p.setIsRead(false);
p.setFolderId(INBOX_FOLDER_ID);
Room r = new Room();
r.setAppointment(true);
r.setType(Room.Type.conference);
p.setRoom(r);
setModelObject(p);
roomParams.setVisible(getModelObject().isBookedRoom());
form.setModelObject(p);
this.isPrivate = isPrivate;
return this;
}
@Override
protected void onOpen(IPartialPageRequestHandler handler) {
if (getModel().getObject().getTo() != null) {
modelTo.getObject().add(getModel().getObject().getTo());
}
handler.add(form);
super.onOpen(handler);
}
public MessageDialog(String id, CompoundPropertyModel<PrivateMessage> model) {
super(id, Application.getString(1209), model);
form = new Form<PrivateMessage>("form", getModel());
form.add(feedback.setOutputMarkupId(true));
form.add(new UserMultiChoice("to", modelTo).setRequired(true));
form.add(new TextField<String>("subject"));
DefaultWysiwygToolbar toolbar = new DefaultWysiwygToolbar("toolbarContainer");
form.add(toolbar);
form.add(new WysiwygEditor("message", toolbar));
form.add(roomParamsBlock.setOutputMarkupId(true));
final CheckBox bookedRoom = new CheckBox("bookedRoom");
form.add(bookedRoom.setOutputMarkupId(true).add(new AjaxEventBehavior("click") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
PrivateMessage p = MessageDialog.this.getModelObject();
p.setBookedRoom(!p.isBookedRoom());
roomParams.setVisible(p.isBookedRoom());
target.add(bookedRoom, roomParamsBlock);
}
}));
roomParamsBlock.add(roomParams);
roomParams.add(new RoomTypeDropDown("room.type"));
roomParams.add(start);
roomParams.add(end);
add(form.setOutputMarkupId(true));
}
@Override
protected List<DialogButton> getButtons() {
return Arrays.asList(send, cancel);
}
@Override
public DialogButton getSubmitButton() {
return send;
}
@Override
public Form<PrivateMessage> getForm() {
return form;
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(feedback);
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
PrivateMessage m = getModelObject();
m.setInserted(new Date());
UserDao userDao = getBean(UserDao.class);
User owner = userDao.get(getUserId());
if (m.isBookedRoom()) {
Room r = m.getRoom();
r.setName(m.getSubject());
r.setComment("");
r.setNumberOfPartizipants(100L);
r.setAppointment(true);
r.setAllowUserQuestions(true);
r.setAllowFontStyles(true);
r = getBean(RoomDao.class).update(r, getUserId());
Appointment a = new Appointment();
a.setTitle(m.getSubject());
a.setDescription(m.getMessage());
a.setRoom(r);
a.setStart(CalendarWebHelper.getDate(start.getModelObject()));
a.setEnd(CalendarWebHelper.getDate(end.getModelObject()));
List<MeetingMember> attendees = new ArrayList<>();
for (User to : modelTo.getObject()) {
MeetingMember mm = new MeetingMember();
mm.setUser(to);
mm.setDeleted(false);
mm.setInserted(a.getInserted());
mm.setUpdated(a.getUpdated());
mm.setAppointment(a);
attendees.add(mm);
}
a.setOwner(owner);
a.setMeetingMembers(attendees);
getBean(AppointmentDao.class).update(a, getUserId(), false);
m.setRoom(r);
} else {
m.setRoom(null);
}
PrivateMessageDao msgDao = getBean(PrivateMessageDao.class);
for (User to : modelTo.getObject()) {
if (to.getId() == null) {
userDao.update(to, getUserId());
}
//to send
PrivateMessage p = new PrivateMessage(m);
p.setTo(to);
p.setFolderId(SENT_FOLDER_ID);
msgDao.update(p, getUserId());
//to inbox
p = new PrivateMessage(m);
p.setOwner(to);
p.setFolderId(INBOX_FOLDER_ID);
msgDao.update(p, getUserId());
if (to.getAddress() != null) {
String aLinkHTML = (isPrivate && to.getType() == Type.user) ? "<br/><br/>" + "<a href='" + getContactsLink() + "'>"
+ Application.getString(1302, to.getLanguageId()) + "</a><br/>" : "";
String invitation_link = "";
if (p.isBookedRoom()) {
Invitation i = getBean(IInvitationManager.class).getInvitation(to, p.getRoom(),
false, null, Valid.Period, owner, to.getLanguageId()
, CalendarHelper.getDate(start.getModelObject(), to.getTimeZoneId())
, CalendarHelper.getDate(end.getModelObject(), to.getTimeZoneId()), null);
invitation_link = getInvitationLink(i);
if (invitation_link == null) {
invitation_link = "";
} else {
invitation_link = "<br/>" //
+ Application.getString(503, to.getLanguageId())
+ "<br/><a href='" + invitation_link
+ "'>"
+ Application.getString(504, to.getLanguageId()) + "</a><br/>";
}
}
String subj = p.getSubject() == null ? "" : p.getSubject();
getBean(MailHandler.class).send(to.getAddress().getEmail(),
Application.getString(1301, to.getLanguageId()) + subj,
(p.getMessage() == null ? "" : p.getMessage().replaceAll("\\<.*?>", "")) + aLinkHTML + invitation_link);
}
}
}
@Override
protected void onDetach() {
modelTo.detach();
super.onDetach();
}
}
| [
"andy.qi@logicmonitor.com"
] | andy.qi@logicmonitor.com |
2ff1926d4be675b9df8b89f2ca963a0478a909b1 | 0b9762df22cd60da9d657bb26bcf1116fe391cf8 | /src/cn/edu/fudan/mmdb/hbase/isax/index/TestISAXIndex.java | 4e343298984da8a50ae0031571f9cebed3bfaded | [
"MIT"
] | permissive | ItGql/SparkIsax | 4767218233c8803aadcfc8eef2f4524f47ed2e2d | e09c3f888137424ea4676d3d06dd1900570f3c71 | refs/heads/master | 2021-01-18T20:27:54.274031 | 2017-04-08T02:44:47 | 2017-04-08T02:44:47 | 86,970,571 | 4 | 7 | null | null | null | null | UTF-8 | Java | false | false | 4,999 | java | /**
Copyright [2011] [Josh Patterson]
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 cn.edu.fudan.mmdb.hbase.isax.index;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import cn.edu.fudan.mmdb.timeseries.TPoint;
import cn.edu.fudan.mmdb.timeseries.TSException;
import cn.edu.fudan.mmdb.timeseries.Timeseries;
import cn.edu.fudan.mmdb.isax.ISAXUtils;
import cn.edu.fudan.mmdb.isax.index.IndexHashParams;
import cn.edu.fudan.mmdb.isax.index.TimeseriesInstance;
//import edu.hawaii.jmotif.datatype.isax.index.iSAXIndex;
/**
*
* These are some example use cases with Lumberyard
*
* Two primary ways we want to cover
*
* - using Lumberyard as a simple java client - query a specific table for a
* pattern - may have multiple tables in same hbase, all use similar schema
* though - table specified in query call - search-pattern becomes key
*
* - using Lumberyard via a http-service like Tornado - would want to specify
* the table from the REST query - would want to specify the search-pattern from
* the REST query -> search-query becomes key - schema is hard coded?
*
* - TODO - think about loading schemes and how tables get created.
*
* @author jpatterson
*
*/
public class TestISAXIndex {
public static void insert_test() {
ISAXIndex index = new ISAXIndex();
System.out.println("\ntestISAXIndex_1");
// iSAXIndex index = new iSAXIndex( 4, 4, 8 );
Timeseries ts = new Timeseries();
ts.add(new TPoint(-1.0, 0));
ts.add(new TPoint(-0.5, 1));
ts.add(new TPoint(-0.25, 2));
ts.add(new TPoint(0.0, 3));
ts.add(new TPoint(0.25, 4));
ts.add(new TPoint(0.50, 5));
ts.add(new TPoint(0.75, 6));
ts.add(new TPoint(1.0, 7));
TimeseriesInstance tsi_A = new TimeseriesInstance(ts);
for (int x = 0; x < 3; x++) {
index.InsertSequence(ts, "genome.txt", 204526 + x);
}
// index.InsertSequence(ts, "genome.txt", 104530 );
}
public static void SearchTest() {
System.out.println("\nLumberyard > Search Test > Approximate Search");
ISAXIndex index = new ISAXIndex();
Timeseries ts = new Timeseries();
ts.add(new TPoint(-1.0, 0));
ts.add(new TPoint(-0.5, 1));
ts.add(new TPoint(-0.25, 2));
ts.add(new TPoint(0.0, 3));
ts.add(new TPoint(0.25, 4));
ts.add(new TPoint(0.50, 5));
ts.add(new TPoint(0.75, 6));
ts.add(new TPoint(1.0, 7));
System.out.println("Searching for: " + ts);
// index.InsertSequence(ts_2, "genome.txt", 104526 );
long start = System.currentTimeMillis();
TimeseriesInstance result = index.ApproxSearch(ts);
long diff = System.currentTimeMillis() - start;
if (result == null) {
System.out.println("Approx Search > no result found!");
// assertEquals( "null check", true, false );
} else {
System.out.println("Found ts in " + diff + " ms");
}
result.Debug();
}
public static void RandomInsertAndSearchTest(String table_name, int numberInserts) {
System.out.println("\nLumberyard > Search Test > Random Insert Then Approximate Search");
ISAXIndex index = new ISAXIndex();
if (false == index.LoadIndex(table_name)) {
System.out.println("\n\nCannot Load Index: " + table_name + ", quitting");
return;
}
int sampleSize = index.root_node.params.orig_ts_len;
Timeseries search_ts = null;
for (int x = 0; x < numberInserts; x++) {
System.out.print("." + x);
Timeseries ts_insert = ISAXUtils.generateRandomTS(sampleSize);
if (x == (numberInserts / 2)) {
search_ts = ts_insert;
}
index.InsertSequence(ts_insert, "ts.txt", 1000 + x * 20);
}
System.out.println(" ----- insert done -------");
System.out.println("Searching For: " + search_ts);
long start = System.currentTimeMillis();
TimeseriesInstance result = index.ApproxSearch(search_ts);
long diff = System.currentTimeMillis() - start;
if (result == null) {
System.out.println("Approx Search > no result found!");
// assertEquals( "null check", true, false );
} else {
System.out.println("Found ts in " + diff + " ms");
}
result.Debug();
}
/**
* @param args
*/
public static void main(String[] args) {
HBaseUtils.open();
try {
HBaseUtils.CreateNewTable(ISAXIndex.TABLE_NAME);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
insert_test();
SearchTest();
RandomInsertAndSearchTest(ISAXIndex.TABLE_NAME,10);
HBaseUtils.close();
}
} | [
"gql_2013@163.com"
] | gql_2013@163.com |
ae36ab504885009b8001f6089a8b4f942e4747ca | 1834c9ef1e6d9b77b6fd77a83b1de422ec6d9466 | /app/src/main/gen/com/timetracker/Manifest.java | be76c180a826481acad9ac22ddc2d9c9de94cd9e | [] | no_license | mrbabbage/android | 16b71b9dd81ca1fe39882566b3423b678aa19d1a | b79b9e264995577aff4a1b241113fa99af750a65 | refs/heads/master | 2021-01-22T09:41:27.356015 | 2016-12-10T07:34:15 | 2016-12-10T07:34:15 | 76,080,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | /*___Generated_by_IDEA___*/
package com.timetracker;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
} | [
"abdullahbabgi@Abdullahs-MacBook-Pro.local"
] | abdullahbabgi@Abdullahs-MacBook-Pro.local |
792ba8906bddfefd8a9f69cf9ef1f3cfa4b49c8d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/10/10_2115cc1aeeb2788612bd089c5fe8e63098b1f0f3/EclipseStarter/10_2115cc1aeeb2788612bd089c5fe8e63098b1f0f3_EclipseStarter_t.java | 6d578907ef4bd567fd1f460bdd7b53f513e5ff32 | [] | 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 | 52,843 | java | /*******************************************************************************
* Copyright (c) 2003, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.core.runtime.adaptor;
import java.io.*;
import java.lang.reflect.*;
import java.net.*;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.util.*;
import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
import org.eclipse.osgi.framework.internal.core.OSGi;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.framework.stats.StatsManager;
import org.eclipse.osgi.profile.Profile;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.resolver.*;
import org.eclipse.osgi.service.runnable.ParameterizedRunnable;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.service.startlevel.StartLevel;
import org.osgi.util.tracker.ServiceTracker;
/**
* Special startup class for the Eclipse Platform. This class cannot be
* instantiated; all functionality is provided by static methods.
* <p>
* The Eclipse Platform makes heavy use of Java class loaders for loading
* plug-ins. Even the Eclispe Runtime itself and the OSGi framework need
* to be loaded by special class loaders. The upshot is that a
* client program (such as a Java main program, a servlet) cannot
* reference any part of Eclipse directly. Instead, a client must use this
* loader class to start the platform, invoking functionality defined
* in plug-ins, and shutting down the platform when done.
* </p>
* <p>Note that the fields on this class are not API. </p>
* @since 3.0
*/
public class EclipseStarter {
private static FrameworkAdaptor adaptor;
private static BundleContext context;
private static ServiceTracker applicationTracker;
private static boolean initialize = false;
public static boolean debug = false;
private static boolean running = false;
// command line arguments
private static final String CLEAN = "-clean"; //$NON-NLS-1$
private static final String CONSOLE = "-console"; //$NON-NLS-1$
private static final String CONSOLE_LOG = "-consoleLog"; //$NON-NLS-1$
private static final String DEBUG = "-debug"; //$NON-NLS-1$
private static final String INITIALIZE = "-initialize"; //$NON-NLS-1$
private static final String DEV = "-dev"; //$NON-NLS-1$
private static final String WS = "-ws"; //$NON-NLS-1$
private static final String OS = "-os"; //$NON-NLS-1$
private static final String ARCH = "-arch"; //$NON-NLS-1$
private static final String NL = "-nl"; //$NON-NLS-1$
private static final String CONFIGURATION = "-configuration"; //$NON-NLS-1$
private static final String USER = "-user"; //$NON-NLS-1$
private static final String NOEXIT = "-noExit"; //$NON-NLS-1$
// this is more of an Eclipse argument but this OSGi implementation stores its
// metadata alongside Eclipse's.
private static final String DATA = "-data"; //$NON-NLS-1$
// System properties
public static final String PROP_BUNDLES = "osgi.bundles"; //$NON-NLS-1$
public static final String PROP_BUNDLES_STARTLEVEL = "osgi.bundles.defaultStartLevel"; //$NON-NLS-1$ //The start level used to install the bundles
public static final String PROP_EXTENSIONS = "osgi.framework.extensions"; //$NON-NLS-1$
public static final String PROP_INITIAL_STARTLEVEL = "osgi.startLevel"; //$NON-NLS-1$ //The start level when the fwl start
public static final String PROP_DEBUG = "osgi.debug"; //$NON-NLS-1$
public static final String PROP_DEV = "osgi.dev"; //$NON-NLS-1$
public static final String PROP_CLEAN = "osgi.clean"; //$NON-NLS-1$
public static final String PROP_CONSOLE = "osgi.console"; //$NON-NLS-1$
public static final String PROP_CONSOLE_CLASS = "osgi.consoleClass"; //$NON-NLS-1$
public static final String PROP_CHECK_CONFIG = "osgi.checkConfiguration"; //$NON-NLS-1$
public static final String PROP_OS = "osgi.os"; //$NON-NLS-1$
public static final String PROP_WS = "osgi.ws"; //$NON-NLS-1$
public static final String PROP_NL = "osgi.nl"; //$NON-NLS-1$
public static final String PROP_ARCH = "osgi.arch"; //$NON-NLS-1$
public static final String PROP_ADAPTOR = "osgi.adaptor"; //$NON-NLS-1$
public static final String PROP_SYSPATH = "osgi.syspath"; //$NON-NLS-1$
public static final String PROP_LOGFILE = "osgi.logfile"; //$NON-NLS-1$
public static final String PROP_FRAMEWORK = "osgi.framework"; //$NON-NLS-1$
public static final String PROP_INSTALL_AREA = "osgi.install.area"; //$NON-NLS-1$
public static final String PROP_FRAMEWORK_SHAPE = "osgi.framework.shape"; //$NON-NLS-1$ //the shape of the fwk (jar, or folder)
public static final String PROP_NOSHUTDOWN = "osgi.noShutdown"; //$NON-NLS-1$
public static final String PROP_EXITCODE = "eclipse.exitcode"; //$NON-NLS-1$
public static final String PROP_EXITDATA = "eclipse.exitdata"; //$NON-NLS-1$
public static final String PROP_CONSOLE_LOG = "eclipse.consoleLog"; //$NON-NLS-1$
private static final String PROP_VM = "eclipse.vm"; //$NON-NLS-1$
private static final String PROP_VMARGS = "eclipse.vmargs"; //$NON-NLS-1$
private static final String PROP_COMMANDS = "eclipse.commands"; //$NON-NLS-1$
public static final String PROP_IGNOREAPP = "eclipse.ignoreApp"; //$NON-NLS-1$
private static final String FILE_SCHEME = "file:"; //$NON-NLS-1$
private static final String FILE_PROTOCOL = "file"; //$NON-NLS-1$
private static final String REFERENCE_SCHEME = "reference:"; //$NON-NLS-1$
private static final String REFERENCE_PROTOCOL = "reference"; //$NON-NLS-1$
private static final String INITIAL_LOCATION = "initial@"; //$NON-NLS-1$
/** string containing the classname of the adaptor to be used in this framework instance */
protected static final String DEFAULT_ADAPTOR_CLASS = "org.eclipse.core.runtime.adaptor.EclipseAdaptor"; //$NON-NLS-1$
private static final int DEFAULT_INITIAL_STARTLEVEL = 6; // default value for legacy purposes
private static final String DEFAULT_BUNDLES_STARTLEVEL = "4"; //$NON-NLS-1$
// Console information
protected static final String DEFAULT_CONSOLE_CLASS = "org.eclipse.osgi.framework.internal.core.FrameworkConsole"; //$NON-NLS-1$
private static final String CONSOLE_NAME = "OSGi Console"; //$NON-NLS-1$
private static FrameworkLog log;
/**
* This is the main to start osgi.
* It only works when the framework is being jared as a single jar
*/
public static void main(String[] args) throws Exception {
URL url = EclipseStarter.class.getProtectionDomain().getCodeSource().getLocation();
System.getProperties().put(PROP_FRAMEWORK, url.toExternalForm());
String filePart = url.getFile();
System.getProperties().put(PROP_INSTALL_AREA, filePart.substring(0, filePart.lastIndexOf('/')));
System.getProperties().put(PROP_NOSHUTDOWN, "true"); //$NON-NLS-1$
run(args, null);
}
/**
* Launches the platform and runs a single application. The application is either identified
* in the given arguments (e.g., -application <app id>) or in the <code>eclipse.application</code>
* System property. This convenience method starts
* up the platform, runs the indicated application, and then shuts down the
* platform. The platform must not be running already.
*
* @param args the command line-style arguments used to configure the platform
* @param endSplashHandler the block of code to run to tear down the splash
* screen or <code>null</code> if no tear down is required
* @return the result of running the application
* @throws Exception if anything goes wrong
*/
public static Object run(String[] args, Runnable endSplashHandler) throws Exception {
if (Profile.PROFILE && Profile.STARTUP)
Profile.logEnter("EclipseStarter.run()", null); //$NON-NLS-1$
if (running)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING);
boolean startupFailed = true;
try {
startup(args, endSplashHandler);
startupFailed = false;
if (Boolean.getBoolean(PROP_IGNOREAPP))
return null;
return run(null);
} catch (Throwable e) {
// ensure the splash screen is down
if (endSplashHandler != null)
endSplashHandler.run();
// may use startupFailed to understand where the error happened
FrameworkLogEntry logEntry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, startupFailed ? EclipseAdaptorMsg.ECLIPSE_STARTUP_STARTUP_ERROR : EclipseAdaptorMsg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null); //$NON-NLS-1$//$NON-NLS-2$
if (log != null) {
log.log(logEntry);
logUnresolvedBundles(context.getBundles());
} else
// TODO desperate measure - ideally, we should write this to disk (a la Main.log)
e.printStackTrace();
} finally {
try {
if (!Boolean.getBoolean(PROP_NOSHUTDOWN))
shutdown();
} catch (Throwable e) {
FrameworkLogEntry logEntry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, EclipseAdaptorMsg.ECLIPSE_STARTUP_SHUTDOWN_ERROR, 1, e, null);
if (log != null)
log.log(logEntry);
else
// TODO desperate measure - ideally, we should write this to disk (a la Main.log)
e.printStackTrace();
}
if (Profile.PROFILE && Profile.STARTUP)
Profile.logExit("EclipseStarter.run()"); //$NON-NLS-1$
if (Profile.PROFILE) {
String report = Profile.getProfileLog();
// avoiding writing to the console if there is nothing to print
if (report != null && report.length() > 0)
System.out.println(report);
}
}
// first check to see if the framework is forcing a restart
if (Boolean.getBoolean("osgi.forcedRestart")) { //$NON-NLS-1$
System.getProperties().put(PROP_EXITCODE, "23"); //$NON-NLS-1$
return null;
}
// we only get here if an error happened
System.getProperties().put(PROP_EXITCODE, "13"); //$NON-NLS-1$
System.getProperties().put(PROP_EXITDATA, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_CHECK_LOG, log.getFile().getPath()));
return null;
}
/**
* Returns true if the platform is already running, false otherwise.
* @return whether or not the platform is already running
*/
public static boolean isRunning() {
return running;
}
protected static FrameworkLog createFrameworkLog() {
FrameworkLog frameworkLog;
String logFileProp = System.getProperty(EclipseStarter.PROP_LOGFILE);
if (logFileProp != null) {
frameworkLog = new EclipseLog(new File(logFileProp));
} else {
Location location = LocationManager.getConfigurationLocation();
File configAreaDirectory = null;
if (location != null)
// TODO assumes the URL is a file: url
configAreaDirectory = new File(location.getURL().getFile());
if (configAreaDirectory != null) {
String logFileName = Long.toString(System.currentTimeMillis()) + EclipseAdaptor.F_LOG;
File logFile = new File(configAreaDirectory, logFileName);
System.getProperties().put(EclipseStarter.PROP_LOGFILE, logFile.getAbsolutePath());
frameworkLog = new EclipseLog(logFile);
} else
frameworkLog = new EclipseLog();
}
if ("true".equals(System.getProperty(EclipseStarter.PROP_CONSOLE_LOG))) //$NON-NLS-1$
frameworkLog.setConsoleLog(true);
return frameworkLog;
}
/**
* Starts the platform and sets it up to run a single application. The application is either identified
* in the given arguments (e.g., -application <app id>) or in the <code>eclipse.application</code>
* System property. The platform must not be running already.
* <p>
* The given runnable (if not <code>null</code>) is used to tear down the splash screen if required.
* </p>
* @param args the arguments passed to the application
* @throws Exception if anything goes wrong
*/
public static void startup(String[] args, Runnable endSplashHandler) throws Exception {
if (Profile.PROFILE && Profile.STARTUP)
Profile.logEnter("EclipseStarter.startup()", null); //$NON-NLS-1$
if (running)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING);
processCommandLine(args);
LocationManager.initializeLocations();
log = createFrameworkLog();
initializeContextFinder();
loadConfigurationInfo();
finalizeProperties();
if (Profile.PROFILE)
Profile.initProps(); // catch any Profile properties set in eclipse.properties...
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "props inited"); //$NON-NLS-1$ //$NON-NLS-2$
adaptor = createAdaptor();
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "adapter created"); //$NON-NLS-1$ //$NON-NLS-2$
((EclipseAdaptor) adaptor).setLog(log);
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "adapter log set"); //$NON-NLS-1$ //$NON-NLS-2$
OSGi osgi = new OSGi(adaptor);
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "OSGi created"); //$NON-NLS-1$ //$NON-NLS-2$
osgi.launch();
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "osgi launched"); //$NON-NLS-1$ //$NON-NLS-2$
String console = System.getProperty(PROP_CONSOLE);
if (console != null) {
startConsole(osgi, new String[0], console);
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "console started"); //$NON-NLS-1$ //$NON-NLS-2$
}
context = osgi.getBundleContext();
publishSplashScreen(endSplashHandler);
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "loading basic bundles"); //$NON-NLS-1$ //$NON-NLS-2$
Bundle[] startBundles = loadBasicBundles();
// set the framework start level to the ultimate value. This will actually start things
// running if they are persistently active.
setStartLevel(getStartLevel());
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "StartLevel set"); //$NON-NLS-1$ //$NON-NLS-2$
// they should all be active by this time
ensureBundlesActive(startBundles);
if (debug || System.getProperty(PROP_DEV) != null)
// only spend time showing unresolved bundles in dev/debug mode
logUnresolvedBundles(context.getBundles());
running = true;
if (Profile.PROFILE && Profile.STARTUP)
Profile.logExit("EclipseStarter.startup()"); //$NON-NLS-1$
}
private static void initializeContextFinder() {
Thread current = Thread.currentThread();
try {
Method getContextClassLoader = Thread.class.getMethod("getContextClassLoader", null); //$NON-NLS-1$
Method setContextClassLoader = Thread.class.getMethod("setContextClassLoader", new Class[] { ClassLoader.class }); //$NON-NLS-1$
Object[] params = new Object[] { new ContextFinder((ClassLoader) getContextClassLoader.invoke(current, null)) };
setContextClassLoader.invoke(current, params);
return;
} catch (SecurityException e) {
//Ignore
} catch (NoSuchMethodException e) {
//Ignore
} catch (IllegalArgumentException e) {
//Ignore
} catch (IllegalAccessException e) {
//Ignore
} catch (InvocationTargetException e) {
//Ignore
}
FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_CANNOT_SET_CONTEXTFINDER, null), 0, null, null);
log.log(entry);
}
private static int getStartLevel() {
String level = System.getProperty(PROP_INITIAL_STARTLEVEL);
if (level != null)
try {
return Integer.parseInt(level);
} catch (NumberFormatException e) {
if (debug)
System.out.println("Start level = " + level + " parsed. Using hardcoded default: 6"); //$NON-NLS-1$ //$NON-NLS-2$
}
return DEFAULT_INITIAL_STARTLEVEL;
}
/**
* Runs the applicaiton for which the platform was started. The platform
* must be running.
* <p>
* The given argument is passed to the application being run. If it is <code>null</code>
* then the command line arguments used in starting the platform, and not consumed
* by the platform code, are passed to the application as a <code>String[]</code>.
* </p>
* @param argument the argument passed to the application. May be <code>null</code>
* @return the result of running the application
* @throws Exception if anything goes wrong
*/
public static Object run(Object argument) throws Exception {
if (Profile.PROFILE && Profile.STARTUP)
Profile.logEnter("EclipseStarter.run(Object)()", null); //$NON-NLS-1$
if (!running)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_NOT_RUNNING);
// if we are just initializing, do not run the application just return.
if (initialize)
return new Integer(0);
initializeApplicationTracker();
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.run(Object)()", "applicaton tracker initialized"); //$NON-NLS-1$ //$NON-NLS-2$
ParameterizedRunnable application = (ParameterizedRunnable) applicationTracker.getService();
applicationTracker.close();
if (application == null)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION);
if (debug) {
String timeString = System.getProperty("eclipse.startTime"); //$NON-NLS-1$
long time = timeString == null ? 0L : Long.parseLong(timeString);
System.out.println("Starting application: " + (System.currentTimeMillis() - time)); //$NON-NLS-1$
}
if (Profile.PROFILE && (Profile.STARTUP || Profile.BENCHMARK))
Profile.logTime("EclipseStarter.run(Object)()", "framework initialized! starting application..."); //$NON-NLS-1$ //$NON-NLS-2$
try {
return application.run(argument);
} finally {
if (Profile.PROFILE && Profile.STARTUP)
Profile.logExit("EclipseStarter.run(Object)()"); //$NON-NLS-1$
}
}
/**
* Shuts down the Platform. The state of the Platform is not automatically
* saved before shutting down.
* <p>
* On return, the Platform will no longer be running (but could be re-launched
* with another call to startup). If relaunching, care must be taken to reinitialize
* any System properties which the platform uses (e.g., osgi.instance.area) as
* some policies in the platform do not allow resetting of such properties on
* subsequent runs.
* </p><p>
* Any objects handed out by running Platform,
* including Platform runnables obtained via getRunnable, will be
* permanently invalid. The effects of attempting to invoke methods
* on invalid objects is undefined.
* </p>
* @throws Exception if anything goes wrong
*/
public static void shutdown() throws Exception {
if (!running)
return;
stopSystemBundle();
}
private static void ensureBundlesActive(Bundle[] bundles) {
for (int i = 0; i < bundles.length; i++) {
if (bundles[i].getState() != Bundle.ACTIVE) {
String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE, bundles[i]);
throw new IllegalStateException(message);
}
}
}
private static void logUnresolvedBundles(Bundle[] bundles) {
State state = adaptor.getState();
FrameworkLog logService = adaptor.getFrameworkLog();
StateHelper stateHelper = adaptor.getPlatformAdmin().getStateHelper();
for (int i = 0; i < bundles.length; i++)
if (bundles[i].getState() == Bundle.INSTALLED) {
String generalMessage = NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED, bundles[i]);
BundleDescription description = state.getBundle(bundles[i].getBundleId());
// for some reason, the state does not know about that bundle
if (description == null)
continue;
FrameworkLogEntry[] logChildren = null;
VersionConstraint[] unsatisfied = stateHelper.getUnsatisfiedConstraints(description);
if (unsatisfied.length > 0) {
// the bundle wasn't resolved due to some of its constraints were unsatisfiable
logChildren = new FrameworkLogEntry[unsatisfied.length];
for (int j = 0; j < unsatisfied.length; j++)
logChildren[j] = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, EclipseAdaptorMsg.getResolutionFailureMessage(unsatisfied[j]), 0, null, null);
} else if (description.getSymbolicName() != null) {
BundleDescription[] homonyms = state.getBundles(description.getSymbolicName());
for (int j = 0; j < homonyms.length; j++)
if (homonyms[j].isResolved()) {
logChildren = new FrameworkLogEntry[1];
logChildren[0] = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_OTHER_VERSION, homonyms[j].getLocation()), 0, null, null); //$NON-NLS-1$
}
}
logService.log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, generalMessage, 0, null, logChildren));
}
}
private static void publishSplashScreen(final Runnable endSplashHandler) {
// InternalPlatform now how to retrieve this later
Dictionary properties = new Hashtable();
properties.put("name", "splashscreen"); //$NON-NLS-1$ //$NON-NLS-2$
Runnable handler = new Runnable() {
public void run() {
StatsManager.doneBooting();
endSplashHandler.run();
}
};
context.registerService(Runnable.class.getName(), handler, properties);
}
private static URL searchForBundle(String name, String parent) throws MalformedURLException {
URL url = null;
File fileLocation = null;
boolean reference = false;
try {
URL child = new URL(name);
url = new URL(new File(parent).toURL(), name);
} catch (MalformedURLException e) {
// TODO this is legacy support for non-URL names. It should be removed eventually.
// if name was not a URL then construct one.
// Assume it should be a reference and htat it is relative. This support need not
// be robust as it is temporary..
File child = new File(name);
fileLocation = child.isAbsolute() ? child : new File(parent, name);
url = new URL(REFERENCE_PROTOCOL, null, fileLocation.toURL().toExternalForm());
reference = true;
}
// if the name was a URL then see if it is relative. If so, insert syspath.
if (!reference) {
URL baseURL = url;
// if it is a reference URL then strip off the reference: and set base to the file:...
if (url.getProtocol().equals(REFERENCE_PROTOCOL)) {
reference = true;
String baseSpec = url.getFile();
if (baseSpec.startsWith(FILE_SCHEME)) {
File child = new File(baseSpec.substring(5));
baseURL = child.isAbsolute() ? child.toURL() : new File(parent, child.getPath()).toURL();
} else
baseURL = new URL(baseSpec);
}
fileLocation = new File(baseURL.getFile());
// if the location is relative, prefix it with the parent
if (!fileLocation.isAbsolute())
fileLocation = new File(parent, fileLocation.toString());
}
// If the result is a reference then search for the real result and
// reconstruct the answer.
if (reference) {
String result = searchFor(fileLocation.getName(), new File(fileLocation.getParent()).getAbsolutePath());
if (result != null)
url = new URL(REFERENCE_PROTOCOL, null, FILE_SCHEME + result);
else
return null;
}
// finally we have something worth trying
try {
URLConnection result = url.openConnection();
result.connect();
return url;
} catch (IOException e) {
// int i = location.lastIndexOf('_');
// return i == -1? location : location.substring(0, i);
return null;
}
}
/*
* Ensure all basic bundles are installed, resolved and scheduled to start. Returns an array containing
* all basic bundles that are marked to start.
*/
private static Bundle[] loadBasicBundles() throws IOException {
long startTime = System.currentTimeMillis();
String osgiBundles = System.getProperty(PROP_BUNDLES);
String osgiExtensions = System.getProperty(PROP_EXTENSIONS);
if (osgiExtensions != null && osgiExtensions.length() > 0) {
osgiBundles = osgiExtensions + ',' + osgiBundles;
System.getProperties().put(PROP_BUNDLES, osgiBundles);
}
String[] installEntries = getArrayFromList(osgiBundles, ","); //$NON-NLS-1$
// get the initial bundle list from the installEntries
InitialBundle[] initialBundles = getInitialBundles(installEntries);
// get the list of currently installed initial bundles from the framework
Bundle[] curInitBundles = getCurrentInitialBundles();
// list of bundles to be refreshed
List toRefresh = new ArrayList(curInitBundles.length);
// uninstall any of the currently installed bundles that do not exist in the
// initial bundle list from installEntries.
uninstallBundles(curInitBundles, initialBundles, toRefresh);
// install the initialBundles that are not already installed.
ArrayList startBundles = new ArrayList(installEntries.length);
installBundles(initialBundles, curInitBundles, startBundles, toRefresh);
// If we installed/uninstalled something, force a refresh of all installed/uninstalled bundles
if (!toRefresh.isEmpty())
refreshPackages((Bundle[]) toRefresh.toArray(new Bundle[toRefresh.size()]));
// schedule all basic bundles to be started
Bundle[] startInitBundles = (Bundle[]) startBundles.toArray(new Bundle[startBundles.size()]);
startBundles(startInitBundles);
if (debug)
System.out.println("Time to load bundles: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$
return startInitBundles;
}
private static InitialBundle[] getInitialBundles(String[] installEntries) throws MalformedURLException {
ArrayList result = new ArrayList(installEntries.length);
int defaultStartLevel = Integer.parseInt(System.getProperty(PROP_BUNDLES_STARTLEVEL, DEFAULT_BUNDLES_STARTLEVEL));
String syspath = getSysPath();
for (int i = 0; i < installEntries.length; i++) {
String name = installEntries[i];
int level = defaultStartLevel;
boolean start = false;
int index = name.indexOf('@');
if (index >= 0) {
String[] attributes = getArrayFromList(name.substring(index + 1, name.length()), ":"); //$NON-NLS-1$
name = name.substring(0, index);
for (int j = 0; j < attributes.length; j++) {
String attribute = attributes[j];
if (attribute.equals("start")) //$NON-NLS-1$
start = true;
else
level = Integer.parseInt(attribute);
}
}
URL location = searchForBundle(name, syspath);
if (location == null) {
FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_BUNDLE_NOT_FOUND, installEntries[i]), 0, null, null);
log.log(entry);
// skip this entry
continue;
}
location = makeRelative(LocationManager.getInstallLocation().getURL(), location);
String locationString = INITIAL_LOCATION + location.toExternalForm();
result.add(new InitialBundle(locationString, location, level, start));
}
return (InitialBundle[]) result.toArray(new InitialBundle[result.size()]);
}
private static void refreshPackages(Bundle[] bundles) {
ServiceReference packageAdminRef = context.getServiceReference(PackageAdmin.class.getName());
PackageAdmin packageAdmin = null;
if (packageAdminRef != null) {
packageAdmin = (PackageAdmin) context.getService(packageAdminRef);
if (packageAdmin == null)
return;
}
// TODO this is such a hack it is silly. There are still cases for race conditions etc
// but this should allow for some progress...
final Semaphore semaphore = new Semaphore(0);
FrameworkListener listener = new FrameworkListener() {
public void frameworkEvent(FrameworkEvent event) {
if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED)
semaphore.release();
}
};
context.addFrameworkListener(listener);
packageAdmin.refreshPackages(bundles);
semaphore.acquire();
context.removeFrameworkListener(listener);
context.ungetService(packageAdminRef);
}
/**
* Invokes the OSGi Console on another thread
*
* @param osgi The current OSGi instance for the console to attach to
* @param consoleArgs An String array containing commands from the command line
* for the console to execute
* @param consolePort the port on which to run the console. Empty string implies the default port.
*/
private static void startConsole(OSGi osgi, String[] consoleArgs, String consolePort) {
try {
String consoleClassName = System.getProperty(PROP_CONSOLE_CLASS, DEFAULT_CONSOLE_CLASS);
Class consoleClass = Class.forName(consoleClassName);
Class[] parameterTypes;
Object[] parameters;
if (consolePort.length() == 0) {
parameterTypes = new Class[] {OSGi.class, String[].class};
parameters = new Object[] {osgi, consoleArgs};
} else {
parameterTypes = new Class[] {OSGi.class, int.class, String[].class};
parameters = new Object[] {osgi, new Integer(consolePort), consoleArgs};
}
Constructor constructor = consoleClass.getConstructor(parameterTypes);
Object console = constructor.newInstance(parameters);
Thread t = new Thread(((Runnable) console), CONSOLE_NAME);
t.start();
} catch (NumberFormatException nfe) {
// TODO log or something other than write on System.err
System.err.println(NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_INVALID_PORT, consolePort));
} catch (Exception ex) {
System.out.println(NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_FIND, CONSOLE_NAME));
}
}
/**
* Creates and returns the adaptor
*
* @return a FrameworkAdaptor object
*/
private static FrameworkAdaptor createAdaptor() throws Exception {
String adaptorClassName = System.getProperty(PROP_ADAPTOR, DEFAULT_ADAPTOR_CLASS);
Class adaptorClass = Class.forName(adaptorClassName);
Class[] constructorArgs = new Class[] {String[].class};
Constructor constructor = adaptorClass.getConstructor(constructorArgs);
return (FrameworkAdaptor) constructor.newInstance(new Object[] {new String[0]});
}
private static String[] processCommandLine(String[] args) throws Exception {
EnvironmentInfo.allArgs = args;
if (args.length == 0) {
EnvironmentInfo.frameworkArgs = args;
EnvironmentInfo.appArgs = args;
return args;
}
int[] configArgs = new int[args.length];
configArgs[0] = -1; // need to initialize the first element to something that could not be an index.
int configArgIndex = 0;
for (int i = 0; i < args.length; i++) {
boolean found = false;
// check for args without parameters (i.e., a flag arg)
// check if debug should be enabled for the entire platform
// If this is the last arg or there is a following arg (i.e., arg+1 has a leading -),
// simply enable debug. Otherwise, assume that that the following arg is
// actually the filename of an options file. This will be processed below.
if (args[i].equalsIgnoreCase(DEBUG) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) { //$NON-NLS-1$
System.getProperties().put(PROP_DEBUG, ""); //$NON-NLS-1$
debug = true;
found = true;
}
// check if development mode should be enabled for the entire platform
// If this is the last arg or there is a following arg (i.e., arg+1 has a leading -),
// simply enable development mode. Otherwise, assume that that the following arg is
// actually some additional development time class path entries. This will be processed below.
if (args[i].equalsIgnoreCase(DEV) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) { //$NON-NLS-1$
System.getProperties().put(PROP_DEV, ""); //$NON-NLS-1$
found = true;
}
// look for the initialization arg
if (args[i].equalsIgnoreCase(INITIALIZE)) {
initialize = true;
found = true;
}
// look for the clean flag.
if (args[i].equalsIgnoreCase(CLEAN)) {
System.getProperties().put(PROP_CLEAN, "true"); //$NON-NLS-1$
found = true;
}
// look for the consoleLog flag
if (args[i].equalsIgnoreCase(CONSOLE_LOG)) {
System.getProperties().put(PROP_CONSOLE_LOG, "true"); //$NON-NLS-1$
found = true;
}
// look for the console with no port.
if (args[i].equalsIgnoreCase(CONSOLE) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) { //$NON-NLS-1$
System.getProperties().put(PROP_CONSOLE, ""); //$NON-NLS-1$
found = true;
}
if (args[i].equalsIgnoreCase(NOEXIT)) {
System.getProperties().put(PROP_NOSHUTDOWN, "true"); //$NON-NLS-1$
found = true;
}
if (found) {
configArgs[configArgIndex++] = i;
continue;
}
// check for args with parameters. If we are at the last argument or if the next one
// has a '-' as the first character, then we can't have an arg with a parm so continue.
if (i == args.length - 1 || args[i + 1].startsWith("-")) { //$NON-NLS-1$
continue;
}
String arg = args[++i];
// look for the console and port.
if (args[i - 1].equalsIgnoreCase(CONSOLE)) {
System.getProperties().put(PROP_CONSOLE, arg);
found = true;
}
// look for the configuration location .
if (args[i - 1].equalsIgnoreCase(CONFIGURATION)) {
System.getProperties().put(LocationManager.PROP_CONFIG_AREA, arg);
found = true;
}
// look for the data location for this instance.
if (args[i - 1].equalsIgnoreCase(DATA)) {
System.getProperties().put(LocationManager.PROP_INSTANCE_AREA, arg);
found = true;
}
// look for the user location for this instance.
if (args[i - 1].equalsIgnoreCase(USER)) {
System.getProperties().put(LocationManager.PROP_USER_AREA, arg);
found = true;
}
// look for the development mode and class path entries.
if (args[i - 1].equalsIgnoreCase(DEV)) {
System.getProperties().put(PROP_DEV, arg);
found = true;
}
// look for the debug mode and option file location.
if (args[i - 1].equalsIgnoreCase(DEBUG)) {
System.getProperties().put(PROP_DEBUG, arg);
debug = true;
found = true;
}
// look for the window system.
if (args[i - 1].equalsIgnoreCase(WS)) {
System.getProperties().put(PROP_WS, arg);
found = true;
}
// look for the operating system
if (args[i - 1].equalsIgnoreCase(OS)) {
System.getProperties().put(PROP_OS, arg);
found = true;
}
// look for the system architecture
if (args[i - 1].equalsIgnoreCase(ARCH)) {
System.getProperties().put(PROP_ARCH, arg);
found = true;
}
// look for the nationality/language
if (args[i - 1].equalsIgnoreCase(NL)) {
System.getProperties().put(PROP_NL, arg);
found = true;
}
// done checking for args. Remember where an arg was found
if (found) {
configArgs[configArgIndex++] = i - 1;
configArgs[configArgIndex++] = i;
}
}
// remove all the arguments consumed by this argument parsing
if (configArgIndex == 0) {
EnvironmentInfo.frameworkArgs = new String[0];
EnvironmentInfo.appArgs = args;
return args;
}
EnvironmentInfo.appArgs = new String[args.length - configArgIndex];
EnvironmentInfo.frameworkArgs = new String[configArgIndex];
configArgIndex = 0;
int j = 0;
int k = 0;
for (int i = 0; i < args.length; i++) {
if (i == configArgs[configArgIndex]) {
EnvironmentInfo.frameworkArgs[k++] = args[i];
configArgIndex++;
} else
EnvironmentInfo.appArgs[j++] = args[i];
}
return EnvironmentInfo.appArgs;
}
/**
* Returns the result of converting a list of comma-separated tokens into an array
*
* @return the array of string tokens
* @param prop the initial comma-separated string
*/
private static String[] getArrayFromList(String prop, String separator) {
if (prop == null || prop.trim().equals("")) //$NON-NLS-1$
return new String[0];
Vector list = new Vector();
StringTokenizer tokens = new StringTokenizer(prop, separator); //$NON-NLS-1$
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken().trim();
if (!token.equals("")) //$NON-NLS-1$
list.addElement(token);
}
return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[list.size()]);
}
protected static String getSysPath() {
String result = System.getProperty(PROP_SYSPATH);
if (result != null)
return result;
result = getSysPathFromURL(System.getProperty(PROP_FRAMEWORK));
if (result == null)
result = getSysPathFromCodeSource();
if (result == null)
throw new IllegalStateException("Can not find the system path.");
if (Character.isUpperCase(result.charAt(0))) {
char[] chars = result.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
result = new String(chars);
}
System.getProperties().put(PROP_SYSPATH, result);
return result;
}
private static String getSysPathFromURL(String urlSpec) {
if (urlSpec == null)
return null;
URL url = null;
try {
url = new URL(urlSpec);
} catch (MalformedURLException e) {
return null;
}
File fwkFile = new File(url.getFile());
fwkFile = new File(fwkFile.getAbsolutePath());
fwkFile = new File(fwkFile.getParent());
return fwkFile.getAbsolutePath();
}
private static String getSysPathFromCodeSource() {
ProtectionDomain pd = EclipseStarter.class.getProtectionDomain();
if (pd == null)
return null;
CodeSource cs = pd.getCodeSource();
if (cs == null)
return null;
URL url = cs.getLocation();
if (url == null)
return null;
String result = url.getFile();
if (result.endsWith(".jar")) { //$NON-NLS-1$
result = result.substring(0, result.lastIndexOf('/'));
if ("folder".equals(System.getProperty(PROP_FRAMEWORK_SHAPE))) //$NON-NLS-1$
result = result.substring(0, result.lastIndexOf('/'));
} else {
if (result.endsWith("/")) //$NON-NLS-1$
result = result.substring(0, result.length() - 1);
result = result.substring(0, result.lastIndexOf('/'));
result = result.substring(0, result.lastIndexOf('/'));
}
return result;
}
private static Bundle[] getCurrentInitialBundles() {
Bundle[] installed = context.getBundles();
ArrayList initial = new ArrayList();
for (int i = 0; i < installed.length; i++) {
Bundle bundle = installed[i];
if (bundle.getLocation().startsWith(INITIAL_LOCATION))
initial.add(bundle);
}
return (Bundle[]) initial.toArray(new Bundle[initial.size()]);
}
private static Bundle getBundleByLocation(String location, Bundle[] bundles) {
for (int i = 0; i < bundles.length; i++) {
Bundle bundle = bundles[i];
if (location.equalsIgnoreCase(bundle.getLocation()))
return bundle;
}
return null;
}
private static void uninstallBundles(Bundle[] curInitBundles, InitialBundle[] newInitBundles, List toRefresh) {
for (int i = 0; i < curInitBundles.length; i++) {
boolean found = false;
for (int j = 0; j < newInitBundles.length; j++) {
if (curInitBundles[i].getLocation().equalsIgnoreCase(newInitBundles[j].locationString)) {
found = true;
break;
}
}
if (!found)
try {
curInitBundles[i].uninstall();
toRefresh.add(curInitBundles[i]);
} catch (BundleException e) {
FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_UNINSTALL, curInitBundles[i].getLocation()), 0, e, null);
log.log(entry);
}
}
}
private static void installBundles(InitialBundle[] initialBundles, Bundle[] curInitBundles, ArrayList startBundles, List toRefresh) {
ServiceReference reference = context.getServiceReference(StartLevel.class.getName());
StartLevel startService = null;
if (reference != null)
startService = (StartLevel) context.getService(reference);
for (int i = 0; i < initialBundles.length; i++) {
Bundle osgiBundle = getBundleByLocation(initialBundles[i].locationString, curInitBundles);
try {
// don't need to install if it is already installed
if (osgiBundle == null) {
InputStream in = initialBundles[i].location.openStream();
osgiBundle = context.installBundle(initialBundles[i].locationString, in);
if (initialBundles[i].level >= 0 && startService != null)
startService.setBundleStartLevel(osgiBundle, initialBundles[i].level);
}
if (initialBundles[i].start)
startBundles.add(osgiBundle);
// include basic bundles in case they were not resolved before
if ((osgiBundle.getState() & Bundle.INSTALLED) != 0)
toRefresh.add(osgiBundle);
} catch (BundleException e) {
FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null);
log.log(entry);
} catch (IOException e) {
FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null);
log.log(entry);
}
}
context.ungetService(reference);
}
private static void startBundles(Bundle[] bundles) {
for (int i = 0; i < bundles.length; i++) {
Bundle bundle = bundles[i];
if (bundle.getState() == Bundle.INSTALLED)
throw new IllegalStateException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED, bundle.getLocation()));
try {
bundle.start();
} catch (BundleException e) {
FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null);
log.log(entry);
}
}
}
private static void initializeApplicationTracker() {
Filter filter = null;
try {
String appClass = ParameterizedRunnable.class.getName();
filter = context.createFilter("(&(objectClass=" + appClass + ")(eclipse.application=*))"); //$NON-NLS-1$ //$NON-NLS-2$
} catch (InvalidSyntaxException e) {
// ignore this. It should never happen as we have tested the above format.
}
applicationTracker = new ServiceTracker(context, filter, null);
applicationTracker.open();
}
private static void loadConfigurationInfo() {
Location configArea = LocationManager.getConfigurationLocation();
if (configArea == null)
return;
URL location = null;
try {
location = new URL(configArea.getURL().toExternalForm() + LocationManager.CONFIG_FILE);
} catch (MalformedURLException e) {
// its ok. Thie should never happen
}
mergeProperties(System.getProperties(), loadProperties(location));
}
private static Properties loadProperties(URL location) {
Properties result = new Properties();
if (location == null)
return result;
try {
InputStream in = location.openStream();
try {
result.load(in);
} finally {
in.close();
}
} catch (IOException e) {
// its ok if there is no file. We'll just use the defaults for everything
// TODO but it might be nice to log something with gentle wording (i.e., it is not an error)
}
return result;
}
/**
* Returns a URL which is equivalent to the given URL relative to the
* specified base URL. Works only for file: URLs
* @throws MalformedURLException
*/
private static URL makeRelative(URL base, URL location) throws MalformedURLException {
if (base == null)
return location;
boolean reference = location.getProtocol().equals(REFERENCE_PROTOCOL);
URL nonReferenceLocation = location;
if (reference)
nonReferenceLocation = new URL(location.getPath());
if (!"file".equals(base.getProtocol())) //$NON-NLS-1$
return location;
// if some URL component does not match, return the original location
if (!base.getProtocol().equals(nonReferenceLocation.getProtocol()))
return location;
if (base.getHost() == null ^ nonReferenceLocation.getHost() == null)
return location;
if (base.getHost() != null && !base.getHost().equals(nonReferenceLocation.getHost()))
return location;
if (base.getPort() != nonReferenceLocation.getPort())
return location;
File locationPath = new File(nonReferenceLocation.getPath());
// if location is not absolute, return original location
if (!locationPath.isAbsolute())
return location;
File relativePath = makeRelative(new File(base.getPath()), locationPath);
String urlPath = relativePath.getPath();
if (File.separatorChar != '/')
urlPath = urlPath.replace(File.separatorChar, '/');
if (nonReferenceLocation.getPath().endsWith("/")) //$NON-NLS-1$
// restore original trailing slash
urlPath += '/';
URL relativeURL = new URL(base.getProtocol(), base.getHost(), base.getPort(), urlPath);
if (reference)
relativeURL = new URL(REFERENCE_SCHEME + relativeURL.toExternalForm());
return relativeURL;
}
private static File makeRelative(File base, File location) {
if (!location.isAbsolute())
return location;
File relative = new File(new FilePath(base).makeRelative(new FilePath(location)));
return relative;
}
private static void mergeProperties(Properties destination, Properties source) {
for (Enumeration e = source.keys(); e.hasMoreElements();) {
String key = (String) e.nextElement();
String value = source.getProperty(key);
if (destination.getProperty(key) == null)
destination.put(key, value);
}
}
private static void stopSystemBundle() throws BundleException {
if (context == null || !running)
return;
Bundle systemBundle = context.getBundle(0);
if (systemBundle.getState() == Bundle.ACTIVE) {
final Semaphore semaphore = new Semaphore(0);
FrameworkListener listener = new FrameworkListener() {
public void frameworkEvent(FrameworkEvent event) {
if (event.getType() == FrameworkEvent.STARTLEVEL_CHANGED)
semaphore.release();
}
};
context.addFrameworkListener(listener);
systemBundle.stop();
semaphore.acquire();
context.removeFrameworkListener(listener);
}
context = null;
applicationTracker = null;
running = false;
}
private static void setStartLevel(final int value) {
ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
tracker.open();
final StartLevel startLevel = (StartLevel) tracker.getService();
final Semaphore semaphore = new Semaphore(0);
FrameworkListener listener = new FrameworkListener() {
public void frameworkEvent(FrameworkEvent event) {
if (event.getType() == FrameworkEvent.STARTLEVEL_CHANGED && startLevel.getStartLevel() == value)
semaphore.release();
}
};
context.addFrameworkListener(listener);
startLevel.setStartLevel(value);
semaphore.acquire();
context.removeFrameworkListener(listener);
tracker.close();
}
/**
* Searches for the given target directory immediately under
* the given start location. If one is found then this location is returned;
* otherwise an exception is thrown.
*
* @return the location where target directory was found
* @param start the location to begin searching
*/
private static String searchFor(final String target, String start) {
String[] candidates = new File(start).list();
if (candidates == null)
return null;
String result = null;
Object maxVersion = null;
for (int i = 0; i < candidates.length; i++) {
File candidate = new File(start, candidates[i]);
if (!candidate.getName().equals(target) && !candidate.getName().startsWith(target + "_")) //$NON-NLS-1$
continue;
String name = candidate.getName();
String version = ""; //$NON-NLS-1$ // Note: directory with version suffix is always > than directory without version suffix
int index = name.indexOf('_');
if (index != -1)
version = name.substring(index + 1);
Object currentVersion = getVersionElements(version);
if (maxVersion == null) {
result = candidate.getAbsolutePath();
maxVersion = currentVersion;
} else {
if (compareVersion((Object[]) maxVersion, (Object[]) currentVersion) < 0) {
result = candidate.getAbsolutePath();
maxVersion = currentVersion;
}
}
}
if (result == null)
return null;
return result.replace(File.separatorChar, '/') + "/"; //$NON-NLS-1$
}
/**
* Do a quick parse of version identifier so its elements can be correctly compared.
* If we are unable to parse the full version, remaining elements are initialized
* with suitable defaults.
* @return an array of size 4; first three elements are of type Integer (representing
* major, minor and service) and the fourth element is of type String (representing
* qualifier). Note, that returning anything else will cause exceptions in the caller.
*/
private static Object[] getVersionElements(String version) {
Object[] result = {new Integer(0), new Integer(0), new Integer(0), ""}; //$NON-NLS-1$
StringTokenizer t = new StringTokenizer(version, "."); //$NON-NLS-1$
String token;
int i = 0;
while (t.hasMoreTokens() && i < 4) {
token = t.nextToken();
if (i < 3) {
// major, minor or service ... numeric values
try {
result[i++] = new Integer(token);
} catch (Exception e) {
// invalid number format - use default numbers (0) for the rest
break;
}
} else {
// qualifier ... string value
result[i++] = token;
}
}
return result;
}
/**
* Compares version strings.
* @return result of comparison, as integer;
* <code><0</code> if left < right;
* <code>0</code> if left == right;
* <code>>0</code> if left > right;
*/
private static int compareVersion(Object[] left, Object[] right) {
int result = ((Integer) left[0]).compareTo((Integer) right[0]); // compare major
if (result != 0)
return result;
result = ((Integer) left[1]).compareTo((Integer) right[1]); // compare minor
if (result != 0)
return result;
result = ((Integer) left[2]).compareTo((Integer) right[2]); // compare service
if (result != 0)
return result;
return ((String) left[3]).compareTo((String) right[3]); // compare qualifier
}
private static String buildCommandLine(String arg, String value) {
StringBuffer result = new StringBuffer(300);
String entry = System.getProperty(PROP_VM);
if (entry == null)
return null;
result.append(entry);
result.append('\n');
// append the vmargs and commands. Assume that these already end in \n
entry = System.getProperty(PROP_VMARGS);
if (entry != null)
result.append(entry);
entry = System.getProperty(PROP_COMMANDS);
if (entry != null)
result.append(entry);
String commandLine = result.toString();
int i = commandLine.indexOf(arg + "\n"); //$NON-NLS-1$
if (i == 0)
commandLine += arg + "\n" + value + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
else {
i += arg.length() + 1;
String left = commandLine.substring(0, i);
int j = commandLine.indexOf('\n', i);
String right = commandLine.substring(j);
commandLine = left + value + right;
}
return commandLine;
}
private static void finalizeProperties() {
// if check config is unknown and we are in dev mode,
if (System.getProperty(PROP_DEV) != null && System.getProperty(PROP_CHECK_CONFIG) == null)
System.getProperties().put(PROP_CHECK_CONFIG, "true"); //$NON-NLS-1$
}
private static class InitialBundle {
public final String locationString;
public final URL location;
public final int level;
public final boolean start;
InitialBundle(String locationString, URL location, int level, boolean start) {
this.locationString = locationString;
this.location = location;
this.level = level;
this.start = start;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
4ef659facb585d29c541bfb665e047a1bd001c63 | 63427167695fbb15bb5ab86850f97f8bdd18e350 | /src/main/java/com/yang/areaservice/model/ChsaProperty.java | e889df0db2611707d3738dfb3920d5785244b3c2 | [
"Apache-2.0"
] | permissive | Susan0808/areaservice | c83cafe0356501873865f5f1d3e4eb79fe95e526 | 38526504d8ff339019193c6d8be4b39387a99705 | refs/heads/main | 2023-03-16T20:49:26.870605 | 2021-03-22T18:03:18 | 2021-03-22T18:03:18 | 350,259,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package com.yang.areaservice.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({"HLTH_CHSA_SYSID","CMNTY_HLTH_SERV_AREA_CODE", "CMNTY_HLTH_SERV_AREA_NAME", "OBJECTID"})
public class ChsaProperty {
private int HLTH_CHSA_SYSID;
private String CMNTY_HLTH_SERV_AREA_CODE;
private String CMNTY_HLTH_SERV_AREA_NAME;
private int OBJECTID;
}
| [
"susan20210121@outlook.com"
] | susan20210121@outlook.com |
5ed8e3f19d1bc383044b2758587feeaf59a5083b | eae64ca1229b9eecc8a2221e564b3fe431be434a | /BusinessProcessModelingTool/src/bp/model/data/ExecutionType.java | 66ee223f4fa6abb8a1459745b1b5cee6c8c16ed0 | [
"MIT"
] | permissive | ZoranTrkulja/KROKI-mockup-tool | aa47ccb4a5ce7078a987740df9091e76846c8bf6 | f5a2e05091f0e4ae33050ce3ff60980600379030 | refs/heads/master | 2021-01-15T13:23:18.365797 | 2014-12-13T10:32:04 | 2014-12-13T10:32:04 | 29,124,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | package bp.model.data;
public enum ExecutionType {
PARALLEL("parallel"), SEQUENTIAL("sequential");
private String name;
private ExecutionType(String name) {
this.name = name;
}
private ExecutionType() { }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static ExecutionType getEnumValue(String value) {
if (value == null)
return null;
String s = value.toLowerCase();
for (ExecutionType et : ExecutionType.values()) {
if (s.equals(et.getName()))
return et;
}
return null;
}
}
| [
"sp3cijalac@gmail.com"
] | sp3cijalac@gmail.com |
fe08459aa910f436f1367ae968c90b359f71a9e7 | 9d42a9c585e0f0e9add0b63012491632acd59f57 | /lgw-common/src/main/java/com/liangguowen/common/utils/FtpUtil.java | a24dec52d1f1e15eb81b2aa2ae606af713e3e436 | [] | no_license | lgw999/sso | 3fd2f4853b8e8fbd10fd4858e06a2ebf2bd13748 | 9aab871305322f62a2e5f29cc18dd56d166ad4f3 | refs/heads/master | 2020-03-29T05:04:39.281938 | 2018-09-20T06:59:27 | 2018-09-20T06:59:27 | 148,969,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,704 | java | package com.liangguowen.common.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
/**
* ftp上传下载工具类
* <p>Title: FtpUtil</p>
* <p>Description: </p>
* <p>Company: www.liangguowen.com</p>
* @author lgw
* @date 2015年7月29日下午8:11:51
* @version 1.0
*/
public class FtpUtil {
/**
* Description: 向FTP服务器上传文件
* @param host FTP服务器hostname
* @param port FTP服务器端口
* @param username FTP登录账号
* @param password FTP登录密码
* @param basePath FTP服务器基础目录
* @param filePath FTP服务器文件存放路径。例如分日期存放:/2015/01/01。文件的路径为basePath+filePath
* @param filename 上传到FTP服务器上的文件名
* @param input 输入流
* @return 成功返回true,否则返回false
*/
public static boolean uploadFile(String host, int port, String username, String password, String basePath,
String filePath, String filename, InputStream input) {
boolean result = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(host, port);// 连接FTP服务器
// 如果采用默认端口,可以使用ftp.connect(host)的方式直接连接FTP服务器
ftp.login(username, password);// 登录
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return result;
}
//切换到上传目录
if (!ftp.changeWorkingDirectory(basePath+filePath)) {
//如果目录不存在创建目录
String[] dirs = filePath.split("/");
String tempPath = basePath;
for (String dir : dirs) {
if (null == dir || "".equals(dir)) continue;
tempPath += "/" + dir;
if (!ftp.changeWorkingDirectory(tempPath)) {
if (!ftp.makeDirectory(tempPath)) {
return result;
} else {
ftp.changeWorkingDirectory(tempPath);
}
}
}
}
//设置上传文件的类型为二进制类型
ftp.setFileType(FTP.BINARY_FILE_TYPE);
//上传文件
if (!ftp.storeFile(filename, input)) {
return result;
}
input.close();
ftp.logout();
result = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return result;
}
/**
* Description: 从FTP服务器下载文件
* @param host FTP服务器hostname
* @param port FTP服务器端口
* @param username FTP登录账号
* @param password FTP登录密码
* @param remotePath FTP服务器上的相对路径
* @param fileName 要下载的文件名
* @param localPath 下载后保存到本地的路径
* @return
*/
public static boolean downloadFile(String host, int port, String username, String password, String remotePath,
String fileName, String localPath) {
boolean result = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(host, port);
// 如果采用默认端口,可以使用ftp.connect(host)的方式直接连接FTP服务器
ftp.login(username, password);// 登录
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return result;
}
ftp.changeWorkingDirectory(remotePath);// 转移到FTP服务器目录
FTPFile[] fs = ftp.listFiles();
for (FTPFile ff : fs) {
if (ff.getName().equals(fileName)) {
File localFile = new File(localPath + "/" + ff.getName());
OutputStream is = new FileOutputStream(localFile);
ftp.retrieveFile(ff.getName(), is);
is.close();
}
}
ftp.logout();
result = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return result;
}
public static void main(String[] args) {
try {
FileInputStream in=new FileInputStream(new File("E:\\eclipse\\abc.jpg"));
boolean flag = uploadFile("119.23.203.100", 21, "ftpuser", "ftpuser", "/home/ftpuser/www/image","/2015/01/21", "abc.jpg", in);
System.out.println(flag);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"Administrator@DESKTOP-1QDUJ7T"
] | Administrator@DESKTOP-1QDUJ7T |
e6398b892b5e30054d7c77d84ffe71f854fee03b | 8bfed4c8e7415013779fc89477d3fae4273de9c3 | /protobuf/src/java/com/futu/opend/api/protobuf/GetGlobalState.java | 88e75ae81c9ed4d0f26e211a3fcc4b29c8a2d157 | [
"Apache-2.0"
] | permissive | trustex/java-for-FutuOpenD | 9cb9a72ad35544e10206a83e005a43c28ba28a05 | 842369ce6b1351b3ff049d446dffd0089d51eb1a | refs/heads/master | 2020-07-15T22:24:04.923325 | 2019-04-04T13:50:38 | 2019-04-04T13:50:38 | 205,661,465 | 0 | 1 | Apache-2.0 | 2019-09-01T10:32:47 | 2019-09-01T10:32:46 | null | UTF-8 | Java | false | true | 112,252 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: GetGlobalState.proto
package com.futu.opend.api.protobuf;
public final class GetGlobalState {
private GetGlobalState() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface C2SOrBuilder extends
// @@protoc_insertion_point(interface_extends:GetGlobalState.C2S)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
boolean hasUserID();
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
long getUserID();
}
/**
* Protobuf type {@code GetGlobalState.C2S}
*/
public static final class C2S extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:GetGlobalState.C2S)
C2SOrBuilder {
// Use C2S.newBuilder() to construct.
private C2S(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private C2S(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final C2S defaultInstance;
public static C2S getDefaultInstance() {
return defaultInstance;
}
public C2S getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private C2S(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
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;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
userID_ = input.readUInt64();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_C2S_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_C2S_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.C2S.class, com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder.class);
}
public static com.google.protobuf.Parser<C2S> PARSER =
new com.google.protobuf.AbstractParser<C2S>() {
public C2S parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new C2S(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<C2S> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int USERID_FIELD_NUMBER = 1;
private long userID_;
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
public boolean hasUserID() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
public long getUserID() {
return userID_;
}
private void initFields() {
userID_ = 0L;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasUserID()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt64(1, userID_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, userID_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.C2S parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.futu.opend.api.protobuf.GetGlobalState.C2S prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code GetGlobalState.C2S}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:GetGlobalState.C2S)
com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_C2S_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_C2S_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.C2S.class, com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder.class);
}
// Construct using com.futu.opend.api.protobuf.GetGlobalState.C2S.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
userID_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_C2S_descriptor;
}
public com.futu.opend.api.protobuf.GetGlobalState.C2S getDefaultInstanceForType() {
return com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance();
}
public com.futu.opend.api.protobuf.GetGlobalState.C2S build() {
com.futu.opend.api.protobuf.GetGlobalState.C2S result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.futu.opend.api.protobuf.GetGlobalState.C2S buildPartial() {
com.futu.opend.api.protobuf.GetGlobalState.C2S result = new com.futu.opend.api.protobuf.GetGlobalState.C2S(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.userID_ = userID_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.futu.opend.api.protobuf.GetGlobalState.C2S) {
return mergeFrom((com.futu.opend.api.protobuf.GetGlobalState.C2S)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.futu.opend.api.protobuf.GetGlobalState.C2S other) {
if (other == com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance()) return this;
if (other.hasUserID()) {
setUserID(other.getUserID());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasUserID()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.futu.opend.api.protobuf.GetGlobalState.C2S parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.futu.opend.api.protobuf.GetGlobalState.C2S) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private long userID_ ;
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
public boolean hasUserID() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
public long getUserID() {
return userID_;
}
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
public Builder setUserID(long value) {
bitField0_ |= 0x00000001;
userID_ = value;
onChanged();
return this;
}
/**
* <code>required uint64 userID = 1;</code>
*
* <pre>
*需要跟FutuOpenD登陆的牛牛用户ID一致,否则会返回失败
* </pre>
*/
public Builder clearUserID() {
bitField0_ = (bitField0_ & ~0x00000001);
userID_ = 0L;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:GetGlobalState.C2S)
}
static {
defaultInstance = new C2S(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:GetGlobalState.C2S)
}
public interface S2COrBuilder extends
// @@protoc_insertion_point(interface_extends:GetGlobalState.S2C)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
boolean hasMarketHK();
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
int getMarketHK();
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
boolean hasMarketUS();
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
int getMarketUS();
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
boolean hasMarketSH();
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
int getMarketSH();
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
boolean hasMarketSZ();
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
int getMarketSZ();
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
boolean hasMarketHKFuture();
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
int getMarketHKFuture();
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
boolean hasQotLogined();
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
boolean getQotLogined();
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
boolean hasTrdLogined();
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
boolean getTrdLogined();
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
boolean hasServerVer();
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
int getServerVer();
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
boolean hasServerBuildNo();
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
int getServerBuildNo();
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
boolean hasTime();
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
long getTime();
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
boolean hasLocalTime();
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
double getLocalTime();
}
/**
* Protobuf type {@code GetGlobalState.S2C}
*/
public static final class S2C extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:GetGlobalState.S2C)
S2COrBuilder {
// Use S2C.newBuilder() to construct.
private S2C(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private S2C(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final S2C defaultInstance;
public static S2C getDefaultInstance() {
return defaultInstance;
}
public S2C getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private S2C(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
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;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
marketHK_ = input.readInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
marketUS_ = input.readInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
marketSH_ = input.readInt32();
break;
}
case 32: {
bitField0_ |= 0x00000008;
marketSZ_ = input.readInt32();
break;
}
case 40: {
bitField0_ |= 0x00000010;
marketHKFuture_ = input.readInt32();
break;
}
case 48: {
bitField0_ |= 0x00000020;
qotLogined_ = input.readBool();
break;
}
case 56: {
bitField0_ |= 0x00000040;
trdLogined_ = input.readBool();
break;
}
case 64: {
bitField0_ |= 0x00000080;
serverVer_ = input.readInt32();
break;
}
case 72: {
bitField0_ |= 0x00000100;
serverBuildNo_ = input.readInt32();
break;
}
case 80: {
bitField0_ |= 0x00000200;
time_ = input.readInt64();
break;
}
case 89: {
bitField0_ |= 0x00000400;
localTime_ = input.readDouble();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_S2C_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_S2C_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.S2C.class, com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder.class);
}
public static com.google.protobuf.Parser<S2C> PARSER =
new com.google.protobuf.AbstractParser<S2C>() {
public S2C parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new S2C(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<S2C> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int MARKETHK_FIELD_NUMBER = 1;
private int marketHK_;
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
public boolean hasMarketHK() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
public int getMarketHK() {
return marketHK_;
}
public static final int MARKETUS_FIELD_NUMBER = 2;
private int marketUS_;
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
public boolean hasMarketUS() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
public int getMarketUS() {
return marketUS_;
}
public static final int MARKETSH_FIELD_NUMBER = 3;
private int marketSH_;
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
public boolean hasMarketSH() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
public int getMarketSH() {
return marketSH_;
}
public static final int MARKETSZ_FIELD_NUMBER = 4;
private int marketSZ_;
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
public boolean hasMarketSZ() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
public int getMarketSZ() {
return marketSZ_;
}
public static final int MARKETHKFUTURE_FIELD_NUMBER = 5;
private int marketHKFuture_;
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
public boolean hasMarketHKFuture() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
public int getMarketHKFuture() {
return marketHKFuture_;
}
public static final int QOTLOGINED_FIELD_NUMBER = 6;
private boolean qotLogined_;
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
public boolean hasQotLogined() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
public boolean getQotLogined() {
return qotLogined_;
}
public static final int TRDLOGINED_FIELD_NUMBER = 7;
private boolean trdLogined_;
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
public boolean hasTrdLogined() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
public boolean getTrdLogined() {
return trdLogined_;
}
public static final int SERVERVER_FIELD_NUMBER = 8;
private int serverVer_;
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
public boolean hasServerVer() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
public int getServerVer() {
return serverVer_;
}
public static final int SERVERBUILDNO_FIELD_NUMBER = 9;
private int serverBuildNo_;
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
public boolean hasServerBuildNo() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
public int getServerBuildNo() {
return serverBuildNo_;
}
public static final int TIME_FIELD_NUMBER = 10;
private long time_;
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
public boolean hasTime() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
public long getTime() {
return time_;
}
public static final int LOCALTIME_FIELD_NUMBER = 11;
private double localTime_;
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
public boolean hasLocalTime() {
return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
public double getLocalTime() {
return localTime_;
}
private void initFields() {
marketHK_ = 0;
marketUS_ = 0;
marketSH_ = 0;
marketSZ_ = 0;
marketHKFuture_ = 0;
qotLogined_ = false;
trdLogined_ = false;
serverVer_ = 0;
serverBuildNo_ = 0;
time_ = 0L;
localTime_ = 0D;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasMarketHK()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMarketUS()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMarketSH()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMarketSZ()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMarketHKFuture()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasQotLogined()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTrdLogined()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasServerVer()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasServerBuildNo()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTime()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt32(1, marketHK_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, marketUS_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt32(3, marketSH_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt32(4, marketSZ_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeInt32(5, marketHKFuture_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBool(6, qotLogined_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBool(7, trdLogined_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeInt32(8, serverVer_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
output.writeInt32(9, serverBuildNo_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeInt64(10, time_);
}
if (((bitField0_ & 0x00000400) == 0x00000400)) {
output.writeDouble(11, localTime_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, marketHK_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, marketUS_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, marketSH_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, marketSZ_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, marketHKFuture_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(6, qotLogined_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(7, trdLogined_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(8, serverVer_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(9, serverBuildNo_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(10, time_);
}
if (((bitField0_ & 0x00000400) == 0x00000400)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(11, localTime_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.S2C parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.futu.opend.api.protobuf.GetGlobalState.S2C prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code GetGlobalState.S2C}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:GetGlobalState.S2C)
com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_S2C_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_S2C_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.S2C.class, com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder.class);
}
// Construct using com.futu.opend.api.protobuf.GetGlobalState.S2C.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
marketHK_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
marketUS_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
marketSH_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
marketSZ_ = 0;
bitField0_ = (bitField0_ & ~0x00000008);
marketHKFuture_ = 0;
bitField0_ = (bitField0_ & ~0x00000010);
qotLogined_ = false;
bitField0_ = (bitField0_ & ~0x00000020);
trdLogined_ = false;
bitField0_ = (bitField0_ & ~0x00000040);
serverVer_ = 0;
bitField0_ = (bitField0_ & ~0x00000080);
serverBuildNo_ = 0;
bitField0_ = (bitField0_ & ~0x00000100);
time_ = 0L;
bitField0_ = (bitField0_ & ~0x00000200);
localTime_ = 0D;
bitField0_ = (bitField0_ & ~0x00000400);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_S2C_descriptor;
}
public com.futu.opend.api.protobuf.GetGlobalState.S2C getDefaultInstanceForType() {
return com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance();
}
public com.futu.opend.api.protobuf.GetGlobalState.S2C build() {
com.futu.opend.api.protobuf.GetGlobalState.S2C result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.futu.opend.api.protobuf.GetGlobalState.S2C buildPartial() {
com.futu.opend.api.protobuf.GetGlobalState.S2C result = new com.futu.opend.api.protobuf.GetGlobalState.S2C(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.marketHK_ = marketHK_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.marketUS_ = marketUS_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.marketSH_ = marketSH_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.marketSZ_ = marketSZ_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.marketHKFuture_ = marketHKFuture_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.qotLogined_ = qotLogined_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.trdLogined_ = trdLogined_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
result.serverVer_ = serverVer_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000100;
}
result.serverBuildNo_ = serverBuildNo_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000200;
}
result.time_ = time_;
if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
to_bitField0_ |= 0x00000400;
}
result.localTime_ = localTime_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.futu.opend.api.protobuf.GetGlobalState.S2C) {
return mergeFrom((com.futu.opend.api.protobuf.GetGlobalState.S2C)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.futu.opend.api.protobuf.GetGlobalState.S2C other) {
if (other == com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance()) return this;
if (other.hasMarketHK()) {
setMarketHK(other.getMarketHK());
}
if (other.hasMarketUS()) {
setMarketUS(other.getMarketUS());
}
if (other.hasMarketSH()) {
setMarketSH(other.getMarketSH());
}
if (other.hasMarketSZ()) {
setMarketSZ(other.getMarketSZ());
}
if (other.hasMarketHKFuture()) {
setMarketHKFuture(other.getMarketHKFuture());
}
if (other.hasQotLogined()) {
setQotLogined(other.getQotLogined());
}
if (other.hasTrdLogined()) {
setTrdLogined(other.getTrdLogined());
}
if (other.hasServerVer()) {
setServerVer(other.getServerVer());
}
if (other.hasServerBuildNo()) {
setServerBuildNo(other.getServerBuildNo());
}
if (other.hasTime()) {
setTime(other.getTime());
}
if (other.hasLocalTime()) {
setLocalTime(other.getLocalTime());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasMarketHK()) {
return false;
}
if (!hasMarketUS()) {
return false;
}
if (!hasMarketSH()) {
return false;
}
if (!hasMarketSZ()) {
return false;
}
if (!hasMarketHKFuture()) {
return false;
}
if (!hasQotLogined()) {
return false;
}
if (!hasTrdLogined()) {
return false;
}
if (!hasServerVer()) {
return false;
}
if (!hasServerBuildNo()) {
return false;
}
if (!hasTime()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.futu.opend.api.protobuf.GetGlobalState.S2C parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.futu.opend.api.protobuf.GetGlobalState.S2C) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int marketHK_ ;
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
public boolean hasMarketHK() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
public int getMarketHK() {
return marketHK_;
}
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
public Builder setMarketHK(int value) {
bitField0_ |= 0x00000001;
marketHK_ = value;
onChanged();
return this;
}
/**
* <code>required int32 marketHK = 1;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股主板市场状态
* </pre>
*/
public Builder clearMarketHK() {
bitField0_ = (bitField0_ & ~0x00000001);
marketHK_ = 0;
onChanged();
return this;
}
private int marketUS_ ;
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
public boolean hasMarketUS() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
public int getMarketUS() {
return marketUS_;
}
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
public Builder setMarketUS(int value) {
bitField0_ |= 0x00000002;
marketUS_ = value;
onChanged();
return this;
}
/**
* <code>required int32 marketUS = 2;</code>
*
* <pre>
*Qot_Common.QotMarketState,美股Nasdaq市场状态
* </pre>
*/
public Builder clearMarketUS() {
bitField0_ = (bitField0_ & ~0x00000002);
marketUS_ = 0;
onChanged();
return this;
}
private int marketSH_ ;
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
public boolean hasMarketSH() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
public int getMarketSH() {
return marketSH_;
}
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
public Builder setMarketSH(int value) {
bitField0_ |= 0x00000004;
marketSH_ = value;
onChanged();
return this;
}
/**
* <code>required int32 marketSH = 3;</code>
*
* <pre>
*Qot_Common.QotMarketState,沪市状态
* </pre>
*/
public Builder clearMarketSH() {
bitField0_ = (bitField0_ & ~0x00000004);
marketSH_ = 0;
onChanged();
return this;
}
private int marketSZ_ ;
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
public boolean hasMarketSZ() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
public int getMarketSZ() {
return marketSZ_;
}
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
public Builder setMarketSZ(int value) {
bitField0_ |= 0x00000008;
marketSZ_ = value;
onChanged();
return this;
}
/**
* <code>required int32 marketSZ = 4;</code>
*
* <pre>
*Qot_Common.QotMarketState,深市状态
* </pre>
*/
public Builder clearMarketSZ() {
bitField0_ = (bitField0_ & ~0x00000008);
marketSZ_ = 0;
onChanged();
return this;
}
private int marketHKFuture_ ;
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
public boolean hasMarketHKFuture() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
public int getMarketHKFuture() {
return marketHKFuture_;
}
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
public Builder setMarketHKFuture(int value) {
bitField0_ |= 0x00000010;
marketHKFuture_ = value;
onChanged();
return this;
}
/**
* <code>required int32 marketHKFuture = 5;</code>
*
* <pre>
*Qot_Common.QotMarketState,港股期货市场状态
* </pre>
*/
public Builder clearMarketHKFuture() {
bitField0_ = (bitField0_ & ~0x00000010);
marketHKFuture_ = 0;
onChanged();
return this;
}
private boolean qotLogined_ ;
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
public boolean hasQotLogined() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
public boolean getQotLogined() {
return qotLogined_;
}
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
public Builder setQotLogined(boolean value) {
bitField0_ |= 0x00000020;
qotLogined_ = value;
onChanged();
return this;
}
/**
* <code>required bool qotLogined = 6;</code>
*
* <pre>
*是否登陆行情服务器
* </pre>
*/
public Builder clearQotLogined() {
bitField0_ = (bitField0_ & ~0x00000020);
qotLogined_ = false;
onChanged();
return this;
}
private boolean trdLogined_ ;
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
public boolean hasTrdLogined() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
public boolean getTrdLogined() {
return trdLogined_;
}
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
public Builder setTrdLogined(boolean value) {
bitField0_ |= 0x00000040;
trdLogined_ = value;
onChanged();
return this;
}
/**
* <code>required bool trdLogined = 7;</code>
*
* <pre>
*是否登陆交易服务器
* </pre>
*/
public Builder clearTrdLogined() {
bitField0_ = (bitField0_ & ~0x00000040);
trdLogined_ = false;
onChanged();
return this;
}
private int serverVer_ ;
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
public boolean hasServerVer() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
public int getServerVer() {
return serverVer_;
}
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
public Builder setServerVer(int value) {
bitField0_ |= 0x00000080;
serverVer_ = value;
onChanged();
return this;
}
/**
* <code>required int32 serverVer = 8;</code>
*
* <pre>
*版本号
* </pre>
*/
public Builder clearServerVer() {
bitField0_ = (bitField0_ & ~0x00000080);
serverVer_ = 0;
onChanged();
return this;
}
private int serverBuildNo_ ;
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
public boolean hasServerBuildNo() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
public int getServerBuildNo() {
return serverBuildNo_;
}
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
public Builder setServerBuildNo(int value) {
bitField0_ |= 0x00000100;
serverBuildNo_ = value;
onChanged();
return this;
}
/**
* <code>required int32 serverBuildNo = 9;</code>
*
* <pre>
*buildNo
* </pre>
*/
public Builder clearServerBuildNo() {
bitField0_ = (bitField0_ & ~0x00000100);
serverBuildNo_ = 0;
onChanged();
return this;
}
private long time_ ;
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
public boolean hasTime() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
public long getTime() {
return time_;
}
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
public Builder setTime(long value) {
bitField0_ |= 0x00000200;
time_ = value;
onChanged();
return this;
}
/**
* <code>required int64 time = 10;</code>
*
* <pre>
*当前服务器时间
* </pre>
*/
public Builder clearTime() {
bitField0_ = (bitField0_ & ~0x00000200);
time_ = 0L;
onChanged();
return this;
}
private double localTime_ ;
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
public boolean hasLocalTime() {
return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
public double getLocalTime() {
return localTime_;
}
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
public Builder setLocalTime(double value) {
bitField0_ |= 0x00000400;
localTime_ = value;
onChanged();
return this;
}
/**
* <code>optional double localTime = 11;</code>
*
* <pre>
*当前本地时间
* </pre>
*/
public Builder clearLocalTime() {
bitField0_ = (bitField0_ & ~0x00000400);
localTime_ = 0D;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:GetGlobalState.S2C)
}
static {
defaultInstance = new S2C(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:GetGlobalState.S2C)
}
public interface RequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:GetGlobalState.Request)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
boolean hasC2S();
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
com.futu.opend.api.protobuf.GetGlobalState.C2S getC2S();
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder getC2SOrBuilder();
}
/**
* Protobuf type {@code GetGlobalState.Request}
*/
public static final class Request extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:GetGlobalState.Request)
RequestOrBuilder {
// Use Request.newBuilder() to construct.
private Request(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Request(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Request defaultInstance;
public static Request getDefaultInstance() {
return defaultInstance;
}
public Request getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Request(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
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;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder subBuilder = null;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
subBuilder = c2S_.toBuilder();
}
c2S_ = input.readMessage(com.futu.opend.api.protobuf.GetGlobalState.C2S.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(c2S_);
c2S_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000001;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Request_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Request_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.Request.class, com.futu.opend.api.protobuf.GetGlobalState.Request.Builder.class);
}
public static com.google.protobuf.Parser<Request> PARSER =
new com.google.protobuf.AbstractParser<Request>() {
public Request parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Request(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Request> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int C2S_FIELD_NUMBER = 1;
private com.futu.opend.api.protobuf.GetGlobalState.C2S c2S_;
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public boolean hasC2S() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.C2S getC2S() {
return c2S_;
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder getC2SOrBuilder() {
return c2S_;
}
private void initFields() {
c2S_ = com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasC2S()) {
memoizedIsInitialized = 0;
return false;
}
if (!getC2S().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeMessage(1, c2S_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, c2S_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Request parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.futu.opend.api.protobuf.GetGlobalState.Request prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code GetGlobalState.Request}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:GetGlobalState.Request)
com.futu.opend.api.protobuf.GetGlobalState.RequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Request_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Request_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.Request.class, com.futu.opend.api.protobuf.GetGlobalState.Request.Builder.class);
}
// Construct using com.futu.opend.api.protobuf.GetGlobalState.Request.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getC2SFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (c2SBuilder_ == null) {
c2S_ = com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance();
} else {
c2SBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Request_descriptor;
}
public com.futu.opend.api.protobuf.GetGlobalState.Request getDefaultInstanceForType() {
return com.futu.opend.api.protobuf.GetGlobalState.Request.getDefaultInstance();
}
public com.futu.opend.api.protobuf.GetGlobalState.Request build() {
com.futu.opend.api.protobuf.GetGlobalState.Request result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.futu.opend.api.protobuf.GetGlobalState.Request buildPartial() {
com.futu.opend.api.protobuf.GetGlobalState.Request result = new com.futu.opend.api.protobuf.GetGlobalState.Request(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
if (c2SBuilder_ == null) {
result.c2S_ = c2S_;
} else {
result.c2S_ = c2SBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.futu.opend.api.protobuf.GetGlobalState.Request) {
return mergeFrom((com.futu.opend.api.protobuf.GetGlobalState.Request)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.futu.opend.api.protobuf.GetGlobalState.Request other) {
if (other == com.futu.opend.api.protobuf.GetGlobalState.Request.getDefaultInstance()) return this;
if (other.hasC2S()) {
mergeC2S(other.getC2S());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasC2S()) {
return false;
}
if (!getC2S().isInitialized()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.futu.opend.api.protobuf.GetGlobalState.Request parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.futu.opend.api.protobuf.GetGlobalState.Request) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private com.futu.opend.api.protobuf.GetGlobalState.C2S c2S_ = com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
com.futu.opend.api.protobuf.GetGlobalState.C2S, com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder, com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder> c2SBuilder_;
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public boolean hasC2S() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.C2S getC2S() {
if (c2SBuilder_ == null) {
return c2S_;
} else {
return c2SBuilder_.getMessage();
}
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public Builder setC2S(com.futu.opend.api.protobuf.GetGlobalState.C2S value) {
if (c2SBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
c2S_ = value;
onChanged();
} else {
c2SBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public Builder setC2S(
com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder builderForValue) {
if (c2SBuilder_ == null) {
c2S_ = builderForValue.build();
onChanged();
} else {
c2SBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public Builder mergeC2S(com.futu.opend.api.protobuf.GetGlobalState.C2S value) {
if (c2SBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001) &&
c2S_ != com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance()) {
c2S_ =
com.futu.opend.api.protobuf.GetGlobalState.C2S.newBuilder(c2S_).mergeFrom(value).buildPartial();
} else {
c2S_ = value;
}
onChanged();
} else {
c2SBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public Builder clearC2S() {
if (c2SBuilder_ == null) {
c2S_ = com.futu.opend.api.protobuf.GetGlobalState.C2S.getDefaultInstance();
onChanged();
} else {
c2SBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder getC2SBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getC2SFieldBuilder().getBuilder();
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder getC2SOrBuilder() {
if (c2SBuilder_ != null) {
return c2SBuilder_.getMessageOrBuilder();
} else {
return c2S_;
}
}
/**
* <code>required .GetGlobalState.C2S c2s = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
com.futu.opend.api.protobuf.GetGlobalState.C2S, com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder, com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder>
getC2SFieldBuilder() {
if (c2SBuilder_ == null) {
c2SBuilder_ = new com.google.protobuf.SingleFieldBuilder<
com.futu.opend.api.protobuf.GetGlobalState.C2S, com.futu.opend.api.protobuf.GetGlobalState.C2S.Builder, com.futu.opend.api.protobuf.GetGlobalState.C2SOrBuilder>(
getC2S(),
getParentForChildren(),
isClean());
c2S_ = null;
}
return c2SBuilder_;
}
// @@protoc_insertion_point(builder_scope:GetGlobalState.Request)
}
static {
defaultInstance = new Request(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:GetGlobalState.Request)
}
public interface ResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:GetGlobalState.Response)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
boolean hasRetType();
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
int getRetType();
/**
* <code>optional string retMsg = 2;</code>
*/
boolean hasRetMsg();
/**
* <code>optional string retMsg = 2;</code>
*/
java.lang.String getRetMsg();
/**
* <code>optional string retMsg = 2;</code>
*/
com.google.protobuf.ByteString
getRetMsgBytes();
/**
* <code>optional int32 errCode = 3;</code>
*/
boolean hasErrCode();
/**
* <code>optional int32 errCode = 3;</code>
*/
int getErrCode();
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
boolean hasS2C();
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
com.futu.opend.api.protobuf.GetGlobalState.S2C getS2C();
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder getS2COrBuilder();
}
/**
* Protobuf type {@code GetGlobalState.Response}
*/
public static final class Response extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:GetGlobalState.Response)
ResponseOrBuilder {
// Use Response.newBuilder() to construct.
private Response(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Response(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Response defaultInstance;
public static Response getDefaultInstance() {
return defaultInstance;
}
public Response getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Response(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
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;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
retType_ = input.readInt32();
break;
}
case 18: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
retMsg_ = bs;
break;
}
case 24: {
bitField0_ |= 0x00000004;
errCode_ = input.readInt32();
break;
}
case 34: {
com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
subBuilder = s2C_.toBuilder();
}
s2C_ = input.readMessage(com.futu.opend.api.protobuf.GetGlobalState.S2C.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(s2C_);
s2C_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000008;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Response_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Response_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.Response.class, com.futu.opend.api.protobuf.GetGlobalState.Response.Builder.class);
}
public static com.google.protobuf.Parser<Response> PARSER =
new com.google.protobuf.AbstractParser<Response>() {
public Response parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Response(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Response> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int RETTYPE_FIELD_NUMBER = 1;
private int retType_;
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
public boolean hasRetType() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
public int getRetType() {
return retType_;
}
public static final int RETMSG_FIELD_NUMBER = 2;
private java.lang.Object retMsg_;
/**
* <code>optional string retMsg = 2;</code>
*/
public boolean hasRetMsg() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional string retMsg = 2;</code>
*/
public java.lang.String getRetMsg() {
java.lang.Object ref = retMsg_;
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()) {
retMsg_ = s;
}
return s;
}
}
/**
* <code>optional string retMsg = 2;</code>
*/
public com.google.protobuf.ByteString
getRetMsgBytes() {
java.lang.Object ref = retMsg_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
retMsg_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ERRCODE_FIELD_NUMBER = 3;
private int errCode_;
/**
* <code>optional int32 errCode = 3;</code>
*/
public boolean hasErrCode() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional int32 errCode = 3;</code>
*/
public int getErrCode() {
return errCode_;
}
public static final int S2C_FIELD_NUMBER = 4;
private com.futu.opend.api.protobuf.GetGlobalState.S2C s2C_;
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public boolean hasS2C() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.S2C getS2C() {
return s2C_;
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder getS2COrBuilder() {
return s2C_;
}
private void initFields() {
retType_ = -400;
retMsg_ = "";
errCode_ = 0;
s2C_ = com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasRetType()) {
memoizedIsInitialized = 0;
return false;
}
if (hasS2C()) {
if (!getS2C().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt32(1, retType_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getRetMsgBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt32(3, errCode_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(4, s2C_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, retType_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getRetMsgBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, errCode_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, s2C_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.futu.opend.api.protobuf.GetGlobalState.Response parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.futu.opend.api.protobuf.GetGlobalState.Response prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code GetGlobalState.Response}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:GetGlobalState.Response)
com.futu.opend.api.protobuf.GetGlobalState.ResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Response_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Response_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.futu.opend.api.protobuf.GetGlobalState.Response.class, com.futu.opend.api.protobuf.GetGlobalState.Response.Builder.class);
}
// Construct using com.futu.opend.api.protobuf.GetGlobalState.Response.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getS2CFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
retType_ = -400;
bitField0_ = (bitField0_ & ~0x00000001);
retMsg_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
errCode_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
if (s2CBuilder_ == null) {
s2C_ = com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance();
} else {
s2CBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.futu.opend.api.protobuf.GetGlobalState.internal_static_GetGlobalState_Response_descriptor;
}
public com.futu.opend.api.protobuf.GetGlobalState.Response getDefaultInstanceForType() {
return com.futu.opend.api.protobuf.GetGlobalState.Response.getDefaultInstance();
}
public com.futu.opend.api.protobuf.GetGlobalState.Response build() {
com.futu.opend.api.protobuf.GetGlobalState.Response result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.futu.opend.api.protobuf.GetGlobalState.Response buildPartial() {
com.futu.opend.api.protobuf.GetGlobalState.Response result = new com.futu.opend.api.protobuf.GetGlobalState.Response(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.retType_ = retType_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.retMsg_ = retMsg_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.errCode_ = errCode_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
if (s2CBuilder_ == null) {
result.s2C_ = s2C_;
} else {
result.s2C_ = s2CBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.futu.opend.api.protobuf.GetGlobalState.Response) {
return mergeFrom((com.futu.opend.api.protobuf.GetGlobalState.Response)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.futu.opend.api.protobuf.GetGlobalState.Response other) {
if (other == com.futu.opend.api.protobuf.GetGlobalState.Response.getDefaultInstance()) return this;
if (other.hasRetType()) {
setRetType(other.getRetType());
}
if (other.hasRetMsg()) {
bitField0_ |= 0x00000002;
retMsg_ = other.retMsg_;
onChanged();
}
if (other.hasErrCode()) {
setErrCode(other.getErrCode());
}
if (other.hasS2C()) {
mergeS2C(other.getS2C());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasRetType()) {
return false;
}
if (hasS2C()) {
if (!getS2C().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.futu.opend.api.protobuf.GetGlobalState.Response parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.futu.opend.api.protobuf.GetGlobalState.Response) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int retType_ = -400;
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
public boolean hasRetType() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
public int getRetType() {
return retType_;
}
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
public Builder setRetType(int value) {
bitField0_ |= 0x00000001;
retType_ = value;
onChanged();
return this;
}
/**
* <code>required int32 retType = 1 [default = -400];</code>
*
* <pre>
*RetType,返回结果
* </pre>
*/
public Builder clearRetType() {
bitField0_ = (bitField0_ & ~0x00000001);
retType_ = -400;
onChanged();
return this;
}
private java.lang.Object retMsg_ = "";
/**
* <code>optional string retMsg = 2;</code>
*/
public boolean hasRetMsg() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional string retMsg = 2;</code>
*/
public java.lang.String getRetMsg() {
java.lang.Object ref = retMsg_;
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()) {
retMsg_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string retMsg = 2;</code>
*/
public com.google.protobuf.ByteString
getRetMsgBytes() {
java.lang.Object ref = retMsg_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
retMsg_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string retMsg = 2;</code>
*/
public Builder setRetMsg(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
retMsg_ = value;
onChanged();
return this;
}
/**
* <code>optional string retMsg = 2;</code>
*/
public Builder clearRetMsg() {
bitField0_ = (bitField0_ & ~0x00000002);
retMsg_ = getDefaultInstance().getRetMsg();
onChanged();
return this;
}
/**
* <code>optional string retMsg = 2;</code>
*/
public Builder setRetMsgBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
retMsg_ = value;
onChanged();
return this;
}
private int errCode_ ;
/**
* <code>optional int32 errCode = 3;</code>
*/
public boolean hasErrCode() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional int32 errCode = 3;</code>
*/
public int getErrCode() {
return errCode_;
}
/**
* <code>optional int32 errCode = 3;</code>
*/
public Builder setErrCode(int value) {
bitField0_ |= 0x00000004;
errCode_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 errCode = 3;</code>
*/
public Builder clearErrCode() {
bitField0_ = (bitField0_ & ~0x00000004);
errCode_ = 0;
onChanged();
return this;
}
private com.futu.opend.api.protobuf.GetGlobalState.S2C s2C_ = com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
com.futu.opend.api.protobuf.GetGlobalState.S2C, com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder, com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder> s2CBuilder_;
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public boolean hasS2C() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.S2C getS2C() {
if (s2CBuilder_ == null) {
return s2C_;
} else {
return s2CBuilder_.getMessage();
}
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public Builder setS2C(com.futu.opend.api.protobuf.GetGlobalState.S2C value) {
if (s2CBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
s2C_ = value;
onChanged();
} else {
s2CBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public Builder setS2C(
com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder builderForValue) {
if (s2CBuilder_ == null) {
s2C_ = builderForValue.build();
onChanged();
} else {
s2CBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public Builder mergeS2C(com.futu.opend.api.protobuf.GetGlobalState.S2C value) {
if (s2CBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008) &&
s2C_ != com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance()) {
s2C_ =
com.futu.opend.api.protobuf.GetGlobalState.S2C.newBuilder(s2C_).mergeFrom(value).buildPartial();
} else {
s2C_ = value;
}
onChanged();
} else {
s2CBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public Builder clearS2C() {
if (s2CBuilder_ == null) {
s2C_ = com.futu.opend.api.protobuf.GetGlobalState.S2C.getDefaultInstance();
onChanged();
} else {
s2CBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder getS2CBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getS2CFieldBuilder().getBuilder();
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
public com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder getS2COrBuilder() {
if (s2CBuilder_ != null) {
return s2CBuilder_.getMessageOrBuilder();
} else {
return s2C_;
}
}
/**
* <code>optional .GetGlobalState.S2C s2c = 4;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
com.futu.opend.api.protobuf.GetGlobalState.S2C, com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder, com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder>
getS2CFieldBuilder() {
if (s2CBuilder_ == null) {
s2CBuilder_ = new com.google.protobuf.SingleFieldBuilder<
com.futu.opend.api.protobuf.GetGlobalState.S2C, com.futu.opend.api.protobuf.GetGlobalState.S2C.Builder, com.futu.opend.api.protobuf.GetGlobalState.S2COrBuilder>(
getS2C(),
getParentForChildren(),
isClean());
s2C_ = null;
}
return s2CBuilder_;
}
// @@protoc_insertion_point(builder_scope:GetGlobalState.Response)
}
static {
defaultInstance = new Response(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:GetGlobalState.Response)
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_GetGlobalState_C2S_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_GetGlobalState_C2S_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_GetGlobalState_S2C_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_GetGlobalState_S2C_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_GetGlobalState_Request_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_GetGlobalState_Request_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_GetGlobalState_Response_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_GetGlobalState_Response_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\024GetGlobalState.proto\022\016GetGlobalState\032\014" +
"Common.proto\032\020Qot_Common.proto\"\025\n\003C2S\022\016\n" +
"\006userID\030\001 \002(\004\"\330\001\n\003S2C\022\020\n\010marketHK\030\001 \002(\005\022" +
"\020\n\010marketUS\030\002 \002(\005\022\020\n\010marketSH\030\003 \002(\005\022\020\n\010m" +
"arketSZ\030\004 \002(\005\022\026\n\016marketHKFuture\030\005 \002(\005\022\022\n" +
"\nqotLogined\030\006 \002(\010\022\022\n\ntrdLogined\030\007 \002(\010\022\021\n" +
"\tserverVer\030\010 \002(\005\022\025\n\rserverBuildNo\030\t \002(\005\022" +
"\014\n\004time\030\n \002(\003\022\021\n\tlocalTime\030\013 \001(\001\"+\n\007Requ" +
"est\022 \n\003c2s\030\001 \002(\0132\023.GetGlobalState.C2S\"d\n" +
"\010Response\022\025\n\007retType\030\001 \002(\005:\004-400\022\016\n\006retM",
"sg\030\002 \001(\t\022\017\n\007errCode\030\003 \001(\005\022 \n\003s2c\030\004 \001(\0132\023" +
".GetGlobalState.S2CB\035\n\033com.futu.opend.ap" +
"i.protobuf"
};
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.futu.opend.api.protobuf.Common.getDescriptor(),
com.futu.opend.api.protobuf.QotCommon.getDescriptor(),
}, assigner);
internal_static_GetGlobalState_C2S_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_GetGlobalState_C2S_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_GetGlobalState_C2S_descriptor,
new java.lang.String[] { "UserID", });
internal_static_GetGlobalState_S2C_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_GetGlobalState_S2C_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_GetGlobalState_S2C_descriptor,
new java.lang.String[] { "MarketHK", "MarketUS", "MarketSH", "MarketSZ", "MarketHKFuture", "QotLogined", "TrdLogined", "ServerVer", "ServerBuildNo", "Time", "LocalTime", });
internal_static_GetGlobalState_Request_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_GetGlobalState_Request_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_GetGlobalState_Request_descriptor,
new java.lang.String[] { "C2S", });
internal_static_GetGlobalState_Response_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_GetGlobalState_Response_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_GetGlobalState_Response_descriptor,
new java.lang.String[] { "RetType", "RetMsg", "ErrCode", "S2C", });
com.futu.opend.api.protobuf.Common.getDescriptor();
com.futu.opend.api.protobuf.QotCommon.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"myhappylife@163.com"
] | myhappylife@163.com |
5943834ed9c5353abb8e976151ad96fb1ed97d85 | 475e0850ce7f19d1cab23eff765f6b755790ec66 | /src/com/pwsturk/meg/Observer/Gosterge.java | c7a220ba5f4015bcf59a6bda67feef6c74338c44 | [] | no_license | mehmetgelmedi/DesignPatterns | e76f2f2515891299066fd0bf39b58c600db40d7f | 85b3233ad46df0877195b47b0fd4a74071443ad1 | refs/heads/master | 2021-01-09T20:45:13.040498 | 2016-07-04T22:44:53 | 2016-07-04T22:44:53 | 62,331,481 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 101 | java | package com.pwsturk.meg.Observer;
public interface Gosterge {
void guncelle(double hisseDegeri);
}
| [
"mehmetemingelmedi@gmail.com0"
] | mehmetemingelmedi@gmail.com0 |
1059ef61d89802d08892fb24923450e939693012 | d49c1ab814da689b81ee0682eca3bca17729e973 | /app/src/main/java/edu/glut/tiny/ui/MainActivity.java | 72890f00147c02afa0f57f72617248162f0e7eee | [] | no_license | lhdigo/Tiny | 36501daa8ac88934b2ec8dc890263a918e51ce92 | 261954e2791a86cbe15c9c47c6ac81cf920921b5 | refs/heads/master | 2022-12-28T23:19:49.257378 | 2020-10-19T03:10:48 | 2020-10-19T03:10:48 | 299,046,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,723 | java | package edu.glut.tiny.ui;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.SearchView;
import androidx.core.view.MenuItemCompat;
import androidx.fragment.app.FragmentTransaction;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.bottomnavigation.BottomNavigationItemView;
import com.google.android.material.bottomnavigation.BottomNavigationMenuView;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.hyphenate.EMCallBack;
import com.hyphenate.EMConnectionListener;
import com.hyphenate.EMError;
import com.hyphenate.chat.EMClient;
import java.io.Serializable;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import edu.glut.tiny.R;
import edu.glut.tiny.app.IMApplication;
import edu.glut.tiny.contract.MainContract;
import edu.glut.tiny.data.entity.Contacts;
import edu.glut.tiny.presenter.MainPresenter;
import edu.glut.tiny.ui.activity.AddContactActivity;
import edu.glut.tiny.ui.activity.BaseActivity;
import edu.glut.tiny.ui.activity.ColorLensActivity;
import edu.glut.tiny.ui.activity.LoginActivity;
import edu.glut.tiny.ui.activity.SearchableActivity;
import edu.glut.tiny.utils.factory.FragmentFactory;
public class MainActivity extends BaseActivity implements MainContract.View {
private BottomNavigationView bottomNavigationView;
private static MaterialToolbar materialToolbar;
private SearchView searchView;
private MainContract.Presenter mainPresenter;
private TextView count;
public TextView getCount() {
return count;
}
public static MaterialToolbar getMaterialToolbar() {
return materialToolbar;
}
@Override
public int getLayoutResourceId() {
return R.layout.activity_main;
}
@Override
public void init() {
super.init();
materialToolbar = findViewById(R.id.header_toolbar);
bottomNavigationView = findViewById(R.id.tab_bottom_bar);
bottomNavigationView.setSelectedItemId(R.id.page_message);
//未读消息角标
BottomNavigationMenuView menuView = (BottomNavigationMenuView) bottomNavigationView.getChildAt(0);
BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(0);
View badge = LayoutInflater.from(this).inflate(R.layout.count, menuView, false);
itemView.addView(badge);
count = findViewById(R.id.message_count);
AtomicReference<FragmentTransaction> beginTransaction = new AtomicReference<>(getSupportFragmentManager().beginTransaction());
beginTransaction.get().replace(R.id.home_body, FragmentFactory.getInstance(R.id.page_message)).commit();
mainPresenter = new MainPresenter(this, getApplicationContext());
materialToolbar.setTitle(getString(R.string.text_label_conversation));
setSupportActionBar(materialToolbar);
bottomNavigationView.setOnNavigationItemSelectedListener(item -> {
//获取FragmentTransaction,并且开启事务。
int messageCount = EMClient.getInstance().chatManager().getUnreadMessageCount();
if (messageCount > 0 && item.getItemId() != R.id.page_message) {
count.setText(String.valueOf(messageCount));
count.setVisibility(View.VISIBLE);
} else if (item.getItemId() == R.id.page_message) count.setVisibility(View.INVISIBLE);
beginTransaction.set(getSupportFragmentManager().beginTransaction());
beginTransaction.get().replace(R.id.home_body, FragmentFactory.getInstance(item.getItemId()));
beginTransaction.get().commit();
return true;
});
EMClient.getInstance().addConnectionListener(new EMConnectionListener() {
@Override
public void onConnected() {
}
@Override
public void onDisconnected(int i) {
if (i == EMError.USER_LOGIN_ANOTHER_DEVICE) {
showLoginError();
}
}
});
if (!EMClient.getInstance().isConnected()) {
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
// intent.putExtra("USER_LOGIN_ANOTHER_DEVICE",true);
getApplicationContext().startActivity(intent);
}
}
private void showLoginError() {
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
boolean user_login_another_device = getIntent().getBooleanExtra("USER_LOGIN_ANOTHER_DEVICE", false);
Log.d("TAG", "isUSER_LOGIN_ANOTHER_DEVICE: " + user_login_another_device);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(IMApplication.getInstance().getTopActivity());
builder.setTitle("下线通知");
builder.setMessage("您的账号已在别处登录");
builder.setCancelable(false);
builder.setPositiveButton("退出", (dialog, which) -> {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("USER_LOGIN_ANOTHER_DEVICE", true);
getApplicationContext().startActivity(intent);
});
builder.setNegativeButton("重新登录", (dialog, which) -> {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("USER_LOGIN_ANOTHER_DEVICE", true);
getApplicationContext().startActivity(intent);
});
runOnUiThread(() -> {
AlertDialog alertDialog = builder.create();
alertDialog.show();
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.top_app_bar,menu);
MenuItem searchItem = menu.findItem(R.id.search);
MenuItem darkItem = menu.findItem(R.id.dark_mode);
MenuItem lightItem = menu.findItem(R.id.light_mode);
//获取当前是否是夜间模式
new Thread(()-> {
int localNightMode = AppCompatDelegate.getDefaultNightMode();
if (localNightMode == AppCompatDelegate.MODE_NIGHT_YES) {
//显示切换日间模式
lightItem.setVisible(true);
} else darkItem.setVisible(true);
}).start();
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
searchView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
searchView.setQueryHint(getString(R.string.query_hint_label));
//获取焦点
searchView.setFocusable(true);
searchView.requestFocusFromTouch();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
List<Contacts> data = mainPresenter.search(query);
if (data.size() == 0) {
runOnUiThread(() -> {
Toast.makeText(getApplicationContext(), "没有联系人哦!", Toast.LENGTH_LONG).show();
});
return true;
}
Intent search = new Intent(getApplicationContext(), SearchableActivity.class);
search.putExtra("searchData", (Serializable) data);
startActivity(search);
searchView.clearFocus();
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
//List<Contacts> data = mainPresenter.search(newText);
//if (TextUtils.isEmpty(newText)) searchView.setVisibility(View.INVISIBLE);
//Log.d(this.toString(), "onQueryTextChange: "+ data.toString());
return true;
}
});
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.add_contact:
startActivity(new Intent(getApplicationContext(), AddContactActivity.class));
return true;
case R.id.qr_code_scanner:
scanQRCode();
return true;
case R.id.color_lens:
buildColorLensAlertDialog(getApplicationContext());
return true;
case R.id.dark_mode:
switchDarkMode();
return true;
case R.id.light_mode:
switchLightMode();
return true;
default:
super.onOptionsItemSelected(item);
}
return false;
}
private void buildColorLensAlertDialog(Context context) {
startActivity(new Intent(this, ColorLensActivity.class));
}
@Override
public void onSearchSuccess() {
}
@Override
public void onSearchFailed() {
}
private void scanQRCode() {
IntentIntegrator intentIntegrator = new IntentIntegrator(MainActivity.this);
intentIntegrator.initiateScan();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// 获取解析结果
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null) {
if (result.getContents() == null) {
Toast.makeText(this, "取消扫描", Toast.LENGTH_LONG).show();
} else {
Handler handler = new android.os.Handler(Looper.getMainLooper());
String toAddUsername = result.getContents();
//Toast.makeText(this, "扫描内容:" + result.getContents(), Toast.LENGTH_LONG).show();
EMClient.getInstance()
.contactManager()
.aysncAddContact(toAddUsername, null, new EMCallBack() {
@Override
public void onSuccess() {
handler.post(() -> {
Toast.makeText(getApplicationContext(), "已发送好友请求给" + toAddUsername, Toast.LENGTH_LONG).show();
});
}
@Override
public void onError(int i, String s) {
handler.post(() -> {
Toast.makeText(getApplicationContext(), "发送好友请求失败", Toast.LENGTH_LONG).show();
});
}
@Override
public void onProgress(int i, String s) {
}
});
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
} | [
"lhdigo@qq.com"
] | lhdigo@qq.com |
a6436b4bf41fe30f81d9534d17872457e987cb6b | 9bb01897981e3413540a8bc277e8fd23bc5b89a5 | /src/main/java/br/com/estacionamento/controllers/response/UsuarioDTO.java | 9eef1c698f2d549fba1a93dc82db683fe58cc089 | [] | no_license | vitorchaves27/desafiozup | 488a98fd90bf61d7d7c6d787d4afe19027c69c7e | 6fe6cb8356a5ac8f5ee7d1180d83388cdea596b1 | refs/heads/master | 2023-05-09T11:26:27.053737 | 2021-05-31T03:15:08 | 2021-05-31T03:15:08 | 372,367,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,036 | java | package br.com.estacionamento.controllers.response;
import java.util.List;
public class UsuarioDTO {
private String nome;
private String cpf;
private String email;
private String dataNascimento;
private List<VeiculosResponseDTO> veiculos;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getDataNascimento() {
return dataNascimento;
}
public void setDataNascimento(String dataNascimento) {
this.dataNascimento = dataNascimento;
}
public List<VeiculosResponseDTO> getVeiculos() {
return veiculos;
}
public void setVeiculos(List<VeiculosResponseDTO> veiculos) {
this.veiculos = veiculos;
}
}
| [
"vitorchaves27@yahoo.com.br"
] | vitorchaves27@yahoo.com.br |
bcd8a628485d73dd353ad2e6fcb0d076a1829fe7 | 19bd6fa0085d7b24750ce2c75fd4f0f5da66d602 | /eureka-application-provider/src/main/java/com/example/eureka/application/provider/controller/ApplicationRestController.java | df520ac5a1f3d20ee2f29bd78ec4fbe48fdd09eb | [] | no_license | hujhao/demo-eureka | e96f3cf598100afc75dab8af0c739e719d3b6ad1 | 1cce883e30e0ac90889cff8b366f8aae2e57237c | refs/heads/master | 2022-11-15T00:23:45.686530 | 2020-06-27T13:45:57 | 2020-06-27T13:45:57 | 275,379,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package com.example.eureka.application.provider.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ApplicationRestController {
@Value("${server.port}")
private String port;
@RequestMapping(path = "/serverName/{serverName}")
public String getServerName(@PathVariable String serverName){
System.out.println(port);
return serverName;
}
}
| [
"hujh26@midea.com"
] | hujh26@midea.com |
9b345943f362d4aaf08838b3a1349bcfcf31b42f | f6f0fdb180d7b78c0756149e6fd853588197f0ff | /TobosuPicture/app/src/main/java/com/tbs/tobosupicture/view/wheelviews/wheelview/MyArrayWheelAdapter.java | 6789c2edb80ab77ca4032f1c4bf81fc857b17a17 | [] | no_license | WangYong20181102/tubosu | bc0ccff347aeb6a61e6962d0adf0572202f74b48 | 2f9f9121f8d8ddc572e5bbc940f63abfa08d0baa | refs/heads/master | 2020-04-04T22:18:04.233547 | 2019-04-23T06:44:18 | 2019-04-23T06:44:18 | 156,318,394 | 2 | 0 | null | 2019-04-16T07:18:30 | 2018-11-06T03:08:54 | Java | UTF-8 | Java | false | false | 1,590 | java | /*
* Copyright 2011 Yuri Kanivets
*
* 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.tbs.tobosupicture.view.wheelviews.wheelview;
import android.content.Context;
/**
* The simple Array wheel adapter
* @param <T> the element type
*/
public class MyArrayWheelAdapter<T> extends AbstractWheelTextAdapter {
// items
private T items[];
/**
* Constructor
* @param context the current mContext
* @param items the items
*/
public MyArrayWheelAdapter(Context context, T items[]) {
super(context);
//setEmptyItemResource(TEXT_VIEW_ITEM_RESOURCE);
this.items = items;
}
@Override
public CharSequence getItemText(int index) {
if (index >= 0 && index < items.length) {
T item = items[index];
if (item instanceof CharSequence) {
return (CharSequence) item;
}
return item.toString();
}
return null;
}
@Override
public int getItemsCount() {
return items.length;
}
}
| [
"ifthink@qq.com"
] | ifthink@qq.com |
fe521ee3cb4bd0353fc3b253f823dbd0ac48d7d0 | 457b2c9176a99c20d7f52b62e2c6ce13dbd7730a | /Demo/src/demo/servlet/admin/UserInformation.java | 8baea64a5db691391bb02f9054b8eaf8e2a7b267 | [] | no_license | hoangie2k62/share | ed4e6d6430fbe064d49bd38fda275123ebb2fdb7 | 194e664b8d71f5eb17b62fb206a48079a02499f5 | refs/heads/master | 2020-04-01T02:20:12.713769 | 2019-05-20T18:25:53 | 2019-05-20T18:25:53 | 152,774,921 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,513 | java | package demo.servlet.admin;
import java.io.IOException;
import java.sql.Connection;
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 demo.beans.UserAccount;
import demo.beans.UserFamily;
import demo.beans.UserInfo;
import demo.utils.DBUtilsAccount;
import demo.utils.DBUtilsInfo;
import demo.utils.MyUtils;
@WebServlet(urlPatterns = {"/ad/userInfo"})
public class UserInformation extends HttpServlet{
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
Connection conn = MyUtils.getStoredConnection(request);
String msnv = request.getParameter("msnv");
UserAccount acc = DBUtilsAccount.getAccount(conn, msnv);
request.setAttribute("acc", acc);
UserInfo info = DBUtilsInfo.getInfo(conn, msnv);
request.setAttribute("info", info);
UserFamily family = DBUtilsInfo.getFamily(conn, msnv);
request.setAttribute("family", family);
RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/demo/views/admin/user_info.jsp");
dispatcher.forward(request, response);
}catch(Exception ex) {
ex.printStackTrace();
}
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
Connection conn = MyUtils.getStoredConnection(request);
String msnv = request.getParameter("msnv");
String oldmsnv = request.getParameter("oldmsnv");
String imageData = "../demo/views/picture/17020769.jpg";
String employees = request.getParameter("userName");
String office = request.getParameter("office");
String email = request.getParameter("email");
String salaryStr = request.getParameter("salary");
int salary = Integer.parseInt(salaryStr);
boolean check = DBUtilsAccount.checkInfo(conn, msnv);
if(!check) {
msnv = oldmsnv;
request.setAttribute("swear", "lưu ý: msnv đã tồn tại");
}
UserAccount user = new UserAccount(msnv, employees, office, email, salary, imageData);
DBUtilsAccount.updateEmployee(conn, user, oldmsnv);
UserAccount acc = DBUtilsAccount.getAccount(conn, msnv);
request.setAttribute("acc", acc);
UserInfo info = DBUtilsInfo.getInfo(conn, msnv);
request.setAttribute("info", info);
UserFamily family = DBUtilsInfo.getFamily(conn, msnv);
request.setAttribute("family", family);
RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/demo/views/admin/user_info.jsp");
dispatcher.forward(request, response);
}catch(Exception e) {
e.printStackTrace();
}
}
}
| [
"hoangie2k62@gmail.com"
] | hoangie2k62@gmail.com |
19fcc029d6d525830d51df17bfd35562b6cd99a9 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_a992db5b37cc777225650c02a76168e3ada70f3e/NeoServiceExtension/4_a992db5b37cc777225650c02a76168e3ada70f3e_NeoServiceExtension_s.java | 0a0616fcfe5c45a7fc7cc4fb5c442a68d161fa5a | [] | 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 | 2,068 | java | package org.amanzi.awe.catalog.neo;
import java.io.File;
import java.io.Serializable;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import net.refractions.udig.catalog.IService;
import net.refractions.udig.catalog.ServiceExtension;
public class NeoServiceExtension implements ServiceExtension {
/* Neo4J service key, URL to the Neo4J database and gis node */
public static final String URL_KEY = "org.amanzi.awe.catalog.neo.url";
public static final String CLASS_KEY = "org.amanzi.awe.catalog.neo.class";
@Override
public Map<String, Serializable> createParams(URL url) {
try {
if (url.getProtocol().equals("file")) {
// the URL represent a normal file or directory on disk
File path = new File(url.toURI());
if (path.exists() && path.isDirectory()) {
// check the directory, does it contain a neo4j database
File neostore = new File(path,"neostore");
if (neostore.exists()) {
Map<String, Serializable> params = new HashMap<String, Serializable>();
params.put(URL_KEY, url);
params.put(CLASS_KEY, URL.class);
return params;
}
}
}
} catch (Throwable t) {
// something went wrong, URL must be for another service
}
// unable to create the parameters, URL must be for another service
return null;
}
@Override
public IService createService(URL id, Map<String, Serializable> params) {
// good defensive programming
if (params == null) {
return null;
}
// check for the property service key
if (params.containsKey(URL_KEY)) {
// found it, create the service handle
return new NeoService(params);
}
// key not found
return null;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
ef1e741b1962c80a3e860200999ccd67b43d11ba | 948308b338051e69571381facb4d48b907639373 | /app/src/main/java/wangwn/ChooseRoom.java | b9e778de4c519b6776e779b2078d64ddcac3bad5 | [] | no_license | fangfangzf/DormSelection | d6f028b636bdc33c322c1a466366671a66bcb22c | 7c34ac8d5debba20fdb99faa436e4ceec832f251 | refs/heads/master | 2020-06-19T11:45:27.287942 | 2017-12-27T08:17:21 | 2017-12-27T08:17:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,202 | java | package wangwn;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import wangwn.Model.Student;
public class ChooseRoom extends AppCompatActivity {
ListView myinfolistview;
Button btn_deal;
Student student=new Student();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chooseroom);
ActionBar actionBar=getSupportActionBar();
actionBar.hide();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("办理住宿");
student= (Student) getIntent().getSerializableExtra("student");
myinfolistview= (ListView) findViewById(R.id.mylist);
btn_deal= (Button) findViewById(R.id.deal_with_mybus);
btn_deal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(ChooseRoom.this,ChooseNoofPerson.class);
Bundle bundle=new Bundle();
bundle.putSerializable("student",student);
intent.putExtras(bundle);
startActivity(intent);
}
});
initlistview();//初始化Myinfo
}
private void initlistview() {
List<String> myinfo=new ArrayList<>();
myinfo.add("姓名:"+" "+ student.getName());
myinfo.add("学号:"+" "+ student.getStudentid());
myinfo.add("性别:"+" "+ student.getGender() );
myinfo.add("校验码:"+" "+ student.getVcode() );
ArrayAdapter myadapter=new ArrayAdapter(this,android.R.layout.simple_list_item_1,myinfo);
myinfolistview.setAdapter(myadapter);
}
}
| [
"wangwn@pku.edu.cn"
] | wangwn@pku.edu.cn |
c2090f2ed06b849a6e6fdb1ccb10aa627ffc0cbb | 7773e6c6123b39fea133c069c0810a7e1d5b6ec7 | /app/src/main/java/com/tnz/app/exam4me/services/UpdateProfileService.java | 64c1cea66f2fd9e7db27e77ae5985e46f165a30f | [] | no_license | TwahaNz/AndroidActivities | dffe4d733c5c69b1160533c08d9175d4bcb535bc | cc300eb2cee614ede02818bcd98489033a99ab73 | refs/heads/master | 2021-01-17T06:30:39.674825 | 2016-06-08T14:18:45 | 2016-06-08T14:18:45 | 60,542,537 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package com.tnz.app.exam4me.services;
import android.content.Context;
import com.tnz.app.exam4me.domain.settings.Registration;
/**
* Created by Admin on 2016/05/08.
* Service to allow registered users to update their profiles.
* The reason this is a bound service is because the user need not
* interact with the update
*/
//Bound Service
public interface UpdateProfileService {
void updateDetails(Context context, Registration registration);
}
| [
"admin@localhost.localdomain"
] | admin@localhost.localdomain |
76ac3718743608f309f9908e7672040590684a9d | 55c63256eda448ef53c57d60d7b4e8742f2bf785 | /src/main/java/state/SoldOutState.java | 421a92f57b5cf115913e58194c40248c201e123a | [] | no_license | Alex-Za/DesignPatterns | 4a79fc99d6bed951d8215504d85ef738f546ce41 | 707010aeb947c4884912443cc2526ce965b0b2d4 | refs/heads/master | 2023-07-16T15:52:54.574282 | 2021-09-04T12:08:36 | 2021-09-04T12:08:36 | 398,889,622 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | package state;
import state.interfaces.State;
public class SoldOutState implements State {
GumballMachine gumballMachine;
public SoldOutState(GumballMachine gumballMachine) {
this.gumballMachine = gumballMachine;
}
@Override
public void insertQuarter() {
System.out.println("You can't insert a quarter, the machine is sold out");
}
@Override
public void ejectQuarter() {
System.out.println("You can't eject, you haven't inserted a quarter yet");
}
@Override
public void turnCrank() {
System.out.println("You turned, but there are no gumballs");
}
@Override
public void dispense() {
System.out.println("No gumball dispensed");
}
}
| [
"38041377+Alex-Za@users.noreply.github.com"
] | 38041377+Alex-Za@users.noreply.github.com |
1e0a9fa2c7eba81b34fea073830de5c656fe2164 | 7909c7d145876fc68b58ab5c059b81728c6d9c54 | /myArrayList/src/com/shf2/ArrayListTest01.java | 82607d9aa4d0d5f2f0db8f9bb44937bafb39a564 | [] | no_license | shuhongfan/Java | 2cbf6e2a257fb04c025dde4c7eb0f22ec628f1f2 | cc922f9b6536c6777bf3b21d0ad99e0db367a04f | refs/heads/main | 2023-06-18T14:46:03.415828 | 2021-07-21T03:31:22 | 2021-07-21T03:31:22 | 384,601,617 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 535 | java | package com.shf2;
import java.util.ArrayList;
public class ArrayListTest01 {
public static void main(String[] args) {
ArrayList<Student> array=new ArrayList<>();
Student s1=new Student("hello",30);
Student s2=new Student("world",100);
Student s3=new Student("java",50);
array.add(s1);
array.add(s2);
array.add(s3);
for(int i=0;i<array.size();i++){
Student s = array.get(i);
System.out.println(s.getName()+", "+s.getAge());
}
}
}
| [
"shuhongfan@live.com"
] | shuhongfan@live.com |
0301c544343dfc00375bde6abc16059df7303579 | 412bb4d120f829aef6f991db40b8189d343b221d | /src/com/example/studygroup/model/NavDrawerItem.java | 8cd758f75e8c09982c71555e6bfe00f9c53b697c | [] | no_license | donhatanh/StudyGroup | bfcea0cbca927c8ad4097e35dd82c868e7309b2a | 56d86697064650e8e457f2e46aa93d8509634cde | refs/heads/master | 2021-01-10T12:19:35.673520 | 2015-12-15T01:46:23 | 2015-12-15T01:46:23 | 47,861,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,077 | java | package com.example.studygroup.model;
public class NavDrawerItem {
private String title;
private int icon;
private String count = "0";
// boolean to set visiblity of the counter
private boolean isCounterVisible = false;
public NavDrawerItem(){}
public NavDrawerItem(String title, int icon){
this.title = title;
this.icon = icon;
}
public NavDrawerItem(String title, int icon, boolean isCounterVisible, String count){
this.title = title;
this.icon = icon;
this.isCounterVisible = isCounterVisible;
this.count = count;
}
public String getTitle(){
return this.title;
}
public int getIcon(){
return this.icon;
}
public String getCount(){
return this.count;
}
public boolean getCounterVisibility(){
return this.isCounterVisible;
}
public void setTitle(String title){
this.title = title;
}
public void setIcon(int icon){
this.icon = icon;
}
public void setCount(String count){
this.count = count;
}
public void setCounterVisibility(boolean isCounterVisible){
this.isCounterVisible = isCounterVisible;
}
}
| [
"donhatanh90@gmail.com"
] | donhatanh90@gmail.com |
4c1c4c52a1660c91bcded4e3c94882237e1130a3 | 91fb4cb2dcc34d4f0e45db0b21b4b1cf9181baa9 | /wizard/src/de/ergodirekt/wizard/StarterServer.java | 3e93ecd5fcedd825654c598aa4d14781be88dba7 | [] | no_license | ed-azubis-13/Wizard | 311b0da41b62a82a203809d44853a7adf89740bc | 241e590ed5248fff5a6259fbe2016f983c7dd36c | refs/heads/master | 2020-05-17T06:38:40.362552 | 2013-12-20T11:52:27 | 2013-12-20T11:52:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package de.ergodirekt.wizard;
import java.awt.EventQueue;
import javax.swing.UnsupportedLookAndFeelException;
import de.ergodirekt.wizard.server.ServerConsole;
/**
* Die Klasse startet den Server.
* @author Tobias
*
*/
public class StarterServer {
/**
* Launch the application.
*
* @throws UnsupportedLookAndFeelException
* @throws IllegalAccessException
* @throws InstantiationException
* @throws ClassNotFoundException
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ServerConsole window = new ServerConsole();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
| [
"LADMIN@PC205"
] | LADMIN@PC205 |
e068cd82f6064c574a6c05e7659abdea7981f29a | 95aad3122468ebb9ecb3dbb98735660422594b41 | /TeamAntitarraJAVA/Pong/src/MainMenu.java | bf379400b3fac18c00bad22159d5c58adf4032ea | [] | no_license | borko9696/SoftwareUniversity | 1885af0f2d78fa72853c184b3ae5a20badd3160a | 3ab58527d579702185902f44acfff128dfb2334b | refs/heads/master | 2020-12-13T06:09:42.830607 | 2016-11-09T18:22:45 | 2016-11-09T18:22:45 | 46,283,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,983 | java | import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.*;
public class MainMenu extends JFrame {
private static final long serialVersionUID = 1L;
int screenWidth = 300;
int screenHeight = 170;
int buttonWidth = 180;
int buttonHeight = 40;
JButton vsComputer, vsPlayer, Quit;
// JCheckBox twoPlayers;
public MainMenu() {
BufferedImage myImage = null;
try {
myImage = ImageIO.read(new File("background.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
setContentPane(new ImagePanel(myImage));
addButtons();
addActions();
getContentPane().setLayout(null);
//button positioning
vsComputer.setBounds((screenWidth - buttonWidth) / 2, 5, buttonWidth,
buttonHeight);
vsPlayer.setBounds((screenWidth - buttonWidth) / 2, 50, buttonWidth,
buttonHeight);
Quit.setBounds((screenWidth - (buttonWidth-90)) / 2, 95, buttonWidth-90,
buttonHeight);
getContentPane().add(vsComputer);
getContentPane().add(vsPlayer);
getContentPane().add(Quit);
pack();
setVisible(true);
setLocationRelativeTo(null);
setSize(screenWidth, screenHeight);
setTitle("Pong Menu");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
}
private void addButtons() {
vsComputer = new JButton("Player vs Computer");
vsPlayer = new JButton("Player vs Player");
Quit = new JButton("Quit");
}
private void addActions() {
vsComputer.addActionListener(new ActionListener() { // Take vsComputer button, add
// new actionListener
public void actionPerformed(ActionEvent e) {
dispose();
Game game = new Game();
game.start();
}
}); // vsComputer button
vsPlayer.addActionListener(new ActionListener() { // Take vsPlayer button, add
// new actionListener
public void actionPerformed(ActionEvent e) {
dispose();
Game game = new Game();
game.ai.isTwoPlayer=true;
game.start();
}
}); // vsPlayer button
Quit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0); // Game shutdown
}
}); // Quit button
}
}
class ImagePanel extends JComponent {
private Image image;
public ImagePanel(Image image){
this.image = image;
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(image, 0, 0, null);
}
} | [
"borko9696@abv.bg"
] | borko9696@abv.bg |
cadacdc28690cae74a1e517e539d19d072a30b99 | fd2c6d6e11362a3db547439dcb693ac8624b4da3 | /src/main/java/com/swking/controller/TemplateController.java | 10f38bd7fffb14364b2e1f9c26107ac81223fef4 | [] | no_license | Swkings/blog_community_server | 4111a408f01492a6233eb68d25fd9bd732d4b40f | 72bae94b05a640ca66152c8c96838f01ae361e4c | refs/heads/main | 2023-07-14T12:07:36.770826 | 2021-08-26T12:26:49 | 2021-08-26T12:26:49 | 384,866,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,954 | java | package com.swking.controller;
import com.swking.service.UserService;
import com.swking.type.ResultCodeEnum;
import com.swking.type.ReturnData;
import com.swking.util.GlobalConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @Author: Swking
* @email : 1114006175@qq.com
* @Date : 2021/07/16
* @File : TemplateController
* @Desc : 请求返回模板需要用@Controller,Vue前端返回json,用@RestController,用该类将此分离
**/
@Controller
@Api(tags = "Template API")
public class TemplateController implements GlobalConstant {
@Autowired
private UserService userService;
@Value("${blogCommunity.client.domain}")
private String clientDomain;
// http://localhost:8080/api/activation/101/code
@RequestMapping(path = "/activation/{userId}/{code}", method = RequestMethod.GET)
@ApiOperation(value = "激活账号", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "path", required = true),
@ApiImplicitParam(name = "code", value = "激活码", paramType = "path", required = true)
})
public String activation(
Model model,
@PathVariable("userId") int userId,
@PathVariable("code") String code,
HttpServletRequest request, HttpServletResponse response) {
ReturnData resData;
int result = userService.activation(userId, code);
if (result == ACTIVATION_SUCCESS) {
resData = ReturnData.success().message("激活成功");
} else if (result == ACTIVATION_REPEAT) {
resData = ReturnData.error(ResultCodeEnum.ERROR_REPEAT_ACTIVATE_USER);
} else {
resData = ReturnData.error(ResultCodeEnum.ERROR_ACTIVATE_CODE);
}
model.addAttribute("url", clientDomain+"/login");
model.addAttribute("resData", resData);
return "/transfer/activation-result";
}
@GetMapping(path = "/error")
@ApiOperation(value = "错误页", httpMethod = "GET")
public String getErrorPage() {
return "/error/500";
}
@GetMapping(path = "/denied")
@ApiOperation(value = "错误页", httpMethod = "GET")
public String getDeniedPage() {
return "/error/404";
}
}
| [
"1114006175@qq.com"
] | 1114006175@qq.com |
a4b01fa49f10de17fa40ede24b4efd0a21be3fa8 | b1bd14dbc1c14396ae63185e7656f63c8e518410 | /demo-commons/src/main/java/com/ltchen/demo/commons/cli/AntExample.java | 04f3109dd666f1dc3ea03134e8c2db19c9ade481 | [] | no_license | loupipalien/demo | 58295c7ab1f71fdcbfc500bcbde47f503a2d512d | d3aeaa7aece932c2e33d7df0aa6af2c2530308a0 | refs/heads/master | 2020-12-30T12:56:05.034812 | 2019-02-16T07:59:42 | 2019-02-16T07:59:42 | 91,374,862 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,869 | java | package com.ltchen.demo.commons.cli;
import org.apache.commons.cli.*;
/**
* @author: ltchen
* @date: 2018/1/31
*/
public class AntExample {
public static void main(String[] args) {
AntExample example = new AntExample();
// 定义解析器
CommandLineParser parser = new DefaultParser();
try {
example.usage(example.defineStage());
// 解析命令行
CommandLine line = parser.parse(example.defineStage(), args);
}
catch( ParseException exp ) {
System.err.println( "Parsing failed. Reason: " + exp.getMessage() );
}
}
public Options defineStage() {
// 布尔选项
Option help = new Option( "help", "print this message" );
Option projecthelp = new Option( "projecthelp", "print project help information" );
Option version = new Option( "version", "print the version information and exit" );
Option quiet = new Option( "quiet", "be extra quiet" );
Option verbose = new Option( "verbose", "be extra verbose" );
Option debug = new Option( "debug", "print debugging information" );
Option emacs = new Option( "emacs", "produce logging information without adornments" );
// 参数选项
Option logfile = Option.builder("logfile").argName("file").hasArg().desc("use given file for log").build();
Option logger = Option.builder("logger").argName("classname").hasArg().desc("the class which it to perform logging").build();
Option listener = Option.builder("listener").argName("classname").hasArg().desc("add an instance of class as a project listener").build();
Option buildfile = Option.builder("buildfile").argName("file").hasArg().desc("use given buildfile").build();
Option find = Option.builder("find").argName("file").hasArg().desc("search for buildfile towards the root of the filesystem and use it").build();
// property 选项
Option property = Option.builder("D").argName("property=value").numberOfArgs(2).desc("use value for given property").build();
// 选项
Options options = new Options();
options.addOption( help );
options.addOption( projecthelp );
options.addOption( version );
options.addOption( quiet );
options.addOption( verbose );
options.addOption( debug );
options.addOption( emacs );
options.addOption( logfile );
options.addOption( logger );
options.addOption( listener );
options.addOption( buildfile );
options.addOption( find );
options.addOption( property );
return options;
}
public void usage(Options options) {
HelpFormatter formatter = new HelpFormatter();
String syntax = "ant";
formatter.printHelp( syntax, options);
}
}
| [
"loupipalien@gmail.com"
] | loupipalien@gmail.com |
1a50caf26e6b2d438e38db7dde59414ea6d26340 | 1e00d2cbe7ac6cc296242283be2ee5dc0e08733d | /src/main/java/com/common/trycatch/TryDemo.java | 01da63d5896d0df3a52e69d7bfb6f9a988affb33 | [] | no_license | chuckma/MyJavaWebProject | 6b7852750c1c8decfa16b077716ba8b3b432ab2d | f6262716ffa76c237fad006e8677839cb9493f77 | refs/heads/master | 2023-01-05T06:45:55.377745 | 2020-04-08T03:19:17 | 2020-04-08T03:19:17 | 102,749,242 | 1 | 0 | null | 2022-12-16T03:46:23 | 2017-09-07T14:46:58 | Java | UTF-8 | Java | false | false | 462 | java | package com.common.trycatch;
/**
* @author Administrator
*/
public class TryDemo {
public static void main(String[] args) {
System.out.println(action());
}
private static String action() {
try{
System.out.println(1/1);
return "try";
}catch (Exception e){
e.printStackTrace();
return "catch";
}finally {
System.out.println("finally");
}
}
}
| [
"robbincen@163.com"
] | robbincen@163.com |
06c878fd55f6ba92b67b8a1298a5c21061ca6153 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/19/org/apache/commons/lang3/StringUtils_trimToEmpty_332.java | b6df4c6ba5807d7d528ad039a612f70ba42bb3ae | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 8,835 | java |
org apach common lang3
oper link java lang string
code safe
empti isempti blank isblank
check string text
trim strip
remov lead trail whitespac
equal
compar string safe
start startswith
check string start prefix safe
end endswith
check string end suffix safe
index indexof index lastindexof
safe index check
index indexofani index lastindexofani index indexofanybut index lastindexofanybut
index set string
containsonli containsnon containsani
string charact
substr left mid
safe substr extract
substr substringbefor substr substringaft substr substringbetween
substr extract rel string
split join
split string arrai substr vice versa
remov delet
remov part string
replac overlai
search string replac string
chomp chop
remov part string
left pad leftpad pad rightpad center repeat
pad string
upper case uppercas lower case lowercas swap case swapcas capit uncapit
string
count match countmatch
count number occurr string
alpha isalpha numer isnumer whitespac iswhitespac ascii printabl isasciiprint
check charact string
default string defaultstr
protect input string
revers revers delimit reversedelimit
revers string
abbrevi
abbrevi string ellipsi
differ
compar string report differ
levenstein distanc levensteindist
number need chang string
code string util stringutil defin word relat
string handl
code
empti length string code
space space charact code
whitespac charact defin link charact whitespac iswhitespac
trim charact link string trim
code string util stringutil handl code input string quietli
code input code
code code return
detail vari method
side effect code handl
code null pointer except nullpointerexcept consid bug
code string util stringutil
method give sampl code explain oper
symbol code input includ code
thread safe threadsaf
java lang string
version
string util stringutil
remov control charact
end string return empti string string
empti trim code
string trim link string trim
trim remov start end charact
strip whitespac link strip empti striptoempti string
pre
string util stringutil trim empti trimtoempti
string util stringutil trim empti trimtoempti
string util stringutil trim empti trimtoempti
string util stringutil trim empti trimtoempti abc abc
string util stringutil trim empti trimtoempti abc abc
pre
param str string trim
trim string empti string code input
string trim empti trimtoempti string str
str empti str trim
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
ad1b03a606683414004bde4594195f290358e09b | daf4fd847c89270a6540cd6c5cc38b303837e92d | /app/src/androidTest/java/com/netforceinfotech/tripsplit/ApplicationTest.java | 66804ef4fd5b8660c08461eee4d8bb77ae4521de | [] | no_license | kunsangnetforce/TripSplit | 1e749a368e3e9c4615dc222932831655351f625e | 8acc5b3d1e9bdc8637983409a65268961b505321 | refs/heads/master | 2021-01-11T17:27:30.054966 | 2017-01-27T14:07:30 | 2017-01-27T14:07:30 | 65,287,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.netforceinfotech.tripsplit;
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);
}
} | [
"kunsang@netforce.co"
] | kunsang@netforce.co |
eaa9b31b82620b978322ca510bf7a2ee5274ec40 | c4a6aa9551d524f33455641fe912c67c0bfed6ad | /LoginWithSocial/app/src/main/java/org/simpumind/com/loginwithsocial/PDetails.java | 0e2bf2e29e1b0db5eb46a6ca0f272dcb972f213d | [] | no_license | moderateepheezy/All-Project | 5cc2b88890bfed57f0857d8b427fba019a0eba6e | febdd22349ccf04bd9d470aa44fc15a1c017634d | refs/heads/master | 2021-01-10T06:06:49.459862 | 2016-03-18T16:01:55 | 2016-03-18T16:01:55 | 54,213,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package org.simpumind.com.loginwithsocial;
/**
* Created by simpumind on 2/4/16.
*/
public class PDetails {
public String userName;
public String userEmail;
public String userPhoto;
public String userGender;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserEmail() {
return userEmail;
}
public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
}
public String getUserPhoto() {
return userPhoto;
}
public void setUserPhoto(String userPhoto) {
this.userPhoto = userPhoto;
}
public String getUserGender() {
return userGender;
}
public void setUserGender(String userGender) {
this.userGender = userGender;
}
}
| [
"moderateepheezy@gmail.com"
] | moderateepheezy@gmail.com |
390a783427ec61a4d0fc541e0e297d543aa71ae9 | fb84fd76e346155dbe03c722215c50dd860d4d55 | /test/CalculatorTest.java | ca0e55ea85120b997305916e58faa908b5af2413 | [] | no_license | tlcowling/java-katas | 48e3af78e8741ef0b8a31e013b453d6a1f7e64af | 28b7818da407973ac40829f709c1ec678bd3abf4 | refs/heads/master | 2016-09-16T10:57:48.348959 | 2012-06-14T23:22:52 | 2012-06-14T23:22:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,379 | java | import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class CalculatorTest {
@Test
public void shouldReturnZeroOnEmptyString(){
assertThat(new Calculator().add(""),is(0));
}
@Test
public void shouldReturnZeroOnNullStringAdd(){
assertThat(new Calculator().add(null),is(0));
}
@Test
public void shouldReturnOneOnStringOne(){
assertThat(new Calculator().add("1"),is(1));
}
@Test
public void shouldReturnSumOfTwoNumbersSeparatedByComma(){
assertThat(new Calculator().add("1,2"),is(3));
}
@Test
public void shouldReturnSumOfnNumbersSeparatedByCommas(){
assertThat(new Calculator().add("1,2,3"),is(6));
assertThat(new Calculator().add("1,2,3,4"),is(10));
assertThat(new Calculator().add("1,2,3,4,5"),is(15));
assertThat(new Calculator().add("1,5,6,3,7,8"),is(30));
}
@Test
public void shouldReturnSumOfNumbersSeparatedByNewLine(){
assertThat(new Calculator().add("1\n2,4"),is(7));
}
@Test
public void shouldNotSuccessfullyAddDodgyCombo(){
assertThat(new Calculator().add("1,\n2,4"),is(7));
}
@Test
public void shouldReturnSumOfNumbersSeparatedByNewDelimiter(){
assertThat(new Calculator().add("//;\n1;2"),is(3));
}
}
| [
"tom.cowling@gmail.com"
] | tom.cowling@gmail.com |
1732947df5d6cc746595fc21fa9314ebf852e793 | 88d987f12088a9b094d622c6a323dea846150b77 | /src/com/company/Docente.java | a1cd50ed4628230061a7319dffdc241942f893df | [] | no_license | BrigitteAlejandra19/InstitutoConPatronDisenoFactory | bf9b03e9883dbdbcaaeed92a925446c756749b6a | 50e1bc976b83377f858a124d0efb9bd878df6cc9 | refs/heads/master | 2023-06-15T09:47:04.366089 | 2021-07-11T20:06:08 | 2021-07-11T20:06:08 | 385,042,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 87 | java | package com.company;
public class Docente extends Empleado implements IEmpleado{
}
| [
"brigittealejandra19@hotmail.com"
] | brigittealejandra19@hotmail.com |
e5286022785c7084cd14ca8b819798396ce24ed2 | c0da93335d633c854e58b12223b3738c9baf95e7 | /bbcdaas_common/bbcdaas_common/src/main/java/de/bbcdaas/common/beans/document/Document.java | 5d8474b4b66f6b70bb09e21658f5fbf16cab2da3 | [
"Apache-2.0"
] | permissive | osake/BBC-DaaS | c67034c66f558054e1c95c1b929d88a23a65c468 | 16d3a70ff689f125361686288fc3367a1e89fec3 | refs/heads/master | 2021-01-18T02:21:13.889634 | 2013-07-26T14:45:29 | 2013-07-26T14:45:29 | 53,438,169 | 0 | 0 | null | 2016-03-08T19:13:02 | 2016-03-08T19:13:01 | null | UTF-8 | Java | false | false | 8,995 | java | package de.bbcdaas.common.beans.document;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
/**
* Bean representing a set of data (could be an entity, a lucene document,
* a book, ... anything)
* @author Robert Illers
*/
public class Document implements Comparable<Document>, Serializable {
private final transient static Logger logger = Logger.getLogger(Document.class);
// document types
public static final int DOCUMENT_TYPE_UNDEFINED = 0;
public static final int DOCUMENT_TYPE_ARTICLE = 1;
public static final int DOCUMENT_TYPE_REDIRECT = 2;
public static final int DOCUMENT_TYPE_DISAMBIGUATION = 3;
// the identifier of the document, different documents have different ids
private String id;
// the name of the document representet by an URI
private String uri;
// a String representing this document, e.g. a term
private String surfaceForm;
// the scores of the document given by document scorer
private List<Float> scores = new ArrayList<Float>();
// combined scores calculated from scoring combiners
private List<Float> combinedScores = new ArrayList<Float>();
// document fields containing content data
private List<Field> fields = new ArrayList<Field>();
// list of surfaceForms that are also in the documents title or in the documents keywords
// Example: Input surfaceForms: "Programmierung", "Java"
// Title: "Programmierung in Java", current surfaceForm: "Programmierung"
// multimatching surfaceForm: "Java"
private List<String> multimatchingSurfaceForms = new ArrayList<String>();
// stores how many keywords of the keywords of all documents from another termValue
// match with the keywords of this document (surfaceForm, <documentID, keywordMatchCount>)
private Map<String, Map<Integer, Integer>> termDocsKeywordMatches = new HashMap<String, Map<Integer, Integer>>();
// document type
private Integer type = DOCUMENT_TYPE_UNDEFINED;
// document candidate ratings
private Map<Class, Float> candidateRatings = new LinkedHashMap<Class, Float>();
private Boolean inserted = false;
/**
* Constructor that creates a document with an undefined id
*/
public Document() {
this.id = "undefined";
}
/**
* Constructor
* @param id
*/
public Document(int id) {
this.id = Integer.toString(id);
}
/**
* Constructor
* @param id
*/
public Document(String id) {
this.id = id;
}
/**
* Sets ratings for the document that indicates if the document is a good
* candidate, this values are set by document candidate finders
* @return
*/
public Map<Class, Float> getCandidateRatings() {
return candidateRatings;
}
/**
*
* @param candidateFinderClass
* @return
*/
public Float getCandidateRating(Class candidateFinderClass) {
return candidateRatings.get(candidateFinderClass);
}
/**
*
* @param candidateRatings
*/
public void addCandidateRating(Class candidateFinderClass, float candidateRating) {
this.candidateRatings.put(candidateFinderClass, candidateRating);
}
/**
*
* @param newCandidateRatings
*/
public void addCandidateRatings(Map<Class, Float> newCandidateRatings) {
this.candidateRatings.putAll(candidateRatings);
}
/**
* Returns the id of the document as int
* @return id
*/
public int getID() {
try {
return Integer.parseInt(this.id);
} catch(NumberFormatException e) {
logger.error(e.getMessage());
return 0;
}
}
/**
* Returns the id of the document as String
* @return id
*/
public String getIDString() {
return this.id;
}
/**
* Adds a new field containing data
* @param name
* @param value
* @param store
* @param analyze
* @param termVectors
*/
public void addField(String name, String value, boolean store,
boolean analyze, boolean termVectors) {
Field field = new Field(name, store, analyze, termVectors);
field.setValue(value);
Field existingField = this.getFieldByName(name);
if (existingField != null) {
this.fields.remove(existingField);
}
this.fields.add(field);
}
/**
* Adds a new field containing data
* @param name
* @param values
* @param store
* @param analyze
* @param termVectors
*/
public void addField(String name, List<String> values, boolean store,
boolean analyze, boolean termVectors) {
Field field = new Field(name, store, analyze, termVectors);
field.setValues(values);
Field existingField = this.getFieldByName(name);
if (existingField != null) {
this.fields.remove(existingField);
}
this.fields.add(field);
}
/**
* Returns all document fields
* @return fields
*/
public List<Field> getFields() {
return this.fields;
}
/**
*
* @param name
* @return field
*/
public Field getFieldByName(String name) {
for (Field field : fields) {
if (field.getName().equals(name)) {
return field;
}
}
return null;
}
/**
* The documents scores.
* @return scores
*/
public List<Float> getScores() {
return scores;
}
/**
* Adds a score to the list of document scores
* @param score
*/
public void addScore(Float score) {
this.scores.add(score);
}
/**
* If two documents are compared, te one with the highest total score will
* be rated as bigger.
* @param o another document to compare to
* @return 0 if total scores are equal, -1 if score of this object is higher
* and 1 otherwhise.
*/
@Override
public int compareTo(Document o) {
if (o.getCombinedScore() == this.getCombinedScore()) {
return 0;
}
if (o.getCombinedScore() < this.getCombinedScore()) {
return -1;
} else {
return 1;
}
}
/**
* Compares the document by an other document, they are different if they
* have different ids
* @param obj
* @return true if documents are equal
*/
@Override
public boolean equals(Object obj) {
if (obj.getClass() == Document.class) {
return this.id.equals(((Document)obj).id);
}
return false;
}
/**
* Returns the documents hashCode based on the hashCode of the documents id
* @return hashCode
*/
@Override
public int hashCode() {
if (this.id != null) {
return this.id.hashCode();
}
return 0;
}
/**
*
* @return
*/
public List<String> getMultimatchingSurfaceForms() {
return multimatchingSurfaceForms;
}
/**
*
* @param multimatchingSurfaceForm
*/
public void addMultimatchingSurfaceForm(String multimatchingSurfaceForm) {
this.multimatchingSurfaceForms.add(multimatchingSurfaceForm);
}
/**
*
*/
public void clearMultimatchingSurfaceForms() {
this.multimatchingSurfaceForms.clear();
}
/**
*
* @return
*/
public String getSurfaceForm() {
return surfaceForm;
}
/**
*
* @param surfaceForm
*/
public void setSurfaceForm(String surfaceForm) {
this.surfaceForm = surfaceForm;
}
/**
*
* @return
*/
public int getType() {
return type;
}
/**
*
* @param type
*/
public void setType(Integer type) {
this.type = type;
}
/**
*
* @return
*/
public Map<String, Map<Integer, Integer>> getTermDocsKeywordMatches() {
return termDocsKeywordMatches;
}
/**
*
* @param termValue
* @param docID
* @param numberOfMatchingKeywords
*/
public void addTermDocsKeywordMatch(String termValue, Integer docID, Integer numberOfMatchingKeywords) {
if (!this.termDocsKeywordMatches.containsKey(termValue)) {
this.termDocsKeywordMatches.put(termValue, new HashMap<Integer, Integer>());
}
this.termDocsKeywordMatches.get(termValue).put(docID, numberOfMatchingKeywords);
}
/**
*
*/
public void clearTermDocsKeywordMatches() {
this.termDocsKeywordMatches.clear();
}
/**
*
* @return
*/
public Float getCombinedScore() {
if (combinedScores.isEmpty()) {
return 0.0f;
}
return combinedScores.get(0);
}
/**
*
* @param combinedScore
*/
public void addCombinedScore(Float combinedScore) {
this.combinedScores.add(combinedScore);
}
/**
*
* @return
*/
public List<Float> getCombinedScores() {
return this.combinedScores;
}
/**
*
* @return
*/
public String getUri() {
return uri;
}
/**
*
* @param uri
*/
public void setUri(String uri) {
this.uri = uri;
}
public Boolean getInserted() {
return inserted;
}
public void setInserted(Boolean inserted) {
this.inserted = inserted;
}
} | [
"info@christianherta.de"
] | info@christianherta.de |
0473fabc8c78865e9d310f87a9d85d50e533fbe2 | 049dae8498403c9afe455cfb5c32b133a6fc3d5f | /app/src/main/java/com/bang/bookshare/activity/BookInfoActivity.java | 0c55acadefba2c4d548ca2289f0ba40ce0ea733a | [] | no_license | chenliguan/BookShare | 62a2e83a1d2917775a5e43a53259d90eaafafefe | ccdfa7e310ec8fbd0dcc6040d924c3f350cf0427 | refs/heads/master | 2021-01-10T13:35:03.083106 | 2016-02-05T16:50:59 | 2016-02-05T16:50:59 | 50,761,628 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,699 | java | package com.bang.bookshare.activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.bang.bookshare.R;
import com.bang.bookshare.entity.Book;
import com.bang.bookshare.entity.User;
import com.bang.bookshare.utils.ActivityStack;
import com.bang.bookshare.utils.EnumDataChange;
import com.bang.bookshare.utils.HttpPathUtil;
import com.bang.bookshare.utils.LogUtil;
import com.bang.bookshare.view.CircleImageView;
import com.bang.bookshare.volley.VolleyHandler;
import com.bang.bookshare.volley.VolleyHttpRequest;
import java.util.HashMap;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
/**
* 图书详情页面
*
* @author Bang
* @file com.bang.bookshare.activity
* @date 2016/1/31
* @Version 1.0
*/
public class BookInfoActivity extends FrameActivity {
@InjectView(R.id.civ_head_afd)
CircleImageView civHeadAfd;
@InjectView(R.id.tv_book_name)
TextView tvBookName;
@InjectView(R.id.tv_user_name)
TextView tvUserName;
@InjectView(R.id.tv_profile)
TextView tvProfile;
@InjectView(R.id.tv_author)
TextView tvAuthor;
@InjectView(R.id.tv_is_borrowed)
TextView tvIsBorrowed;
@InjectView(R.id.tv_book_collections)
TextView tvBookCollections;
@InjectView(R.id.tv_phone)
TextView tvPhone;
@InjectView(R.id.tv_address)
TextView tvAddress;
@InjectView(R.id.tv_title)
TextView tvTitle;
private Book.EcListEntity ecListEntity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_book_info);
ButterKnife.inject(this);
ActivityStack.getInstance().addActivity(this);
/**
* 初始化变量
*/
initVariable();
/**
* 绑定/设置数据操作
*/
bindData();
}
/**
* 初始化变量
*/
private void initVariable() {
tvTitle.setText(getString(R.string.book_detail));
// 暂时以此图片代替
civHeadAfd.setImageUrl(getString(R.string.book), R.mipmap.ic_head, R.mipmap.ic_head);
// 获取传来的book
Intent intent = this.getIntent();
ecListEntity = (Book.EcListEntity) intent.getSerializableExtra("ecListEntity");
tvUserName.setText(ecListEntity.getUserName());
tvIsBorrowed.setText(ecListEntity.getIsBorrowed());
tvBookName.setText(ecListEntity.getBookName());
tvAuthor.setText(ecListEntity.getBookAuthor());
tvBookCollections.setText(ecListEntity.getBookCollections());
tvProfile.setText(ecListEntity.getBookProfile());
tvPhone.setText(String.valueOf(ecListEntity.getUserId()));
}
/**
* 绑定/设置数据操作
*/
public void bindData() {
// 请求获取用户信息
getUserIfo();
}
/**
* 监听实现
*/
@OnClick({R.id.iv_back, R.id.rlyt_phone, R.id.btn_chat})
public void onClick(View view) {
switch (view.getId()) {
case R.id.iv_back:
finish();
break;
case R.id.rlyt_phone:
// 用户拨打书主电话
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tvPhone.getText()));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
case R.id.btn_chat:
Intent intent2 = new Intent(this, ChatActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("relatedUserId",ecListEntity.getUserId());
intent2.putExtras(bundle);
startActivity(intent2);
LogUtil.showLog("ecListEntity.getUserId():" + ecListEntity.getUserId());
break;
default:
break;
}
}
/**
* 请求获取用户信息
*/
private void getUserIfo() {
VolleyHandler<String> volleyRequest = new VolleyHandler<String>() {
@Override
public void reqSuccess(String response) {
if (response == null) {
showMsg(getString(R.string.msg_loading_error));
} else {
// 解析数据
User user = User.praseJson(response);
// 请求业务判断
if (user.isSuccess()) {
User.EcListEntity entity = user.ecList.get(0);
// 英文转换陈中文
String userSchool = null;
if (entity.getUserSchool() != null) {
userSchool = EnumDataChange.EN_CH(entity.getUserSchool());
}
// 设置页面当前的值
String address = userSchool + entity.getClasses() + entity.getAdress();
tvAddress.setText(address);
} else {
showMsg(user.getMessage());
}
}
}
@Override
public void reqError(String error) {
showMsg(getString(R.string.msg_con_server_error));
}
};
// Post请求键值对
HashMap<String, String> params = new HashMap<>();
params.put("userId", String.valueOf(ecListEntity.getUserId()));
VolleyHttpRequest.String_request(HttpPathUtil.getUserIfo(), params, volleyRequest);
}
}
| [
"1130314814@qq.com"
] | 1130314814@qq.com |
28e38248c6243c6f043275478a00d343231d5d70 | 7da37b3675e78e8f9dd25a74a5232793bc895c75 | /src/observer2/ISubject.java | e7d41e0558ea8d262f49f4ab1a9af15762e0f3f7 | [] | no_license | javiercc/Java-Design-Patterns | c67f75b76f6637405c7e62da32d5113f3aa8e6d8 | 5ad55ad62ae4cab1f246ea2253bdce7c943099bc | refs/heads/master | 2021-01-10T08:55:40.547710 | 2016-03-23T18:47:46 | 2016-03-23T18:47:46 | 54,584,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package observer2;
interface ISubject {
void register(IObserver o);
void unregister(IObserver o);
void notifyObservers(int i);
} | [
"javialquiler40@gmail.com"
] | javialquiler40@gmail.com |
4bb5bc93357f51a64951c75cb7002dc996588268 | 8ccc121d9d3f19cf06b4b0257efaa46b4202a530 | /src/test/java/com/virtu/coding/ScoreTest.java | 60c0507fc4a8452aabe04435e1c628c882a9651f | [] | no_license | manoflogan/AsliArthikPractice | 7b87bb88420bfb59e1ed848427c48a85da7522b8 | 4e7122447e2f9ff6493d63198d88b50e2bc8245b | refs/heads/master | 2022-04-23T15:23:27.927837 | 2020-04-24T10:22:54 | 2020-04-24T10:22:54 | 258,473,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 807 | java | // Copyright 2020 ManOf Logan. All Rights Reserved.
package com.virtu.coding;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
*
*/
public class ScoreTest {
private Score score;
@BeforeMethod
public void setUp() {
score = new Score();
}
@AfterMethod
public void tearDown() {
score = null;
}
@Test
public void testSolution1() {
MatcherAssert.assertThat(score.solution(new int[] {1, 6, 3, 4, 3, 5}),
Matchers.is(new int[] {1, 4, 4, 4, 4, 5}));
}
@Test
public void testSolution2() {
MatcherAssert.assertThat(score.solution(new int[] {100, 50, 40, 30}),
Matchers.is(new int[] {100, 50, 40, 30}));
}
}
| [
"manoflogan@gmail.com"
] | manoflogan@gmail.com |
d6c268546476451d0b0aa05ca5514bc9afa77307 | 4afd07ef50a824e5cda58a87cb61fad83c8096d8 | /src/main/java/netty01/TestServer.java | bbc911632f223e45c0871def7860420fdd8fca11 | [] | no_license | xiaohei55/nettyTest | 347b777b089faf258690a437f100e77d3e9d339c | 79087993c8ac7f60ff26ac366bcc7c140202cf90 | refs/heads/master | 2020-07-17T05:41:36.031419 | 2019-09-03T00:37:30 | 2019-09-03T00:37:30 | 205,958,347 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,089 | java | package netty01;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
/**
* @Author yufeng.lin@ucarinc.com
* @Date 2019年9月2日 0002 08:56:12
* @Version 1.0
* @Description 描述:
**/
public class TestServer {
public static void main(String ars []) throws InterruptedException {
EventLoopGroup boss = new NioEventLoopGroup();
EventLoopGroup worker = new NioEventLoopGroup();
try{
ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.group(boss,worker).channel(NioServerSocketChannel.class)
.childHandler(new TestServerInitlizer());
// 只要是8899 就处理
ChannelFuture channelFuture = bootstrap.bind(8899).sync();
channelFuture.channel().closeFuture().sync();
}finally {
boss.shutdownGracefully();
worker.shutdownGracefully();
}
}
}
| [
"yufeng.lin@ucarinc.com"
] | yufeng.lin@ucarinc.com |
6cc74947cdb321b9fbca9f6105a39273bebca171 | d9014bad4b01dc202747c7f55c3aa722976119ca | /src/main/java/com/jzfq/house/swagger/model/ResponseModel.java | fffe68a6469388e9e5dcd994b7470663dafc3af5 | [] | no_license | luseek/house | be0d73bc55f5170347e194efe8a8b33c5de2c19f | 2dae1c94931a2ce5b45be74b90d22872d4a4246c | refs/heads/master | 2023-03-20T03:52:05.892394 | 2018-09-14T00:31:56 | 2018-09-14T00:31:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,603 | java | package com.jzfq.house.swagger.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;
/**
* ResponseModel
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T15:43:37.058Z")
public class ResponseModel {
@JsonProperty("code")
private Integer code = null;
@JsonProperty("message")
private String message = null;
@JsonProperty("data")
private Object data = null;
public ResponseModel code(Integer code) {
this.code = code;
return this;
}
/**
* Get code
* @return code
**/
@ApiModelProperty(required = true, value = "")
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ResponseModel message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@ApiModelProperty(required = true, value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ResponseModel data(String data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
**/
@ApiModelProperty(value = "")
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ResponseModel responseModel = (ResponseModel) o;
return Objects.equals(this.code, responseModel.code) &&
Objects.equals(this.message, responseModel.message) &&
Objects.equals(this.data, responseModel.data);
}
@Override
public int hashCode() {
return Objects.hash(code, message, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ResponseModel {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"liuwei@juzifenqi.com"
] | liuwei@juzifenqi.com |
06b1d08b05f2148a93886b04067dc0756d5a7098 | 99c5ca9077110b7ff2b8918372a4f2813a8f7de4 | /Registration_BY_SpringBoot/src/main/java/com/main/service/BenificiaryService.java | b6f867e5310e24ae0b65ec83a9774fc8c36adf81 | [] | no_license | udhaya97/vishuone | 3779a979767701f1e8b2b5b2db0754287005edcd | 6330273b000f7f621da2cb52649425a1710bae9f | refs/heads/master | 2020-05-09T20:31:39.662835 | 2019-04-16T08:51:56 | 2019-04-16T08:51:56 | 181,410,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.main.service;
import java.util.List;
import com.main.model.Benificiary;
public interface BenificiaryService {
public Benificiary saveBenificiary(Benificiary benificiary);
public Benificiary getBenificiaryFortransfer(int regId);
public List<Benificiary> getListBenificiaryFortransfer(int regId);
}
| [
"SubhaM@LP-7VFQWQ1.HCLT.CORP.HCL.IN"
] | SubhaM@LP-7VFQWQ1.HCLT.CORP.HCL.IN |
635ca0290d12fa41e38ac01b11c820c3f4f7feec | 8f2eed41d5e49f9467b7a98528ec43cf7db7b2bd | /src/com/wtkj/rms/code/service/SoftwareServiceI.java | e6daa6a50617407cc096c360baa8d2db05f22f79 | [] | no_license | shengyusoft/CodeLocation | 045ffbb2f71fbc3059b87befc16597ac9d2d6c74 | 8a55baecc5e05600b38316c9390bc0168f95a768 | refs/heads/master | 2021-01-17T15:16:05.870404 | 2016-05-02T07:52:18 | 2016-05-02T07:52:18 | 34,651,356 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package com.wtkj.rms.code.service;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.wtkj.common.PageFilter;
import com.wtkj.rms.code.model.vo.SoftwareVo;
public interface SoftwareServiceI {
public List<SoftwareVo> dataGrid(SoftwareVo vo, PageFilter ph);
public Long count(SoftwareVo vo, PageFilter ph);
public SoftwareVo get(Long id);
public void add(SoftwareVo vo, HttpServletRequest request);
public void edit(SoftwareVo vo, HttpServletRequest request);
public void delete(Long id);
public void delete(String ids);
}
| [
"634488360@qq.com"
] | 634488360@qq.com |
ebfd3401988cfa94d1811b338fb61ad207eba62a | 8fbfee5b319e076cf54fdd1b1868c82db6dd5510 | /icaptor-service-rest/src/main/java/com/fiveware/model/infra/AgentInfra.java | f9052e8e055417e709d21afc7d9c30cd94a1ce64 | [] | no_license | mhtoyoda/bots | 0e06bd7de57adbf2036a4b60d9436526f1358223 | beadd183388c6c8dc8a7bb85ee7ec3b14d947621 | refs/heads/master | 2020-03-22T02:23:36.874230 | 2017-12-12T16:17:24 | 2017-12-12T16:17:24 | 139,367,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package com.fiveware.model.infra;
public class AgentInfra {
private Long mem;
private Long memfree;
public Long getMem() {
return mem;
}
public void setMem(Long mem) {
this.mem = mem;
}
public Long getMemfree() {
return memfree;
}
public void setMemfree(Long memfree) {
this.memfree = memfree;
}
}
| [
"valdisnei@MacBook-Pro-de-Valdisnei.local"
] | valdisnei@MacBook-Pro-de-Valdisnei.local |
4df47c0b023d1819a6bb027ac98786b24077780b | 3bbb5090ec51516f29316e380cfc07c25fb29b5e | /qa/evil-tests/src/test/java/org/elasticsearch/bootstrap/EvilJNANativesTests.java | 3f0709f1a301462427d21731b011ffbf895bea99 | [
"Apache-2.0"
] | permissive | strapdata/elassandra5-rc | 66bb349b62ea4c6ef38ff5cca1ce8cd99877c40b | 0a1d0066331e5347186f30aac1233f793f4fac24 | refs/heads/v5.5.0-strapdata | 2022-12-12T22:51:01.546176 | 2018-08-03T16:05:37 | 2018-08-08T14:25:20 | 96,863,176 | 0 | 0 | Apache-2.0 | 2022-12-08T00:37:34 | 2017-07-11T07:18:48 | Java | UTF-8 | Java | false | false | 3,415 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.bootstrap;
import org.apache.lucene.util.Constants;
import org.elasticsearch.common.io.PathUtils;
import org.elasticsearch.test.ESTestCase;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
public class EvilJNANativesTests extends ESTestCase {
public void testSetMaximumNumberOfThreads() throws IOException {
if (Constants.LINUX) {
final List<String> lines = Files.readAllLines(PathUtils.get("/proc/self/limits"));
if (!lines.isEmpty()) {
for (final String line : lines) {
if (line != null && line.startsWith("Max processes")) {
final String[] fields = line.split("\\s+");
final long limit =
"unlimited".equals(fields[2])
? JNACLibrary.RLIM_INFINITY
: Long.parseLong(fields[2]);
assertThat(JNANatives.MAX_NUMBER_OF_THREADS, equalTo(limit));
return;
}
}
}
fail("should have read max processes from /proc/self/limits");
} else {
assertThat(JNANatives.MAX_NUMBER_OF_THREADS, equalTo(-1L));
}
}
public void testSetMaxSizeVirtualMemory() throws IOException {
if (Constants.LINUX) {
final List<String> lines = Files.readAllLines(PathUtils.get("/proc/self/limits"));
if (!lines.isEmpty()) {
for (final String line : lines) {
if (line != null && line.startsWith("Max address space")) {
final String[] fields = line.split("\\s+");
final String limit = fields[3];
assertThat(
JNANatives.rlimitToString(JNANatives.MAX_SIZE_VIRTUAL_MEMORY),
equalTo(limit));
return;
}
}
}
fail("should have read max size virtual memory from /proc/self/limits");
} else if (Constants.MAC_OS_X) {
assertThat(
JNANatives.MAX_SIZE_VIRTUAL_MEMORY,
anyOf(equalTo(Long.MIN_VALUE), greaterThanOrEqualTo(0L)));
} else {
assertThat(JNANatives.MAX_SIZE_VIRTUAL_MEMORY, equalTo(Long.MIN_VALUE));
}
}
}
| [
"jason@tedor.me"
] | jason@tedor.me |
78b850e5db3ae01b1dcb13c40879ad4495712fce | 7aeec7446d3f802dd6268821e7980db1991c62b5 | /app/src/main/java/com/shenjing/dimension/dimension/base/crop/Crop.java | d40f46b054a2e600432351baa408f4ced47dd133 | [] | no_license | 15868827922/dimension | 0f6a4d8ec74131517ac06166a81a7b980c8683b9 | 0723ad05447c049d8a9910ff82efc665f98c07bb | refs/heads/master | 2020-03-24T00:18:52.789988 | 2018-08-10T08:20:28 | 2018-08-10T08:20:28 | 142,285,028 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,617 | java | package com.shenjing.dimension.dimension.base.crop;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Fragment;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
/**
* Builder for crop Intents and utils for handling result
*/
public class Crop {
public static final int REQUEST_CROP = 6709;
public static final int REQUEST_PICK = 9162;
public static final int RESULT_ERROR = 404;
interface Extra {
String ASPECT_X = "aspect_x";
String ASPECT_Y = "aspect_y";
String MAX_X = "max_x";
String MAX_Y = "max_y";
String AS_PNG = "as_png";
String ERROR = "error";
}
private Intent cropIntent;
/**
* Create a crop Intent builder with source and destination image Uris
*
* @param source Uri for image to crop
* @param destination Uri for saving the cropped image
*/
public static Crop of(Uri source, Uri destination) {
return new Crop(source, destination);
}
private Crop(Uri source, Uri destination) {
cropIntent = new Intent();
cropIntent.setData(source);
cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, destination);
}
/**
* Set fixed aspect ratio for crop area
*
* @param x Aspect X
* @param y Aspect Y
*/
public Crop withAspect(int x, int y) {
cropIntent.putExtra(Extra.ASPECT_X, x);
cropIntent.putExtra(Extra.ASPECT_Y, y);
return asSquare();
}
/**
* Crop area with fixed 1:1 aspect ratio
*/
public Crop asSquare() {
cropIntent.putExtra(Extra.ASPECT_X, 1);
cropIntent.putExtra(Extra.ASPECT_Y, 1);
return this;
}
/**
* Set maximum crop size
*
* @param width Max width
* @param height Max height
*/
public Crop withMaxSize(int width, int height) {
cropIntent.putExtra(Extra.MAX_X, width);
cropIntent.putExtra(Extra.MAX_Y, height);
return this;
}
/**
* Set whether to save the result as a PNG or not. Helpful to preserve alpha.
* @param asPng whether to save the result as a PNG or not
*/
public Crop asPng(boolean asPng) {
cropIntent.putExtra(Extra.AS_PNG, asPng);
return this;
}
/**
* Send the crop Intent from an Activity
*
* @param activity Activity to receive result
*/
public void start(Activity activity) {
start(activity, REQUEST_CROP);
}
/**
* Send the crop Intent from an Activity with a custom request code
*
* @param activity Activity to receive result
* @param requestCode requestCode for result
*/
public void start(Activity activity, int requestCode) {
activity.startActivityForResult(getIntent(activity), requestCode);
}
/**
* Send the crop Intent from a Fragment
*
* @param context Context
* @param fragment Fragment to receive result
*/
public void start(Context context, Fragment fragment) {
start(context, fragment, REQUEST_CROP);
}
/**
* Send the crop Intent from a support library Fragment
*
* @param context Context
* @param fragment Fragment to receive result
*/
public void start(Context context, android.support.v4.app.Fragment fragment) {
start(context, fragment, REQUEST_CROP);
}
/**
* Send the crop Intent with a custom request code
*
* @param context Context
* @param fragment Fragment to receive result
* @param requestCode requestCode for result
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void start(Context context, Fragment fragment, int requestCode) {
fragment.startActivityForResult(getIntent(context), requestCode);
}
/**
* Send the crop Intent with a custom request code
*
* @param context Context
* @param fragment Fragment to receive result
* @param requestCode requestCode for result
*/
public void start(Context context, android.support.v4.app.Fragment fragment, int requestCode) {
fragment.startActivityForResult(getIntent(context), requestCode);
}
/**
* Get Intent to start crop Activity
*
* @param context Context
* @return Intent for CropImageActivity
*/
public Intent getIntent(Context context) {
cropIntent.setClass(context, CropImageActivity.class);
return cropIntent;
}
/**
* Retrieve URI for cropped image, as set in the Intent builder
*
* @param result Output Image URI
*/
public static Uri getOutput(Intent result) {
return result.getParcelableExtra(MediaStore.EXTRA_OUTPUT);
}
/**
* Retrieve error that caused crop to fail
*
* @param result Result Intent
* @return Throwable handled in CropImageActivity
*/
public static Throwable getError(Intent result) {
return (Throwable) result.getSerializableExtra(Extra.ERROR);
}
/**
* Pick image from an Activity
*
* @param activity Activity to receive result
*/
public static void pickImage(Activity activity) {
pickImage(activity, REQUEST_PICK);
}
/**
* Pick image from a Fragment
*
* @param context Context
* @param fragment Fragment to receive result
*/
public static void pickImage(Context context, Fragment fragment) {
pickImage(context, fragment, REQUEST_PICK);
}
/**
* Pick image from a support library Fragment
*
* @param context Context
* @param fragment Fragment to receive result
*/
public static void pickImage(Context context, android.support.v4.app.Fragment fragment) {
pickImage(context, fragment, REQUEST_PICK);
}
/**
* Pick image from an Activity with a custom request code
*
* @param activity Activity to receive result
* @param requestCode requestCode for result
*/
public static void pickImage(Activity activity, int requestCode) {
try {
activity.startActivityForResult(getImagePicker(), requestCode);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
/**
* Pick image from a Fragment with a custom request code
*
* @param context Context
* @param fragment Fragment to receive result
* @param requestCode requestCode for result
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void pickImage(Context context, Fragment fragment, int requestCode) {
try {
fragment.startActivityForResult(getImagePicker(), requestCode);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
/**
* Pick image from a support library Fragment with a custom request code
*
* @param context Context
* @param fragment Fragment to receive result
* @param requestCode requestCode for result
*/
public static void pickImage(Context context, android.support.v4.app.Fragment fragment, int requestCode) {
try {
fragment.startActivityForResult(getImagePicker(), requestCode);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
private static Intent getImagePicker() {
return new Intent(Intent.ACTION_GET_CONTENT).setType("image/*");
}
}
| [
"411127028@qq.com"
] | 411127028@qq.com |
2a28909cc67f2f18c1aa0ba5bce743d79f6d9e5e | dcfc0402238118f7831498c062607e010eea2ea0 | /MCA/Sem 2/DCS/Client-server communication/UDP/UDPServer_2.java | 9b59ff0c5656459cd7ef6d2a89c7f6e89f84555c | [] | no_license | srv-code/College-Lab-Exercises | be3cf451b0a10fe5d74f3a5fa4f89aa379e1c90b | f3282fbf626d4a7b1395f10cbb6770c9e98732e6 | refs/heads/master | 2020-08-03T14:21:43.656150 | 2020-01-27T13:35:05 | 2020-01-27T13:35:05 | 211,783,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 956 | java | import java.net.DatagramSocket;
import java.net.DatagramPacket;
public class UDPServer {
/**
Server module: Sends length of message buffer
@param args[0] server port
*/
public static void main(String[] args) {
DatagramSocket socket = null;
try {
socket = new DatagramSocket(Integer.parseInt(args[0]));
System.out.println("[Server started]");
while(true) {
DatagramPacket rcvPack = new DatagramPacket(new byte[1024], 1024);
socket.receive(rcvPack);
DatagramPacket sndPack = new DatagramPacket( new byte[] { (byte)rcvPack.getLength() },
1,
rcvPack.getAddress(),
rcvPack.getPort());
socket.send(sndPack);
}
} catch(Exception e) {
System.err.println("Err while sending/receiving: " + e);
} finally {
try {
if(socket != null) {
socket.close();
}
} catch(Exception e) {
System.err.println("Err while closing socket: " + e);
}
}
}
} | [
"sourav.blackjack@gmail.com"
] | sourav.blackjack@gmail.com |
22e85991f3adb6108e8e3e23e6f944dd05aaa307 | a8ac29989b58f4a8dc68478cd60cc927bcba7899 | /src/main/java/io/remme/java/blockchaininfo/dto/transactions/Transaction.java | 2a9df7d1374e486dca06a684d52682233192fdea | [
"Apache-2.0"
] | permissive | Remmeauth/remme-client-java | 6b2513e3ee099a9af66d785ef77680ed301237cd | 207786915bc8fc28833093081d9a7f690592da9e | refs/heads/master | 2020-04-06T11:13:05.599324 | 2019-02-13T12:10:18 | 2019-02-13T12:10:18 | 157,408,408 | 2 | 0 | Apache-2.0 | 2019-02-13T12:10:19 | 2018-11-13T16:10:04 | Java | UTF-8 | Java | false | false | 213 | java | package io.remme.java.blockchaininfo.dto.transactions;
import io.remme.java.blockchaininfo.dto.responses.BaseResponse;
import lombok.Data;
@Data
public class Transaction extends BaseResponse<TransactionData> {
} | [
"marchello9307@gmail.com"
] | marchello9307@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.