blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
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
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
678fcf1d763ffdb19e22343564c33f44e7b39300
|
d1e13dbde481ebfce555145ce92b690eb7d194ff
|
/li_blog_xo/src/main/java/com/steel/li_blog_xo/vo/CommentVO.java
|
cd980bf221341c2f6077e9d9c170a33668a770a3
|
[] |
no_license
|
king-code0212/LiBlog
|
a9275ee6b20bd9a91ec7bb85538e85d4fcd5a6e3
|
cbb60c0ce771815adc62b856046a0b12ea863eba
|
refs/heads/master
| 2023-01-05T14:51:12.162233 | 2020-10-31T07:17:36 | 2020-10-31T07:17:36 | 303,974,222 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,263 |
java
|
package com.steel.li_blog_xo.vo;
import com.steel.li_blog_base.validator.annotion.IntegerNotNull;
import com.steel.li_blog_base.validator.annotion.NotBlank;
import com.steel.li_blog_base.validator.group.GetList;
import com.steel.li_blog_base.validator.group.GetOne;
import com.steel.li_blog_base.validator.group.Insert;
import com.steel.li_blog_base.vo.BaseVO;
import lombok.Data;
/**
* CommentVO
*
* @author: steel
* @create: 2020年1月11日16:15:52
*/
@Data
public class CommentVO extends BaseVO<CommentVO> {
/**
* 用户uid
*/
@NotBlank(groups = {Insert.class, GetOne.class})
private String userUid;
/**
* 回复某条评论的uid
*/
private String toUid;
/**
* 回复某个人的uid
*/
private String toUserUid;
/**
* 用户名
*/
private String userName;
/**
* 评论类型: 0: 评论 1: 点赞
*/
private Integer type;
/**
* 评论内容
*/
@NotBlank(groups = {Insert.class})
private String content;
/**
* 博客uid
*/
private String blogUid;
/**
* 评论来源: MESSAGE_BOARD,ABOUT,BLOG_INFO 等
*/
@NotBlank(groups = {Insert.class, GetList.class})
private String source;
}
|
[
"[email protected]"
] | |
13e3d9a5722185fa6f0e7340fe8da373c559e0d5
|
95b4bba011ab3b947ab9b227c25b5f7dc5dc8270
|
/src/Registration.java
|
3f1eb10976e5a2578f436a07cb3297315ae2854f
|
[] |
no_license
|
kevintdao/voting-system
|
29835a8d0532028fd1f52658928e24102289909f
|
2cf44863282074e5c7785359543644ddd4867e6e
|
refs/heads/master
| 2023-07-30T10:14:47.283826 | 2021-09-21T01:23:12 | 2021-09-21T01:23:12 | 372,707,667 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 12,745 |
java
|
import javax.swing.*;
import javax.swing.text.MaskFormatter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.ParseException;
/**
* Extends JPanel to create a GUI page for registering a new profile.
* Includes dark mode, language selection, password confirmation,
* unique username check, and empty field detection.
* @author Kevin Dao, Cole Garton, Timothy Evans
* @version 1.0.0, Dec 6 2020
* @see JPanel
*/
public class Registration extends JPanel {
private String[] firstNameLang = {"First Name: ", "Nombre de pila: ", "Prénom: "};
private String[] lastNameLang = {"Last Name: ", "Apellido: ", "Nom de famille: "};
private String[] userIDLang = {"Username: ", "Nombre de usuario: ","Nom d'utilisateur: "};
private String[] passLang = {"Password: ", "Contraseña: ", "Mot de passe: "};
private String[] confirmPassLang = {"Confirm Password: ", "Confirmar contraseña: ", "Confirmez le mot de passe: "};
private String[] countyLang = {"County: ", "Condado: ", "Comté:"};
private String[] stateLang = {"State: ", "Estado: ", "Etat: "};
private String[] birthdayLang = {"Date of Birth (MM/dd/yyyy): ", "Fecha de nacimiento (MM/dd/yyyy): ", "Date de naissance (MM/dd/yyyy): "};
private String[] signUpLang = {"Sign Up", "Regístrate", "S'inscrire"};
private String[] backLang = {"<- Back", "<- Regresa", "<- Retourner"};
private JLabel userIDLabel;
private JTextField userID;
private JLabel firstNameLabel;
private JTextField firstNameField;
private JLabel lastNameLabel;
private JTextField lastNameField;
private JLabel passLabel;
private JPasswordField passField;
private JLabel confirmPassLabel;
private JPasswordField confirmPassField;
private JLabel countyLabel;
private JTextField countyField;
private JLabel stateLabel;
private JTextField stateField;
private JLabel birthdayLabel;
private JFormattedTextField birthdayField;
private JButton backButton;
private JButton signUpButton;
private Double labelWeightX = 0.2;
private Double fieldWeightX = 0.8;
public Registration(){
setLayout(new GridBagLayout());
setName("Registration");
GridBagConstraints c = new GridBagConstraints();
GUIComponents.getDarkModeButton(3).addActionListener(e -> {
if(GUIComponents.getDarkMode()) {
GUIComponents.setDarkMode(false);
GUIComponents.changeMode(false);
}
else {
GUIComponents.setDarkMode(true);
GUIComponents.changeMode(true);
}
refreshPanel();
});
c.insets = new Insets(10,40,0,40); // padding
c.gridx = 0;
c.gridy = 0;
c.ipady = 10;
c.gridwidth = 1;
c.anchor = GridBagConstraints.PAGE_START;
c.weightx = 0.2;
add(GUIComponents.getDarkModeButton(3),c);
// language select component
GUIComponents.getLanguageComboBox(3).addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JComboBox comboBox = (JComboBox) e.getSource();
int selected = comboBox.getSelectedIndex();
GUIComponents.setLanguageIndex(selected);
// set all labels to be the current selected language
firstNameLabel.setText(firstNameLang[selected]);
lastNameLabel.setText(lastNameLang[selected]);
userIDLabel.setText(userIDLang[selected]);
passLabel.setText(passLang[selected]);
confirmPassLabel.setText(confirmPassLang[selected]);
countyLabel.setText(countyLang[selected]);
stateLabel.setText(stateLang[selected]);
birthdayLabel.setText(birthdayLang[selected]);
signUpButton.setText(signUpLang[selected]);
backButton.setText(backLang[selected]);
GUIComponents.changeLanguage();
GUIComponents.updateDarkModeButtonText();
refreshPanel();
}
});
c.gridx = 2; // third column
c.gridy = 0; // first row
c.weightx = 0.2;
c.ipady = 10;
c.insets = new Insets(5,20,0,20); // padding
c.anchor = GridBagConstraints.FIRST_LINE_END;
add(GUIComponents.getLanguageComboBox(3), c);
// first name components
firstNameLabel = new JLabel(firstNameLang[GUIComponents.getLanguageIndex()]);
c.anchor = GridBagConstraints.CENTER;
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 1;
c.ipady = 10;
c.weightx = labelWeightX;
add(firstNameLabel, c);
firstNameField = new JTextField();
c.gridx = 1;
c.gridy = 1;
c.gridwidth = 2;
c.ipady = 10;
c.weightx = fieldWeightX;
add(firstNameField, c);
// last name components
lastNameLabel = new JLabel(lastNameLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0;
c.gridy = 2;
c.ipady = 10;
c.weightx = labelWeightX;
add(lastNameLabel, c);
lastNameField = new JTextField();
c.gridx = 1;
c.gridy = 2;
c.gridwidth = 2;
c.ipady = 10;
c.weightx = fieldWeightX;
add(lastNameField, c);
// user ID components
userIDLabel = new JLabel(userIDLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0; // first column
c.gridy = 3; // second row
c.ipady = 10; // component's height
c.weightx = labelWeightX;
add(userIDLabel, c);
userID = new JTextField("");
c.gridx = 1; // second column
c.gridy = 3; // second row
c.gridwidth = 2; // takes 2 columns
c.ipady = 10; // component's height
c.weightx = fieldWeightX;
add(userID, c);
// password components
passLabel = new JLabel(passLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0;
c.gridy = 5;
c.gridwidth = 1;
c.weightx = labelWeightX;
add(passLabel, c);
passField = new JPasswordField();
c.gridx = 1;
c.gridy = 5;
c.gridwidth = 2;
c.weightx = fieldWeightX;
add(passField, c);
// confirm password components
confirmPassLabel = new JLabel(confirmPassLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0;
c.gridy = 6;
c.gridwidth = 1;
c.weightx = labelWeightX;
add(confirmPassLabel, c);
confirmPassField = new JPasswordField();
c.gridx = 1;
c.gridy = 6;
c.gridwidth = 2;
c.weightx = fieldWeightX;
add(confirmPassField, c);
// county components
countyLabel = new JLabel(countyLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0;
c.gridy = 7;
c.gridwidth = 1;
c.weightx = labelWeightX;
add(countyLabel, c);
countyField = new JTextField();
c.gridx = 1;
c.gridy = 7;
c.gridwidth = 2;
c.weightx = fieldWeightX;
add(countyField, c);
// state components
stateLabel = new JLabel(stateLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0;
c.gridy = 8;
c.gridwidth = 1;
c.weightx = labelWeightX;
add(stateLabel, c);
stateField = new JTextField();
c.gridx = 1;
c.gridy = 8;
c.gridwidth = 2;
c.weightx = fieldWeightX;
add(stateField, c);
// birthday components
birthdayLabel = new JLabel(birthdayLang[GUIComponents.getLanguageIndex()]);
c.gridx = 0;
c.gridy = 9;
c.gridwidth = 1;
c.weightx = labelWeightX;
add(birthdayLabel, c);
try {
MaskFormatter dateMask = new MaskFormatter("##/##/####");
birthdayField = new JFormattedTextField(dateMask);
} catch (ParseException e) {
e.printStackTrace();
}
c.gridx = 1;
c.gridy = 9;
c.gridwidth = 2;
c.weightx = fieldWeightX;
add(birthdayField, c);
// back button
backButton = new JButton(backLang[GUIComponents.getLanguageIndex()]);
backButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
clearAllInputs();
GUIComponents.getCardLayout().show(GUIComponents.getContentPanel(), "LANDING");
}
});
c.anchor = GridBagConstraints.LAST_LINE_START;
c.gridx = 0;
c.gridy = 10;
c.gridwidth = 1;
c.weightx = 0.2;
c.insets = new Insets(30,40,0,40); // padding
add(backButton, c);
// sign up button
signUpButton = new JButton(signUpLang[GUIComponents.getLanguageIndex()]);
c.anchor = GridBagConstraints.LAST_LINE_END;
c.gridx = 1;
c.gridy = 10;
c.gridwidth = 2;
c.weightx = 0.2;
c.insets = new Insets(30,40,0,40); // padding
add(signUpButton, c);
signUpButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// check if the password are the same
if(!passField.getText().equals(confirmPassField.getText())){
JOptionPane.showMessageDialog(GUIComponents.getContentPanel(), "Incorrect password confirmation","Incorrect Password!", JOptionPane.ERROR_MESSAGE);
passField.setText("");
confirmPassField.setText("");
return;
}
// check if username already existed in database
if(Database.checkUsername(userID.getText())){
JOptionPane.showMessageDialog(GUIComponents.getContentPanel(), "Please choose another username","Already existed username!", JOptionPane.ERROR_MESSAGE);
return;
}
// check if any field is empty
for(int i = 0; i < getComponentCount(); i++) {
if(getComponent(i) instanceof JTextField){
JTextField textfield = (JTextField) getComponent(i);
if(textfield.getText().length() == 0){
JOptionPane.showMessageDialog(GUIComponents.getContentPanel(), "Please fill out all of the fields","Empty field detected!", JOptionPane.ERROR_MESSAGE);
return;
}
}
}
// add the user to database
String username = userID.getText();
String password = passField.getText();
String first = firstNameField.getText();
String last = lastNameField.getText();
String dob = birthdayField.getText();
String county = countyField.getText();
String state = stateField.getText();
// add new user to database
Database.addNewUser(username, password, first, last, dob, county, state);
// set the current user to be username
Database.setCurrentUser(username);
// check for account type
if(username.contains("auditor:")){
GUIComponents.getCardLayout().show(GUIComponents.getContentPanel(), "AUDITOR");
}
else if(username.contains("media:")){
GUIComponents.getCardLayout().show(GUIComponents.getContentPanel(), "MEDIA");
}
else{
GUIComponents.getProgressBar().setString("NOT STARTED");
GUIComponents.getCardLayout().show(GUIComponents.getContentPanel(), "HOME");
}
clearAllInputs();
}
});
}
private void refreshPanel(){
revalidate();
repaint();
}
// clear the inputs from textfields in registration page
private void clearAllInputs(){
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for(int i = 0; i < getComponentCount(); i++) {
if(getComponent(i) instanceof JTextField){
JTextField textfield = (JTextField) getComponent(i);
textfield.setText("");
}
}
}
});
}
}
|
[
"[email protected]"
] | |
bcfda7f10f127d376941e6ea9b1ec332fcf3c7ee
|
0b0ede56879be665fac7e1587a13a29d8494bef0
|
/src/main/java/fr/laposte/xfiles/service/AuditEventService.java
|
2f8887df1d6595c814eb54e691b1a4f65bdf69e5
|
[] |
no_license
|
d3d3dlp/jhipster-xfiles
|
a41405add50cadc7fd3bda3c2adcff9afceebc55
|
2c50aa2f107e1a7b90951fb0bbe0ac74949d40d8
|
refs/heads/main
| 2023-02-15T00:12:06.880720 | 2021-01-06T10:12:44 | 2021-01-06T10:12:44 | 327,272,962 | 0 | 0 | null | 2021-01-06T10:51:46 | 2021-01-06T10:12:26 |
Java
|
UTF-8
|
Java
| false | false | 2,951 |
java
|
package fr.laposte.xfiles.service;
import fr.laposte.xfiles.config.audit.AuditEventConverter;
import fr.laposte.xfiles.repository.PersistenceAuditEventRepository;
import io.github.jhipster.config.JHipsterProperties;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service for managing audit events.
* <p>
* This is the default implementation to support SpringBoot Actuator {@code AuditEventRepository}.
*/
@Service
@Transactional
public class AuditEventService {
private final Logger log = LoggerFactory.getLogger(AuditEventService.class);
private final JHipsterProperties jHipsterProperties;
private final PersistenceAuditEventRepository persistenceAuditEventRepository;
private final AuditEventConverter auditEventConverter;
public AuditEventService(
PersistenceAuditEventRepository persistenceAuditEventRepository,
AuditEventConverter auditEventConverter,
JHipsterProperties jhipsterProperties
) {
this.persistenceAuditEventRepository = persistenceAuditEventRepository;
this.auditEventConverter = auditEventConverter;
this.jHipsterProperties = jhipsterProperties;
}
/**
* Old audit events should be automatically deleted after 30 days.
*
* This is scheduled to get fired at 12:00 (am).
*/
@Scheduled(cron = "0 0 12 * * ?")
public void removeOldAuditEvents() {
persistenceAuditEventRepository
.findByAuditEventDateBefore(Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod(), ChronoUnit.DAYS))
.forEach(
auditEvent -> {
log.debug("Deleting audit data {}", auditEvent);
persistenceAuditEventRepository.delete(auditEvent);
}
);
}
@Transactional(readOnly = true)
public Page<AuditEvent> findAll(Pageable pageable) {
return persistenceAuditEventRepository.findAll(pageable).map(auditEventConverter::convertToAuditEvent);
}
@Transactional(readOnly = true)
public Page<AuditEvent> findByDates(Instant fromDate, Instant toDate, Pageable pageable) {
return persistenceAuditEventRepository
.findAllByAuditEventDateBetween(fromDate, toDate, pageable)
.map(auditEventConverter::convertToAuditEvent);
}
@Transactional(readOnly = true)
public Optional<AuditEvent> find(Long id) {
return persistenceAuditEventRepository.findById(id).map(auditEventConverter::convertToAuditEvent);
}
}
|
[
"[email protected]"
] | |
c0c5cddfcfa394f80dd326096450e8771b369b33
|
3bdfc125654926e3c7e8a203592920bd7fbc54dc
|
/src/springbook/user/sqlservice/SqlUpdateFailureException.java
|
60de277c639a551ffbc57431f8fa36d06ab37c86
|
[] |
no_license
|
gragra0111/springEx
|
6a8762fb1baed16ff7ac0ad4b3ca5b938c674a37
|
94671e6e06f5289fc02377baa65c0fb61fd21b05
|
refs/heads/master
| 2021-01-10T10:51:51.256312 | 2016-02-24T07:09:26 | 2016-02-24T07:09:26 | 49,917,250 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 456 |
java
|
package springbook.user.sqlservice;
public class SqlUpdateFailureException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = -4342169287798238330L;
public SqlUpdateFailureException(String message) {
super(message);
}
public SqlUpdateFailureException(String message, Throwable cause) {
super(message, cause);
}
public SqlUpdateFailureException(Throwable cause) {
super(cause);
}
}
|
[
"[email protected]"
] | |
6ec9b4842412ed85d5dade49c58136d1263fdebb
|
4fff4285330949b773e0b615484fb9c4562ff2cd
|
/vc-biz/vc-biz-pub-model/src/main/java/com/ccclubs/pub/orm/model/CsStateExample.java
|
acd6f7f1eba7f3fd06d0023c9c9ebddc5f0471aa
|
[
"Apache-2.0"
] |
permissive
|
soldiers1989/project-2
|
de21398f32f0e468e752381b99167223420728d5
|
dc670d7ba700887d951287ec7ff4a7db90ad9f8f
|
refs/heads/master
| 2020-03-29T08:48:58.549798 | 2018-07-24T03:28:08 | 2018-07-24T03:28:08 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 119,004 |
java
|
package com.ccclubs.pub.orm.model;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CsStateExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table cs_state
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table cs_state
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table cs_state
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public CsStateExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cs_state
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table cs_state
*
* @mbg.generated
*/
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));
}
public Criteria andCssIdIsNull() {
addCriterion("css_id is null");
return (Criteria) this;
}
public Criteria andCssIdIsNotNull() {
addCriterion("css_id is not null");
return (Criteria) this;
}
public Criteria andCssIdEqualTo(Integer value) {
addCriterion("css_id =", value, "cssId");
return (Criteria) this;
}
public Criteria andCssIdNotEqualTo(Integer value) {
addCriterion("css_id <>", value, "cssId");
return (Criteria) this;
}
public Criteria andCssIdGreaterThan(Integer value) {
addCriterion("css_id >", value, "cssId");
return (Criteria) this;
}
public Criteria andCssIdGreaterThanOrEqualTo(Integer value) {
addCriterion("css_id >=", value, "cssId");
return (Criteria) this;
}
public Criteria andCssIdLessThan(Integer value) {
addCriterion("css_id <", value, "cssId");
return (Criteria) this;
}
public Criteria andCssIdLessThanOrEqualTo(Integer value) {
addCriterion("css_id <=", value, "cssId");
return (Criteria) this;
}
public Criteria andCssIdIn(List<Integer> values) {
addCriterion("css_id in", values, "cssId");
return (Criteria) this;
}
public Criteria andCssIdNotIn(List<Integer> values) {
addCriterion("css_id not in", values, "cssId");
return (Criteria) this;
}
public Criteria andCssIdBetween(Integer value1, Integer value2) {
addCriterion("css_id between", value1, value2, "cssId");
return (Criteria) this;
}
public Criteria andCssIdNotBetween(Integer value1, Integer value2) {
addCriterion("css_id not between", value1, value2, "cssId");
return (Criteria) this;
}
public Criteria andCssAccessIsNull() {
addCriterion("css_access is null");
return (Criteria) this;
}
public Criteria andCssAccessIsNotNull() {
addCriterion("css_access is not null");
return (Criteria) this;
}
public Criteria andCssAccessEqualTo(Short value) {
addCriterion("css_access =", value, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessNotEqualTo(Short value) {
addCriterion("css_access <>", value, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessGreaterThan(Short value) {
addCriterion("css_access >", value, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessGreaterThanOrEqualTo(Short value) {
addCriterion("css_access >=", value, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessLessThan(Short value) {
addCriterion("css_access <", value, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessLessThanOrEqualTo(Short value) {
addCriterion("css_access <=", value, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessIn(List<Short> values) {
addCriterion("css_access in", values, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessNotIn(List<Short> values) {
addCriterion("css_access not in", values, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessBetween(Short value1, Short value2) {
addCriterion("css_access between", value1, value2, "cssAccess");
return (Criteria) this;
}
public Criteria andCssAccessNotBetween(Short value1, Short value2) {
addCriterion("css_access not between", value1, value2, "cssAccess");
return (Criteria) this;
}
public Criteria andCssHostIsNull() {
addCriterion("css_host is null");
return (Criteria) this;
}
public Criteria andCssHostIsNotNull() {
addCriterion("css_host is not null");
return (Criteria) this;
}
public Criteria andCssHostEqualTo(Short value) {
addCriterion("css_host =", value, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostNotEqualTo(Short value) {
addCriterion("css_host <>", value, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostGreaterThan(Short value) {
addCriterion("css_host >", value, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostGreaterThanOrEqualTo(Short value) {
addCriterion("css_host >=", value, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostLessThan(Short value) {
addCriterion("css_host <", value, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostLessThanOrEqualTo(Short value) {
addCriterion("css_host <=", value, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostIn(List<Short> values) {
addCriterion("css_host in", values, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostNotIn(List<Short> values) {
addCriterion("css_host not in", values, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostBetween(Short value1, Short value2) {
addCriterion("css_host between", value1, value2, "cssHost");
return (Criteria) this;
}
public Criteria andCssHostNotBetween(Short value1, Short value2) {
addCriterion("css_host not between", value1, value2, "cssHost");
return (Criteria) this;
}
public Criteria andCssNumberIsNull() {
addCriterion("css_number is null");
return (Criteria) this;
}
public Criteria andCssNumberIsNotNull() {
addCriterion("css_number is not null");
return (Criteria) this;
}
public Criteria andCssNumberEqualTo(String value) {
addCriterion("css_number =", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberNotEqualTo(String value) {
addCriterion("css_number <>", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberGreaterThan(String value) {
addCriterion("css_number >", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberGreaterThanOrEqualTo(String value) {
addCriterion("css_number >=", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberLessThan(String value) {
addCriterion("css_number <", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberLessThanOrEqualTo(String value) {
addCriterion("css_number <=", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberLike(String value) {
addCriterion("css_number like", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberNotLike(String value) {
addCriterion("css_number not like", value, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberIn(List<String> values) {
addCriterion("css_number in", values, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberNotIn(List<String> values) {
addCriterion("css_number not in", values, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberBetween(String value1, String value2) {
addCriterion("css_number between", value1, value2, "cssNumber");
return (Criteria) this;
}
public Criteria andCssNumberNotBetween(String value1, String value2) {
addCriterion("css_number not between", value1, value2, "cssNumber");
return (Criteria) this;
}
public Criteria andCssCarIsNull() {
addCriterion("css_car is null");
return (Criteria) this;
}
public Criteria andCssCarIsNotNull() {
addCriterion("css_car is not null");
return (Criteria) this;
}
public Criteria andCssCarEqualTo(Integer value) {
addCriterion("css_car =", value, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarNotEqualTo(Integer value) {
addCriterion("css_car <>", value, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarGreaterThan(Integer value) {
addCriterion("css_car >", value, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarGreaterThanOrEqualTo(Integer value) {
addCriterion("css_car >=", value, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarLessThan(Integer value) {
addCriterion("css_car <", value, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarLessThanOrEqualTo(Integer value) {
addCriterion("css_car <=", value, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarIn(List<Integer> values) {
addCriterion("css_car in", values, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarNotIn(List<Integer> values) {
addCriterion("css_car not in", values, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarBetween(Integer value1, Integer value2) {
addCriterion("css_car between", value1, value2, "cssCar");
return (Criteria) this;
}
public Criteria andCssCarNotBetween(Integer value1, Integer value2) {
addCriterion("css_car not between", value1, value2, "cssCar");
return (Criteria) this;
}
public Criteria andCssAddTimeIsNull() {
addCriterion("css_add_time is null");
return (Criteria) this;
}
public Criteria andCssAddTimeIsNotNull() {
addCriterion("css_add_time is not null");
return (Criteria) this;
}
public Criteria andCssAddTimeEqualTo(Date value) {
addCriterion("css_add_time =", value, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeNotEqualTo(Date value) {
addCriterion("css_add_time <>", value, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeGreaterThan(Date value) {
addCriterion("css_add_time >", value, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeGreaterThanOrEqualTo(Date value) {
addCriterion("css_add_time >=", value, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeLessThan(Date value) {
addCriterion("css_add_time <", value, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeLessThanOrEqualTo(Date value) {
addCriterion("css_add_time <=", value, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeIn(List<Date> values) {
addCriterion("css_add_time in", values, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeNotIn(List<Date> values) {
addCriterion("css_add_time not in", values, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeBetween(Date value1, Date value2) {
addCriterion("css_add_time between", value1, value2, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssAddTimeNotBetween(Date value1, Date value2) {
addCriterion("css_add_time not between", value1, value2, "cssAddTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeIsNull() {
addCriterion("css_current_time is null");
return (Criteria) this;
}
public Criteria andCssCurrentTimeIsNotNull() {
addCriterion("css_current_time is not null");
return (Criteria) this;
}
public Criteria andCssCurrentTimeEqualTo(Date value) {
addCriterion("css_current_time =", value, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeNotEqualTo(Date value) {
addCriterion("css_current_time <>", value, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeGreaterThan(Date value) {
addCriterion("css_current_time >", value, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeGreaterThanOrEqualTo(Date value) {
addCriterion("css_current_time >=", value, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeLessThan(Date value) {
addCriterion("css_current_time <", value, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeLessThanOrEqualTo(Date value) {
addCriterion("css_current_time <=", value, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeIn(List<Date> values) {
addCriterion("css_current_time in", values, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeNotIn(List<Date> values) {
addCriterion("css_current_time not in", values, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeBetween(Date value1, Date value2) {
addCriterion("css_current_time between", value1, value2, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssCurrentTimeNotBetween(Date value1, Date value2) {
addCriterion("css_current_time not between", value1, value2, "cssCurrentTime");
return (Criteria) this;
}
public Criteria andCssRentedIsNull() {
addCriterion("css_rented is null");
return (Criteria) this;
}
public Criteria andCssRentedIsNotNull() {
addCriterion("css_rented is not null");
return (Criteria) this;
}
public Criteria andCssRentedEqualTo(String value) {
addCriterion("css_rented =", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedNotEqualTo(String value) {
addCriterion("css_rented <>", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedGreaterThan(String value) {
addCriterion("css_rented >", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedGreaterThanOrEqualTo(String value) {
addCriterion("css_rented >=", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedLessThan(String value) {
addCriterion("css_rented <", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedLessThanOrEqualTo(String value) {
addCriterion("css_rented <=", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedLike(String value) {
addCriterion("css_rented like", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedNotLike(String value) {
addCriterion("css_rented not like", value, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedIn(List<String> values) {
addCriterion("css_rented in", values, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedNotIn(List<String> values) {
addCriterion("css_rented not in", values, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedBetween(String value1, String value2) {
addCriterion("css_rented between", value1, value2, "cssRented");
return (Criteria) this;
}
public Criteria andCssRentedNotBetween(String value1, String value2) {
addCriterion("css_rented not between", value1, value2, "cssRented");
return (Criteria) this;
}
public Criteria andCssWarnIsNull() {
addCriterion("css_warn is null");
return (Criteria) this;
}
public Criteria andCssWarnIsNotNull() {
addCriterion("css_warn is not null");
return (Criteria) this;
}
public Criteria andCssWarnEqualTo(Integer value) {
addCriterion("css_warn =", value, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnNotEqualTo(Integer value) {
addCriterion("css_warn <>", value, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnGreaterThan(Integer value) {
addCriterion("css_warn >", value, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnGreaterThanOrEqualTo(Integer value) {
addCriterion("css_warn >=", value, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnLessThan(Integer value) {
addCriterion("css_warn <", value, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnLessThanOrEqualTo(Integer value) {
addCriterion("css_warn <=", value, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnIn(List<Integer> values) {
addCriterion("css_warn in", values, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnNotIn(List<Integer> values) {
addCriterion("css_warn not in", values, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnBetween(Integer value1, Integer value2) {
addCriterion("css_warn between", value1, value2, "cssWarn");
return (Criteria) this;
}
public Criteria andCssWarnNotBetween(Integer value1, Integer value2) {
addCriterion("css_warn not between", value1, value2, "cssWarn");
return (Criteria) this;
}
public Criteria andCssRfidIsNull() {
addCriterion("css_rfid is null");
return (Criteria) this;
}
public Criteria andCssRfidIsNotNull() {
addCriterion("css_rfid is not null");
return (Criteria) this;
}
public Criteria andCssRfidEqualTo(String value) {
addCriterion("css_rfid =", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidNotEqualTo(String value) {
addCriterion("css_rfid <>", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidGreaterThan(String value) {
addCriterion("css_rfid >", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidGreaterThanOrEqualTo(String value) {
addCriterion("css_rfid >=", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidLessThan(String value) {
addCriterion("css_rfid <", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidLessThanOrEqualTo(String value) {
addCriterion("css_rfid <=", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidLike(String value) {
addCriterion("css_rfid like", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidNotLike(String value) {
addCriterion("css_rfid not like", value, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidIn(List<String> values) {
addCriterion("css_rfid in", values, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidNotIn(List<String> values) {
addCriterion("css_rfid not in", values, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidBetween(String value1, String value2) {
addCriterion("css_rfid between", value1, value2, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidNotBetween(String value1, String value2) {
addCriterion("css_rfid not between", value1, value2, "cssRfid");
return (Criteria) this;
}
public Criteria andCssRfidDteIsNull() {
addCriterion("css_rfid_dte is null");
return (Criteria) this;
}
public Criteria andCssRfidDteIsNotNull() {
addCriterion("css_rfid_dte is not null");
return (Criteria) this;
}
public Criteria andCssRfidDteEqualTo(String value) {
addCriterion("css_rfid_dte =", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteNotEqualTo(String value) {
addCriterion("css_rfid_dte <>", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteGreaterThan(String value) {
addCriterion("css_rfid_dte >", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteGreaterThanOrEqualTo(String value) {
addCriterion("css_rfid_dte >=", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteLessThan(String value) {
addCriterion("css_rfid_dte <", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteLessThanOrEqualTo(String value) {
addCriterion("css_rfid_dte <=", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteLike(String value) {
addCriterion("css_rfid_dte like", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteNotLike(String value) {
addCriterion("css_rfid_dte not like", value, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteIn(List<String> values) {
addCriterion("css_rfid_dte in", values, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteNotIn(List<String> values) {
addCriterion("css_rfid_dte not in", values, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteBetween(String value1, String value2) {
addCriterion("css_rfid_dte between", value1, value2, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssRfidDteNotBetween(String value1, String value2) {
addCriterion("css_rfid_dte not between", value1, value2, "cssRfidDte");
return (Criteria) this;
}
public Criteria andCssObdMileIsNull() {
addCriterion("css_obd_mile is null");
return (Criteria) this;
}
public Criteria andCssObdMileIsNotNull() {
addCriterion("css_obd_mile is not null");
return (Criteria) this;
}
public Criteria andCssObdMileEqualTo(BigDecimal value) {
addCriterion("css_obd_mile =", value, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileNotEqualTo(BigDecimal value) {
addCriterion("css_obd_mile <>", value, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileGreaterThan(BigDecimal value) {
addCriterion("css_obd_mile >", value, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_obd_mile >=", value, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileLessThan(BigDecimal value) {
addCriterion("css_obd_mile <", value, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_obd_mile <=", value, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileIn(List<BigDecimal> values) {
addCriterion("css_obd_mile in", values, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileNotIn(List<BigDecimal> values) {
addCriterion("css_obd_mile not in", values, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_obd_mile between", value1, value2, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssObdMileNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_obd_mile not between", value1, value2, "cssObdMile");
return (Criteria) this;
}
public Criteria andCssEngineTIsNull() {
addCriterion("css_engine_t is null");
return (Criteria) this;
}
public Criteria andCssEngineTIsNotNull() {
addCriterion("css_engine_t is not null");
return (Criteria) this;
}
public Criteria andCssEngineTEqualTo(BigDecimal value) {
addCriterion("css_engine_t =", value, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTNotEqualTo(BigDecimal value) {
addCriterion("css_engine_t <>", value, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTGreaterThan(BigDecimal value) {
addCriterion("css_engine_t >", value, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_engine_t >=", value, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTLessThan(BigDecimal value) {
addCriterion("css_engine_t <", value, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_engine_t <=", value, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTIn(List<BigDecimal> values) {
addCriterion("css_engine_t in", values, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTNotIn(List<BigDecimal> values) {
addCriterion("css_engine_t not in", values, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_engine_t between", value1, value2, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssEngineTNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_engine_t not between", value1, value2, "cssEngineT");
return (Criteria) this;
}
public Criteria andCssMileageIsNull() {
addCriterion("css_mileage is null");
return (Criteria) this;
}
public Criteria andCssMileageIsNotNull() {
addCriterion("css_mileage is not null");
return (Criteria) this;
}
public Criteria andCssMileageEqualTo(BigDecimal value) {
addCriterion("css_mileage =", value, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageNotEqualTo(BigDecimal value) {
addCriterion("css_mileage <>", value, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageGreaterThan(BigDecimal value) {
addCriterion("css_mileage >", value, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_mileage >=", value, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageLessThan(BigDecimal value) {
addCriterion("css_mileage <", value, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_mileage <=", value, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageIn(List<BigDecimal> values) {
addCriterion("css_mileage in", values, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageNotIn(List<BigDecimal> values) {
addCriterion("css_mileage not in", values, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_mileage between", value1, value2, "cssMileage");
return (Criteria) this;
}
public Criteria andCssMileageNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_mileage not between", value1, value2, "cssMileage");
return (Criteria) this;
}
public Criteria andCssSpeedIsNull() {
addCriterion("css_speed is null");
return (Criteria) this;
}
public Criteria andCssSpeedIsNotNull() {
addCriterion("css_speed is not null");
return (Criteria) this;
}
public Criteria andCssSpeedEqualTo(BigDecimal value) {
addCriterion("css_speed =", value, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedNotEqualTo(BigDecimal value) {
addCriterion("css_speed <>", value, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedGreaterThan(BigDecimal value) {
addCriterion("css_speed >", value, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_speed >=", value, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedLessThan(BigDecimal value) {
addCriterion("css_speed <", value, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_speed <=", value, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedIn(List<BigDecimal> values) {
addCriterion("css_speed in", values, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedNotIn(List<BigDecimal> values) {
addCriterion("css_speed not in", values, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_speed between", value1, value2, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssSpeedNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_speed not between", value1, value2, "cssSpeed");
return (Criteria) this;
}
public Criteria andCssMotorIsNull() {
addCriterion("css_motor is null");
return (Criteria) this;
}
public Criteria andCssMotorIsNotNull() {
addCriterion("css_motor is not null");
return (Criteria) this;
}
public Criteria andCssMotorEqualTo(Integer value) {
addCriterion("css_motor =", value, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorNotEqualTo(Integer value) {
addCriterion("css_motor <>", value, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorGreaterThan(Integer value) {
addCriterion("css_motor >", value, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorGreaterThanOrEqualTo(Integer value) {
addCriterion("css_motor >=", value, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorLessThan(Integer value) {
addCriterion("css_motor <", value, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorLessThanOrEqualTo(Integer value) {
addCriterion("css_motor <=", value, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorIn(List<Integer> values) {
addCriterion("css_motor in", values, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorNotIn(List<Integer> values) {
addCriterion("css_motor not in", values, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorBetween(Integer value1, Integer value2) {
addCriterion("css_motor between", value1, value2, "cssMotor");
return (Criteria) this;
}
public Criteria andCssMotorNotBetween(Integer value1, Integer value2) {
addCriterion("css_motor not between", value1, value2, "cssMotor");
return (Criteria) this;
}
public Criteria andCssOilIsNull() {
addCriterion("css_oil is null");
return (Criteria) this;
}
public Criteria andCssOilIsNotNull() {
addCriterion("css_oil is not null");
return (Criteria) this;
}
public Criteria andCssOilEqualTo(BigDecimal value) {
addCriterion("css_oil =", value, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilNotEqualTo(BigDecimal value) {
addCriterion("css_oil <>", value, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilGreaterThan(BigDecimal value) {
addCriterion("css_oil >", value, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_oil >=", value, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilLessThan(BigDecimal value) {
addCriterion("css_oil <", value, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_oil <=", value, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilIn(List<BigDecimal> values) {
addCriterion("css_oil in", values, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilNotIn(List<BigDecimal> values) {
addCriterion("css_oil not in", values, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_oil between", value1, value2, "cssOil");
return (Criteria) this;
}
public Criteria andCssOilNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_oil not between", value1, value2, "cssOil");
return (Criteria) this;
}
public Criteria andCssPowerIsNull() {
addCriterion("css_power is null");
return (Criteria) this;
}
public Criteria andCssPowerIsNotNull() {
addCriterion("css_power is not null");
return (Criteria) this;
}
public Criteria andCssPowerEqualTo(Integer value) {
addCriterion("css_power =", value, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerNotEqualTo(Integer value) {
addCriterion("css_power <>", value, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerGreaterThan(Integer value) {
addCriterion("css_power >", value, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerGreaterThanOrEqualTo(Integer value) {
addCriterion("css_power >=", value, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerLessThan(Integer value) {
addCriterion("css_power <", value, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerLessThanOrEqualTo(Integer value) {
addCriterion("css_power <=", value, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerIn(List<Integer> values) {
addCriterion("css_power in", values, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerNotIn(List<Integer> values) {
addCriterion("css_power not in", values, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerBetween(Integer value1, Integer value2) {
addCriterion("css_power between", value1, value2, "cssPower");
return (Criteria) this;
}
public Criteria andCssPowerNotBetween(Integer value1, Integer value2) {
addCriterion("css_power not between", value1, value2, "cssPower");
return (Criteria) this;
}
public Criteria andCssEvBatteryIsNull() {
addCriterion("css_ev_battery is null");
return (Criteria) this;
}
public Criteria andCssEvBatteryIsNotNull() {
addCriterion("css_ev_battery is not null");
return (Criteria) this;
}
public Criteria andCssEvBatteryEqualTo(Byte value) {
addCriterion("css_ev_battery =", value, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryNotEqualTo(Byte value) {
addCriterion("css_ev_battery <>", value, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryGreaterThan(Byte value) {
addCriterion("css_ev_battery >", value, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryGreaterThanOrEqualTo(Byte value) {
addCriterion("css_ev_battery >=", value, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryLessThan(Byte value) {
addCriterion("css_ev_battery <", value, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryLessThanOrEqualTo(Byte value) {
addCriterion("css_ev_battery <=", value, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryIn(List<Byte> values) {
addCriterion("css_ev_battery in", values, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryNotIn(List<Byte> values) {
addCriterion("css_ev_battery not in", values, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryBetween(Byte value1, Byte value2) {
addCriterion("css_ev_battery between", value1, value2, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssEvBatteryNotBetween(Byte value1, Byte value2) {
addCriterion("css_ev_battery not between", value1, value2, "cssEvBattery");
return (Criteria) this;
}
public Criteria andCssChargingIsNull() {
addCriterion("css_charging is null");
return (Criteria) this;
}
public Criteria andCssChargingIsNotNull() {
addCriterion("css_charging is not null");
return (Criteria) this;
}
public Criteria andCssChargingEqualTo(Byte value) {
addCriterion("css_charging =", value, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingNotEqualTo(Byte value) {
addCriterion("css_charging <>", value, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingGreaterThan(Byte value) {
addCriterion("css_charging >", value, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingGreaterThanOrEqualTo(Byte value) {
addCriterion("css_charging >=", value, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingLessThan(Byte value) {
addCriterion("css_charging <", value, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingLessThanOrEqualTo(Byte value) {
addCriterion("css_charging <=", value, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingIn(List<Byte> values) {
addCriterion("css_charging in", values, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingNotIn(List<Byte> values) {
addCriterion("css_charging not in", values, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingBetween(Byte value1, Byte value2) {
addCriterion("css_charging between", value1, value2, "cssCharging");
return (Criteria) this;
}
public Criteria andCssChargingNotBetween(Byte value1, Byte value2) {
addCriterion("css_charging not between", value1, value2, "cssCharging");
return (Criteria) this;
}
public Criteria andCssFuelMileageIsNull() {
addCriterion("css_fuel_mileage is null");
return (Criteria) this;
}
public Criteria andCssFuelMileageIsNotNull() {
addCriterion("css_fuel_mileage is not null");
return (Criteria) this;
}
public Criteria andCssFuelMileageEqualTo(BigDecimal value) {
addCriterion("css_fuel_mileage =", value, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageNotEqualTo(BigDecimal value) {
addCriterion("css_fuel_mileage <>", value, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageGreaterThan(BigDecimal value) {
addCriterion("css_fuel_mileage >", value, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_fuel_mileage >=", value, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageLessThan(BigDecimal value) {
addCriterion("css_fuel_mileage <", value, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_fuel_mileage <=", value, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageIn(List<BigDecimal> values) {
addCriterion("css_fuel_mileage in", values, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageNotIn(List<BigDecimal> values) {
addCriterion("css_fuel_mileage not in", values, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_fuel_mileage between", value1, value2, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssFuelMileageNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_fuel_mileage not between", value1, value2, "cssFuelMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageIsNull() {
addCriterion("css_electric_mileage is null");
return (Criteria) this;
}
public Criteria andCssElectricMileageIsNotNull() {
addCriterion("css_electric_mileage is not null");
return (Criteria) this;
}
public Criteria andCssElectricMileageEqualTo(BigDecimal value) {
addCriterion("css_electric_mileage =", value, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageNotEqualTo(BigDecimal value) {
addCriterion("css_electric_mileage <>", value, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageGreaterThan(BigDecimal value) {
addCriterion("css_electric_mileage >", value, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_electric_mileage >=", value, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageLessThan(BigDecimal value) {
addCriterion("css_electric_mileage <", value, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_electric_mileage <=", value, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageIn(List<BigDecimal> values) {
addCriterion("css_electric_mileage in", values, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageNotIn(List<BigDecimal> values) {
addCriterion("css_electric_mileage not in", values, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_electric_mileage between", value1, value2, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssElectricMileageNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_electric_mileage not between", value1, value2, "cssElectricMileage");
return (Criteria) this;
}
public Criteria andCssEnduranceIsNull() {
addCriterion("css_endurance is null");
return (Criteria) this;
}
public Criteria andCssEnduranceIsNotNull() {
addCriterion("css_endurance is not null");
return (Criteria) this;
}
public Criteria andCssEnduranceEqualTo(BigDecimal value) {
addCriterion("css_endurance =", value, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceNotEqualTo(BigDecimal value) {
addCriterion("css_endurance <>", value, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceGreaterThan(BigDecimal value) {
addCriterion("css_endurance >", value, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_endurance >=", value, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceLessThan(BigDecimal value) {
addCriterion("css_endurance <", value, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_endurance <=", value, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceIn(List<BigDecimal> values) {
addCriterion("css_endurance in", values, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceNotIn(List<BigDecimal> values) {
addCriterion("css_endurance not in", values, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_endurance between", value1, value2, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssEnduranceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_endurance not between", value1, value2, "cssEndurance");
return (Criteria) this;
}
public Criteria andCssTemperatureIsNull() {
addCriterion("css_temperature is null");
return (Criteria) this;
}
public Criteria andCssTemperatureIsNotNull() {
addCriterion("css_temperature is not null");
return (Criteria) this;
}
public Criteria andCssTemperatureEqualTo(BigDecimal value) {
addCriterion("css_temperature =", value, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureNotEqualTo(BigDecimal value) {
addCriterion("css_temperature <>", value, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureGreaterThan(BigDecimal value) {
addCriterion("css_temperature >", value, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_temperature >=", value, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureLessThan(BigDecimal value) {
addCriterion("css_temperature <", value, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_temperature <=", value, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureIn(List<BigDecimal> values) {
addCriterion("css_temperature in", values, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureNotIn(List<BigDecimal> values) {
addCriterion("css_temperature not in", values, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_temperature between", value1, value2, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssTemperatureNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_temperature not between", value1, value2, "cssTemperature");
return (Criteria) this;
}
public Criteria andCssCsqIsNull() {
addCriterion("css_csq is null");
return (Criteria) this;
}
public Criteria andCssCsqIsNotNull() {
addCriterion("css_csq is not null");
return (Criteria) this;
}
public Criteria andCssCsqEqualTo(Short value) {
addCriterion("css_csq =", value, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqNotEqualTo(Short value) {
addCriterion("css_csq <>", value, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqGreaterThan(Short value) {
addCriterion("css_csq >", value, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqGreaterThanOrEqualTo(Short value) {
addCriterion("css_csq >=", value, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqLessThan(Short value) {
addCriterion("css_csq <", value, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqLessThanOrEqualTo(Short value) {
addCriterion("css_csq <=", value, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqIn(List<Short> values) {
addCriterion("css_csq in", values, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqNotIn(List<Short> values) {
addCriterion("css_csq not in", values, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqBetween(Short value1, Short value2) {
addCriterion("css_csq between", value1, value2, "cssCsq");
return (Criteria) this;
}
public Criteria andCssCsqNotBetween(Short value1, Short value2) {
addCriterion("css_csq not between", value1, value2, "cssCsq");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionIsNull() {
addCriterion("css_power_consumption is null");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionIsNotNull() {
addCriterion("css_power_consumption is not null");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionEqualTo(String value) {
addCriterion("css_power_consumption =", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionNotEqualTo(String value) {
addCriterion("css_power_consumption <>", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionGreaterThan(String value) {
addCriterion("css_power_consumption >", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionGreaterThanOrEqualTo(String value) {
addCriterion("css_power_consumption >=", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionLessThan(String value) {
addCriterion("css_power_consumption <", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionLessThanOrEqualTo(String value) {
addCriterion("css_power_consumption <=", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionLike(String value) {
addCriterion("css_power_consumption like", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionNotLike(String value) {
addCriterion("css_power_consumption not like", value, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionIn(List<String> values) {
addCriterion("css_power_consumption in", values, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionNotIn(List<String> values) {
addCriterion("css_power_consumption not in", values, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionBetween(String value1, String value2) {
addCriterion("css_power_consumption between", value1, value2, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssPowerConsumptionNotBetween(String value1, String value2) {
addCriterion("css_power_consumption not between", value1, value2, "cssPowerConsumption");
return (Criteria) this;
}
public Criteria andCssLongitudeIsNull() {
addCriterion("css_longitude is null");
return (Criteria) this;
}
public Criteria andCssLongitudeIsNotNull() {
addCriterion("css_longitude is not null");
return (Criteria) this;
}
public Criteria andCssLongitudeEqualTo(BigDecimal value) {
addCriterion("css_longitude =", value, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeNotEqualTo(BigDecimal value) {
addCriterion("css_longitude <>", value, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeGreaterThan(BigDecimal value) {
addCriterion("css_longitude >", value, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_longitude >=", value, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeLessThan(BigDecimal value) {
addCriterion("css_longitude <", value, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_longitude <=", value, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeIn(List<BigDecimal> values) {
addCriterion("css_longitude in", values, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeNotIn(List<BigDecimal> values) {
addCriterion("css_longitude not in", values, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_longitude between", value1, value2, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLongitudeNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_longitude not between", value1, value2, "cssLongitude");
return (Criteria) this;
}
public Criteria andCssLatitudeIsNull() {
addCriterion("css_latitude is null");
return (Criteria) this;
}
public Criteria andCssLatitudeIsNotNull() {
addCriterion("css_latitude is not null");
return (Criteria) this;
}
public Criteria andCssLatitudeEqualTo(BigDecimal value) {
addCriterion("css_latitude =", value, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeNotEqualTo(BigDecimal value) {
addCriterion("css_latitude <>", value, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeGreaterThan(BigDecimal value) {
addCriterion("css_latitude >", value, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_latitude >=", value, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeLessThan(BigDecimal value) {
addCriterion("css_latitude <", value, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_latitude <=", value, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeIn(List<BigDecimal> values) {
addCriterion("css_latitude in", values, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeNotIn(List<BigDecimal> values) {
addCriterion("css_latitude not in", values, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_latitude between", value1, value2, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssLatitudeNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_latitude not between", value1, value2, "cssLatitude");
return (Criteria) this;
}
public Criteria andCssGpsValidIsNull() {
addCriterion("css_gps_valid is null");
return (Criteria) this;
}
public Criteria andCssGpsValidIsNotNull() {
addCriterion("css_gps_valid is not null");
return (Criteria) this;
}
public Criteria andCssGpsValidEqualTo(Byte value) {
addCriterion("css_gps_valid =", value, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidNotEqualTo(Byte value) {
addCriterion("css_gps_valid <>", value, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidGreaterThan(Byte value) {
addCriterion("css_gps_valid >", value, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidGreaterThanOrEqualTo(Byte value) {
addCriterion("css_gps_valid >=", value, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidLessThan(Byte value) {
addCriterion("css_gps_valid <", value, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidLessThanOrEqualTo(Byte value) {
addCriterion("css_gps_valid <=", value, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidIn(List<Byte> values) {
addCriterion("css_gps_valid in", values, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidNotIn(List<Byte> values) {
addCriterion("css_gps_valid not in", values, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidBetween(Byte value1, Byte value2) {
addCriterion("css_gps_valid between", value1, value2, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsValidNotBetween(Byte value1, Byte value2) {
addCriterion("css_gps_valid not between", value1, value2, "cssGpsValid");
return (Criteria) this;
}
public Criteria andCssGpsCnIsNull() {
addCriterion("css_gps_cn is null");
return (Criteria) this;
}
public Criteria andCssGpsCnIsNotNull() {
addCriterion("css_gps_cn is not null");
return (Criteria) this;
}
public Criteria andCssGpsCnEqualTo(Short value) {
addCriterion("css_gps_cn =", value, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnNotEqualTo(Short value) {
addCriterion("css_gps_cn <>", value, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnGreaterThan(Short value) {
addCriterion("css_gps_cn >", value, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnGreaterThanOrEqualTo(Short value) {
addCriterion("css_gps_cn >=", value, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnLessThan(Short value) {
addCriterion("css_gps_cn <", value, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnLessThanOrEqualTo(Short value) {
addCriterion("css_gps_cn <=", value, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnIn(List<Short> values) {
addCriterion("css_gps_cn in", values, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnNotIn(List<Short> values) {
addCriterion("css_gps_cn not in", values, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnBetween(Short value1, Short value2) {
addCriterion("css_gps_cn between", value1, value2, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCnNotBetween(Short value1, Short value2) {
addCriterion("css_gps_cn not between", value1, value2, "cssGpsCn");
return (Criteria) this;
}
public Criteria andCssGpsCountIsNull() {
addCriterion("css_gps_count is null");
return (Criteria) this;
}
public Criteria andCssGpsCountIsNotNull() {
addCriterion("css_gps_count is not null");
return (Criteria) this;
}
public Criteria andCssGpsCountEqualTo(Short value) {
addCriterion("css_gps_count =", value, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountNotEqualTo(Short value) {
addCriterion("css_gps_count <>", value, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountGreaterThan(Short value) {
addCriterion("css_gps_count >", value, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountGreaterThanOrEqualTo(Short value) {
addCriterion("css_gps_count >=", value, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountLessThan(Short value) {
addCriterion("css_gps_count <", value, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountLessThanOrEqualTo(Short value) {
addCriterion("css_gps_count <=", value, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountIn(List<Short> values) {
addCriterion("css_gps_count in", values, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountNotIn(List<Short> values) {
addCriterion("css_gps_count not in", values, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountBetween(Short value1, Short value2) {
addCriterion("css_gps_count between", value1, value2, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssGpsCountNotBetween(Short value1, Short value2) {
addCriterion("css_gps_count not between", value1, value2, "cssGpsCount");
return (Criteria) this;
}
public Criteria andCssDirIsNull() {
addCriterion("css_dir is null");
return (Criteria) this;
}
public Criteria andCssDirIsNotNull() {
addCriterion("css_dir is not null");
return (Criteria) this;
}
public Criteria andCssDirEqualTo(BigDecimal value) {
addCriterion("css_dir =", value, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirNotEqualTo(BigDecimal value) {
addCriterion("css_dir <>", value, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirGreaterThan(BigDecimal value) {
addCriterion("css_dir >", value, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("css_dir >=", value, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirLessThan(BigDecimal value) {
addCriterion("css_dir <", value, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirLessThanOrEqualTo(BigDecimal value) {
addCriterion("css_dir <=", value, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirIn(List<BigDecimal> values) {
addCriterion("css_dir in", values, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirNotIn(List<BigDecimal> values) {
addCriterion("css_dir not in", values, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_dir between", value1, value2, "cssDir");
return (Criteria) this;
}
public Criteria andCssDirNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("css_dir not between", value1, value2, "cssDir");
return (Criteria) this;
}
public Criteria andCssCircularIsNull() {
addCriterion("css_circular is null");
return (Criteria) this;
}
public Criteria andCssCircularIsNotNull() {
addCriterion("css_circular is not null");
return (Criteria) this;
}
public Criteria andCssCircularEqualTo(Byte value) {
addCriterion("css_circular =", value, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularNotEqualTo(Byte value) {
addCriterion("css_circular <>", value, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularGreaterThan(Byte value) {
addCriterion("css_circular >", value, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularGreaterThanOrEqualTo(Byte value) {
addCriterion("css_circular >=", value, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularLessThan(Byte value) {
addCriterion("css_circular <", value, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularLessThanOrEqualTo(Byte value) {
addCriterion("css_circular <=", value, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularIn(List<Byte> values) {
addCriterion("css_circular in", values, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularNotIn(List<Byte> values) {
addCriterion("css_circular not in", values, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularBetween(Byte value1, Byte value2) {
addCriterion("css_circular between", value1, value2, "cssCircular");
return (Criteria) this;
}
public Criteria andCssCircularNotBetween(Byte value1, Byte value2) {
addCriterion("css_circular not between", value1, value2, "cssCircular");
return (Criteria) this;
}
public Criteria andCssPtcIsNull() {
addCriterion("css_ptc is null");
return (Criteria) this;
}
public Criteria andCssPtcIsNotNull() {
addCriterion("css_ptc is not null");
return (Criteria) this;
}
public Criteria andCssPtcEqualTo(Byte value) {
addCriterion("css_ptc =", value, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcNotEqualTo(Byte value) {
addCriterion("css_ptc <>", value, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcGreaterThan(Byte value) {
addCriterion("css_ptc >", value, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcGreaterThanOrEqualTo(Byte value) {
addCriterion("css_ptc >=", value, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcLessThan(Byte value) {
addCriterion("css_ptc <", value, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcLessThanOrEqualTo(Byte value) {
addCriterion("css_ptc <=", value, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcIn(List<Byte> values) {
addCriterion("css_ptc in", values, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcNotIn(List<Byte> values) {
addCriterion("css_ptc not in", values, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcBetween(Byte value1, Byte value2) {
addCriterion("css_ptc between", value1, value2, "cssPtc");
return (Criteria) this;
}
public Criteria andCssPtcNotBetween(Byte value1, Byte value2) {
addCriterion("css_ptc not between", value1, value2, "cssPtc");
return (Criteria) this;
}
public Criteria andCssCompresIsNull() {
addCriterion("css_compres is null");
return (Criteria) this;
}
public Criteria andCssCompresIsNotNull() {
addCriterion("css_compres is not null");
return (Criteria) this;
}
public Criteria andCssCompresEqualTo(Byte value) {
addCriterion("css_compres =", value, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresNotEqualTo(Byte value) {
addCriterion("css_compres <>", value, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresGreaterThan(Byte value) {
addCriterion("css_compres >", value, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresGreaterThanOrEqualTo(Byte value) {
addCriterion("css_compres >=", value, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresLessThan(Byte value) {
addCriterion("css_compres <", value, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresLessThanOrEqualTo(Byte value) {
addCriterion("css_compres <=", value, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresIn(List<Byte> values) {
addCriterion("css_compres in", values, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresNotIn(List<Byte> values) {
addCriterion("css_compres not in", values, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresBetween(Byte value1, Byte value2) {
addCriterion("css_compres between", value1, value2, "cssCompres");
return (Criteria) this;
}
public Criteria andCssCompresNotBetween(Byte value1, Byte value2) {
addCriterion("css_compres not between", value1, value2, "cssCompres");
return (Criteria) this;
}
public Criteria andCssFanIsNull() {
addCriterion("css_fan is null");
return (Criteria) this;
}
public Criteria andCssFanIsNotNull() {
addCriterion("css_fan is not null");
return (Criteria) this;
}
public Criteria andCssFanEqualTo(Byte value) {
addCriterion("css_fan =", value, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanNotEqualTo(Byte value) {
addCriterion("css_fan <>", value, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanGreaterThan(Byte value) {
addCriterion("css_fan >", value, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanGreaterThanOrEqualTo(Byte value) {
addCriterion("css_fan >=", value, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanLessThan(Byte value) {
addCriterion("css_fan <", value, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanLessThanOrEqualTo(Byte value) {
addCriterion("css_fan <=", value, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanIn(List<Byte> values) {
addCriterion("css_fan in", values, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanNotIn(List<Byte> values) {
addCriterion("css_fan not in", values, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanBetween(Byte value1, Byte value2) {
addCriterion("css_fan between", value1, value2, "cssFan");
return (Criteria) this;
}
public Criteria andCssFanNotBetween(Byte value1, Byte value2) {
addCriterion("css_fan not between", value1, value2, "cssFan");
return (Criteria) this;
}
public Criteria andCssSavingIsNull() {
addCriterion("css_saving is null");
return (Criteria) this;
}
public Criteria andCssSavingIsNotNull() {
addCriterion("css_saving is not null");
return (Criteria) this;
}
public Criteria andCssSavingEqualTo(Byte value) {
addCriterion("css_saving =", value, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingNotEqualTo(Byte value) {
addCriterion("css_saving <>", value, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingGreaterThan(Byte value) {
addCriterion("css_saving >", value, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingGreaterThanOrEqualTo(Byte value) {
addCriterion("css_saving >=", value, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingLessThan(Byte value) {
addCriterion("css_saving <", value, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingLessThanOrEqualTo(Byte value) {
addCriterion("css_saving <=", value, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingIn(List<Byte> values) {
addCriterion("css_saving in", values, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingNotIn(List<Byte> values) {
addCriterion("css_saving not in", values, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingBetween(Byte value1, Byte value2) {
addCriterion("css_saving between", value1, value2, "cssSaving");
return (Criteria) this;
}
public Criteria andCssSavingNotBetween(Byte value1, Byte value2) {
addCriterion("css_saving not between", value1, value2, "cssSaving");
return (Criteria) this;
}
public Criteria andCssDoorIsNull() {
addCriterion("css_door is null");
return (Criteria) this;
}
public Criteria andCssDoorIsNotNull() {
addCriterion("css_door is not null");
return (Criteria) this;
}
public Criteria andCssDoorEqualTo(String value) {
addCriterion("css_door =", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorNotEqualTo(String value) {
addCriterion("css_door <>", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorGreaterThan(String value) {
addCriterion("css_door >", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorGreaterThanOrEqualTo(String value) {
addCriterion("css_door >=", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorLessThan(String value) {
addCriterion("css_door <", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorLessThanOrEqualTo(String value) {
addCriterion("css_door <=", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorLike(String value) {
addCriterion("css_door like", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorNotLike(String value) {
addCriterion("css_door not like", value, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorIn(List<String> values) {
addCriterion("css_door in", values, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorNotIn(List<String> values) {
addCriterion("css_door not in", values, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorBetween(String value1, String value2) {
addCriterion("css_door between", value1, value2, "cssDoor");
return (Criteria) this;
}
public Criteria andCssDoorNotBetween(String value1, String value2) {
addCriterion("css_door not between", value1, value2, "cssDoor");
return (Criteria) this;
}
public Criteria andCssEngineIsNull() {
addCriterion("css_engine is null");
return (Criteria) this;
}
public Criteria andCssEngineIsNotNull() {
addCriterion("css_engine is not null");
return (Criteria) this;
}
public Criteria andCssEngineEqualTo(Byte value) {
addCriterion("css_engine =", value, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineNotEqualTo(Byte value) {
addCriterion("css_engine <>", value, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineGreaterThan(Byte value) {
addCriterion("css_engine >", value, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineGreaterThanOrEqualTo(Byte value) {
addCriterion("css_engine >=", value, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineLessThan(Byte value) {
addCriterion("css_engine <", value, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineLessThanOrEqualTo(Byte value) {
addCriterion("css_engine <=", value, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineIn(List<Byte> values) {
addCriterion("css_engine in", values, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineNotIn(List<Byte> values) {
addCriterion("css_engine not in", values, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineBetween(Byte value1, Byte value2) {
addCriterion("css_engine between", value1, value2, "cssEngine");
return (Criteria) this;
}
public Criteria andCssEngineNotBetween(Byte value1, Byte value2) {
addCriterion("css_engine not between", value1, value2, "cssEngine");
return (Criteria) this;
}
public Criteria andCssKeyIsNull() {
addCriterion("css_key is null");
return (Criteria) this;
}
public Criteria andCssKeyIsNotNull() {
addCriterion("css_key is not null");
return (Criteria) this;
}
public Criteria andCssKeyEqualTo(Byte value) {
addCriterion("css_key =", value, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyNotEqualTo(Byte value) {
addCriterion("css_key <>", value, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyGreaterThan(Byte value) {
addCriterion("css_key >", value, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyGreaterThanOrEqualTo(Byte value) {
addCriterion("css_key >=", value, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyLessThan(Byte value) {
addCriterion("css_key <", value, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyLessThanOrEqualTo(Byte value) {
addCriterion("css_key <=", value, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyIn(List<Byte> values) {
addCriterion("css_key in", values, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyNotIn(List<Byte> values) {
addCriterion("css_key not in", values, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyBetween(Byte value1, Byte value2) {
addCriterion("css_key between", value1, value2, "cssKey");
return (Criteria) this;
}
public Criteria andCssKeyNotBetween(Byte value1, Byte value2) {
addCriterion("css_key not between", value1, value2, "cssKey");
return (Criteria) this;
}
public Criteria andCssGearIsNull() {
addCriterion("css_gear is null");
return (Criteria) this;
}
public Criteria andCssGearIsNotNull() {
addCriterion("css_gear is not null");
return (Criteria) this;
}
public Criteria andCssGearEqualTo(Byte value) {
addCriterion("css_gear =", value, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearNotEqualTo(Byte value) {
addCriterion("css_gear <>", value, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearGreaterThan(Byte value) {
addCriterion("css_gear >", value, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearGreaterThanOrEqualTo(Byte value) {
addCriterion("css_gear >=", value, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearLessThan(Byte value) {
addCriterion("css_gear <", value, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearLessThanOrEqualTo(Byte value) {
addCriterion("css_gear <=", value, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearIn(List<Byte> values) {
addCriterion("css_gear in", values, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearNotIn(List<Byte> values) {
addCriterion("css_gear not in", values, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearBetween(Byte value1, Byte value2) {
addCriterion("css_gear between", value1, value2, "cssGear");
return (Criteria) this;
}
public Criteria andCssGearNotBetween(Byte value1, Byte value2) {
addCriterion("css_gear not between", value1, value2, "cssGear");
return (Criteria) this;
}
public Criteria andCssLightIsNull() {
addCriterion("css_light is null");
return (Criteria) this;
}
public Criteria andCssLightIsNotNull() {
addCriterion("css_light is not null");
return (Criteria) this;
}
public Criteria andCssLightEqualTo(Integer value) {
addCriterion("css_light =", value, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightNotEqualTo(Integer value) {
addCriterion("css_light <>", value, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightGreaterThan(Integer value) {
addCriterion("css_light >", value, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightGreaterThanOrEqualTo(Integer value) {
addCriterion("css_light >=", value, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightLessThan(Integer value) {
addCriterion("css_light <", value, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightLessThanOrEqualTo(Integer value) {
addCriterion("css_light <=", value, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightIn(List<Integer> values) {
addCriterion("css_light in", values, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightNotIn(List<Integer> values) {
addCriterion("css_light not in", values, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightBetween(Integer value1, Integer value2) {
addCriterion("css_light between", value1, value2, "cssLight");
return (Criteria) this;
}
public Criteria andCssLightNotBetween(Integer value1, Integer value2) {
addCriterion("css_light not between", value1, value2, "cssLight");
return (Criteria) this;
}
public Criteria andCssLockIsNull() {
addCriterion("css_lock is null");
return (Criteria) this;
}
public Criteria andCssLockIsNotNull() {
addCriterion("css_lock is not null");
return (Criteria) this;
}
public Criteria andCssLockEqualTo(Integer value) {
addCriterion("css_lock =", value, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockNotEqualTo(Integer value) {
addCriterion("css_lock <>", value, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockGreaterThan(Integer value) {
addCriterion("css_lock >", value, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockGreaterThanOrEqualTo(Integer value) {
addCriterion("css_lock >=", value, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockLessThan(Integer value) {
addCriterion("css_lock <", value, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockLessThanOrEqualTo(Integer value) {
addCriterion("css_lock <=", value, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockIn(List<Integer> values) {
addCriterion("css_lock in", values, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockNotIn(List<Integer> values) {
addCriterion("css_lock not in", values, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockBetween(Integer value1, Integer value2) {
addCriterion("css_lock between", value1, value2, "cssLock");
return (Criteria) this;
}
public Criteria andCssLockNotBetween(Integer value1, Integer value2) {
addCriterion("css_lock not between", value1, value2, "cssLock");
return (Criteria) this;
}
public Criteria andCssNetTypeIsNull() {
addCriterion("css_net_type is null");
return (Criteria) this;
}
public Criteria andCssNetTypeIsNotNull() {
addCriterion("css_net_type is not null");
return (Criteria) this;
}
public Criteria andCssNetTypeEqualTo(Byte value) {
addCriterion("css_net_type =", value, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeNotEqualTo(Byte value) {
addCriterion("css_net_type <>", value, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeGreaterThan(Byte value) {
addCriterion("css_net_type >", value, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("css_net_type >=", value, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeLessThan(Byte value) {
addCriterion("css_net_type <", value, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeLessThanOrEqualTo(Byte value) {
addCriterion("css_net_type <=", value, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeIn(List<Byte> values) {
addCriterion("css_net_type in", values, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeNotIn(List<Byte> values) {
addCriterion("css_net_type not in", values, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeBetween(Byte value1, Byte value2) {
addCriterion("css_net_type between", value1, value2, "cssNetType");
return (Criteria) this;
}
public Criteria andCssNetTypeNotBetween(Byte value1, Byte value2) {
addCriterion("css_net_type not between", value1, value2, "cssNetType");
return (Criteria) this;
}
public Criteria andCssBaseLacIsNull() {
addCriterion("css_base_lac is null");
return (Criteria) this;
}
public Criteria andCssBaseLacIsNotNull() {
addCriterion("css_base_lac is not null");
return (Criteria) this;
}
public Criteria andCssBaseLacEqualTo(Integer value) {
addCriterion("css_base_lac =", value, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacNotEqualTo(Integer value) {
addCriterion("css_base_lac <>", value, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacGreaterThan(Integer value) {
addCriterion("css_base_lac >", value, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacGreaterThanOrEqualTo(Integer value) {
addCriterion("css_base_lac >=", value, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacLessThan(Integer value) {
addCriterion("css_base_lac <", value, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacLessThanOrEqualTo(Integer value) {
addCriterion("css_base_lac <=", value, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacIn(List<Integer> values) {
addCriterion("css_base_lac in", values, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacNotIn(List<Integer> values) {
addCriterion("css_base_lac not in", values, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacBetween(Integer value1, Integer value2) {
addCriterion("css_base_lac between", value1, value2, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseLacNotBetween(Integer value1, Integer value2) {
addCriterion("css_base_lac not between", value1, value2, "cssBaseLac");
return (Criteria) this;
}
public Criteria andCssBaseCiIsNull() {
addCriterion("css_base_ci is null");
return (Criteria) this;
}
public Criteria andCssBaseCiIsNotNull() {
addCriterion("css_base_ci is not null");
return (Criteria) this;
}
public Criteria andCssBaseCiEqualTo(Integer value) {
addCriterion("css_base_ci =", value, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiNotEqualTo(Integer value) {
addCriterion("css_base_ci <>", value, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiGreaterThan(Integer value) {
addCriterion("css_base_ci >", value, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiGreaterThanOrEqualTo(Integer value) {
addCriterion("css_base_ci >=", value, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiLessThan(Integer value) {
addCriterion("css_base_ci <", value, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiLessThanOrEqualTo(Integer value) {
addCriterion("css_base_ci <=", value, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiIn(List<Integer> values) {
addCriterion("css_base_ci in", values, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiNotIn(List<Integer> values) {
addCriterion("css_base_ci not in", values, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiBetween(Integer value1, Integer value2) {
addCriterion("css_base_ci between", value1, value2, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssBaseCiNotBetween(Integer value1, Integer value2) {
addCriterion("css_base_ci not between", value1, value2, "cssBaseCi");
return (Criteria) this;
}
public Criteria andCssOrderIsNull() {
addCriterion("css_order is null");
return (Criteria) this;
}
public Criteria andCssOrderIsNotNull() {
addCriterion("css_order is not null");
return (Criteria) this;
}
public Criteria andCssOrderEqualTo(Long value) {
addCriterion("css_order =", value, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderNotEqualTo(Long value) {
addCriterion("css_order <>", value, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderGreaterThan(Long value) {
addCriterion("css_order >", value, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderGreaterThanOrEqualTo(Long value) {
addCriterion("css_order >=", value, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderLessThan(Long value) {
addCriterion("css_order <", value, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderLessThanOrEqualTo(Long value) {
addCriterion("css_order <=", value, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderIn(List<Long> values) {
addCriterion("css_order in", values, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderNotIn(List<Long> values) {
addCriterion("css_order not in", values, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderBetween(Long value1, Long value2) {
addCriterion("css_order between", value1, value2, "cssOrder");
return (Criteria) this;
}
public Criteria andCssOrderNotBetween(Long value1, Long value2) {
addCriterion("css_order not between", value1, value2, "cssOrder");
return (Criteria) this;
}
public Criteria andCssMoDataIsNull() {
addCriterion("css_mo_data is null");
return (Criteria) this;
}
public Criteria andCssMoDataIsNotNull() {
addCriterion("css_mo_data is not null");
return (Criteria) this;
}
public Criteria andCssMoDataEqualTo(String value) {
addCriterion("css_mo_data =", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataNotEqualTo(String value) {
addCriterion("css_mo_data <>", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataGreaterThan(String value) {
addCriterion("css_mo_data >", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataGreaterThanOrEqualTo(String value) {
addCriterion("css_mo_data >=", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataLessThan(String value) {
addCriterion("css_mo_data <", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataLessThanOrEqualTo(String value) {
addCriterion("css_mo_data <=", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataLike(String value) {
addCriterion("css_mo_data like", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataNotLike(String value) {
addCriterion("css_mo_data not like", value, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataIn(List<String> values) {
addCriterion("css_mo_data in", values, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataNotIn(List<String> values) {
addCriterion("css_mo_data not in", values, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataBetween(String value1, String value2) {
addCriterion("css_mo_data between", value1, value2, "cssMoData");
return (Criteria) this;
}
public Criteria andCssMoDataNotBetween(String value1, String value2) {
addCriterion("css_mo_data not between", value1, value2, "cssMoData");
return (Criteria) this;
}
public Criteria andCssTeNoIsNull() {
addCriterion("css_te_no is null");
return (Criteria) this;
}
public Criteria andCssTeNoIsNotNull() {
addCriterion("css_te_no is not null");
return (Criteria) this;
}
public Criteria andCssTeNoEqualTo(String value) {
addCriterion("css_te_no =", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoNotEqualTo(String value) {
addCriterion("css_te_no <>", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoGreaterThan(String value) {
addCriterion("css_te_no >", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoGreaterThanOrEqualTo(String value) {
addCriterion("css_te_no >=", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoLessThan(String value) {
addCriterion("css_te_no <", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoLessThanOrEqualTo(String value) {
addCriterion("css_te_no <=", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoLike(String value) {
addCriterion("css_te_no like", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoNotLike(String value) {
addCriterion("css_te_no not like", value, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoIn(List<String> values) {
addCriterion("css_te_no in", values, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoNotIn(List<String> values) {
addCriterion("css_te_no not in", values, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoBetween(String value1, String value2) {
addCriterion("css_te_no between", value1, value2, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssTeNoNotBetween(String value1, String value2) {
addCriterion("css_te_no not between", value1, value2, "cssTeNo");
return (Criteria) this;
}
public Criteria andCssAutopilotIsNull() {
addCriterion("css_autopilot is null");
return (Criteria) this;
}
public Criteria andCssAutopilotIsNotNull() {
addCriterion("css_autopilot is not null");
return (Criteria) this;
}
public Criteria andCssAutopilotEqualTo(Integer value) {
addCriterion("css_autopilot =", value, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotNotEqualTo(Integer value) {
addCriterion("css_autopilot <>", value, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotGreaterThan(Integer value) {
addCriterion("css_autopilot >", value, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotGreaterThanOrEqualTo(Integer value) {
addCriterion("css_autopilot >=", value, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotLessThan(Integer value) {
addCriterion("css_autopilot <", value, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotLessThanOrEqualTo(Integer value) {
addCriterion("css_autopilot <=", value, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotIn(List<Integer> values) {
addCriterion("css_autopilot in", values, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotNotIn(List<Integer> values) {
addCriterion("css_autopilot not in", values, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotBetween(Integer value1, Integer value2) {
addCriterion("css_autopilot between", value1, value2, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssAutopilotNotBetween(Integer value1, Integer value2) {
addCriterion("css_autopilot not between", value1, value2, "cssAutopilot");
return (Criteria) this;
}
public Criteria andCssHandbrakeIsNull() {
addCriterion("css_handbrake is null");
return (Criteria) this;
}
public Criteria andCssHandbrakeIsNotNull() {
addCriterion("css_handbrake is not null");
return (Criteria) this;
}
public Criteria andCssHandbrakeEqualTo(Integer value) {
addCriterion("css_handbrake =", value, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeNotEqualTo(Integer value) {
addCriterion("css_handbrake <>", value, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeGreaterThan(Integer value) {
addCriterion("css_handbrake >", value, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeGreaterThanOrEqualTo(Integer value) {
addCriterion("css_handbrake >=", value, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeLessThan(Integer value) {
addCriterion("css_handbrake <", value, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeLessThanOrEqualTo(Integer value) {
addCriterion("css_handbrake <=", value, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeIn(List<Integer> values) {
addCriterion("css_handbrake in", values, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeNotIn(List<Integer> values) {
addCriterion("css_handbrake not in", values, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeBetween(Integer value1, Integer value2) {
addCriterion("css_handbrake between", value1, value2, "cssHandbrake");
return (Criteria) this;
}
public Criteria andCssHandbrakeNotBetween(Integer value1, Integer value2) {
addCriterion("css_handbrake not between", value1, value2, "cssHandbrake");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table cs_state
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table cs_state
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
|
[
"[email protected]"
] | |
0ac5265fe9a800c191ef9cc0cc4bd4fb32d2444f
|
7a18eea9ccc603ef2cae895d7822eb65f94c9d56
|
/app/src/main/java/com/example/android/abstract_mediator/WulinAlliance.java
|
99cc86459eff9f3a6812b630b8e2cebdcceeca48
|
[] |
no_license
|
wangchao1994/AndroidDesighPattern
|
09e53aaf992e88897f5a96168aedbe5b7f5dd518
|
298ed7eaa7213e58902f47a4006873059fbe69fc
|
refs/heads/master
| 2020-06-11T01:05:17.309197 | 2019-06-26T08:35:05 | 2019-06-26T08:35:05 | 193,811,511 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 185 |
java
|
package com.example.android.abstract_mediator;
/**
* 抽象中介者父类
*/
public abstract class WulinAlliance {
public abstract void notice(String message, United united);
}
|
[
"[email protected]"
] | |
f5f18a1383b3cb74d35165a4d2a70573175504c2
|
ee3fddf30d4f4acff6889d3021f1501ec8fbbd36
|
/app/src/main/java/com/primol/m_status/AboutUs_Activity.java
|
b89657f990c3bff0944142efef48609adea06925
|
[] |
no_license
|
priyajagtap/M_Status
|
e1b61f0baee71e1a003315b2770e11e6eaaf8130
|
0f3670ddb70897c8f638b8fe4f7655cfec464cbb
|
refs/heads/master
| 2021-01-11T23:44:24.174990 | 2017-01-19T12:02:22 | 2017-01-19T12:02:22 | 78,628,567 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,889 |
java
|
package com.primol.m_status;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
public class AboutUs_Activity extends AppCompatActivity {
TextView fbpage,twitterpage,linkedinpage,instagrampage;
private AdView mAdViewtop,adviewbtm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_us_);
MobileAds.initialize(getApplicationContext(), "ca-app-pub-3629419195739803~4843984776");
// String android_id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
// String deviceId = md5(android_id).toUpperCase();
mAdViewtop = (AdView) findViewById(R.id.ad_Top_au);
// AdRequest adRequest = new AdRequest.Builder().addTestDevice(deviceId).build();
AdRequest adRequest = new AdRequest.Builder().build();
mAdViewtop.loadAd(adRequest);
adviewbtm = (AdView) findViewById(R.id.ad_bottom_au);
// AdRequest adRequestbtm = new AdRequest.Builder().addTestDevice(deviceId).build();
AdRequest adRequestbtm = new AdRequest.Builder().build();
adviewbtm.loadAd(adRequestbtm);
/* fbpage = (TextView)findViewById(R.id.link_fb_tv);
Spanned Text = Html.fromHtml("<a href='http://www.google.com//'>आमचे Facebook पेज</a>");
fbpage.setMovementMethod(LinkMovementMethod.getInstance());
fbpage.setText(Text);
*/
/* twitterpage = (TextView)findViewById(R.id.link_twitter_tv);
Spanned Text2 = Html.fromHtml("<a href='http://www.google.com//'>आमचे Twitter पेज</a>");
twitterpage.setMovementMethod(LinkMovementMethod.getInstance());
twitterpage.setText(Text2);*/
/* linkedinpage = (TextView)findViewById(R.id.link_linkedin_tv);
Spanned Text3 = Html.fromHtml("<a href='http://www.google.com//'>आमचे LinkedIn पेज</a>");
linkedinpage.setMovementMethod(LinkMovementMethod.getInstance());
linkedinpage.setText(Text3);*/
/* instagrampage = (TextView)findViewById(R.id.link_instagram_tv);
Spanned Text4 = Html.fromHtml("<a href='http://www.google.com//'>आमचे Instagram पेज</a>");
instagrampage.setMovementMethod(LinkMovementMethod.getInstance());
instagrampage.setText(Text4);*/
}
}/*
INSERT INTO Marathi_Status(status) SELECT status FROM sms.marathi_status;
DELETE FROM Marathi_Status WHERE id NOT IN(SELECT MIN(id) FROM Marathi_StatusGROUP BY status);*/
|
[
"[email protected]"
] | |
ef98310dd3d407e16bcfe942bcff5c13cdad7732
|
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
|
/sources/com/airbnb/android/contentframework/viewcomponents/viewmodels/StoryCreationPickTripRowEpoxyModel.java
|
b1f6ec1b9bb6826c8249e912c25028f2df44b21a
|
[] |
no_license
|
jasonnth/AirCode
|
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
|
d37db1baa493fca56f390c4205faf5c9bbe36604
|
refs/heads/master
| 2020-07-03T08:35:24.902940 | 2019-08-12T03:34:56 | 2019-08-12T03:34:56 | 201,842,970 | 0 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 968 |
java
|
package com.airbnb.android.contentframework.viewcomponents.viewmodels;
import android.view.View.OnClickListener;
import com.airbnb.android.contentframework.views.StoryCreationPickTripRowView;
import com.airbnb.android.core.models.Reservation;
import com.airbnb.p027n2.epoxy.AirEpoxyModel;
public abstract class StoryCreationPickTripRowEpoxyModel extends AirEpoxyModel<StoryCreationPickTripRowView> {
OnClickListener clickListener;
Reservation reservation;
public void bind(StoryCreationPickTripRowView view) {
super.bind(view);
view.setImageUrl(this.reservation.getCityPhotoUrl());
view.setTitle(this.reservation.getListing().getLocation());
view.setSubtitle(this.reservation.getStartDate().getDateString(view.getContext()));
view.setOnClickListener(this.clickListener);
}
public void unbind(StoryCreationPickTripRowView view) {
super.unbind(view);
view.setOnClickListener(null);
}
}
|
[
"[email protected]"
] | |
918fe03db1c430a0c5a8b175ebffb3ef9d5ef390
|
1f3063c1c38c41e8a520d8f23a50ff6d2c7bce25
|
/Gladiator-Spring-HomeLoan/src/main/java/com/example/demo/layer2/DebtorNotFoundException.java
|
d5c7a83455ad4fc7fa78b9511b114b7c891cdbdc
|
[] |
no_license
|
hrutvikdesai0007/HomeLoan-Gladiator-Final
|
ef2720c906c2556952c943986531711f270641fd
|
f88586e2c176cc7e9083a2eaac71db7d6e5a607f
|
refs/heads/master
| 2023-07-11T06:06:22.980656 | 2021-08-16T17:39:26 | 2021-08-16T17:39:26 | 396,815,422 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 157 |
java
|
package com.example.demo.layer2;
public class DebtorNotFoundException extends Exception {
public DebtorNotFoundException(String str) {
super(str);
}
}
|
[
"[email protected]"
] | |
8113e5e5c700bd9570c0b64f85a60800d1ae928b
|
6c95a281b3a7ed5ed4c8eb9d18b27425799b8ea3
|
/java-parser/src/main/java/com/jwu/javaparser/parser/visitors/ClassOrInterfaceDeclarationVisitor.java
|
ca4dcb554d7e74a0bcf9c523373391121ac60867
|
[
"MIT"
] |
permissive
|
TMWilds/dependents-development
|
cfbba8a118847cdc6c7f9c20a5c0fe6baba909fd
|
23ad7263e2055b5c85ac04ddac856eb271d2bb71
|
refs/heads/master
| 2021-01-02T09:48:27.460405 | 2020-05-03T22:14:05 | 2020-05-03T22:14:05 | 239,563,391 | 0 | 0 |
MIT
| 2020-05-03T22:14:07 | 2020-02-10T16:51:58 |
Java
|
UTF-8
|
Java
| false | false | 2,008 |
java
|
package com.jwu.javaparser.parser.visitors;
import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.type.ClassOrInterfaceType;
import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
import com.jwu.javaparser.dependencygraph.DependencyGraph;
/**
* ClassOrInterfaceDeclarationVisitor visits class, interface and enum declarations to
* identify any class inheritance or interface implementations, which are then added to the
* dependency call graph.
*/
public class ClassOrInterfaceDeclarationVisitor extends VoidVisitorAdapter<Void> {
DependencyGraph graph;
public ClassOrInterfaceDeclarationVisitor(DependencyGraph graph) {
this.graph = graph;
}
/**
* @param ci
* @param arg
*/
@Override
public void visit(ClassOrInterfaceDeclaration ci, Void arg) {
try {
super.visit(ci, arg);
System.out.println("Class identified by ClassOrInterfaceDeclarationVisitor " + ci.getNameAsString());
this.graph.addClass(ci.resolve().getPackageName(), ci.resolve().getClassName());
String qualifiedName = ci.resolve().getPackageName() + "." + ci.resolve().getClassName();
NodeList<ClassOrInterfaceType> extendedTypes = ci.getExtendedTypes();
extendedTypes.forEach(type -> {
System.out.println("Found extended type: " + type.getName().asString());
this.graph.addClass(type.resolve().getTypeDeclaration().getPackageName(), type.resolve().getTypeDeclaration().getClassName());
String parentQualifiedName = type.resolve().getTypeDeclaration().getPackageName() + "." + type.resolve().getTypeDeclaration().getClassName();
this.graph.addExtendsEdge(parentQualifiedName, qualifiedName);
});
} catch (Exception e) {
System.out.println("Error occurred in ClassOrInterfaceDeclarationVisitor");
}
}
}
|
[
"[email protected]"
] | |
b75419d67e50f5cd90e27847738efd8cd0841f08
|
5216fed896cf831d615ee38f353f4b8292b63dc3
|
/src/main/java/com/bookstore/repository/PromoSubRepository.java
|
c444a7e8fbad5daf827ce737b80d864bf3d4edfd
|
[] |
no_license
|
7iffvny/RareFinds
|
e07211f7447aca7664de40911c594b38e93b6510
|
b73899bb081be27b42e0327cfdb0f1e5b1967ea1
|
refs/heads/main
| 2023-04-16T18:46:45.172741 | 2021-05-03T22:09:20 | 2021-05-03T22:09:20 | 363,235,214 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 738 |
java
|
package com.bookstore.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.bookstore.domain.Promotion;
import com.bookstore.domain.PromotionSub;
public interface PromoSubRepository extends JpaRepository<PromotionSub, Integer> {
@Query("SELECT pr FROM PromotionSub pr WHERE pr.user_email = ?1")
public PromotionSub findByEmail(String email);
@Query("SELECT pr FROM PromotionSub pr WHERE pr.user_email = ?1")
List <PromotionSub> findByEmails(String email);
@Query("SELECT p FROM PromotionSub p WHERE p.promoCode = ?1")
public PromotionSub findByCode(String code);
public PromotionSub findById(Long promoId);
}
|
[
"[email protected]"
] | |
d4bbd0cf135ba2c166680d1fcb29a1505a0bb10c
|
74610ac0fa5c968c71ef180200e61af971c06539
|
/src/cz/cuni/mff/java/places/Home.java
|
62c34f9d8880db198992474a98be5929ae8836c2
|
[] |
no_license
|
bodommer/the_betrayed
|
c2efddc225e33474ec0f3cafb50e0ec82adcf1d2
|
df46497c589602d10f5c30f46d63cdfd1615ee5c
|
refs/heads/master
| 2021-09-25T08:48:33.897148 | 2018-02-08T15:40:17 | 2018-02-08T15:40:17 | 115,445,296 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,145 |
java
|
package cz.cuni.mff.java.places;
import java.util.Scanner;
import java.util.Set;
import cz.cuni.mff.java.character.Hero;
import cz.cuni.mff.java.equipment.Armour;
import cz.cuni.mff.java.equipment.Weapon;
public class Home {
Set<Weapon> weapons;
Set<Armour> armours;
Scanner scanner;
Hero hero;
public Home(Hero hero, Scanner scanner) {
this.scanner = scanner;
this.hero = hero;
visitHome();
}
private void visitHome() {
System.out.println("Welcome home! What do you want to do? See weapons, see armour, change weapon, change armour, or exit?");
while(true) {
String input = scanner.nextLine();
switch (input) {
case "see weapons":
seeWeapons();
break;
case "see armour":
seeArmour();
break;
case "change weapon":
changeWeapon();
break;
case "change armour":
changeArmour();
break;
case "exit":
return;
default:
System.out.println("Invalid command!");
}
}
}
private void seeWeapons() {
}
private void seeArmour() {
}
private void changeWeapon() {
}
private void changeArmour() {
}
}
|
[
"[email protected]"
] | |
c518c99cf99496d356040f2b6823b160307b078f
|
f7cb9aec68b990c635e4d9908c0b46c63b88c1c1
|
/android/app/src/main/java/com/frustatedindian/task1/MainActivity.java
|
4eb18b26dc8732d5ec33e9cdb14ac150d1ec56f5
|
[] |
no_license
|
risav4129/HomePage
|
cb031a2d8e204d4f280ca1b25dca04458cdcc68e
|
efb9323ca65bbdecea6a0aa4a872890600b9529e
|
refs/heads/master
| 2020-07-22T05:18:12.421728 | 2019-09-08T08:44:35 | 2019-09-08T08:44:35 | 207,085,078 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 370 |
java
|
package com.frustatedindian.task1;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
|
[
"[email protected]"
] | |
e3226c1e9d2da9b9f5b711ab4255bc41ec4f87c1
|
48b6072f3b962c88de386b33b0a5a2aa46d81463
|
/core/src/main/java/wtf/nucker/kitpvpplus/managers/Locations.java
|
004a8a5096211ca75068917a0f858c4a5b9fcc5a
|
[
"MIT"
] |
permissive
|
TorbS00/KitPvPPlus
|
213e86c900f697c5c572649853c50810092e0217
|
4ccdf7923045bf6e0d836202b5e7950f18d1cb44
|
refs/heads/master
| 2023-06-20T20:23:17.730723 | 2021-07-19T22:33:12 | 2021-07-19T22:33:12 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,102 |
java
|
package wtf.nucker.kitpvpplus.managers;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import wtf.nucker.kitpvpplus.utils.Config;
/**
* @author Nucker
* @project KitPvpCore
* @date 01/07/2021
*/
public enum Locations {
SPAWN("spawn", new Location(Bukkit.getWorld("world"), 0, 0, 0)),
ARENA("arena", new Location(Bukkit.getWorld("world"), 0, 0, 0));
private Location location;
private final String path;
private final Location def;
private static Config configInstance;
private static YamlConfiguration config;
Locations(String path, Location def) {
this.path = path;
this.def = def;
if(Locations.getConfig() == null || Locations.getConfig().get(path) == null) {
Locations.serialize(def, path);
}
this.location = Locations.deserialize(path);
}
public Location get() {
return this.location;
}
public String getPath() {
return path;
}
public Location getDef() {
return def;
}
public void set(Location newLocation) {
this.location = newLocation;
Locations.serialize(newLocation, this.path);
Locations.getConfigInstance().save();
}
public static Location deserialize(String path) {
if(Locations.getConfig() == null) return new Location(Bukkit.getWorld("world"), 0, 65, 0);
if(Locations.getConfig().getConfigurationSection(path) == null) Locations.getConfig().set(path, "");
Locations.getConfigInstance().save();
ConfigurationSection section = Locations.getConfig().getConfigurationSection(path);
return new Location(
Bukkit.getWorld(section.getString("world")),
section.getDouble("x"),
section.getDouble("y"),
section.getDouble("z"),
Float.parseFloat(section.getString("yaw")),
Float.parseFloat(section.getString("pitch"))
);
}
public static void serialize(Location location, String path) {
if(Locations.getConfig() == null) return;
ConfigurationSection section = Locations.getConfig().getConfigurationSection(path);
section.set("world", location.getWorld().getName());
section.set("x", location.getX());
section.set("y", location.getY());
section.set("z", location.getZ());
section.set("yaw", location.getYaw());
section.set("pitch", location.getPitch());
Locations.getConfigInstance().save();
}
public static void setup() {
Locations.configInstance = new Config("locations.yml");
Locations.config = Locations.configInstance.getConfig();
for (Locations location : Locations.values()) {
location.location = Locations.deserialize(location.getPath());
}
}
public static YamlConfiguration getConfig() {
return config;
}
public static Config getConfigInstance() {
return configInstance;
}
}
|
[
"[email protected]"
] | |
767527cb91657f8e965af37baf94f4ed08bd6a37
|
74b47b895b2f739612371f871c7f940502e7165b
|
/aws-java-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/RedactionConfigJsonUnmarshaller.java
|
15d9ba0d85fd35f2abd3c86b5a8975d3f4c6d303
|
[
"Apache-2.0"
] |
permissive
|
baganda07/aws-sdk-java
|
fe1958ed679cd95b4c48f971393bf03eb5512799
|
f19bdb30177106b5d6394223a40a382b87adf742
|
refs/heads/master
| 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 |
Apache-2.0
| 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null |
UTF-8
|
Java
| false | false | 3,292 |
java
|
/*
* Copyright 2017-2022 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.comprehend.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.comprehend.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* RedactionConfig JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RedactionConfigJsonUnmarshaller implements Unmarshaller<RedactionConfig, JsonUnmarshallerContext> {
public RedactionConfig unmarshall(JsonUnmarshallerContext context) throws Exception {
RedactionConfig redactionConfig = new RedactionConfig();
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 null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("PiiEntityTypes", targetDepth)) {
context.nextToken();
redactionConfig.setPiiEntityTypes(new ListUnmarshaller<String>(context.getUnmarshaller(String.class))
.unmarshall(context));
}
if (context.testExpression("MaskMode", targetDepth)) {
context.nextToken();
redactionConfig.setMaskMode(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("MaskCharacter", targetDepth)) {
context.nextToken();
redactionConfig.setMaskCharacter(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 redactionConfig;
}
private static RedactionConfigJsonUnmarshaller instance;
public static RedactionConfigJsonUnmarshaller getInstance() {
if (instance == null)
instance = new RedactionConfigJsonUnmarshaller();
return instance;
}
}
|
[
""
] | |
aa5f3b12e66ff4fa5faa230b5068c9d203f58b7e
|
3696b523d4bbc664ec4d7e21eb5228ef0563fc60
|
/ITDCcasestudy-4/src/main/java/dxc/com/pojos/hotel.java
|
7aaca18a416172021f37a910ed093b4d398cf672
|
[] |
no_license
|
bmb3/itdcapplication
|
1884708be67442c70bcf15039053d457deddabb9
|
1626e24151bdf8d72ffe7b7273d0c336c324e1f4
|
refs/heads/master
| 2022-11-29T09:36:32.383948 | 2020-08-12T05:30:40 | 2020-08-12T05:30:40 | 286,923,717 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,640 |
java
|
package dxc.com.pojos;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document
public class hotel
{
@Id
private int HotelId;
private String HotelName;
private long HotelPhNo;
private String HotelAddress;
private double RoomCostPerDay;
private int TotalNoOfRooms;
private int RoomsOccupied;
private int RoomsVacant;
public hotel()
{
}
public int getHotelId() {
return HotelId;
}
public void setHotelId(int hotelId) {
HotelId = hotelId;
}
public String getHotelName() {
return HotelName;
}
public void setHotelName(String hotelName) {
HotelName = hotelName;
}
public long getHotelPhNo() {
return HotelPhNo;
}
public void setHotelPhNo(long hotelPhNo) {
HotelPhNo = hotelPhNo;
}
public String getHotelAddress() {
return HotelAddress;
}
public void setHotelAddress(String hotelAddress) {
HotelAddress = hotelAddress;
}
public double getRoomCostPerDay() {
return RoomCostPerDay;
}
public void setRoomCostPerDay(double roomCostPerDay) {
RoomCostPerDay = roomCostPerDay;
}
public int getTotalNoOfRooms() {
return TotalNoOfRooms;
}
public void setTotalNoOfRooms(int totalNoOfRooms) {
TotalNoOfRooms = totalNoOfRooms;
}
public int getRoomsOccupied() {
return RoomsOccupied;
}
public void setRoomsOccupied(int roomsOccupied) {
RoomsOccupied = roomsOccupied;
}
public int getRoomsVacant() {
return RoomsVacant;
}
public void setRoomsVacant(int roomsVacant) {
RoomsVacant = roomsVacant;
}
}
|
[
"[email protected]"
] | |
e4f3304aeffd8ac5552ce544698df37775e7aafc
|
c60f5e9ffefa9c42988e40124fb0849e32ba4df1
|
/hutool-jwt/src/main/java/cn/hutool/jwt/signers/AlgorithmUtil.java
|
a9f6752bb5ea6d28bce73d03e63b009502af9aa0
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-mulanpsl-2.0-en",
"MulanPSL-2.0"
] |
permissive
|
kingour/hutool
|
421d914930da3a45a3d7f289df02369018a031d8
|
1d85b66be10631671438786e6d051877293409f8
|
refs/heads/v5-master
| 2021-08-18T07:19:41.720943 | 2021-08-13T01:57:41 | 2021-08-13T01:57:41 | 218,266,013 | 0 | 0 |
NOASSERTION
| 2021-08-13T01:57:42 | 2019-10-29T10:56:28 | null |
UTF-8
|
Java
| false | false | 2,183 |
java
|
package cn.hutool.jwt.signers;
import cn.hutool.core.map.BiMap;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.crypto.asymmetric.SignAlgorithm;
import cn.hutool.crypto.digest.HmacAlgorithm;
import java.util.HashMap;
/**
* 算法工具类,算法和JWT算法ID对应表
*
* @author looly
* @since 5.7.0
*/
public class AlgorithmUtil {
private static final BiMap<String, String> map;
static {
map = new BiMap<>(new HashMap<>());
map.put("HS256", HmacAlgorithm.HmacSHA256.getValue());
map.put("HS384", HmacAlgorithm.HmacSHA384.getValue());
map.put("HS512", HmacAlgorithm.HmacSHA512.getValue());
map.put("RS256", SignAlgorithm.SHA256withRSA.getValue());
map.put("RS384", SignAlgorithm.SHA384withRSA.getValue());
map.put("RS512", SignAlgorithm.SHA512withRSA.getValue());
map.put("ES256", SignAlgorithm.SHA256withECDSA.getValue());
map.put("ES384", SignAlgorithm.SHA384withECDSA.getValue());
map.put("ES512", SignAlgorithm.SHA512withECDSA.getValue());
map.put("PS256", SignAlgorithm.SHA256withRSA_PSS.getValue());
map.put("PS384", SignAlgorithm.SHA384withRSA_PSS.getValue());
map.put("PS512", SignAlgorithm.SHA512withRSA_PSS.getValue());
}
/**
* 获取算法,用户传入算法ID返回算法名,传入算法名返回本身
* @param idOrAlgorithm 算法ID或算法名
* @return 算法名
*/
public static String getAlgorithm(String idOrAlgorithm){
return ObjectUtil.defaultIfNull(getAlgorithmById(idOrAlgorithm), idOrAlgorithm);
}
/**
* 获取算法ID,用户传入算法名返回ID,传入算法ID返回本身
* @param idOrAlgorithm 算法ID或算法名
* @return 算法ID
*/
public static String getId(String idOrAlgorithm){
return ObjectUtil.defaultIfNull(getIdByAlgorithm(idOrAlgorithm), idOrAlgorithm);
}
/**
* 根据JWT算法ID获取算法
*
* @param id JWT算法ID
* @return 算法
*/
private static String getAlgorithmById(String id) {
return map.get(id.toUpperCase());
}
/**
* 根据算法获取JWT算法ID
*
* @param algorithm 算法
* @return JWT算法ID
*/
private static String getIdByAlgorithm(String algorithm) {
return map.getInverse().get(algorithm);
}
}
|
[
"[email protected]"
] | |
1fb708a6cc689a1e22c8781f44be543b1f6d7ae4
|
e50406e0dbc988ad6df7ebb988e3cae4a6ae8a62
|
/src/main/java/it/univaq/disim/oop/pharma/controller/amministratorecontroller/ListaFarmaciAmministratoreController.java
|
4295eeaeb1699cb7121fc10d717aed104fa06836
|
[] |
no_license
|
MagicBitUnivaq/farmaciaMagicBit
|
23a48c25e01e162e1c6b82b0ce96a36912bbb3c7
|
3f8fe310522f53ca0bd49f85a924172d4c1828dc
|
refs/heads/master
| 2023-07-16T04:37:01.362015 | 2021-09-05T21:16:21 | 2021-09-05T21:16:21 | 403,413,941 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,554 |
java
|
package it.univaq.disim.oop.pharma.controller.amministratorecontroller;
import java.net.URL;
import java.time.LocalDate;
import java.util.List;
import java.util.ResourceBundle;
import it.univaq.disim.oop.pharma.business.BusinessException;
import it.univaq.disim.oop.pharma.business.FarmacoService;
import it.univaq.disim.oop.pharma.business.MyPharmaBusinessFactory;
import it.univaq.disim.oop.pharma.controller.DataInitializable;
import it.univaq.disim.oop.pharma.domain.Amministratore;
import it.univaq.disim.oop.pharma.domain.Farmaco;
import it.univaq.disim.oop.pharma.view.ViewDispatcher;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.paint.Color;
import javafx.util.Callback;
public class ListaFarmaciAmministratoreController implements Initializable, DataInitializable<Amministratore> {
@FXML
private Label farmaciLabel;
@FXML
private TableView<Farmaco> farmaciTable;
@FXML
private TableColumn<Farmaco, String> nomeTableColumn;
@FXML
private TableColumn<Farmaco, String> principioAttivoTableColumn;
@FXML
private TableColumn<Farmaco, String> produttoreTableColumn;
@FXML
private TableColumn<Farmaco, LocalDate> scadenzaTableColumn;
@FXML
private TableColumn<Farmaco, Double> costoTableColumn;
@FXML
private TableColumn<Farmaco, Integer> quantitaDisponibileTableColumn;
@FXML
private TableColumn<Farmaco, Button> azioniTableColumn;
@FXML
private TableColumn<Farmaco, Button> eliminaTableColumn;
@FXML
private Button aggiungiFarmacoButton;
private ViewDispatcher dispatcher;
private FarmacoService farmacoService;
public ListaFarmaciAmministratoreController() {
dispatcher = ViewDispatcher.getInstance();
MyPharmaBusinessFactory factory = MyPharmaBusinessFactory.getInstance();
farmacoService = factory.getFarmacoService();
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
nomeTableColumn.setCellValueFactory(new PropertyValueFactory<>("nome"));
principioAttivoTableColumn.setCellValueFactory(new PropertyValueFactory<>("principioAttivo"));
produttoreTableColumn.setCellValueFactory(new PropertyValueFactory<>("produttore"));
scadenzaTableColumn.setCellValueFactory(new PropertyValueFactory<>("scadenza"));
costoTableColumn.setCellValueFactory(new PropertyValueFactory<>("costo"));
quantitaDisponibileTableColumn.setCellValueFactory(new PropertyValueFactory<>("quantitaDisponibile"));
azioniTableColumn.setStyle("-fx-alignment: CENTER;");
azioniTableColumn.setCellValueFactory(
new Callback<TableColumn.CellDataFeatures<Farmaco, Button>, ObservableValue<Button>>() {
@Override
public ObservableValue<Button> call(CellDataFeatures<Farmaco, Button> param) {
final Button modificaButton = new Button("Modifica");
modificaButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
dispatcher.renderView("modificaFarmaco", param.getValue());
}
});
return new SimpleObjectProperty<Button>(modificaButton);
}
});
eliminaTableColumn.setStyle("-fx-alignment: CENTER;");
eliminaTableColumn.setCellValueFactory(
new Callback<TableColumn.CellDataFeatures<Farmaco, Button>, ObservableValue<Button>>() {
@Override
public ObservableValue<Button> call(CellDataFeatures<Farmaco, Button> param) {
final Button eliminaButton = new Button("Elimina");
eliminaButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
dispatcher.renderView("eliminaFarmaco", param.getValue());
}
});
return new SimpleObjectProperty<Button>(eliminaButton);
}
});
}
@Override
public void initializeData(Amministratore amministratore) {
try {
List<Farmaco> farmaci = farmacoService.trovaTuttiFarmaci();
ObservableList<Farmaco> farmaciData = FXCollections.observableArrayList(farmaci);
nomeTableColumn.setCellFactory(new Callback<TableColumn<Farmaco, String>, TableCell<Farmaco, String>>() {
public TableCell<Farmaco, String> call(TableColumn<Farmaco, String> param) {
return new TableCell<Farmaco, String>() {
@Override
public void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (!isEmpty()) {
try {
// Per ogni farmaco in esaurimento si colora il nome di rosso
for (Farmaco f : farmacoService.farmaciInEsaurimento()) {
if (item.contains("" + f.getNome())) {
this.setTextFill(Color.RED);
break;
}
}
} catch (BusinessException e) {
e.printStackTrace();
}
setText(item);
}
}
};
}
});
farmaciTable.setItems(farmaciData);
} catch (BusinessException e) {
dispatcher.renderError(e);
}
}
@FXML
public void aggiungiFarmacoAction(ActionEvent event) {
Farmaco farmaco = new Farmaco();
dispatcher.renderView("aggiungiFarmaco", farmaco);
}
}
|
[
"[email protected]"
] | |
c5c399312f9353e7a20479f966c3e2aab0da530c
|
eeab78a90a2ca993f26fe4e00923d6a2426c9c98
|
/e3-search/e3-search-service/src/main/java/guo/ping/e3mall/search/message/ItemAddMessageReceiver.java
|
878a2a4e608ebe1e6a2154e9a5a3f32f3ca99fa5
|
[] |
no_license
|
wjpit1990/e3-springboot
|
3dabfbd2c41b18cd57f235af1eb93d90cc6133e3
|
c442606c7e99e2a6ef18847a4f1c72d03448927c
|
refs/heads/master
| 2020-05-09T09:49:39.622799 | 2019-03-05T06:41:39 | 2019-03-05T06:41:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,018 |
java
|
package guo.ping.e3mall.search.message;
import guo.ping.e3mall.common.pojo.SearchItem;
import guo.ping.e3mall.search.mapper.SearchItemMapper;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.common.SolrInputDocument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
import java.io.IOException;
@Component
public class ItemAddMessageReceiver {
@Autowired
private SearchItemMapper searchItemMapper;
@Autowired
private SolrClient solrClient;
@JmsListener(destination = "itemAddTopic", containerFactory = "jmsTopicListenerContainerFactory")
public void itemAddReceiver(Long msg) {
try {
// 0、等待1s让e3-manager-service提交完事务,商品添加成功
Thread.sleep(1000);
// 1、根据商品id查询商品信息
SearchItem searchItem = searchItemMapper.getItemById(msg);
// 2、创建一SolrInputDocument对象。
SolrInputDocument document = new SolrInputDocument();
// 3、使用SolrServer对象写入索引库。
document.addField("id", searchItem.getId());
document.addField("item_title", searchItem.getTitle());
document.addField("item_sell_point", searchItem.getSell_point());
document.addField("item_price", searchItem.getPrice());
document.addField("item_image", searchItem.getImage());
document.addField("item_category_name", searchItem.getCategory_name());
// 5、向索引库中添加文档。
solrClient.add(document);
solrClient.commit();
} catch (SolrServerException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
[
"[email protected]"
] | |
80ade3f30ee8024cd0dc2714a50a43cc03004e32
|
83a67f1d45c7a2069e13e48efc34563b52f8096c
|
/frontend/app/src/main/java/mcc_2018_g15/chatapp/GalleryGridAdapter.java
|
7fadb506570ee27a0a64299029a69b0b8e92bea3
|
[
"Apache-2.0"
] |
permissive
|
kwendim/Whisper_chat
|
b01032e8ecaae8aea56ce9294e301fed3e5de4b3
|
285371fe9671f164d84627b3902dc76d0ce5acef
|
refs/heads/master
| 2023-03-03T15:36:19.159063 | 2021-02-18T11:59:05 | 2021-02-18T11:59:05 | 340,035,559 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,449 |
java
|
package mcc_2018_g15.chatapp;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import com.facebook.drawee.view.SimpleDraweeView;
import com.squareup.picasso.Picasso;
import com.stfalcon.frescoimageviewer.ImageViewer;
public class GalleryGridAdapter extends BaseAdapter {
private Context context;
private final String[] imageurl;
public GalleryGridAdapter(Context context, String[] imageurl) {
this.context = context;
this.imageurl = imageurl;
}
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View gridView;
if (convertView == null) {
gridView = new View(context);
// get layout from mobile.xml
gridView = inflater.inflate(R.layout.content_gallery, null);
// set image based on selected text
// ImageView imageView = (ImageView) gridView
// .findViewById(R.id.grid_item_image);
// Picasso.get().load(imageurl[position]).into(imageView);
//
// String mobile = imageurl[position];
SimpleDraweeView drawee = (SimpleDraweeView) gridView.findViewById(R.id.grid_image);
final int new_pos = position;
Log.d("new_pos", String.valueOf(new_pos));
drawee.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new ImageViewer.Builder<>(context,imageurl).setStartPosition(new_pos).show();
}
});
drawee.setImageURI(imageurl[position]);
} else {
gridView = (View) convertView;
}
Log.d("grid view", "has returned");
return gridView;
}
@Override
public int getCount() {
return imageurl.length;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
}
|
[
"[email protected]"
] | |
90fce115870121eebf921bad927654c9f2549cdf
|
704f35deae55d2ca4b1199822438f86d767c772c
|
/src/PracticeSession/GrossIncome.java
|
988e528e08aaa429ad890cbbc8a74f2907a9e68f
|
[] |
no_license
|
raminrocker75/Java-programming
|
8b7e4a4b12d5cc0e74963d0382e46b6ac03c7baa
|
f23be32a8a2a8a11b747c20c78a68273d3ea9f8a
|
refs/heads/master
| 2023-06-25T20:51:00.406073 | 2021-07-27T00:06:12 | 2021-07-27T00:06:12 | 369,878,351 | 0 | 0 | null | 2021-07-27T00:06:13 | 2021-05-22T18:19:42 |
Java
|
UTF-8
|
Java
| false | false | 1,191 |
java
|
package PracticeSession;
import java.util .Scanner;
public class GrossIncome {
public static void main(String[] args) {
Scanner scan = new Scanner (System.in);
System.out.println("How many work hours per week: ");
double workHour = scan.nextDouble();
System.out.println("How much is the hourly rate: ");
double hourlyRate = scan.nextDouble();
double overTimeRate = 1.5 * hourlyRate ;
System.out.println("Over time rate: " + overTimeRate );
double overTime = 0;
if (workHour<=40) {
double timeHour = workHour;
} else{
overTime = workHour - 40;
}
double overTime1 = overTimeRate * overTime;
double totalIncome = workHour * hourlyRate;
double federalTax = 0.07 , socialTax = 0.06 , medicare = 0.01;
double totalTax = federalTax + socialTax + medicare;
System.out.println("Total tax rate: " + totalTax);
System.out.println("Total income before tax: " + totalIncome);
System.out.println("Total tax: " +(totalIncome * totalTax) );
System.out.println("Total income after tax: " + (totalIncome - totalTax));
}
}
|
[
"[email protected]"
] | |
c8059dbb5e1b4af5c89d47979e89d02a5a84bd22
|
094acf0e12ebebe26d2321096926de293a80a706
|
/picRetrive/src/test.java
|
ae86d48cd9b2814fe3184f87b3f6e3d7e0445512
|
[] |
no_license
|
nijun6/GetPicFeature
|
73f0eb8811e6d87d7998c1e7b85b2b1c993af98c
|
a306b53aebe3fb1f50cd08cb9cbd3a33265e6459
|
refs/heads/master
| 2021-01-10T06:25:43.637612 | 2016-01-05T08:23:51 | 2016-01-05T08:23:51 | 46,100,897 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,312 |
java
|
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.queryparser.flexible.standard.config.NumericFieldConfigListener;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
public class test {
public static void main(String[] args) throws IOException, ParseException, WrongFormatFeaString {
build();
}
public static void testSearch() throws IOException, WrongFormatFeaString, ParseException {
FeaLib feaLib = new FeaLib("D:\\NJ\\prg\\picFea\\picFea\\picLib\\index");
PicFeature picFeature = new PicFeature("D:\\NJ\\prg\\picFea\\picFea\\picLib\\D__NJ_pictures_libpic_0.png.txt");
SearchRes sRes = feaLib.search(picFeature);
System.out.println(sRes);
}
public static void checkReader() throws IOException {
Directory directory = FSDirectory.open(Paths.get("D:\\NJ\\prg\\picFea\\picFea\\picLib\\index"));
IndexSearcher searcher = new IndexSearcher(DirectoryReader.open(directory));
IndexReader reader = searcher.getIndexReader();
ArrayList<String> arrayList = new ArrayList<String>();
for (int i = 0; i < reader.maxDoc(); i++) {
arrayList.add(searcher.doc(i).get("ID"));
}
arrayList.sort(new Comparator<String>() {
@Override
public int compare(String arg0, String arg1) {
return arg0.compareTo(arg1);
}
});
for (int i = 0; i < reader.maxDoc(); i++) {
System.out.println("i = " + i + " " + arrayList.get(i));
}
}
public static void Search() throws IOException, ParseException {
Directory directory = FSDirectory.open(Paths.get("D:\\NJ\\prg\\picFea\\picFea\\picLib\\index"));
IndexSearcher searcher = new IndexSearcher(DirectoryReader.open(directory));
IndexReader indexReader = searcher.getIndexReader();
System.out.println("there are " + indexReader.numDocs() + " documents in the index");
QueryParser parser = new QueryParser("ID", new StandardAnalyzer());
String id = "104";
Query query = parser.parse(id);
TopDocs topDocs = searcher.search(query, 10);
for (ScoreDoc scoreDoc: topDocs.scoreDocs) {
System.out.println(indexReader.document(scoreDoc.doc).get("ID"));
}
}
public static void build() throws IOException, WrongFormatFeaString, ParseException {
File idFiles = new File("D:\\NJ\\prg\\picFea\\picFea\\picLib\\ID");
File feaFiles = new File("D:\\NJ\\prg\\picFea\\picFea\\picLib\\fea");
FeaLib feaLib = new FeaLib("D:\\NJ\\prg\\picFea\\picFea\\picLib\\index");
for (int i = 0; i < idFiles.listFiles().length; i++) {
PicFeature picFeature = new PicFeature(idFiles.listFiles()[i].getPath()
, feaFiles.listFiles()[i].getPath());
feaLib.addFeature(picFeature);
}
}
}
|
[
"[email protected]"
] | |
3ec8fe56ff0ea4722545dbc0c9f6a2043d29ee90
|
c59501d34650773f67dff1e533f985d9e798da0c
|
/spring-cloud-demo/src/main/java/org/wq/demo/springclouddemo/thread/ThreasA.java
|
6c7ebf66c84a4cf79c219116cdc87f607ff33fcf
|
[] |
no_license
|
ewardb/spring-cloud-demo
|
6714ba96f1c3d4b4bfda97082fbaf2cc1108dd4a
|
06184275912bde7db725f266f9ca4051bdcb14b2
|
refs/heads/master
| 2022-06-03T00:29:35.763602 | 2020-03-28T03:15:04 | 2020-03-28T03:15:04 | 197,201,207 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 640 |
java
|
package org.wq.demo.springclouddemo.thread;
/**
* @author wangqiang26
* @mail [email protected]
* @Date 15:04 2018/11/15
*/
public class ThreasA extends Thread {
boolean isRunning = true;
public boolean isRunning(){
return isRunning;
}
public void setRunning(boolean isRunning){
this.isRunning = isRunning;
}
@Override
public void run(){
System.out.println("into Run method");
while(isRunning == true){
// System.out.println("-------------");
//此处进行循环
}
System.out.println("The thread have already shutdown");
}
}
|
[
"[email protected]"
] | |
8fd4c8b0b82e785dd9b757a1903bbfc866f3e3e2
|
ef9404cf780318801bbb03668863febf381bbe5b
|
/java/week03/test.java
|
663fa82ddd4974ab7848f5feac4516a98567762d
|
[] |
no_license
|
SeoHwiDo/aws-vscode
|
1f3f2a7b06b82de9e335aad881fa9d18dbb5ea5f
|
0f9fb072e5f463e7bb44a73eef1b23278612a98d
|
refs/heads/master
| 2023-06-02T22:11:27.500335 | 2021-06-20T08:36:16 | 2021-06-20T08:36:16 | 345,544,588 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 134 |
java
|
package week03;
public class test{
public static void main(String args[]){
System.out.println("hello world");
}
}
|
[
"[email protected]"
] | |
f26d9b1e4ec9aea69ce00c642303daa83365ac51
|
e70c031ec5ba0eb91398adac7ec17bbde51153df
|
/src/main/java/com/leaderment/mysql_mapper/SupplierMapper.java
|
a9eeb2e7832fb2fbfdb6fde7c2098e34116b15b8
|
[] |
no_license
|
honsen-lh/bison-sync
|
7b413a0b05a8ddd6feb0cc842800b9c243cd1c8e
|
e8739452c6473b4064abf376778f9e19040be1b8
|
refs/heads/master
| 2020-05-24T20:04:41.643993 | 2019-09-02T02:10:24 | 2019-09-02T02:10:24 | 187,448,532 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 444 |
java
|
package com.leaderment.mysql_mapper;
import java.util.List;
import com.leaderment.mysql_pojo.Supplier;
import com.leaderment.sqlserver_pojo.VendorVO;
public interface SupplierMapper {
int deleteByPrimaryKey(Integer supplierId);
int insert(Supplier record);
Supplier selectByPrimaryKey(Integer supplierId);
List<Supplier> selectAll();
int updateByPrimaryKey(Supplier record);
void batchInsert(List<VendorVO> list);
}
|
[
"[email protected]"
] | |
fe2274190c890697ff2ac07b2f3c1c4b4102e145
|
b7043c1fed8ead2d21d79f5b39e36723479dc287
|
/lab5_sem4/client/src/client/Client.java
|
b67399bc37a52c9b7544b68c59e30c3ed79cc005
|
[] |
no_license
|
Foll0wTh3Wh1teRabbit/NSU_OOP_4sem
|
52881cda4d4d5548fd701afc1090a7a05a9e13e4
|
915fa266e07a9be7ab9e3aa107e9279376475b8f
|
refs/heads/main
| 2023-04-16T17:03:29.393550 | 2021-04-30T04:09:22 | 2021-04-30T04:09:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,646 |
java
|
package client;
import model.common.Field;
import model.common.Sign;
import protocol.response.Response;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
public class Client {
private final Socket clientSocket;
private final ObjectInputStream objectInputStream;
private final ObjectOutputStream objectOutputStream;
private final ClientController clientController;
public Client(Socket socket, ClientController clientController) throws IOException, ClassNotFoundException {
this.clientSocket = socket;
this.clientController = clientController;
this.objectInputStream = new ObjectInputStream(clientSocket.getInputStream());
this.objectOutputStream = new ObjectOutputStream(clientSocket.getOutputStream());
start();
}
private void start() throws IOException, ClassNotFoundException {
while (!clientSocket.isClosed()) {
Response<?> response = (Response<?>) objectInputStream.readObject();
switch (response.getResponseType()) {
case INFO -> clientController.getRenderer().handle((String) response.getData());
case MOVE -> clientController.getRenderer().handle((Field) response.getData());
case ERROR -> clientController.getRenderer().handle((Exception) response.getData());
case SIGN_DELEGATION -> clientController.getRenderer().handle((Sign) response.getData());
}
}
}
public ObjectOutputStream getObjectOutputStream() {
return objectOutputStream;
}
}
|
[
"[email protected]"
] | |
fb08f1066bf04feb60fd7dea2e7204b8b39aa37a
|
798e3563930a7f5098a790d86cba09a53a9030bd
|
/src/com/uas/mobile/controller/common/QueryInfoController.java
|
2f8802eb3c8e52730e9861bfe08743d3207832df
|
[] |
no_license
|
dreamvalley/6.0.0
|
c5cabed6f34cab783df16de9ff6ddfc118b7c4fe
|
12ed81bf7a46a649711bcf654bf9bcafe70054c2
|
refs/heads/master
| 2022-02-17T02:31:57.439726 | 2018-07-25T02:52:27 | 2018-07-25T02:52:27 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,743 |
java
|
package com.uas.mobile.controller.common;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.uas.mobile.service.QueryInfoService;
@Controller
public class QueryInfoController {
@Autowired
private QueryInfoService queryInfoService;
@RequestMapping("/mobile/qry/getReport.action")
@ResponseBody
public Map<String,Object> getInfoByCode(String emcode,String condition){
Map<String, Object> data = queryInfoService.getInfoByCode(emcode,condition);
return data;
}
@RequestMapping("/mobile/qry/reportCondition.action")
@ResponseBody
public Map<String,Object> getReportCondition(String caller,String title){
Map<String, Object> condition = queryInfoService.getReportCondition(caller,title);
return condition;
}
@RequestMapping("/mobile/qry/queryJsp.action")
@ResponseBody
public Map<String,Object> getQueryJsp(String emcode){
Map<String, Object> map = queryInfoService.getQueryJsp(emcode);
return map;
}
@RequestMapping("/mobile/qry/schemeCondition.action")
@ResponseBody
public Map<String,Object> getSchemeCondition(String caller,String id){
Map<String,Object> map=queryInfoService.getSchemeConditin(caller, id);
return map;
}
@RequestMapping("/mobile/qry/schemeResult.action")
@ResponseBody
public Map<String,Object>getSchemeResult(String caller,Integer id,int pageIndex,int pageSize,String condition){
return queryInfoService.getSchemeResult(caller,id,pageIndex,pageSize,condition);
}
}
|
[
"[email protected]"
] | |
ce2387748f15dcf72b72f9b73a1042cf0bba53cb
|
5e5627a971ee024c1dfd495ffaf44314c6ba61f8
|
/HearingFusion/src/testcase/schedule/schedule_011_TaskException_SearchExceptionAppointment.java
|
ef3a90ae6b1493aea2883ac1c3899b210543f459
|
[] |
no_license
|
tanmle/SelJava
|
23d79dd365cbc2fb91fe7a7b03a7c796f09fc6b7
|
42991ff74c49c8f22c1beec6cad7da222be021a8
|
refs/heads/master
| 2020-05-20T05:55:27.903678 | 2016-09-14T15:52:19 | 2016-09-14T15:52:19 | 68,220,113 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,704 |
java
|
package schedule;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import page.LoginPage;
import page.PageFactory;
import page.SchedulePage;
import common.AbstractTest;
import common.Constant;
public class schedule_011_TaskException_SearchExceptionAppointment extends AbstractTest{
@Parameters({ "browser", "ipClient", "port" })
@BeforeClass(alwaysRun = true)
public void setup(String browser, String ipClient, String port){
driver = openBrowser(browser, port, ipClient);
loginPage = PageFactory.getLoginPage(driver, ipClient);
organization = Constant.ORGANIZATION;
qaStaffUsername = Constant.QA_STAFF_USERNAME;
password = Constant.PASSWORD;
apptType = "Cerumen management";
provider = "Needle, Space";
}
@Test(groups = { "regression" },description = "Leaving all fields blank")
public void Schedule_69_LeavingAllFieldsBlank()
{
log.info("Schedule_69 - Step 01: Login with correct username & password");
schedulePage = loginPage.login(organization, qaStaffUsername, password, false);
log.info("Schedule_69 - Step 02: Click on Recalls link in Task");
schedulePage.switchToScheduleFrame(driver);
schedulePage.clickOnExceptionsLink();
log.info("Schedule_69 - Step 03: Click on Search button");
numberOfExceptionApptItem = schedulePage.getNumberOfExceptionAppointmentItem();
schedulePage.clickOnSearchAppointmentButton();
log.info("VP: Show list of Recall Patient");
verifyEquals(numberOfExceptionApptItem, schedulePage.getNumberOfExceptionAppointmentItem());
}
@Test(groups = { "regression" },description = "Incorrect Patient Last Name, First Name")
public void Schedule_70_IncorrectPatientName()
{
log.info("Schedule_70 - Step 01: Input incorrect Patient Last name");
schedulePage.inputPatientLastNameValue("incorrectPatientLastName");
log.info("Schedule_70 - Step 02: Input incorrect Patient First name");
schedulePage.inputPatientFirstNameValue("incorrectPatientFirstName");
log.info("Schedule_70 - Step 03: Click on Search button");
schedulePage.clickOnSearchAppointmentButton();
log.info("VP: Message display with content 'No Appointments with Exceptions found'");
verifyTrue(schedulePage.isSearchExceptionApptMessageDisplayWithContent("No Appointments with Exceptions found"));
}
@Test(groups = { "regression" },description = "Incorrect all fields")
public void Schedule_71_IncorrectAllFields()
{
log.info("Schedule_71 - Step 01: Input incorrect Patient Last name");
schedulePage.inputPatientLastNameValue("incorrectPatientLastName");
log.info("Schedule_71 - Step 02: Input incorrect Patient First name");
schedulePage.inputPatientFirstNameValue("incorrectPatientFirstName");
log.info("Schedule_71 - Step 03: Input incorrect Patient Preferred Name");
schedulePage.inputPatientPreferredNameValue("incorrectPatientPreferredName");
log.info("Schedule_71 - Step 04: Input incorrect Provider Last Name");
schedulePage.inputProviderLastNameValue("incorrectProviderLastName");
log.info("Schedule_71 - Step 05: Input incorrect Provider First Name");
schedulePage.inputProviderFirstNameValue("incorrectProviderFirstName");
log.info("Schedule_71 - Step 06: Select Appointment Type");
schedulePage.selectAppointmentType("Delivery");
log.info("Schedule_71 - Step 07: Input incorrect Note");
schedulePage.inputNoteValue("incorrectNote");
log.info("Schedule_71 - Step 05: Click on Search button");
schedulePage.clickOnSearchAppointmentButton();
log.info("VP: Message display with content 'No Appointments with Exceptions found'");
verifyTrue(schedulePage.isSearchExceptionApptMessageDisplayWithContent("No Appointments with Exceptions found"));
}
@Test(groups = { "regression" },description = "Correct Patient Last Name,Patient First Name")
public void Schedule_72_CorrectPatientName()
{
log.info("Schedule_72 - Step 01: Input correct Patient Last name");
schedulePage.inputPatientLastNameValue("Piccolo");
log.info("Schedule_72 - Step 02: Input correct Patient First name");
schedulePage.inputPatientFirstNameValue("James");
log.info("Schedule_72 - Step 03: Input correct Patient Preferred Name");
schedulePage.inputPatientPreferredNameValue("");
log.info("Schedule_72 - Step 04: Input incorrect Provider Last Name");
schedulePage.inputProviderLastNameValue("");
log.info("Schedule_72 - Step 05: Input incorrect Provider First Name");
schedulePage.inputProviderFirstNameValue("");
log.info("Schedule_72 - Step 06: Select Appointment Type");
schedulePage.selectAppointmentType("");
log.info("Schedule_72 - Step 07: Input incorrect Note");
schedulePage.inputNoteValue("");
log.info("Schedule_72 - Step 08: Click on Search button");
schedulePage.clickOnSearchAppointmentButton();
log.info("VP: Show list of Exception Appt of Patient: Panther, Pink");
verifyTrue(schedulePage.isListOfExceptionApptDisplayWithPatientInfor("Piccolo, James"));
}
@Test(groups = { "regression" },description = "Correct all field")
public void Schedule_73_CorrectAllField()
{
log.info("Schedule_73 - Step 01: Input correct Patient Last name");
schedulePage.inputPatientLastNameValue("Piccolo");
log.info("Schedule_73 - Step 02: Input correct Patient First name");
schedulePage.inputPatientFirstNameValue("James");
log.info("Schedule_73 - Step 03: Input correct Patient Preferred Name");
schedulePage.inputPatientPreferredNameValue("");
log.info("Schedule_73 - Step 04: Input correct Provider Last Name");
schedulePage.inputProviderLastNameValue("Needle");
log.info("Schedule_73 - Step 05: Input correct Provider First Name");
schedulePage.inputProviderFirstNameValue("Space");
log.info("Schedule_73 - Step 06: Select Appointment Type");
schedulePage.selectAppointmentType(apptType);
log.info("Schedule_73 - Step 07: Input correct Note");
schedulePage.inputNoteValue("");
log.info("Schedule_73 - Step 08: Click on Search button");
schedulePage.clickOnSearchAppointmentButton();
log.info("VP: Show list of Exception Appt with all correct infor");
verifyTrue(schedulePage.isExceptionAppointmentDisplayWithCorrectInfor(apptType, "Piccolo, James", provider));
}
@AfterClass(alwaysRun = true)
public void tearDown() {
logout(driver, ipClient);
closeBrowser(driver);
}
private WebDriver driver;
private LoginPage loginPage;
private SchedulePage schedulePage;
private String organization, qaStaffUsername, password;
private int numberOfExceptionApptItem;
private String apptType, provider;
}
|
[
"Tan Le"
] |
Tan Le
|
fab18572c48580c0b7668e9329312bec148b9732
|
bf7923b32cc49c4708d32034a15de8b74eb9112c
|
/app/src/main/java/com/example/rutuldesai/orangescrum/MySharedPreference.java
|
9af0bc49e532f3101fb21939c1811c17ec828225
|
[] |
no_license
|
rutuldesai1993/Orange-Scrum
|
7339439b0e3b8e722df53eb526456fb381273279
|
30656728dc6e41b86a78b65b6c166f8b018a3611
|
refs/heads/master
| 2020-04-12T07:37:02.676785 | 2019-01-02T20:26:35 | 2019-01-02T20:26:35 | 162,359,970 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,756 |
java
|
package com.example.rutuldesai.orangescrum;
import android.content.Context;
import android.content.SharedPreferences;
public class MySharedPreference {
private static final String OC_PASSWORD = "oc_password";
private static final String OC_CHECKED = "oc_checked";
private static final String OC_EMAIL = "oc_email";
SharedPreferences preferences;
static MySharedPreference mySharedPreference;
public static final String OC_PREFERENCES = "ocpreferences";
public static final String OC_AUTH_TOKEN = "oc_authtoken";
private MySharedPreference(Context context) {
preferences = context.getSharedPreferences(OC_PREFERENCES,Context.MODE_PRIVATE);
}
public static MySharedPreference getInstance(Context context) {
if(mySharedPreference == null)
mySharedPreference = new MySharedPreference(context);
return mySharedPreference;
}
public void saveAuthToken(String token)
{
preferences.edit().putString(OC_AUTH_TOKEN,token).commit();
}
public String getAuthToken()
{
return preferences.getString(OC_AUTH_TOKEN,null);
}
public void saveLogin(String email,String password)
{
preferences.edit().putString(OC_EMAIL,email).commit();
preferences.edit().putString(OC_PASSWORD,password).commit();
}
public String getEmail()
{
return preferences.getString(OC_EMAIL,null);
}
public String getOcPassword()
{
return preferences.getString(OC_PASSWORD,null);
}
public void saveChecked(Boolean checked){
preferences.edit().putBoolean(OC_CHECKED,checked).commit();
}
public boolean getChecked(){
return preferences.getBoolean(OC_CHECKED, false);
}
}
|
[
"[email protected]"
] | |
7a8c9561748a14c4150628141e811251098970f3
|
7ce64c7b3219b4932dcd9fbd2688d06e53c2d980
|
/cocoatouch/src/main/java/org/robovm/cocoatouch/foundation/NSUUID.java
|
26114ca1da3ccd7664a18d4c262e0adc156aac36
|
[
"Apache-2.0"
] |
permissive
|
shannah/robovm
|
d410764a717055c76ec7981bc547b3385692a486
|
17b723a0485cbf0700af9ec55ff3272879c112b3
|
refs/heads/master
| 2021-01-18T08:58:33.598527 | 2013-09-09T19:28:44 | 2013-09-09T19:28:44 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,847 |
java
|
/*
* Copyright (C) 2012 Trillian AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.robovm.cocoatouch.foundation;
/*<imports>*/
import java.util.*;
import org.robovm.objc.*;
import org.robovm.objc.annotation.*;
import org.robovm.objc.block.*;
import org.robovm.rt.bro.*;
import org.robovm.rt.bro.annotation.*;
import org.robovm.rt.bro.ptr.*;
/*</imports>*/
/**
*
* <div class="javadoc">
* @see <a href="http://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/ObjC_classic/../../../../Foundation/Reference/NSUUID_Class/Reference/Reference.html">NSUUID Class Reference</a>
* @since Available in iOS 6.0 and later.
* </div>
*/
/*<library>*/@Library("Foundation")/*</library>*/
@NativeClass public class /*<name>*/ NSUUID /*</name>*/
extends /*<extends>*/ NSObject /*</extends>*/
/*<implements>*/ /*</implements>*/ {
static {
ObjCRuntime.bind(/*<name>*/ NSUUID /*</name>*/.class);
}
private static final ObjCClass objCClass = ObjCClass.getByType(/*<name>*/ NSUUID /*</name>*/.class);
/*<constructors>*/
protected NSUUID(SkipInit skipInit) { super(skipInit); }
public NSUUID() {}
/*</constructors>*/
/*<properties>*/
/*</properties>*/
/*<methods>*/
/*</methods>*/
/*<callbacks>*/
/*</callbacks>*/
}
|
[
"[email protected]"
] | |
baf33e17bbb1344a0024d93c428145ab61bcf336
|
adf22b8fea4d94790b10cc77358dca4ce07b31fd
|
/app/src/main/java/com/linkloving/taiwan/logic/UI/HeartRate/DayDatefragment.java
|
c465bc81566bd76889d166ff174f06eb10db242c
|
[] |
no_license
|
shangdinvxu/taiwan
|
eec5ed9cd6b3b3c540f09fba5a2ef42ac1d8c7d1
|
5cbf483d1de1a27e9780add3b389034f0e53adf5
|
refs/heads/master
| 2021-01-22T20:25:38.878891 | 2017-05-06T14:43:28 | 2017-05-06T14:43:28 | 85,319,569 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,501 |
java
|
package com.linkloving.taiwan.logic.UI.HeartRate;
import android.annotation.TargetApi;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.linkloving.taiwan.R;
import com.linkloving.taiwan.utils.ViewUtils.calendar.MonthDateView;
import butterknife.ButterKnife;
/**
* Created by Daniel.Xu on 2016/11/3.
*/
public class DayDatefragment extends Fragment {
public ImageView left_btn ;
public ImageView right_btn;
public MonthDateView monthDateView;
private IDataChangeListener dataChangeListener;
private View view ;
public String date;
private int type = 0;
public void setDataChangeListener(IDataChangeListener dataChangeListener){
this.dataChangeListener = dataChangeListener;
}
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.tw_dayview_fragment, container, false);
LinearLayout totalView = (LinearLayout) view.findViewById(R.id.step_linear_day);
totalView.setPadding(0,200,0,0);
ButterKnife.inject(this, view);
left_btn = (ImageView) view.findViewById(R.id.step_calendar_iv_left);
right_btn = (ImageView) view.findViewById(R.id.step_calendar_iv_right);
monthDateView = (MonthDateView) view.findViewById(R.id.monthDateView);
monthDateView.setDateClick(new MonthDateView.DateClick() {
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onClickOnDate() {
//拼接日期字符串(可以自己定义)
if (monthDateView.getmSelDay()==0){
return ;
}
String checkDate =monthDateView.getmSelYear()+"-"+monthDateView.getmSelMonth()+"-"+monthDateView.getmSelDay();
dataChangeListener.onDataChange(checkDate);
if (type == 0) {
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
DayFragment dayFragment = new DayFragment();
Bundle bundle = new Bundle();
bundle.putString("checkDate", checkDate);
dayFragment.setArguments(bundle);
transaction.replace(R.id.middle_framelayout, dayFragment);
fragmentManager.popBackStack(null,1);
transaction.addToBackStack(null);
transaction.commit();
}
}
});
left_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
type = 1;
monthDateView.onLeftClick();
type = 0;
}
});
right_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
type = 1;
monthDateView.onRightClick();
type = 0;
}
});
return view;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}
|
[
"[email protected]"
] | |
1173b98e7416cd27ee70f05c9782c20e7f1141a3
|
3a291f22e3c4e4f33dfcdc46c4d2f5a2ddcf654e
|
/qt-trading-admin/src/main/java/com/qtdbp/tradingadmin/AdminApplication.java
|
de4847abe32a8f7b35ad84f9a57d03149b048e0a
|
[] |
no_license
|
zjpjohn/qtbdp-parents
|
5b8ac601acf1b6ab08a1879f23d64e436814218f
|
d2e7367a76ff2dc786961e645916c764a5543222
|
refs/heads/master
| 2020-12-03T02:01:31.440633 | 2017-06-30T10:20:09 | 2017-06-30T10:20:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,649 |
java
|
package com.qtdbp.tradingadmin;
import com.github.tobato.fastdfs.FdfsClientConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
/**
* 钱塘数据交易中心后台管理应用
*
* @Import(FdfsClientConfig.class) 注入fastDfs 客户端
* @author: caidchen
* @create: 2017-04-12 13:53
* To change this template use File | Settings | File Templates.
*/
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages = "com.qtdbp.tradingadmin.mapper")
@EnableJpaRepositories(basePackages = "com.qtdbp.tradingadmin.base.security.repository")
@Import(FdfsClientConfig.class)
public class AdminApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
}
/**
* 提供一个 SpringBootServletInitializer 子类,并覆盖它的 configure 方法。
* 我们可以把应用的主类改为继承 SpringBootServletInitializer
*
* @param application
* @return
*/
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(AdminApplication.class);
}
}
|
[
"[email protected]"
] | |
2b63b39719ed559bb28ee2d4e8f7233da97f9267
|
ea9a96a57eb558d6b4d061ddec16b5c9144d418c
|
/mehul_bhuva_assign1/coursesRegistration/src/coursesRegistration/util/Results.java
|
27d5c6025b2d182a5349277e595a28c55701388d
|
[] |
no_license
|
mebhuva/Course-Scheduler
|
50ce07db720aae1032d15aafbf6e3b31acc20dbe
|
ca8f6107a4a56c292d245104e63f78324638afb1
|
refs/heads/master
| 2020-04-14T09:46:35.175574 | 2018-09-24T00:39:22 | 2018-09-24T00:39:22 | 163,768,667 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,636 |
java
|
package coursesRegistration.util;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class Results implements FileDisplayInterface, StdoutDisplayInterface {
@Override
public String toString() {
return "Results [getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString()
+ "]";
}
//writing student name and allocated courses output on console
@Override
public void writeconsole(HashMap<String, Student> studentdetails) {
try {
//iterating through student detail hashmap
for (Map.Entry objstudentdetails : studentdetails.entrySet()) {
Student objstudent = new Student();
objstudent = (Student) objstudentdetails.getValue();
ArrayList<Course> courseallocated = new ArrayList<Course>();
courseallocated = objstudent.getCourseallocated();
System.out.println("Student_Name : "+ objstudentdetails.getKey()+" Course 1 : " +courseallocated.get(0).getCourseName()+", Course 2 : "+courseallocated.get(1).getCourseName()+", Course 3 : "+courseallocated.get(2).getCourseName());
}
} catch (Exception e) {
e.printStackTrace();
}
finally
{
}
}
//writing student name and allocated courses output in registration_results file
@Override
public void writeFile(HashMap<String, Student> studentdetails, String filename) {
BufferedWriter writer = null;
try {
File file = new File(filename);
writer = new BufferedWriter(new FileWriter(file, true));//using buffered writer to write into the file
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
}
try {
//iterating through student detail hashmap
for (Map.Entry objstudentdetails : studentdetails.entrySet()) {
Student objstudent = new Student();
objstudent = (Student) objstudentdetails.getValue();
ArrayList<Course> courseallocated = new ArrayList<Course>();
courseallocated = objstudent.getCourseallocated();
try {
writer.append("Student_Name : "+ objstudentdetails.getKey()+" Course 1 : " +courseallocated.get(0).getCourseName()+", Course 2 : "+courseallocated.get(1).getCourseName()+", Course 3 : "+courseallocated.get(2).getCourseName()+"\n");
} catch (IOException e) {
e.printStackTrace();
}
finally
{
}
}
} catch (Exception e1) {
e1.printStackTrace();
}
finally
{
}
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
finally
{
}
}
}
|
[
"[email protected]"
] | |
4d7d5c46a4625d1c04cbe03e31d7027fd7708c36
|
2a53e83fe358c4d5f4c73c6f0a71750260b140cb
|
/app/src/main/java/ve/com/lerny/paymentapp/base/BaseResponse.java
|
90bb3e497943b5096bd09101d617fb936c34544b
|
[] |
no_license
|
darkangel00016/PaymentApp
|
4ebf962a1c2af044d19f5f2e070bc5bed8ef85fb
|
97014c5069fea9ebc47752cdecd0bb930276b7a9
|
refs/heads/master
| 2020-03-20T23:13:39.438109 | 2018-06-19T03:31:03 | 2018-06-19T03:31:03 | 137,836,175 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 149 |
java
|
package ve.com.lerny.paymentapp.base;
public class BaseResponse {
public String error;
public String message;
public String status;
}
|
[
"[email protected]"
] | |
5adb3ae02e20eac33d1ebf19d9223c88fd969d40
|
b06666822d0e660e573385f4b2be254ec12d1b61
|
/app/src/androidTest/java/com/ooxx/meteor/androidcopter/ApplicationTest.java
|
323248544a65874f1dbeee35fab58c11b619449e
|
[] |
no_license
|
AlphaLambdaMuPi/AlphaRemoCON
|
aec66082bfeac7babb7ba207e3ee89b2768aa056
|
6471d014adb7e13545e6041ef9bd40ab750dfe8b
|
refs/heads/master
| 2021-01-10T21:19:59.632886 | 2015-06-30T12:16:13 | 2015-06-30T12:16:13 | 37,182,758 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 360 |
java
|
package com.ooxx.meteor.androidcopter;
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);
}
}
|
[
"[email protected]"
] | |
458dce6d0060847c075def12ad16d53b4775cd68
|
0fa708be5acc50b70cf1722e9b55d5697f041abc
|
/app/src/main/java/com/example/gilsonbarbosa/meuprogramamisto/daoum/dao/DaoPessoa.java
|
563aa2280b99e9a97c4a007559ce715fc49f7875
|
[] |
no_license
|
bersangue/meuprogramamisto
|
5dcc4caf49a77f2592740397ac78355ffbf30bc4
|
108836263bdc37cd06b0aeab0101f05e06329dd7
|
refs/heads/master
| 2020-03-12T02:52:59.214981 | 2018-04-20T20:56:52 | 2018-04-20T20:56:52 | 130,410,961 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,805 |
java
|
package com.example.gilsonbarbosa.meuprogramamisto.daoum.dao;
import android.content.ContentValues;
import android.content.Context;
import com.example.gilsonbarbosa.meuprogramamisto.daoum.domain.Pessoa;
import java.util.ArrayList;
public class DaoPessoa {
private Context context;
private DaoAdapter banco;
public DaoPessoa(Context context) {
this.context = context;
//instanciamos o DaoAdapter (Dao mãe)
banco = new DaoAdapter(context);
}
public long insert(Pessoa pessoa) {
/*
* Este método é um pouco mais trabalhado porém, nos retorna o id do
* utlimo registro. Este processo soluciona quando temos que inserir
* dados em chaves estrangeiras em outras tabelas...
*/
ContentValues values = new ContentValues();
values.put("nome", pessoa.getNome());
values.put("email", pessoa.getEmail());
values.put("telefone", pessoa.getTelefone());
// values.put("endereco", pessoa.getEndereco());
// values.put("cidade", pessoa.getCidade());
values.put("sexo", pessoa.getSexo());
long result = banco.queryInsertLastId("pessoa", values);
return result;
}
//Método de alteração
public boolean update(Pessoa pessoa) {
Object[] args = {
pessoa.getNome(),
pessoa.getEmail(),
pessoa.getTelefone(),
// pessoa.getEndereco(),
// pessoa.getCidade(),
pessoa.getSexo(),
pessoa.getId()
};
boolean result = banco.queryExecute(
"UPDATE pessoa SET " +
"nome = ?, " +
"email = ?, " +
"telefone = ?," +
// "endereco = ?," +
// "cidade = ?," +
"sexo = ? " +
"WHERE id = ?;", args);
return result;
}
//Método de exclusão
public boolean delete(long id) {
Object[] args = {id};
boolean result = banco.queryExecute("DELETE FROM pessoa WHERE id = ?", args);
return result;
}
//Método de consulta geral
public ArrayList<Pessoa> getTodos() {
ArrayList<Pessoa> pessoas = new ArrayList<Pessoa>();
ObjetoBanco ob = banco.queryConsulta("SELECT * FROM pessoa ORDER BY nome ASC", null);
if (ob != null) {
for (int i = 0; i < ob.size(); i++) {
Pessoa pessoa = new Pessoa();
pessoa.setId(ob.getLong(i, "id"));
pessoa.setNome(ob.getString(i, "nome"));
pessoa.setEmail(ob.getString(i, "email"));
pessoa.setTelefone(ob.getString(i, "telefone"));
// pessoa.setEndereco(ob.getString(i, "endereco"));
// pessoa.setCidade(ob.getString(i, "cidade"));
pessoa.setSexo(ob.getString(i, "sexo"));
pessoas.add(pessoa);
}
}
return pessoas;
}
//Método de consulta especifica
public Pessoa getPessoa(long id) {
String[] args = {String.valueOf(id)};
ObjetoBanco ob = banco.queryConsulta("SELECT * FROM pessoa WHERE id = ?", args);
Pessoa pessoa = null;
if (ob != null) {
pessoa = new Pessoa();
pessoa.setId(ob.getLong(0, "id"));
pessoa.setNome(ob.getString(0, "nome"));
pessoa.setEmail(ob.getString(0, "email"));
pessoa.setTelefone(ob.getString(0, "telefone"));
// pessoa.setEndereco(ob.getString( 0,"endereco"));
// pessoa.setCidade(ob.getString(0, "cidade"));
pessoa.setSexo(ob.getString(0, "sexo"));
}
return pessoa;
}
}
|
[
"[email protected]"
] | |
471c8dc41642617d336a1d286562e5532160b877
|
e553161c3adba5c1b19914adbacd58f34f27788e
|
/synoptic-ea407ba0a750/src/synoptic/tests/integration/TOMiningPerformanceTests.java
|
9580bb6caea3e4a98b072c4a5ebe4c2788e2c09c
|
[] |
no_license
|
ReedOei/dependent-tests-experiments
|
57daf82d1feb23165651067b7ac004dd74d1e23d
|
9fccc06ec13ff69a1ac8fb2a4dd6f93c89ebd29b
|
refs/heads/master
| 2020-03-20T02:50:59.514767 | 2018-08-23T16:46:01 | 2018-08-23T16:46:01 | 137,126,354 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,210 |
java
|
package synoptic.tests.integration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import synoptic.invariants.miners.ChainWalkingTOInvMiner;
import synoptic.invariants.miners.ITOInvariantMiner;
import synoptic.invariants.miners.TransitiveClosureInvMiner;
import synoptic.main.SynopticMain;
import synoptic.main.parser.ParseException;
import synoptic.main.parser.TraceParser;
import synoptic.model.ChainsTraceGraph;
import synoptic.model.EventNode;
import synoptic.tests.SynopticTest;
@RunWith(value = Parameterized.class)
public class TOMiningPerformanceTests extends SynopticTest {
ITOInvariantMiner miner = null;
int numIterations;
int totalEvents;
int numPartitions;
int numEventTypes;
/**
* Generates parameters for this unit test.
*
* @return The set of parameters to pass to the constructor the unit test.
*/
@Parameters
public static Collection<Object[]> data() {
Object[][] data = new Object[][] {
{ new TransitiveClosureInvMiner(false), 3, 1000, 10, 50 },
{ new TransitiveClosureInvMiner(true), 3, 1000, 10, 50 },
{ new ChainWalkingTOInvMiner(), 3, 10000, 10, 50 } };
return Arrays.asList(data);
}
public TOMiningPerformanceTests(ITOInvariantMiner minerToUse,
int numIterations, int totalEvents, int numPartitions,
int numEventTypes) {
miner = minerToUse;
this.numIterations = numIterations;
this.totalEvents = totalEvents;
this.numPartitions = numPartitions;
this.numEventTypes = numEventTypes;
}
@Before
public void setUp() throws ParseException {
super.setUp();
SynopticMain syn = synoptic.main.SynopticMain
.getInstanceWithExistenceCheck();
syn.options.logLvlExtraVerbose = false;
syn.options.logLvlQuiet = true;
}
public void reportTime(long msTime) {
System.out.println(testName.getMethodName() + ":" + "\n\ttotalEvents "
+ totalEvents + "\n\tnumPartitions " + numPartitions
+ "\n\tnumEventTypes " + numEventTypes + "\n\t==> TIME: "
+ msTime + "ms (averaged over " + numIterations
+ " iterations)\n");
}
@Test
public void mineInvariantsPerfTest() throws Exception {
long total_delta = 0;
long delta = 0;
for (int iter = 0; iter < numIterations; iter++) {
TraceParser parser = new TraceParser();
parser.addRegex("^(?<TYPE>)$");
parser.addPartitionsSeparator("^--$");
// //////
long startTime = System.currentTimeMillis();
String[] traces = partitionTrace(structure1Trace());
delta = System.currentTimeMillis() - startTime;
// ////////
System.out
.println("Done with generating trace in: " + delta + "ms");
// //////
startTime = System.currentTimeMillis();
ArrayList<EventNode> parsedEvents = parseLogEvents(traces, parser);
delta = System.currentTimeMillis() - startTime;
// ////////
System.out.println("Done with parsing trace in: " + delta + "ms");
// //////
startTime = System.currentTimeMillis();
ChainsTraceGraph inputGraph = parser
.generateDirectTORelation(parsedEvents);
delta = System.currentTimeMillis() - startTime;
// ////////
System.out.println("Done with generateDirectTemporalRelation in: "
+ delta + "ms");
System.out.println("Starting mining..");
// /////////////
startTime = System.currentTimeMillis();
miner.computeInvariants(inputGraph, false);
total_delta += System.currentTimeMillis() - startTime;
// /////////////
}
delta = total_delta / numIterations;
reportTime(delta);
}
private String[] structure1Trace() {
String[] trace = new String[totalEvents];
for (int i = 0; i < totalEvents; i++) {
trace[i] = "" + i % numEventTypes;
}
return trace;
}
private String[] partitionTrace(String[] trace) {
if (trace.length % numPartitions != 0) {
throw new IllegalArgumentException(
"Cannot evenly divide trace into partitions");
}
int perPartition = trace.length / numPartitions;
String[] partitioned = new String[trace.length + numPartitions - 1];
int inPartCnt = 0;
int j = 0;
for (int i = 0; i < trace.length; i++) {
partitioned[j] = trace[i];
if (inPartCnt == perPartition) {
partitioned[j + 1] = "--";
j += 2;
inPartCnt = 0;
continue;
}
j++;
inPartCnt += 1;
}
return partitioned;
}
}
|
[
"[email protected]"
] | |
1705677c88718c41a4e8d2d12719605763f7ad82
|
b4518739e003f3bb39e700f1ab0e82b44139b3af
|
/src/main/java/com/elali/banking/TypeConverter.java
|
079ed717658a4e82b645f24cb0519df27f757c81
|
[] |
no_license
|
ielali/Banking
|
532cd190f24642c288cb4941572ff1d6fe7aa76a
|
8f33635167ba697c51065a3ef7b07c7744110e68
|
refs/heads/master
| 2020-05-18T02:08:39.984738 | 2013-11-24T22:28:22 | 2013-11-24T22:28:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,746 |
java
|
package com.elali.banking;
import com.elali.banking.dao.Repository;
import com.elali.banking.domain.DomainObject;
import javax.annotation.Resource;
import javax.inject.Named;
import java.io.Serializable;
import java.lang.reflect.Member;
import java.util.Map;
import static risible.util.ClassUtils.getParameterizedTypes;
/**
* Created with IntelliJ IDEA.
* User: Imad
* Date: 10/15/13
* Time: 1:07 PM
*/
@Named("typeConverter")
public class TypeConverter extends risible.core.TypeConverter {
@Resource
Repository repository;
@Override
public Object convertValue(Map context, Object target, Member member, String propertyName, Object value, Class toType) {
String stringValue = toSingleString(value);
if (DomainObject.class.isAssignableFrom(toType)) {
Class domainObjectIdType = (Class) (getParameterizedTypes(toType)[0]);
Serializable id = (Serializable) convertPrimitives(propertyName, domainObjectIdType, stringValue);
DomainObject object = repository.find(toType, id);
if (object == null) {
try {
object = (DomainObject) toType.newInstance();
object.setId(id);
return object;
} catch (InstantiationException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IllegalAccessException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
return null;
}
return super.convertValue(context, target, member, propertyName, value, toType);
}
}
|
[
"[email protected]"
] | |
7a573cc022f90388a9c5ac162fddc557e18a17b6
|
2b2fcb1902206ad0f207305b9268838504c3749b
|
/WakfuClientSources/srcx/class_2539_axm.java
|
afb1ac99a1784f9cda7e0c8dca53c6d46141a8e1
|
[] |
no_license
|
shelsonjava/Synx
|
4fbcee964631f747efc9296477dee5a22826791a
|
0cb26d5473ba1f36a3ea1d7163a5b9e6ebcb0b1d
|
refs/heads/master
| 2021-01-15T13:51:41.816571 | 2013-11-17T10:46:22 | 2013-11-17T10:46:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 84 |
java
|
final class axm
implements cVt
{
public XF aHa()
{
return new bPJ();
}
}
|
[
"[email protected]"
] | |
a595908a3d9207ae620c1c84cb8f59d2e3d89a88
|
cd14bf9b83ac28367f12d3bdd9f1318913f4f3c0
|
/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/StoreEngine.java
|
681b7fcc11da242a731512c985afd09d12bfdc39
|
[
"Apache-2.0"
] |
permissive
|
AprilYoLies/sofa-jraft
|
313de97e0ae88d8c4d8b4d72f4c35f6a889f8ba2
|
2a36dacc803589fe973ca732b3f7b3d0d02276e3
|
refs/heads/master
| 2022-11-21T23:21:17.378939 | 2019-12-18T09:03:47 | 2019-12-18T09:03:47 | 228,800,125 | 0 | 0 |
Apache-2.0
| 2022-11-16T09:21:59 | 2019-12-18T09:04:39 |
Java
|
UTF-8
|
Java
| false | false | 29,080 |
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.rhea;
import java.io.File;
import java.nio.ByteBuffer;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alipay.remoting.rpc.RpcServer;
import com.alipay.sofa.jraft.Lifecycle;
import com.alipay.sofa.jraft.Status;
import com.alipay.sofa.jraft.entity.Task;
import com.alipay.sofa.jraft.option.NodeOptions;
import com.alipay.sofa.jraft.rhea.client.pd.HeartbeatSender;
import com.alipay.sofa.jraft.rhea.client.pd.PlacementDriverClient;
import com.alipay.sofa.jraft.rhea.client.pd.RemotePlacementDriverClient;
import com.alipay.sofa.jraft.rhea.errors.Errors;
import com.alipay.sofa.jraft.rhea.errors.RheaRuntimeException;
import com.alipay.sofa.jraft.rhea.metadata.Region;
import com.alipay.sofa.jraft.rhea.metadata.RegionEpoch;
import com.alipay.sofa.jraft.rhea.metadata.Store;
import com.alipay.sofa.jraft.rhea.metrics.KVMetrics;
import com.alipay.sofa.jraft.rhea.options.HeartbeatOptions;
import com.alipay.sofa.jraft.rhea.options.MemoryDBOptions;
import com.alipay.sofa.jraft.rhea.options.RegionEngineOptions;
import com.alipay.sofa.jraft.rhea.options.RocksDBOptions;
import com.alipay.sofa.jraft.rhea.options.StoreEngineOptions;
import com.alipay.sofa.jraft.rhea.rpc.ExtSerializerSupports;
import com.alipay.sofa.jraft.rhea.serialization.Serializers;
import com.alipay.sofa.jraft.rhea.storage.BatchRawKVStore;
import com.alipay.sofa.jraft.rhea.storage.KVClosureAdapter;
import com.alipay.sofa.jraft.rhea.storage.KVOperation;
import com.alipay.sofa.jraft.rhea.storage.KVStoreClosure;
import com.alipay.sofa.jraft.rhea.storage.MemoryRawKVStore;
import com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore;
import com.alipay.sofa.jraft.rhea.storage.StorageType;
import com.alipay.sofa.jraft.rhea.util.Constants;
import com.alipay.sofa.jraft.rhea.util.Lists;
import com.alipay.sofa.jraft.rhea.util.Maps;
import com.alipay.sofa.jraft.rhea.util.NetUtil;
import com.alipay.sofa.jraft.rhea.util.Strings;
import com.alipay.sofa.jraft.rpc.RaftRpcServerFactory;
import com.alipay.sofa.jraft.util.BytesUtil;
import com.alipay.sofa.jraft.util.Describer;
import com.alipay.sofa.jraft.util.Endpoint;
import com.alipay.sofa.jraft.util.ExecutorServiceHelper;
import com.alipay.sofa.jraft.util.MetricThreadPoolExecutor;
import com.alipay.sofa.jraft.util.Requires;
import com.alipay.sofa.jraft.util.Utils;
import com.codahale.metrics.ScheduledReporter;
import com.codahale.metrics.Slf4jReporter;
/**
* Storage engine, there is only one instance in a node,
* containing one or more {@link RegionEngine}.
*
* @author jiachun.fjc
*/
public class StoreEngine implements Lifecycle<StoreEngineOptions> {
private static final Logger LOG = LoggerFactory
.getLogger(StoreEngine.class);
static {
ExtSerializerSupports.init();
}
private final ConcurrentMap<Long, RegionKVService> regionKVServiceTable = Maps.newConcurrentMapLong();
private final ConcurrentMap<Long, RegionEngine> regionEngineTable = Maps.newConcurrentMapLong();
private final StateListenerContainer<Long> stateListenerContainer;
private final PlacementDriverClient pdClient;
private final long clusterId;
private Long storeId;
private final AtomicBoolean splitting = new AtomicBoolean(false);
// When the store is started (unix timestamp in milliseconds)
private long startTime = System.currentTimeMillis();
private File dbPath;
private RpcServer rpcServer;
private BatchRawKVStore<?> rawKVStore;
private HeartbeatSender heartbeatSender;
private StoreEngineOptions storeOpts;
// Shared executor services
private ExecutorService readIndexExecutor;
private ExecutorService raftStateTrigger;
private ExecutorService snapshotExecutor;
private ExecutorService cliRpcExecutor;
private ExecutorService raftRpcExecutor;
private ExecutorService kvRpcExecutor;
private ScheduledExecutorService metricsScheduler;
private ScheduledReporter kvMetricsReporter;
private ScheduledReporter threadPoolMetricsReporter;
private boolean started;
public StoreEngine(PlacementDriverClient pdClient, StateListenerContainer<Long> stateListenerContainer) {
this.pdClient = Requires.requireNonNull(pdClient, "pdClient");
this.clusterId = pdClient.getClusterId();
this.stateListenerContainer = Requires.requireNonNull(stateListenerContainer, "stateListenerContainer");
}
@Override
public synchronized boolean init(final StoreEngineOptions opts) {
if (this.started) {
LOG.info("[StoreEngine] already started.");
return true;
}
this.storeOpts = Requires.requireNonNull(opts, "opts");
Endpoint serverAddress = Requires.requireNonNull(opts.getServerAddress(), "opts.serverAddress");
final int port = serverAddress.getPort();
final String ip = serverAddress.getIp();
if (ip == null || Utils.IP_ANY.equals(ip)) {
serverAddress = new Endpoint(NetUtil.getLocalCanonicalHostName(), port);
opts.setServerAddress(serverAddress);
}
final long metricsReportPeriod = opts.getMetricsReportPeriod();
// init region options
List<RegionEngineOptions> rOptsList = opts.getRegionEngineOptionsList();
if (rOptsList == null || rOptsList.isEmpty()) {
// -1 region
final RegionEngineOptions rOpts = new RegionEngineOptions();
rOpts.setRegionId(Constants.DEFAULT_REGION_ID);
rOptsList = Lists.newArrayList();
rOptsList.add(rOpts);
opts.setRegionEngineOptionsList(rOptsList);
}
final String clusterName = this.pdClient.getClusterName();
for (final RegionEngineOptions rOpts : rOptsList) {
rOpts.setRaftGroupId(JRaftHelper.getJRaftGroupId(clusterName, rOpts.getRegionId()));
rOpts.setServerAddress(serverAddress);
rOpts.setInitialServerList(opts.getInitialServerList());
if (rOpts.getNodeOptions() == null) {
// copy common node options
rOpts.setNodeOptions(opts.getCommonNodeOptions() == null ? new NodeOptions() : opts
.getCommonNodeOptions().copy());
}
if (rOpts.getMetricsReportPeriod() <= 0 && metricsReportPeriod > 0) {
// extends store opts
rOpts.setMetricsReportPeriod(metricsReportPeriod);
}
}
// init store
final Store store = this.pdClient.getStoreMetadata(opts);
if (store == null || store.getRegions() == null || store.getRegions().isEmpty()) {
LOG.error("Empty store metadata: {}.", store);
return false;
}
this.storeId = store.getId();
// init executors
if (this.readIndexExecutor == null) {
this.readIndexExecutor = StoreEngineHelper.createReadIndexExecutor(opts.getReadIndexCoreThreads());
}
if (this.raftStateTrigger == null) {
this.raftStateTrigger = StoreEngineHelper.createRaftStateTrigger(opts.getLeaderStateTriggerCoreThreads());
}
if (this.snapshotExecutor == null) {
this.snapshotExecutor = StoreEngineHelper.createSnapshotExecutor(opts.getSnapshotCoreThreads(),
opts.getSnapshotMaxThreads());
}
// init rpc executors
final boolean useSharedRpcExecutor = opts.isUseSharedRpcExecutor();
if (!useSharedRpcExecutor) {
if (this.cliRpcExecutor == null) {
this.cliRpcExecutor = StoreEngineHelper.createCliRpcExecutor(opts.getCliRpcCoreThreads());
}
if (this.raftRpcExecutor == null) {
this.raftRpcExecutor = StoreEngineHelper.createRaftRpcExecutor(opts.getRaftRpcCoreThreads());
}
if (this.kvRpcExecutor == null) {
this.kvRpcExecutor = StoreEngineHelper.createKvRpcExecutor(opts.getKvRpcCoreThreads());
}
}
// init metrics
startMetricReporters(metricsReportPeriod);
// init rpc server
this.rpcServer = new RpcServer(port, true, false);
RaftRpcServerFactory.addRaftRequestProcessors(this.rpcServer, this.raftRpcExecutor, this.cliRpcExecutor);
StoreEngineHelper.addKvStoreRequestProcessor(this.rpcServer, this);
if (!this.rpcServer.start()) {
LOG.error("Fail to init [RpcServer].");
return false;
}
// init db store
if (!initRawKVStore(opts)) {
return false;
}
if (this.rawKVStore instanceof Describer) {
DescriberManager.getInstance().addDescriber((Describer) this.rawKVStore);
}
// init all region engine
if (!initAllRegionEngine(opts, store)) {
LOG.error("Fail to init all [RegionEngine].");
return false;
}
// heartbeat sender
if (this.pdClient instanceof RemotePlacementDriverClient) {
HeartbeatOptions heartbeatOpts = opts.getHeartbeatOptions();
if (heartbeatOpts == null) {
heartbeatOpts = new HeartbeatOptions();
}
this.heartbeatSender = new HeartbeatSender(this);
if (!this.heartbeatSender.init(heartbeatOpts)) {
LOG.error("Fail to init [HeartbeatSender].");
return false;
}
}
this.startTime = System.currentTimeMillis();
LOG.info("[StoreEngine] start successfully: {}.", this);
return this.started = true;
}
@Override
public synchronized void shutdown() {
if (!this.started) {
return;
}
if (this.rpcServer != null) {
this.rpcServer.stop();
}
if (!this.regionEngineTable.isEmpty()) {
for (final RegionEngine engine : this.regionEngineTable.values()) {
engine.shutdown();
}
this.regionEngineTable.clear();
}
if (this.rawKVStore != null) {
this.rawKVStore.shutdown();
}
if (this.heartbeatSender != null) {
this.heartbeatSender.shutdown();
}
this.regionKVServiceTable.clear();
if (this.kvMetricsReporter != null) {
this.kvMetricsReporter.stop();
}
if (this.threadPoolMetricsReporter != null) {
this.threadPoolMetricsReporter.stop();
}
ExecutorServiceHelper.shutdownAndAwaitTermination(this.readIndexExecutor);
ExecutorServiceHelper.shutdownAndAwaitTermination(this.raftStateTrigger);
ExecutorServiceHelper.shutdownAndAwaitTermination(this.snapshotExecutor);
ExecutorServiceHelper.shutdownAndAwaitTermination(this.cliRpcExecutor);
ExecutorServiceHelper.shutdownAndAwaitTermination(this.raftRpcExecutor);
ExecutorServiceHelper.shutdownAndAwaitTermination(this.kvRpcExecutor);
ExecutorServiceHelper.shutdownAndAwaitTermination(this.metricsScheduler);
this.started = false;
LOG.info("[StoreEngine] shutdown successfully.");
}
public PlacementDriverClient getPlacementDriverClient() {
return pdClient;
}
public long getClusterId() {
return clusterId;
}
public Long getStoreId() {
return storeId;
}
public StoreEngineOptions getStoreOpts() {
return storeOpts;
}
public long getStartTime() {
return startTime;
}
public RpcServer getRpcServer() {
return rpcServer;
}
public BatchRawKVStore<?> getRawKVStore() {
return rawKVStore;
}
public RegionKVService getRegionKVService(final long regionId) {
return this.regionKVServiceTable.get(regionId);
}
public long getTotalSpace() {
if (this.dbPath == null || !this.dbPath.exists()) {
return 0;
}
return this.dbPath.getTotalSpace();
}
public long getUsableSpace() {
if (this.dbPath == null || !this.dbPath.exists()) {
return 0;
}
return this.dbPath.getUsableSpace();
}
public long getStoreUsedSpace() {
if (this.dbPath == null || !this.dbPath.exists()) {
return 0;
}
return FileUtils.sizeOf(this.dbPath);
}
public Endpoint getSelfEndpoint() {
return this.storeOpts == null ? null : this.storeOpts.getServerAddress();
}
public RegionEngine getRegionEngine(final long regionId) {
return this.regionEngineTable.get(regionId);
}
public List<RegionEngine> getAllRegionEngines() {
return Lists.newArrayList(this.regionEngineTable.values());
}
public ExecutorService getReadIndexExecutor() {
return readIndexExecutor;
}
public void setReadIndexExecutor(ExecutorService readIndexExecutor) {
this.readIndexExecutor = readIndexExecutor;
}
public ExecutorService getRaftStateTrigger() {
return raftStateTrigger;
}
public void setRaftStateTrigger(ExecutorService raftStateTrigger) {
this.raftStateTrigger = raftStateTrigger;
}
public ExecutorService getSnapshotExecutor() {
return snapshotExecutor;
}
public void setSnapshotExecutor(ExecutorService snapshotExecutor) {
this.snapshotExecutor = snapshotExecutor;
}
public ExecutorService getCliRpcExecutor() {
return cliRpcExecutor;
}
public void setCliRpcExecutor(ExecutorService cliRpcExecutor) {
this.cliRpcExecutor = cliRpcExecutor;
}
public ExecutorService getRaftRpcExecutor() {
return raftRpcExecutor;
}
public void setRaftRpcExecutor(ExecutorService raftRpcExecutor) {
this.raftRpcExecutor = raftRpcExecutor;
}
public ExecutorService getKvRpcExecutor() {
return kvRpcExecutor;
}
public void setKvRpcExecutor(ExecutorService kvRpcExecutor) {
this.kvRpcExecutor = kvRpcExecutor;
}
public ScheduledExecutorService getMetricsScheduler() {
return metricsScheduler;
}
public void setMetricsScheduler(ScheduledExecutorService metricsScheduler) {
this.metricsScheduler = metricsScheduler;
}
public ScheduledReporter getKvMetricsReporter() {
return kvMetricsReporter;
}
public void setKvMetricsReporter(ScheduledReporter kvMetricsReporter) {
this.kvMetricsReporter = kvMetricsReporter;
}
public ScheduledReporter getThreadPoolMetricsReporter() {
return threadPoolMetricsReporter;
}
public void setThreadPoolMetricsReporter(ScheduledReporter threadPoolMetricsReporter) {
this.threadPoolMetricsReporter = threadPoolMetricsReporter;
}
public boolean removeAndStopRegionEngine(final long regionId) {
final RegionEngine engine = this.regionEngineTable.get(regionId);
if (engine != null) {
engine.shutdown();
return true;
}
return false;
}
public StateListenerContainer<Long> getStateListenerContainer() {
return stateListenerContainer;
}
public List<Long> getLeaderRegionIds() {
final List<Long> regionIds = Lists.newArrayListWithCapacity(this.regionEngineTable.size());
for (final RegionEngine regionEngine : this.regionEngineTable.values()) {
if (regionEngine.isLeader()) {
regionIds.add(regionEngine.getRegion().getId());
}
}
return regionIds;
}
public int getRegionCount() {
return this.regionEngineTable.size();
}
public int getLeaderRegionCount() {
int count = 0;
for (final RegionEngine regionEngine : this.regionEngineTable.values()) {
if (regionEngine.isLeader()) {
count++;
}
}
return count;
}
public boolean isBusy() {
// Need more info
return splitting.get();
}
public void applySplit(final Long regionId, final Long newRegionId, final KVStoreClosure closure) {
Requires.requireNonNull(regionId, "regionId");
Requires.requireNonNull(newRegionId, "newRegionId");
if (this.regionEngineTable.containsKey(newRegionId)) {
closure.setError(Errors.CONFLICT_REGION_ID);
closure.run(new Status(-1, "Conflict region id %d", newRegionId));
return;
}
if (!this.splitting.compareAndSet(false, true)) {
closure.setError(Errors.SERVER_BUSY);
closure.run(new Status(-1, "Server is busy now"));
return;
}
final RegionEngine parentEngine = getRegionEngine(regionId);
if (parentEngine == null) {
closure.setError(Errors.NO_REGION_FOUND);
closure.run(new Status(-1, "RegionEngine[%s] not found", regionId));
this.splitting.set(false);
return;
}
if (!parentEngine.isLeader()) {
closure.setError(Errors.NOT_LEADER);
closure.run(new Status(-1, "RegionEngine[%s] not leader", regionId));
this.splitting.set(false);
return;
}
final Region parentRegion = parentEngine.getRegion();
final byte[] startKey = BytesUtil.nullToEmpty(parentRegion.getStartKey());
final byte[] endKey = parentRegion.getEndKey();
final long approximateKeys = this.rawKVStore.getApproximateKeysInRange(startKey, endKey);
final long leastKeysOnSplit = this.storeOpts.getLeastKeysOnSplit();
if (approximateKeys < leastKeysOnSplit) {
closure.setError(Errors.TOO_SMALL_TO_SPLIT);
closure.run(new Status(-1, "RegionEngine[%s]'s keys less than %d", regionId, leastKeysOnSplit));
this.splitting.set(false);
return;
}
final byte[] splitKey = this.rawKVStore.jumpOver(startKey, approximateKeys >> 1);
if (splitKey == null) {
closure.setError(Errors.STORAGE_ERROR);
closure.run(new Status(-1, "Fail to scan split key"));
this.splitting.set(false);
return;
}
final KVOperation op = KVOperation.createRangeSplit(splitKey, regionId, newRegionId);
final Task task = new Task();
task.setData(ByteBuffer.wrap(Serializers.getDefault().writeObject(op)));
task.setDone(new KVClosureAdapter(closure, op));
parentEngine.getNode().apply(task);
}
public void doSplit(final Long regionId, final Long newRegionId, final byte[] splitKey) {
try {
Requires.requireNonNull(regionId, "regionId");
Requires.requireNonNull(newRegionId, "newRegionId");
final RegionEngine parent = getRegionEngine(regionId);
final Region region = parent.getRegion().copy();
final RegionEngineOptions rOpts = parent.copyRegionOpts();
region.setId(newRegionId);
region.setStartKey(splitKey);
region.setRegionEpoch(new RegionEpoch(-1, -1));
rOpts.setRegionId(newRegionId);
rOpts.setStartKeyBytes(region.getStartKey());
rOpts.setEndKeyBytes(region.getEndKey());
rOpts.setRaftGroupId(JRaftHelper.getJRaftGroupId(this.pdClient.getClusterName(), newRegionId));
rOpts.setRaftDataPath(null);
String baseRaftDataPath = this.storeOpts.getRaftDataPath();
if (Strings.isBlank(baseRaftDataPath)) {
baseRaftDataPath = "";
}
rOpts.setRaftDataPath(baseRaftDataPath + "raft_data_region_" + region.getId() + "_"
+ getSelfEndpoint().getPort());
final RegionEngine engine = new RegionEngine(region, this);
if (!engine.init(rOpts)) {
LOG.error("Fail to init [RegionEngine: {}].", region);
throw Errors.REGION_ENGINE_FAIL.exception();
}
// update parent conf
final Region pRegion = parent.getRegion();
final RegionEpoch pEpoch = pRegion.getRegionEpoch();
final long version = pEpoch.getVersion();
pEpoch.setVersion(version + 1); // version + 1
pRegion.setEndKey(splitKey); // update endKey
// the following two lines of code can make a relation of 'happens-before' for
// read 'pRegion', because that a write to a ConcurrentMap happens-before every
// subsequent read of that ConcurrentMap.
this.regionEngineTable.put(region.getId(), engine);
registerRegionKVService(new DefaultRegionKVService(engine));
// update local regionRouteTable
this.pdClient.getRegionRouteTable().splitRegion(pRegion.getId(), region);
} finally {
this.splitting.set(false);
}
}
private void startMetricReporters(final long metricsReportPeriod) {
if (metricsReportPeriod <= 0) {
return;
}
if (this.kvMetricsReporter == null) {
if (this.metricsScheduler == null) {
// will sharing with all regionEngines
this.metricsScheduler = StoreEngineHelper.createMetricsScheduler();
}
// start kv store metrics reporter
this.kvMetricsReporter = Slf4jReporter.forRegistry(KVMetrics.metricRegistry()) //
.prefixedWith("store_" + this.storeId) //
.withLoggingLevel(Slf4jReporter.LoggingLevel.INFO) //
.outputTo(LOG) //
.scheduleOn(this.metricsScheduler) //
.shutdownExecutorOnStop(false) //
.build();
this.kvMetricsReporter.start(metricsReportPeriod, TimeUnit.SECONDS);
}
if (this.threadPoolMetricsReporter == null) {
if (this.metricsScheduler == null) {
// will sharing with all regionEngines
this.metricsScheduler = StoreEngineHelper.createMetricsScheduler();
}
// start threadPool metrics reporter
this.threadPoolMetricsReporter = Slf4jReporter.forRegistry(MetricThreadPoolExecutor.metricRegistry()) //
.withLoggingLevel(Slf4jReporter.LoggingLevel.INFO) //
.outputTo(LOG) //
.scheduleOn(this.metricsScheduler) //
.shutdownExecutorOnStop(false) //
.build();
this.threadPoolMetricsReporter.start(metricsReportPeriod, TimeUnit.SECONDS);
}
}
private boolean initRawKVStore(final StoreEngineOptions opts) {
final StorageType storageType = opts.getStorageType();
switch (storageType) {
case RocksDB:
return initRocksDB(opts);
case Memory:
return initMemoryDB(opts);
default:
throw new UnsupportedOperationException("unsupported storage type: " + storageType);
}
}
private boolean initRocksDB(final StoreEngineOptions opts) {
RocksDBOptions rocksOpts = opts.getRocksDBOptions();
if (rocksOpts == null) {
rocksOpts = new RocksDBOptions();
opts.setRocksDBOptions(rocksOpts);
}
String dbPath = rocksOpts.getDbPath();
if (Strings.isNotBlank(dbPath)) {
try {
FileUtils.forceMkdir(new File(dbPath));
} catch (final Throwable t) {
LOG.error("Fail to make dir for dbPath {}.", dbPath);
return false;
}
} else {
dbPath = "";
}
final String childPath = "db_" + this.storeId + "_" + opts.getServerAddress().getPort();
rocksOpts.setDbPath(Paths.get(dbPath, childPath).toString());
this.dbPath = new File(rocksOpts.getDbPath());
final RocksRawKVStore rocksRawKVStore = new RocksRawKVStore();
if (!rocksRawKVStore.init(rocksOpts)) {
LOG.error("Fail to init [RocksRawKVStore].");
return false;
}
this.rawKVStore = rocksRawKVStore;
return true;
}
private boolean initMemoryDB(final StoreEngineOptions opts) {
MemoryDBOptions memoryOpts = opts.getMemoryDBOptions();
if (memoryOpts == null) {
memoryOpts = new MemoryDBOptions();
opts.setMemoryDBOptions(memoryOpts);
}
final MemoryRawKVStore memoryRawKVStore = new MemoryRawKVStore();
if (!memoryRawKVStore.init(memoryOpts)) {
LOG.error("Fail to init [MemoryRawKVStore].");
return false;
}
this.rawKVStore = memoryRawKVStore;
return true;
}
private boolean initAllRegionEngine(final StoreEngineOptions opts, final Store store) {
Requires.requireNonNull(opts, "opts");
Requires.requireNonNull(store, "store");
String baseRaftDataPath = opts.getRaftDataPath();
if (Strings.isNotBlank(baseRaftDataPath)) {
try {
FileUtils.forceMkdir(new File(baseRaftDataPath));
} catch (final Throwable t) {
LOG.error("Fail to make dir for raftDataPath: {}.", baseRaftDataPath);
return false;
}
} else {
baseRaftDataPath = "";
}
final Endpoint serverAddress = opts.getServerAddress();
final List<RegionEngineOptions> rOptsList = opts.getRegionEngineOptionsList();
final List<Region> regionList = store.getRegions();
Requires.requireTrue(rOptsList.size() == regionList.size());
for (int i = 0; i < rOptsList.size(); i++) {
final RegionEngineOptions rOpts = rOptsList.get(i);
final Region region = regionList.get(i);
if (Strings.isBlank(rOpts.getRaftDataPath())) {
final String childPath = "raft_data_region_" + region.getId() + "_" + serverAddress.getPort();
rOpts.setRaftDataPath(Paths.get(baseRaftDataPath, childPath).toString());
}
Requires.requireNonNull(region.getRegionEpoch(), "regionEpoch");
final RegionEngine engine = new RegionEngine(region, this);
if (engine.init(rOpts)) {
final RegionKVService regionKVService = new DefaultRegionKVService(engine);
registerRegionKVService(regionKVService);
this.regionEngineTable.put(region.getId(), engine);
} else {
LOG.error("Fail to init [RegionEngine: {}].", region);
return false;
}
}
return true;
}
private void registerRegionKVService(final RegionKVService regionKVService) {
final RegionKVService preService = this.regionKVServiceTable.putIfAbsent(regionKVService.getRegionId(),
regionKVService);
if (preService != null) {
throw new RheaRuntimeException("RegionKVService[region=" + regionKVService.getRegionId()
+ "] has already been registered, can not register again!");
}
}
@Override
public String toString() {
return "StoreEngine{storeId=" + storeId + ", startTime=" + startTime + ", dbPath=" + dbPath + ", storeOpts="
+ storeOpts + ", started=" + started + '}';
}
}
|
[
"[email protected]"
] | |
4ba392568a7a77dd994bedcf785d07ee640eecc1
|
6fd2be8f7ac5d9dfa198f3b96db65357605eb9e9
|
/blog-app-apis/src/main/java/com/blog/demo/entities/Category.java
|
46c52d47cedf71b66482d2795609e0acbc350bf2
|
[
"MIT"
] |
permissive
|
usama-muf/usama-muf.github.io
|
51b1e2cbbad7b411154931bf959edec2b29e7591
|
e7fea5834855c5d6c3b018782ca33d0127943c7d
|
refs/heads/main
| 2023-09-01T08:51:01.236007 | 2023-08-24T10:23:47 | 2023-08-24T10:23:47 | 236,504,635 | 0 | 1 | null | 2022-03-07T07:34:07 | 2020-01-27T14:09:28 |
HTML
|
UTF-8
|
Java
| false | false | 1,300 |
java
|
package com.blog.demo.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "categories")
@NoArgsConstructor
@Getter
@Setter
public class Category {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int categoryId;
@NotNull @NotBlank
@Size(min = 3, max = 20, message = "Category length must be between 3 to 20 characters")
private String category;
@NotNull @NotBlank
@Size(min = 5, max = 200, message = "Description length must be between 5 to 200 characters")
@Column(name = "description")
private String categoryDescription;
@OneToMany(mappedBy = "category", cascade = CascadeType.ALL, fetch = FetchType.LAZY )
List<Post> posts = new ArrayList<>();
}
|
[
"[email protected]"
] | |
48d14f5b8ad31bedaf92da0fc3d092ef103e6d34
|
7355608148d406a74b4b56731b470bd6c8a029a0
|
/src/main/java/lukks/eu/ksiazkotk/controller/BooksController.java
|
484d91c9373fdfc8455783eccaf26c685d085854
|
[] |
no_license
|
lukaszdela/ksiazkotk
|
f8a8021465ed76caca7bd21113d8695bb14d6966
|
32b825af1eac84ab410cae7b8490cf4ce72120de
|
refs/heads/master
| 2020-03-21T16:23:58.466467 | 2018-07-09T16:56:33 | 2018-07-09T16:56:33 | 138,767,408 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,981 |
java
|
package lukks.eu.ksiazkotk.controller;
import lukks.eu.ksiazkotk.model.Book;
import lukks.eu.ksiazkotk.model.BookStatus;
import lukks.eu.ksiazkotk.model.Status;
import lukks.eu.ksiazkotk.model.User;
import lukks.eu.ksiazkotk.service.IBookService;
import lukks.eu.ksiazkotk.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Controller
public class BooksController {
private IBookService iBookService;
private IUserService iUserService;
@Autowired
public BooksController(IBookService iBookService, IUserService iUserService) {
this.iBookService = iBookService;
this.iUserService = iUserService;
}
@GetMapping("/")
public String getBookList(Model model){
List<Book> books = iBookService.getAllBooks();
model.addAttribute("books", books);
return "book";
}
@GetMapping("/books/addbook")
public String addBookForm(){
return "addbook";
}
@GetMapping("/books/all")
public String getAllBooks(Model model){
List<Book> books = iBookService.getAllBooks();
model.addAttribute("books", books);
return "book";
}
@GetMapping("/books/free")
public String getFreeBooks(Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
List<Book> books = iBookService.getAllFreeBook(username);
model.addAttribute("books", books);
return "book";
}
@GetMapping("/books/borrowed")
public String getBorrowedBooks(Model model){
List<Book> books = iBookService.getAllBorrowedBooks();
model.addAttribute("books", books);
return "book";
}
@RequestMapping(path = "/books/user/{username}", method = RequestMethod.GET)
public String getUserBooks(@PathVariable("username")String username, Model model){
List<Book> books = iBookService.getUserBooks(username);
model.addAttribute("books", books);
return "book";
}
@GetMapping(path = "/books/active")
public String getUserActiveBooks(Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
List<Book> books = iBookService.getUserActiveBooks(username);
model.addAttribute("books", books);
return "book";
}
@GetMapping(path = "/books/user")
public String getUserOwnedBooks(Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
List<Book> books = iBookService.getUserBooks(username);
model.addAttribute("books", books);
return "book";
}
@GetMapping(path = "/books")
public String searchBooks(@RequestParam("search") String search, Model model){
List<Book> books = iBookService.searchBooks(search);
model.addAttribute("books", books);
return "book";
}
@PostMapping(value = "/books/addbook/new")
public String addNewBook(@ModelAttribute Book book, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
User owner = iUserService.getUserByLogin(username);
book.setCover("/covers/default.jpg");
book.setStatus(BookStatus.FREE);
book.setActive(Status.NEW);
book.setOwner(owner);
List<Book> userBooks = owner.getBooks();
userBooks.add(book);
owner.setBooks(userBooks);
iUserService.saveUser(owner);
iBookService.saveBook(book);
String msg = String.format("New book has been added. Wait for admin to add cover and activate new book.");
model.addAttribute("msg", msg);
return "addbook";
}
@RequestMapping(path = "/books/borrow/{bookId}", method = RequestMethod.GET)
public String borrowBook(@PathVariable("bookId")Long bookId, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
User user = iUserService.getUserByLogin(username);
Book book = iBookService.readBook(bookId);
book.setStatus(BookStatus.LEND);
book.setBorower(user);
iBookService.saveBook(book);
List<Book> books = iBookService.getUserActiveBooks(username);
model.addAttribute("books", books);
return "book";
}
@RequestMapping(path = "/books/cancel/{bookId}", method = RequestMethod.GET)
public String cancelBorrow(@PathVariable("bookId")Long bookId, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
Book book = iBookService.readBook(bookId);
book.setStatus(BookStatus.FREE);
book.setBorower(null);
iBookService.saveBook(book);
List<Book> books = iBookService.getUserActiveBooks(username);
model.addAttribute("books", books);
return "book";
}
@RequestMapping(path = "/books/read/{bookId}", method = RequestMethod.GET)
public String reciveBook(@PathVariable("bookId")Long bookId, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
Book book = iBookService.readBook(bookId);
book.setStatus(BookStatus.READ);
iBookService.saveBook(book);
List<Book> books = iBookService.getUserActiveBooks(username);
model.addAttribute("books", books);
return "book";
}
@RequestMapping(path = "/books/readed/{bookId}", method = RequestMethod.GET)
public String returnBook(@PathVariable("bookId")Long bookId, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
Book book = iBookService.readBook(bookId);
book.setStatus(BookStatus.RETURN);
iBookService.saveBook(book);
List<Book> books = iBookService.getUserActiveBooks(username);
model.addAttribute("books", books);
return "book";
}
@RequestMapping(path = "/books/recive/{bookId}", method = RequestMethod.GET)
public String getBackBook(@PathVariable("bookId")Long bookId, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
Book book = iBookService.readBook(bookId);
book.setStatus(BookStatus.FREE);
iBookService.saveBook(book);
List<Book> books = iBookService.getAllBooks();
model.addAttribute("books", books);
return "book";
}
@RequestMapping(path = "/books/delete/{bookId}", method = RequestMethod.GET)
public String deleteBook(@PathVariable("bookId")Long bookId, Model model){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = authentication.getName();
Book book = iBookService.readBook(bookId);
book.setActive(Status.INACTIVE);
iBookService.saveBook(book);
List<Book> books = iBookService.getUserBooks(username);
model.addAttribute("books", books);
return "book";
}
}
|
[
"[email protected]"
] | |
201461d50e6d25504c12eb7c6b46b066ff143e39
|
3f3539aa3fedb393acef6de74dda766431089252
|
/src/com/zc/demo/demo01/User.java
|
233cf89123f75993cc36fce4db5fcd61fd313a52
|
[] |
no_license
|
microlovezc/DataStructuresandAlgorithms
|
96c72bd7d8873df2a1e81e1da7f44a10925daf8c
|
197faed9a2e0fe26e53e178617ea41a517b0207e
|
refs/heads/main
| 2023-03-19T10:12:23.092342 | 2021-03-12T02:41:05 | 2021-03-12T02:41:05 | 346,902,673 | 0 | 0 | null | 2021-03-12T02:41:05 | 2021-03-12T02:02:01 | null |
UTF-8
|
Java
| false | false | 607 |
java
|
package com.zc.demo.demo01;
public class User {
private String name;
private int money;
public User() {
}
public User(String name, int money) {
this.name = name;
this.money = money;
}
public void show(){
System.out.println("我是"+this.name+",我现在有:"+this.money+"元!");
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMoney() {
return money;
}
public void setMoney(int money) {
this.money = money;
}
}
|
[
"[email protected]"
] | |
c08131f2748f49cc89ff3480d107a99d4a52cf8c
|
1166ad6b5c9bb749ad32a233981f5362cb8b898c
|
/src/main/java/es/upm/fi/PROF_2019_EX2/EntradaInvalida.java
|
2c995ee3f52f12743da55dc5672369f8d908a7a3
|
[] |
no_license
|
JRuedas/PROF_2019_EX2
|
c7638e53755380397f8c839289b1a668dfb24855
|
380bea5c5ec23f24f18f0b71bb87b3038c8bfd8c
|
refs/heads/master
| 2023-08-31T11:38:49.021162 | 2023-08-22T09:41:31 | 2023-08-22T09:41:31 | 224,212,799 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 222 |
java
|
package es.upm.fi.PROF_2019_EX2;
public class EntradaInvalida extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 1L;
public EntradaInvalida(String message) {
super(message);
}
}
|
[
"[email protected]"
] | |
6d79d1fb2f644da0d25bbff5be5124b74f49b28b
|
b6aedb1f276790590e512c467afb835088cd8c42
|
/SeleniumClass/src/Selenium/Grade.java
|
b6e7d60b5a09c1ee6c291c9cf256d755d79c8e56
|
[] |
no_license
|
4pavel/Selenium-Class
|
f4627aee097bdb85d6fbbf82f641020156edf421
|
f62bed894d3d992b6c051135bdf34bbff6e4768e
|
refs/heads/master
| 2020-03-23T23:10:16.589238 | 2018-07-24T22:41:28 | 2018-07-24T22:41:28 | 142,219,738 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 240 |
java
|
package Selenium;
public class Grade {
public static String CalculateGrade(int Score) {
if (Score>90) {
return "A";
}
else if (Score<80) {
return "B";
}
return "F";
}
}
|
[
"Pavel@Pavel-PC"
] |
Pavel@Pavel-PC
|
c58e420ec7ef09971e796a409d13fe75355aef34
|
3ade6afce86e322cd54099b1222779938a008349
|
/userservice/src/main/java/com/juanchaparro/userservice/repo/UserRepo.java
|
5fc8f839ed90d20a7512fbe3c3ffc735ed756487
|
[] |
no_license
|
JCh6/UserService
|
95fa7b3e1c506f56299395cf0fc398c46473652a
|
5b5ed72ccc4ccbdfcc172ad720e8dad15316a912
|
refs/heads/main
| 2023-07-10T03:33:38.805736 | 2021-08-18T16:13:26 | 2021-08-18T16:13:26 | 397,370,496 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 270 |
java
|
package com.juanchaparro.userservice.repo;
import com.juanchaparro.userservice.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepo
extends JpaRepository<User, Long> {
User findByUsername(String username);
}
|
[
"[email protected]"
] | |
dcbf0a3bf74d9ef8acc6fa06897c263c933707fa
|
3021e101a772de0cb473d6692570f9aeeda1e3b9
|
/module-core/src/main/java/com/sxquan/core/entity/ServerResponse.java
|
693bc9b092fa6f250daab5d7e42f16fbce327949
|
[
"Apache-2.0"
] |
permissive
|
sunchuangxin/ebe-shop
|
96824d0fbac61f04dc9ff0797942d1867ab26adc
|
9044d593181051aa517b36c69f201059df3c373b
|
refs/heads/master
| 2023-07-29T08:37:43.466178 | 2021-06-08T07:25:19 | 2021-06-08T07:25:19 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,454 |
java
|
package com.sxquan.core.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.http.HttpStatus;
import java.io.Serializable;
/**
* @Description 统一接口返回
* @Author sxquan
* @Date 2019/12/20 15:20
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ServerResponse implements Serializable {
/**
* 响应代码
*/
private int code;
/**
* 响应消息
*/
private String message;
/**
* 响应结果
*/
private Object data;
private ServerResponse(int code) {
this.code = code;
}
private ServerResponse(int code, Object data) {
this.code = code;
this.data = data;
}
private ServerResponse(int code, String message, Object data) {
this.code = code;
this.message = message;
this.data = data;
}
private ServerResponse(int code, String message) {
this.code = code;
this.message = message;
}
//使之不在json序列化结果当中
@JsonIgnore
public boolean isSuccess() {
return this.code == HttpStatus.OK.value();
}
public int getCode() {
return code;
}
public Object getData() {
return data;
}
public String getMessage() {
return message;
}
public static ServerResponse success() {
return new ServerResponse(HttpStatus.OK.value(), HttpStatus.OK.getReasonPhrase());
}
public static ServerResponse successMessage(String message) {
return new ServerResponse(HttpStatus.OK.value(), message);
}
public static ServerResponse success(Object data) {
return new ServerResponse(HttpStatus.OK.value(), HttpStatus.OK.getReasonPhrase(),data);
}
public static ServerResponse success(String message, Object data) {
return new ServerResponse(HttpStatus.OK.value(), message, data);
}
public static ServerResponse error() {
return new ServerResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
}
public static ServerResponse error(String errorMessage) {
return new ServerResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), errorMessage);
}
public static ServerResponse error(int errorCode, String errorMessage) {
return new ServerResponse(errorCode, errorMessage);
}
}
|
[
"[email protected]"
] | |
742c925dc3f6e541d2ac2dfb7370d5c82c8b852d
|
1c323a486c3086e60d637f92e291816d07a7bbc5
|
/src/main/java/ch/tbd/kafka/backuprestore/restore/kafkaconnect/config/RestoreSourceConnectorConfig.java
|
8443153f0b70c9e84a30e99b048beeb082ecc791
|
[] |
no_license
|
antonioiorfino/kafka-backup
|
fca9719431156104ef512a890827c34a75ed09d3
|
13f3075322ae2352a02144edcb4be94ead4c5b84
|
refs/heads/master
| 2020-05-25T12:28:43.230434 | 2019-05-27T15:00:11 | 2019-05-27T15:00:11 | 187,799,710 | 0 | 0 | null | 2019-05-21T08:55:29 | 2019-05-21T08:55:29 | null |
UTF-8
|
Java
| false | false | 7,560 |
java
|
package ch.tbd.kafka.backuprestore.restore.kafkaconnect.config;
import ch.tbd.kafka.backuprestore.config.ComposableConfig;
import com.amazonaws.regions.RegionUtils;
import com.amazonaws.regions.Regions;
import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.common.config.ConfigDef.Importance;
import org.apache.kafka.common.config.ConfigDef.Type;
import org.apache.kafka.common.config.ConfigDef.Width;
import org.apache.kafka.common.config.ConfigException;
import org.apache.kafka.common.config.types.Password;
import org.apache.kafka.common.utils.Utils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* Class RestoreSourceConnectorConfig.
* This represents TODO.
*
* @author iorfinoa
* @version $$Revision$$
*/
public class RestoreSourceConnectorConfig extends AbstractConfig implements ComposableConfig {
public static final String S3_BUCKET_CONFIG = "s3.bucket.name";
public static final String RESTORE_TOPIC_NAME = "restore.topic";
public static final String S3_PROXY_URL_CONFIG = "s3.proxy.url";
public static final String S3_PROXY_URL_DEFAULT = "";
public static final String S3_PROXY_PORT_CONFIG = "s3.proxy.port";
public static final int S3_PROXY_PORT_DEFAULT = 0;
public static final String S3_PROXY_USER_CONFIG = "s3.proxy.user";
public static final String S3_PROXY_USER_DEFAULT = null;
public static final String S3_PROXY_PASS_CONFIG = "s3.proxy.password";
public static final Password S3_PROXY_PASS_DEFAULT = new Password(null);
public static final String REGION_CONFIG = "s3.region";
public static final String REGION_DEFAULT = Regions.DEFAULT_REGION.getName();
private String name;
public RestoreSourceConnectorConfig(Map<String, String> props) {
this(conf(), props);
}
protected RestoreSourceConnectorConfig(ConfigDef conf, Map<String, String> props) {
super(conf, props);
this.name = parseName(originalsStrings());
}
@Override
public Object get(String key) {
return super.get(key);
}
public String getName() {
return name;
}
public static ConfigDef conf() {
final String group = "restore-s3";
int orderInGroup = 0;
ConfigDef configDef = new ConfigDef()
.define(
S3_BUCKET_CONFIG,
ConfigDef.Type.STRING,
Importance.HIGH,
"The S3 Bucket.",
group,
++orderInGroup,
Width.LONG,
"S3 Bucket"
);
configDef.define(
RESTORE_TOPIC_NAME,
ConfigDef.Type.STRING,
Importance.HIGH,
"The topic name to restore.",
group,
++orderInGroup,
Width.LONG,
"The topic name to restore"
);
configDef.define(
S3_PROXY_URL_CONFIG,
ConfigDef.Type.STRING,
S3_PROXY_URL_DEFAULT,
Importance.LOW,
"S3 Proxy settings encoded in URL syntax. This property is meant to be used only if you"
+ " need to access S3 through a proxy.",
group,
++orderInGroup,
Width.LONG,
"S3 Proxy Settings"
);
configDef.define(
S3_PROXY_PORT_CONFIG,
ConfigDef.Type.INT,
S3_PROXY_PORT_DEFAULT,
Importance.LOW,
"S3 Proxy settings encoded in URL syntax. This property is meant to be used only if you"
+ " need to access S3 through a proxy.",
group,
++orderInGroup,
Width.LONG,
"S3 Proxy Settings"
);
configDef.define(
S3_PROXY_USER_CONFIG,
ConfigDef.Type.STRING,
S3_PROXY_USER_DEFAULT,
Importance.LOW,
"S3 Proxy User. This property is meant to be used only if you"
+ " need to access S3 through a proxy. Using ``"
+ S3_PROXY_USER_CONFIG
+ "`` instead of embedding the username and password in ``"
+ S3_PROXY_URL_CONFIG
+ "`` allows the password to be hidden in the logs.",
group,
++orderInGroup,
Width.LONG,
"S3 Proxy User"
);
configDef.define(
S3_PROXY_PASS_CONFIG,
Type.PASSWORD,
S3_PROXY_PASS_DEFAULT,
Importance.LOW,
"S3 Proxy Password. This property is meant to be used only if you"
+ " need to access S3 through a proxy. Using ``"
+ S3_PROXY_PASS_CONFIG
+ "`` instead of embedding the username and password in ``"
+ S3_PROXY_URL_CONFIG
+ "`` allows the password to be hidden in the logs.",
group,
++orderInGroup,
Width.LONG,
"S3 Proxy Password"
);
configDef.define(
REGION_CONFIG,
Type.STRING,
REGION_DEFAULT,
new RegionValidator(),
Importance.MEDIUM,
"The AWS region to be used the connector.",
group,
++orderInGroup,
Width.LONG,
"AWS region",
new RegionRecommender()
);
return configDef;
}
protected static String parseName(Map<String, String> props) {
String nameProp = props.get("name");
return nameProp != null ? nameProp : "Restore-sink";
}
public String getBucketName() {
return getString(S3_BUCKET_CONFIG);
}
public String getRestoreTopicName() {
return getString(RESTORE_TOPIC_NAME);
}
public String getProxyUrlConfig() {
return getString(S3_PROXY_URL_CONFIG);
}
public int getProxyPortConfig() {
return getInt(S3_PROXY_PORT_CONFIG);
}
public String getRegionConfig() {
return getString(REGION_CONFIG);
}
private static class RegionRecommender implements ConfigDef.Recommender {
@Override
public List<Object> validValues(String name, Map<String, Object> connectorConfigs) {
return Arrays.<Object>asList(RegionUtils.getRegions());
}
@Override
public boolean visible(String name, Map<String, Object> connectorConfigs) {
return true;
}
}
private static class RegionValidator implements ConfigDef.Validator {
@Override
public void ensureValid(String name, Object region) {
String regionStr = ((String) region).toLowerCase().trim();
if (RegionUtils.getRegion(regionStr) == null) {
throw new ConfigException(
name,
region,
"Value must be one of: " + Utils.join(RegionUtils.getRegions(), ", ")
);
}
}
@Override
public String toString() {
return "[" + Utils.join(RegionUtils.getRegions(), ", ") + "]";
}
}
}
|
[
"[email protected]"
] | |
1466da019c34324cded12b7a0c85cd9bcdb5e56b
|
3d365f1f2dc0188ca804c8abf5391fa4b93cf5aa
|
/src/main/java/com/mainproject/mutualfunds/restServices/MutualFundServices.java
|
98176eb114a1e08e0087b10d98cd39b398f48965
|
[] |
no_license
|
vijay-ramanarayanan/MutualFundServer
|
c577c965d6f1523fdaa14edcf3ba4a3e3fff018e
|
32c037e8d700761cd8d0250eea85c210cad0c5df
|
refs/heads/master
| 2020-04-03T07:26:19.511077 | 2018-11-11T15:39:04 | 2018-11-11T15:39:04 | 155,102,868 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,754 |
java
|
package com.mainproject.mutualfunds.restServices;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.mainproject.mutualfunds.database.services.MutualFundInfoService;
import com.mainproject.mutualfunds.database.services.UserFundInfoService;
import com.mainproject.mutualfunds.entities.Mutualfunds;
import com.mainproject.mutualfunds.entities.UserFunds;
@RestController
public class MutualFundServices {
@Autowired
private MutualFundInfoService mutualFundInfoService;
@Autowired
private UserFundInfoService userFundInfoService;
@CrossOrigin(origins = "*")
@GetMapping(path = "/mutual-funds/{fundName}", produces = "application/json")
public List<Mutualfunds> getMutualFundInfo(@PathVariable String fundName) {
return mutualFundInfoService.getMutualFunds(fundName);
}
@CrossOrigin(origins = "*")
@PostMapping(path = "/add-fund", consumes = "application/json", produces = "application/json")
public Map<String, String> userRegister( @RequestBody UserFunds userFunds) {
Map<String, String> hmap = new HashMap<>();
try {
hmap.put("Status", "Success");
userFundInfoService.updateUserFund(userFunds.getEmail(), userFunds.getFundName(), userFunds.getAmountInvested());
return hmap;
} catch(Exception e) {
return null;
}
}
}
|
[
"[email protected]"
] | |
f07fb4e55b67e7e16c1c11e0be7d306a5cc9a118
|
4805af3610f92d97f4e745cd190d6005015f27ff
|
/web/src/main/java/com/hardworking/training/service/ImageService.java
|
f0024e5421a16f01116dfe1cfb236a6868d6a7f5
|
[] |
no_license
|
Hange1995/NBA
|
32eddd6f16e956b60be6d487fcacb62df1a49ada
|
823a29e3805a87e4b3d5d15aa86fa1a1495b5562
|
refs/heads/master
| 2022-09-15T01:18:10.627855 | 2020-06-04T18:31:07 | 2020-06-04T18:31:07 | 247,762,004 | 1 | 0 | null | 2022-09-08T01:08:20 | 2020-03-16T16:19:04 |
Java
|
UTF-8
|
Java
| false | false | 395 |
java
|
package com.hardworking.training.service;
import com.hardworking.training.model.Image;
import com.hardworking.training.repository.ImageDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ImageService {
@Autowired
ImageDao imageDao;
public Image save(Image image){return imageDao.save(image);}
}
|
[
"[email protected]"
] | |
5a74a9da68cfde3539648501f5bdf30455a256ed
|
1db6c3478de9715eaaf1b8406917110b482b7fcc
|
/Warmup-1/backAround.java
|
bb8c58ee509795d9f145e8b4f56874c498f4be36
|
[] |
no_license
|
dherath/CodingBat_Java
|
94b4eda3914c2bb87196a8f5a7bd4c2874db2958
|
376f63335f94ae828aae45978f90370127a3e449
|
refs/heads/master
| 2021-03-16T05:07:50.234063 | 2017-08-23T17:38:32 | 2017-08-23T17:38:32 | 91,534,437 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 106 |
java
|
public String backAround(String str) {
char temp= str.charAt(str.length()-1);
return temp+str+temp;
}
|
[
"[email protected]"
] | |
4a435ec786ca2f04dccce4690cf77e813e0f97da
|
8285d0182fb5a49ca124938d4f244cfc4b1e6901
|
/src/main/java/com/pwi/services/WarehouseService.java
|
1dab662cf3d8818da169e079041552f75b2ee9b0
|
[] |
no_license
|
imranh/PWI
|
0dc365771ffe1c33bfc45c38a9f09afc479351c2
|
9168e6353246a57e8bee61881b9843d3c2f04da1
|
refs/heads/master
| 2021-07-10T03:42:25.892228 | 2017-10-11T13:55:22 | 2017-10-11T13:55:22 | 106,417,832 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,183 |
java
|
/**
*
*/
package com.pwi.services;
import java.io.Serializable;
import java.util.List;
import org.springframework.http.ResponseEntity;
import com.pwi.model.Warehouse;
/**
* @author imran
*
*/
public interface WarehouseService extends Serializable {
/**
* This method is used to store a new warehouse in database
*
* @param warehouse information to be stored
* @return SUCCESS/FAILURE
*/
ResponseEntity<Object> addWarehouse(Warehouse warehouse);
/**
* This method is used to update an existing warehouse in database
*
* @param warehouse updated information object
* @return SUCCESS/FAILURE
*/
ResponseEntity<Object> updateWarehouse(Warehouse warehouse);
/**
* This method is used to delete a warehouse from database
*
* @param warehouse object to be deleted
* @return SUCCESS/FAILURE
*/
ResponseEntity<Object> deleteWarehouse(Warehouse warehouse);
/**
* This method is used to get all warehouses of a company
*
* @param companyId to restrict result to a single company
* @return list of warehouses
*/
List<Warehouse> getAllWarehousesByCompanyId(Integer companyId);
}
|
[
"[email protected]"
] | |
261c6677bc045434a5ed8153d0d09e163b824f22
|
882b4a6ece6e0d2d18158e1d975311dcd4792f8d
|
/MVCProjectTest/src/Controller/CommentBoard/CommentBoardReplyInsert.java
|
f44891f7b619525cf6563bfbf3edcdb0c1810c6c
|
[] |
no_license
|
bios7713/MVCJSP
|
741e7ff8d2291dcab21d6af7453550534dd5bd1c
|
89834523d27f61944a9baec2d662fe8358616d44
|
refs/heads/master
| 2021-01-08T14:18:38.008708 | 2020-02-21T04:13:04 | 2020-02-21T04:13:04 | 242,051,682 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 822 |
java
|
package Controller.CommentBoard;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import Model.DAO.CommentBoardDAO;
import Model.DTO.ReplyDTO;
public class CommentBoardReplyInsert {
public void execute(HttpServletRequest request, HttpServletResponse response) {
CommentBoardDAO dao = new CommentBoardDAO();
ReplyDTO reply = new ReplyDTO();
HttpSession session = request.getSession();
reply.setReplyName(request.getParameter("replyName"));
reply.setReplayContent(request.getParameter("replyContent"));
reply.setUserId((String)session.getAttribute("memId"));
reply.setIpAddr(request.getRemoteAddr());
dao.replyInsert(reply);
}
}
|
[
"HKEDU@DESKTOP-4NFOSDQ"
] |
HKEDU@DESKTOP-4NFOSDQ
|
437e0ed3dc8f23bc6107fd23387d973c0026c130
|
363f7aa05cfe71b9c7524b17538d8604f04bd38c
|
/src/Main.java
|
bddd88611ec7f4a8ef8a5b6cd2e42857e17e2203
|
[] |
no_license
|
Tomkat3370/App06-Zuul
|
945887eac1774504715e8015b934beaf65a9b75e
|
210b78cbc856e7d2cd893523850bd57d49e059c4
|
refs/heads/main
| 2023-03-02T13:17:08.321128 | 2021-02-09T03:38:20 | 2021-02-09T03:38:20 | 318,499,012 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 307 |
java
|
/**
* Based on the Collosal Cave Adventure game
*
*Modified and extended by Kate Gordon and Sarah Cunningham
* 29/01/2021
*/
public class Main
{
private static Game zuul;
/**
*
* @param args
*/
public static void main(String[] args)
{
zuul = new Game();
}
}
|
[
"[email protected]"
] | |
10b82bf2c6111af0366282ea6d5eef7fbcb6bfbb
|
083f64309d498f6eca620e293b357badd7da435c
|
/Code/src/com/viettel/ocs/bean/TreeCommonBean.java
|
1689e02213ebf15e49550c9e4419e6b160f4a0ce
|
[] |
no_license
|
ngotrite/THP
|
56adf904b3c10a4efe071aa5ae200d1dcd85597e
|
56b3e99dc5d7f1454e086a63c34e0162bb07548c
|
refs/heads/master
| 2020-03-21T08:50:03.806372 | 2018-06-23T03:23:33 | 2018-06-23T03:23:33 | 137,751,285 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 95,537 |
java
|
package com.viettel.ocs.bean;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import org.primefaces.context.RequestContext;
import org.primefaces.event.NodeCollapseEvent;
import org.primefaces.event.NodeExpandEvent;
import org.primefaces.event.NodeSelectEvent;
import org.primefaces.model.TreeNode;
import com.viettel.ocs.bean.catalog.BalTypeBean;
import com.viettel.ocs.bean.catalog.BillingCycleTypeBean;
import com.viettel.ocs.bean.catalog.CdrGenFileNameBean;
import com.viettel.ocs.bean.catalog.CdrProcessConfigBean;
import com.viettel.ocs.bean.catalog.CdrServiceBean;
import com.viettel.ocs.bean.catalog.CdrTemplateBean;
import com.viettel.ocs.bean.catalog.CssUssdResponseBean;
import com.viettel.ocs.bean.catalog.GeoHomeBean;
import com.viettel.ocs.bean.catalog.MapAcmbalBalBean;
import com.viettel.ocs.bean.catalog.MapSharebalBalBean;
import com.viettel.ocs.bean.catalog.ParameterBean;
import com.viettel.ocs.bean.catalog.ReserveInfoBean;
import com.viettel.ocs.bean.catalog.ServiceBean;
import com.viettel.ocs.bean.catalog.SmsNotifyTemplateBean;
import com.viettel.ocs.bean.catalog.StateSetBean;
import com.viettel.ocs.bean.catalog.StatisticItemBean;
import com.viettel.ocs.bean.catalog.TriggerDestinationBean;
import com.viettel.ocs.bean.catalog.TriggerMsgBean;
import com.viettel.ocs.bean.catalog.TriggerOcsBean;
import com.viettel.ocs.bean.catalog.UnitTypeBean;
import com.viettel.ocs.bean.catalog.ZoneMapBean;
import com.viettel.ocs.bean.policy.PCCRuleBean;
import com.viettel.ocs.bean.policy.PolicyProfileBean;
import com.viettel.ocs.bean.sys.SystemConfigBean;
import com.viettel.ocs.constant.CategoryType;
import com.viettel.ocs.constant.TreeNodeType;
import com.viettel.ocs.constant.TreeType;
import com.viettel.ocs.dao.BalTypeDAO;
import com.viettel.ocs.dao.BillingCycleTypeDAO;
import com.viettel.ocs.dao.CategoryDAO;
import com.viettel.ocs.dao.CdrGenFilenameDAO;
import com.viettel.ocs.dao.CdrProcessConfigDAO;
import com.viettel.ocs.dao.CdrServiceDAO;
import com.viettel.ocs.dao.CdrTemplateDAO;
import com.viettel.ocs.dao.CssUssdResponseDAO;
import com.viettel.ocs.dao.GeoHomeZoneDAO;
import com.viettel.ocs.dao.MapAcmbalBalDAO;
import com.viettel.ocs.dao.MapSharebalBalDAO;
import com.viettel.ocs.dao.PCCRuleDAO;
import com.viettel.ocs.dao.ParameterDAO;
import com.viettel.ocs.dao.ProfilePepDAO;
import com.viettel.ocs.dao.ReserveInfoDAO;
import com.viettel.ocs.dao.ServiceDAO;
import com.viettel.ocs.dao.SmsNotifyTemplateDAO;
import com.viettel.ocs.dao.StateGroupDAO;
import com.viettel.ocs.dao.StateTypeDAO;
import com.viettel.ocs.dao.StatisticItemDAO;
import com.viettel.ocs.dao.SystemConfigDAO;
import com.viettel.ocs.dao.ThresholdDAO;
import com.viettel.ocs.dao.TriggerDestinationDAO;
import com.viettel.ocs.dao.TriggerMsgDAO;
import com.viettel.ocs.dao.TriggerOcsDAO;
import com.viettel.ocs.dao.TriggerTypeDAO;
import com.viettel.ocs.dao.UnitTypeDAO;
import com.viettel.ocs.dao.ZoneDAO;
import com.viettel.ocs.dao.ZoneMapDAO;
import com.viettel.ocs.db.HibernateUtil;
import com.viettel.ocs.db.Operator;
import com.viettel.ocs.entity.BalType;
import com.viettel.ocs.entity.BaseEntity;
import com.viettel.ocs.entity.BillingCycleType;
import com.viettel.ocs.entity.Category;
import com.viettel.ocs.entity.CdrGenFilename;
import com.viettel.ocs.entity.CdrProcessConfig;
import com.viettel.ocs.entity.CdrService;
import com.viettel.ocs.entity.CdrTemplate;
import com.viettel.ocs.entity.CssUssdResponse;
import com.viettel.ocs.entity.GeoHomeZone;
import com.viettel.ocs.entity.MapAcmbalBal;
import com.viettel.ocs.entity.MapSharebalBal;
import com.viettel.ocs.entity.Parameter;
import com.viettel.ocs.entity.PccRule;
import com.viettel.ocs.entity.ProfilePep;
import com.viettel.ocs.entity.ReserveInfo;
import com.viettel.ocs.entity.Service;
import com.viettel.ocs.entity.SmsNotifyTemplate;
import com.viettel.ocs.entity.StateGroup;
import com.viettel.ocs.entity.StateType;
import com.viettel.ocs.entity.StatisticItem;
import com.viettel.ocs.entity.SystemConfig;
import com.viettel.ocs.entity.Threshold;
import com.viettel.ocs.entity.TriggerDestination;
import com.viettel.ocs.entity.TriggerMsg;
import com.viettel.ocs.entity.TriggerOcs;
import com.viettel.ocs.entity.TriggerType;
import com.viettel.ocs.entity.UnitType;
import com.viettel.ocs.entity.Zone;
import com.viettel.ocs.entity.ZoneMap;
import com.viettel.ocs.model.OcsTreeNode;
import com.viettel.ocs.util.CommonUtil;
@ManagedBean(name = "treeCommonBean")
@ViewScoped
public class TreeCommonBean extends BaseController implements Serializable {
/**
*
*/
private static final long serialVersionUID = -4432210493238596849L;
private ParameterDAO parameterDAO;
private UnitTypeDAO unitTypeDao;
private ZoneMapDAO zoneMapDao;
private StateGroupDAO stateGroupDAO;
private StateTypeDAO stateTypeDAO;
private BalTypeDAO balTypeDAO;
private ThresholdDAO thresholdDAO;
private ReserveInfoDAO reserveInfoDAO;
private ZoneDAO zoneDAO;
private GeoHomeZoneDAO geoHomeDAO;
private TriggerDestinationDAO triggerDesDAO;
private TriggerMsgDAO triggerMsgDAO;
private BillingCycleTypeDAO billingCycleTypeDAO;
private ProfilePepDAO profilePepDAO;
private PCCRuleDAO pccRuleDAO;
private TriggerOcsDAO triggerOcsDAO;
private TriggerTypeDAO triggerTypeDAO;
private ServiceDAO serviceDAO;
private String formType;
private String treeType;
private boolean showBtnCatNew;
private String contentTitle;
private MapSharebalBalDAO mapShareBalDAO;
private MapAcmbalBalDAO mapAcmBalDAO;
private CdrServiceDAO cdrServiceDAO;
private CdrTemplateDAO cdrTemplateDAO;
private CdrGenFilenameDAO cdrGenFilenameDAO;
private CdrProcessConfigDAO cdrProcessConfigDAO;
private SystemConfigDAO systemConfigDAO;
private StatisticItemDAO statisticItemDAO;
private SmsNotifyTemplateDAO smsNotiTemDAO;
private CssUssdResponseDAO cssUssdResponseDAO;
private TreeNode root;
private TreeNode selectedNode;
private Map<Long, TreeNode> mapCatFirstNode = new HashMap<Long, TreeNode>();
private List<Long> lstCatID = new ArrayList<Long>();
private Map<Long, TreeNode> mapCatNode = new HashMap<Long, TreeNode>();
// private Map<String, TreeNode> mapAllNode = new HashMap<String,
// TreeNode>();
private Map<String, List<TreeNode>> mapListNode = new HashMap<>();
private String txtTreeSearch;
private BaseEntity currentEntity;
// Parameter
@ManagedProperty("#{parameterBean}")
private ParameterBean parameterBean;
public void setParameterBean(ParameterBean parameterBean) {
this.parameterBean = parameterBean;
}
// triggerOcsBean
@ManagedProperty("#{triggerOcsBean}")
private TriggerOcsBean triggerOcsBean;
public void setTriggerOcsBean(TriggerOcsBean triggerOcsBean) {
this.triggerOcsBean = triggerOcsBean;
}
// Trigger Destination
@ManagedProperty("#{triggerMsgBean}")
private TriggerMsgBean triggerMsgBean;
public void setTriggerMsgBean(TriggerMsgBean triggerMsgBean) {
this.triggerMsgBean = triggerMsgBean;
}
// Unit Type
@ManagedProperty("#{unitBean}")
private UnitTypeBean unitBean;
public void setUnitBean(UnitTypeBean unitBean) {
this.unitBean = unitBean;
}
// Zone Map
@ManagedProperty("#{zoneMapBean}")
private ZoneMapBean zoneMapBean;
public void setZoneMapBean(ZoneMapBean zoneMapBean) {
this.zoneMapBean = zoneMapBean;
}
// Bal Type
@ManagedProperty("#{balTypeBean}")
private BalTypeBean balTypeBean;
public void setBalTypeBean(BalTypeBean balTypeBean) {
this.balTypeBean = balTypeBean;
}
// Geo Home Zone
@ManagedProperty("#{geoBean}")
private GeoHomeBean geoBean;
public void setGeoBean(GeoHomeBean geoBean) {
this.geoBean = geoBean;
}
@ManagedProperty("#{stateSetBean}")
private StateSetBean stateSetBean;
public void setStateSetBean(StateSetBean stateSetBean) {
this.stateSetBean = stateSetBean;
}
// Billing Cycle
@ManagedProperty("#{billingCycleTypeBean}")
private BillingCycleTypeBean billingCycleTypeBean;
public void setBillingCycleTypeBean(BillingCycleTypeBean billingCycleTypeBean) {
this.billingCycleTypeBean = billingCycleTypeBean;
}
// Trigger Destination
@ManagedProperty("#{triggerDesBean}")
private TriggerDestinationBean triggerDesBean;
public void setTriggerDesBean(TriggerDestinationBean triggerDesBean) {
this.triggerDesBean = triggerDesBean;
}
// Trigger Destination
@ManagedProperty("#{serviceBean}")
private ServiceBean serviceBean;
public void setServiceBean(ServiceBean serviceBean) {
this.serviceBean = serviceBean;
}
// Map Share Bal
@ManagedProperty("#{mapShareBalBean}")
private MapSharebalBalBean mapShareBalBean;
public void setMapShareBalBean(MapSharebalBalBean mapShareBalBean) {
this.mapShareBalBean = mapShareBalBean;
}
// Map Acm Bal
@ManagedProperty("#{mapAcmBalBean}")
private MapAcmbalBalBean mapAcmBalBean;
public void setMapAcmBalBean(MapAcmbalBalBean mapAcmBalBean) {
this.mapAcmBalBean = mapAcmBalBean;
}
// Cdr service
@ManagedProperty("#{cdrServiceBean}")
private CdrServiceBean cdrServiceBean;
public void setCdrServiceBean(CdrServiceBean cdrServiceBean) {
this.cdrServiceBean = cdrServiceBean;
}
// Cdr Template
@ManagedProperty("#{cdrTemplateBean}")
private CdrTemplateBean cdrTemplateBean;
public void setCdrTemplateBean(CdrTemplateBean cdrTemplateBean) {
this.cdrTemplateBean = cdrTemplateBean;
}
// cdrGenFileNameBean
@ManagedProperty("#{cdrGenFileNameBean}")
private CdrGenFileNameBean cdrGenFileNameBean;
public void setCdrGenFileNameBean(CdrGenFileNameBean cdrGenFileNameBean) {
this.cdrGenFileNameBean = cdrGenFileNameBean;
}
// cdr Process Config Bean
@ManagedProperty("#{cdrProcessConfigBean}")
private CdrProcessConfigBean cdrProcessConfigBean;
public void setCdrProcessConfigBean(CdrProcessConfigBean cdrProcessConfigBean) {
this.cdrProcessConfigBean = cdrProcessConfigBean;
}
// System Config Bean
@ManagedProperty("#{systemConfigBean}")
private SystemConfigBean systemConfigBean;
public void setSystemConfigBean(SystemConfigBean systemConfigBean) {
this.systemConfigBean = systemConfigBean;
}
// Statistic Item Bean
@ManagedProperty("#{statisticItemBean}")
private StatisticItemBean statisticItemBean;
public void setStatisticItemBean(StatisticItemBean statisticItemBean) {
this.statisticItemBean = statisticItemBean;
}
@ManagedProperty("#{smsNotiTemBean}")
private SmsNotifyTemplateBean smsNotiTemBean;
public void setSmsNotiTemBean(SmsNotifyTemplateBean smsNotiTemBean) {
this.smsNotiTemBean = smsNotiTemBean;
}
@ManagedProperty("#{cssUssdResponseBean}")
private CssUssdResponseBean cssUssdResponseBean;
public void setCssUssdResponseBean(CssUssdResponseBean cssUssdResponseBean) {
this.cssUssdResponseBean = cssUssdResponseBean;
}
public TreeCommonBean() {
defaulData();
catDao = new CategoryDAO();
parameterDAO = new ParameterDAO();
unitTypeDao = new UnitTypeDAO();
zoneMapDao = new ZoneMapDAO();
stateGroupDAO = new StateGroupDAO();
stateTypeDAO = new StateTypeDAO();
balTypeDAO = new BalTypeDAO();
thresholdDAO = new ThresholdDAO();
reserveInfoDAO = new ReserveInfoDAO();
billingCycleTypeDAO = new BillingCycleTypeDAO();
triggerOcsDAO = new TriggerOcsDAO();
triggerTypeDAO = new TriggerTypeDAO();
serviceDAO = new ServiceDAO();
zoneDAO = new ZoneDAO();
geoHomeDAO = new GeoHomeZoneDAO();
triggerDesDAO = new TriggerDestinationDAO();
triggerMsgDAO = new TriggerMsgDAO();
profilePepDAO = new ProfilePepDAO();
pccRuleDAO = new PCCRuleDAO();
mapShareBalDAO = new MapSharebalBalDAO();
mapAcmBalDAO = new MapAcmbalBalDAO();
cdrServiceDAO = new CdrServiceDAO();
cdrTemplateDAO = new CdrTemplateDAO();
cdrGenFilenameDAO = new CdrGenFilenameDAO();
cdrProcessConfigDAO = new CdrProcessConfigDAO();
systemConfigDAO = new SystemConfigDAO();
statisticItemDAO = new StatisticItemDAO();
smsNotiTemDAO = new SmsNotifyTemplateDAO();
cssUssdResponseDAO = new CssUssdResponseDAO();
String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
if (viewId.endsWith("parameter.xhtml")) {
treeType = TreeType.CATALOG_PARAMETER;
} else if (viewId.endsWith("unittype.xhtml")) {
treeType = TreeType.CATALOG_UNIT_TYPE;
} else if (viewId.endsWith("zonemap.xhtml")) {
treeType = TreeType.CATALOG_ZONE_DATA;
} else if (viewId.endsWith("reserveInfo.xhtml")) {
treeType = TreeType.CATALOG_RESERVE_INFO;
} else if (viewId.endsWith("stateset.xhtml")) {
treeType = TreeType.CATALOG_STATE_SET;
} else if (viewId.endsWith("baltype.xhtml")) {
treeType = TreeType.CATALOG_BALANCE;
} else if (viewId.endsWith("geohomezone.xhtml")) {
treeType = TreeType.CATALOG_GEO_HOME;
} else if (viewId.endsWith("triggerdestination.xhtml")) {
treeType = TreeType.CATALOG_TRIGGER_DESTINATION;
} else if (viewId.endsWith("triggermsg.xhtml")) {
treeType = TreeType.CATALOG_TRIGGER_MESSAGE;
} else if (viewId.endsWith("billingcycle.xhtml")) {
treeType = TreeType.CATALOG_BILLING_CYCLE;
} else if (viewId.endsWith("triggerocs.xhtml")) {
treeType = TreeType.CATALOG_TRIGGER_OCS;
} else if (viewId.endsWith("services.xhtml")) {
treeType = TreeType.CATALOG_SERVICE;
} else if (viewId.endsWith("cdr_service.xhtml")) {
treeType = TreeType.CATALOG_CDR_SERVICE;
} else if (viewId.endsWith("cdr_template.xhtml")) {
treeType = TreeType.CATALOG_CDR_TEMPLATE;
} else if (viewId.endsWith("cdr_gen_fileName.xhtml")) {
treeType = TreeType.CATALOG_CDR_GEN_FILENAME;
} else if (viewId.endsWith("cdr_process_config.xhtml")) {
treeType = TreeType.CATALOG_CDR_PROCESS_CONFIG;
} else if (viewId.endsWith("system_config.xhtml")) {
treeType = TreeType.SYS_SYS_CONFIG;
} else if (viewId.endsWith("statistic_item.xhtml")) {
treeType = TreeType.CATALOG_STATISTIC_ITEM;
} else if (viewId.endsWith("sms_notify_template.xhtml")) {
treeType = TreeType.CATALOG_SMS_NOTIFY_TEMPLATE;
} else if (viewId.endsWith("css_ussd_response.xhtml")) {
treeType = TreeType.CATALOG_CSS_USSD_RESPONSE;
}
buildTree(treeType);
initCategoryType();
}
public void onload() {
// Temporary not work when use jsf template
if (!FacesContext.getCurrentInstance().isPostback()) {
buildTree(treeType);
initCategoryType();
}
}
/************ BUILD TREE - BEGIN *****************/
private void buildTree(String treeType) {
if (treeType == null)
return;
lstCatID.clear();
mapCatNode.clear();
mapListNode.clear();
root = new OcsTreeNode();
switch (treeType) {
case TreeType.CATALOG_PARAMETER:
buildTreeParameter();
break;
case TreeType.CATALOG_UNIT_TYPE:
buildTreeUnitType();
break;
case TreeType.CATALOG_ZONE_DATA:
buildTreeZoneData();
break;
case TreeType.CATALOG_STATE_SET:
buildTreeStateSet();
break;
case TreeType.CATALOG_BALANCE:
buildTreeBalance();
break;
case TreeType.CATALOG_GEO_HOME:
buildTreeGeoHome();
break;
case TreeType.CATALOG_RESERVE_INFO:
buildTreeReserveInfo();
break;
case TreeType.CATALOG_TRIGGER_DESTINATION:
buildTreeTriggerDes();
break;
case TreeType.CATALOG_TRIGGER_MESSAGE:
buildTreeTriggerMsg();
break;
case TreeType.CATALOG_BILLING_CYCLE:
buildTreeBillingCycle();
break;
case TreeType.POLICY_POLICY_PROFILE:
buildTreePolicyProfile();
break;
case TreeType.POLICY_PCC_RULE:
buildTreePccrule();
break;
case TreeType.CATALOG_TRIGGER_OCS:
buildTreeTriggerOcs();
break;
case TreeType.CATALOG_SERVICE:
buildTreeService();
break;
case TreeType.CATALOG_CDR_SERVICE:
buildTreeCDRService();
break;
case TreeType.CATALOG_CDR_TEMPLATE:
buildTreeCDRTemplate();
break;
case TreeType.CATALOG_CDR_GEN_FILENAME:
buildTreeCDRGenFileName();
break;
case TreeType.CATALOG_CDR_PROCESS_CONFIG:
buildTreeCDRProcessConfig();
break;
case TreeType.SYS_SYS_CONFIG:
buildTreeSystemConfig();
break;
case TreeType.CATALOG_STATISTIC_ITEM:
buildTreeStatisticItem();
break;
case TreeType.CATALOG_SMS_NOTIFY_TEMPLATE:
buildTreeSmsNotifyTemplate();
break;
case TreeType.CATALOG_CSS_USSD_RESPONSE:
buildTreeCssUssdResponse();
break;
default:
break;
}
}
// Cuongvv
public void buildTreeParameter() {
/** PARAMETER */
// Build children categories
buildTreeByCatType(treeType, root);
// Add Parameter belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<Parameter> lstParameter = parameterDAO.findByConditions(cols, operators, values, "index");
for (Parameter parameter : lstParameter) {
if(!isFoundNode(parameter))
continue;
TreeNode catNode = mapCatNode.get(parameter.getCategoryId());
if (catNode != null) {
TreeNode parameterNode = new OcsTreeNode(parameter, catNode);
settingNewTreeNode(parameter, parameterNode);
}
}
}
public void buildTreeStateSet() {
/** State Set */
// Build children categories
buildTreeByCatType(treeType, root);
// Add State Set belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<StateGroup> lsStateGroups = stateGroupDAO.findByConditions(cols, operators, values, "index");
List<StateType> lsStateTypes = stateTypeDAO.findByConditions(cols, operators, values, "index ASC");
for (TreeNode treeNode : root.getChildren()) {
Category category = (Category) treeNode.getData();
if (category.getCategoryType() == CategoryType.CTL_STATEGROUP) {
for (StateGroup stateGroup : lsStateGroups) {
if(!isFoundNode(stateGroup))
continue;
TreeNode catNode = mapCatNode.get(stateGroup.getCategoryId());
if (catNode != null) {
TreeNode stateGroupNode = new OcsTreeNode(stateGroup, catNode);
stateGroupNode.setType(TreeNodeType.CAT_STATE_GROUP);
settingNewTreeNode(stateGroup, stateGroupNode);
}
}
} else if (category.getCategoryType() == CategoryType.CTL_STATETYPE) {
for (StateType stateType : lsStateTypes) {
if(!isFoundNode(stateType))
continue;
TreeNode catNode = mapCatNode.get(stateType.getCategoryId());
if (catNode != null) {
TreeNode stateTypeNode = new OcsTreeNode(stateType, catNode);
stateTypeNode.setType(TreeNodeType.CAT_STATE_TYPE);
settingNewTreeNode(stateType, stateTypeNode);
}
}
}
}
}
// Build Tree Billing Cycle
public void buildTreeBillingCycle() {
/** Billing Cycle */
// Build children categories
buildTreeByCatType(treeType, root);
// Add Parameter belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<BillingCycleType> lstBillingCycle = billingCycleTypeDAO.findByConditions(cols, operators, values, "index");
for (BillingCycleType billingCycleType : lstBillingCycle) {
if(!isFoundNode(billingCycleType))
continue;
TreeNode catNode = mapCatNode.get(billingCycleType.getCategoryId());
if (catNode != null) {
TreeNode billingCycleTypeNode = new OcsTreeNode(billingCycleType, catNode);
settingNewTreeNode(billingCycleType, billingCycleTypeNode);
}
}
}
// / --------------
/**** UNIT TYPE - TENT ****/
public void buildTreeUnitType() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Unit Type belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<UnitType> lstUnitType = unitTypeDao.findByConditions(cols, operators, values, "index ASC");
for (UnitType unitType : lstUnitType) {
if(!isFoundNode(unitType))
continue;
TreeNode catNode = mapCatNode.get(unitType.getCategoryId());
if (catNode != null) {
TreeNode unitTypeMapNode = new OcsTreeNode(unitType, catNode);
settingNewTreeNode(unitType, unitTypeMapNode);
}
}
}
/**** ZONE DATA - TENT ****/
public void buildTreeZoneData() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Zone Data belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<ZoneMap> lstZoneMap = zoneMapDao.findByConditions(cols, operators, values, "index");
for (ZoneMap zoneMap : lstZoneMap) {
if(!isFoundNode(zoneMap))
continue;
TreeNode catNode = mapCatNode.get(zoneMap.getCategoryId());
if (catNode != null) {
TreeNode zoneMapNode = new OcsTreeNode(zoneMap, catNode);
settingNewTreeNode(zoneMap, zoneMapNode);
List<Zone> lstZone = zoneDAO.findZoneByConditions(zoneMap.getZoneMapId());
for (Zone zone : lstZone) {
TreeNode zoneNode = new OcsTreeNode(zone, zoneMapNode);
settingNewTreeNode(zone, zoneNode);
}
}
}
}
/**** BALANCES - TENT ****/
public void buildTreeBalance() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add BalType belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<BalType> lstBalType = balTypeDAO.findByConditions(cols, operators, values, "index");
for (BalType balType : lstBalType) {
if(!isFoundNode(balType))
continue;
TreeNode catNode = mapCatNode.get(balType.getCategoryId());
if (catNode != null) {
TreeNode balTypeNode = new OcsTreeNode(balType, catNode);
settingNewTreeNode(balType, balTypeNode);
List<Threshold> lstThreshold = balTypeDAO.findThresholdByBalType(balType.getBalTypeId());
for (Threshold threshold : lstThreshold) {
TreeNode thresholdNode = new OcsTreeNode(threshold, balTypeNode);
settingNewTreeNode(threshold, thresholdNode);
List<TriggerOcs> lsTTriggerOcs = thresholdDAO.findTriggerOcsByTH(threshold.getThresholdId());
for (TriggerOcs triggerOcs : lsTTriggerOcs) {
TreeNode triggerOcsNode = new OcsTreeNode(triggerOcs, thresholdNode);
settingNewTreeNode(triggerOcs, triggerOcsNode);
}
}
}
}
List<MapSharebalBal> lstMapShareBal = mapShareBalDAO.findByConditions(cols, operators, values, "index");
for (MapSharebalBal mapShareBal : lstMapShareBal) {
if(!isFoundNode(mapShareBal))
continue;
TreeNode catNode = mapCatNode.get(mapShareBal.getCategoryId());
if (catNode != null) {
TreeNode balTypeNode = new OcsTreeNode(mapShareBal, catNode);
settingNewTreeNode(mapShareBal, balTypeNode);
}
}
List<MapAcmbalBal> lstMapAcmBal = mapAcmBalDAO.findByConditions(cols, operators, values, "index");
for (MapAcmbalBal mapAcmBal : lstMapAcmBal) {
if(!isFoundNode(mapAcmBal))
continue;
TreeNode catNode = mapCatNode.get(mapAcmBal.getCategoryId());
if (catNode != null) {
TreeNode mapAcmBalNode = new OcsTreeNode(mapAcmBal, catNode);
settingNewTreeNode(mapAcmBal, mapAcmBalNode);
}
}
}
/**** GEO HOME ZONE - TENT ****/
public void buildTreeGeoHome() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Unit Type belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<GeoHomeZone> lstGeoHome = geoHomeDAO.findByConditions(cols, operators, values, "index");
for (GeoHomeZone geoHome : lstGeoHome) {
if(!isFoundNode(geoHome))
continue;
TreeNode catNode = mapCatNode.get(geoHome.getCategoryId());
if (catNode != null) {
TreeNode geoHomeNode = new OcsTreeNode(geoHome, catNode);
settingNewTreeNode(geoHome, geoHomeNode);
}
}
}
/**** TRIGGER DESTINATION - CUONGVV ****/
public void buildTreeTriggerDes() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Trigger Destination belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<TriggerDestination> lstTriggerDes = triggerDesDAO.findByConditions(cols, operators, values, "index");
for (TriggerDestination triggerDes : lstTriggerDes) {
if(!isFoundNode(triggerDes))
continue;
TreeNode catNode = mapCatNode.get(triggerDes.getCategoryId());
if (catNode != null) {
TreeNode triggerDesNode = new OcsTreeNode(triggerDes, catNode);
settingNewTreeNode(triggerDes, triggerDesNode);
}
}
}
/**** TRIGGER MESSAGE - CUONGVV ****/
public void buildTreeTriggerMsg() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Trigger Destination belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<TriggerMsg> lstTriggerMsg = triggerMsgDAO.findByConditions(cols, operators, values, "index");
for (TriggerMsg triggerMsgMap : lstTriggerMsg) {
if(!isFoundNode(triggerMsgMap))
continue;
TreeNode catNode = mapCatNode.get(triggerMsgMap.getCategoryId());
if (catNode != null) {
TreeNode triggerMsgMapNode = new OcsTreeNode(triggerMsgMap, catNode);
settingNewTreeNode(triggerMsgMap, triggerMsgMapNode);
}
}
}
public void buildTreeTriggerOcs() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Trigger Destination belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
for (TreeNode treeNode : root.getChildren()) {
Category category = (Category) treeNode.getData();
if (category.getCategoryType() == CategoryType.CTL_TO_TRIGGER_OCS) {
List<TriggerOcs> lsTriggerOcs = triggerOcsDAO.findByConditions(cols, operators, values, "index");
for (TriggerOcs triggerOcs : lsTriggerOcs) {
if(!isFoundNode(triggerOcs))
continue;
TreeNode catNode = mapCatNode.get(triggerOcs.getCategoryId());
if (catNode != null) {
TreeNode triggerOcsNode = new OcsTreeNode(triggerOcs, catNode);
settingNewTreeNode(triggerOcs, triggerOcsNode);
}
}
} else if (category.getCategoryType() == CategoryType.CTL_TT_TRIGGER_TYPE) {
List<TriggerType> lsTriggerType = triggerTypeDAO.findByConditions(cols, operators, values, "index");
for (TriggerType triggerType : lsTriggerType) {
if(!isFoundNode(triggerType))
continue;
TreeNode catNode = mapCatNode.get(triggerType.getCategoryId());
if (catNode != null) {
TreeNode triggerTypeNode = new OcsTreeNode(triggerType, catNode);
settingNewTreeNode(triggerType, triggerTypeNode);
}
}
}
}
}
public void buildTreeService() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add Trigger Destination belong to Category
String[] cols = { "categoryId" };
Operator[] operators = { Operator.IN };
List<Long> lstCatIDParam = new ArrayList<Long>();
lstCatIDParam.addAll(lstCatID);
if (lstCatIDParam.size() == 0)
lstCatIDParam.add(-1L);
Object[] values = { lstCatIDParam };
List<Service> lstService = serviceDAO.findByConditions(cols, operators, values, "index ASC");
for (Service service : lstService) {
if(!isFoundNode(service))
continue;
TreeNode catNode = mapCatNode.get(service.getCategoryId());
if (catNode != null) {
TreeNode serviceNode = new OcsTreeNode(service, catNode);
settingNewTreeNode(service, serviceNode);
}
}
}
// build tree CDR Service
public void buildTreeCDRService() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<CdrService> lstCdrService = cdrServiceDAO.findCdrServiceByConditions(lstCatID);
for (CdrService cdrService : lstCdrService) {
if(!isFoundNode(cdrService))
continue;
TreeNode catNode = mapCatNode.get(cdrService.getCategoryId());
if (catNode != null) {
TreeNode cdrServiceNode = new OcsTreeNode(cdrService, catNode);
settingNewTreeNode(cdrService, cdrServiceNode);
}
}
}
// build tree CDR Service
public void buildTreeCDRTemplate() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<CdrTemplate> lstCdrTemplate = cdrTemplateDAO.findCdrTemplateByConditions(lstCatID);
for (CdrTemplate cdrTemplate : lstCdrTemplate) {
if(!isFoundNode(cdrTemplate))
continue;
TreeNode catNode = mapCatNode.get(cdrTemplate.getCategoryId());
if (catNode != null) {
TreeNode cdrTemplateNode = new OcsTreeNode(cdrTemplate, catNode);
settingNewTreeNode(cdrTemplate, cdrTemplateNode);
}
}
}
// build tree CDR Gen file name
public void buildTreeCDRGenFileName() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<CdrGenFilename> lstCdrGenFilename = cdrGenFilenameDAO.findCdrGenFilenameByConditions(lstCatID);
for (CdrGenFilename cdrGenFilename : lstCdrGenFilename) {
if(!isFoundNode(cdrGenFilename))
continue;
TreeNode catNode = mapCatNode.get(cdrGenFilename.getCategoryId());
if (catNode != null) {
TreeNode cdrTemplateNode = new OcsTreeNode(cdrGenFilename, catNode);
settingNewTreeNode(cdrGenFilename, cdrTemplateNode);
}
}
}
// build tree CDR ProcessConfig
public void buildTreeCDRProcessConfig() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<CdrProcessConfig> lstCdrProcessConfig = cdrProcessConfigDAO.findCdrProcessConfigByConditions(lstCatID);
for (CdrProcessConfig cdrProcessConfig : lstCdrProcessConfig) {
if(!isFoundNode(cdrProcessConfig))
continue;
TreeNode catNode = mapCatNode.get(cdrProcessConfig.getCategoryId());
if (catNode != null) {
TreeNode cdrTemplateNode = new OcsTreeNode(cdrProcessConfig, catNode);
settingNewTreeNode(cdrProcessConfig, cdrTemplateNode);
}
}
}
public void buildTreeSystemConfig() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<SystemConfig> lstSystemConfig = systemConfigDAO.findByListCat(lstCatID);
for (SystemConfig systemConfig : lstSystemConfig) {
if(!isFoundNode(systemConfig))
continue;
TreeNode catNode = mapCatNode.get(systemConfig.getCategoryId());
if (catNode != null) {
TreeNode systemConfigNode = new OcsTreeNode(systemConfig, catNode);
settingNewTreeNode(systemConfig, systemConfigNode);
}
}
}
private void buildTreeStatisticItem() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<StatisticItem> lstStatisticItem = statisticItemDAO.findByListCat(lstCatID);
for (StatisticItem statisticItem : lstStatisticItem) {
if(!isFoundNode(statisticItem))
continue;
TreeNode catNode = mapCatNode.get(statisticItem.getCategoryId());
if (catNode != null) {
TreeNode statisticItemNode = new OcsTreeNode(statisticItem, catNode);
settingNewTreeNode(statisticItem, statisticItemNode);
}
}
}
public void buildTreeSmsNotifyTemplate() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<SmsNotifyTemplate> lstSmsNotifyTemplate = smsNotiTemDAO.findByListCat(lstCatID);
for (SmsNotifyTemplate smsNotifyTemplate : lstSmsNotifyTemplate) {
if(!isFoundNode(smsNotifyTemplate))
continue;
TreeNode catNode = mapCatNode.get(smsNotifyTemplate .getCategoryId());
if (catNode != null) {
TreeNode smsNotifyTemplateNode = new OcsTreeNode(smsNotifyTemplate , catNode);
settingNewTreeNode(smsNotifyTemplate , smsNotifyTemplateNode);
}
}
}
public void buildTreeCssUssdResponse() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<CssUssdResponse> lstCssUssdResponse = cssUssdResponseDAO.findByListCat(lstCatID);
for (CssUssdResponse cssUssdResponse : lstCssUssdResponse) {
if(!isFoundNode(cssUssdResponse))
continue;
TreeNode catNode = mapCatNode.get(cssUssdResponse.getCategoryId());
if (catNode != null) {
TreeNode cssUssdResponseNode = new OcsTreeNode(cssUssdResponse, catNode);
settingNewTreeNode(cssUssdResponse, cssUssdResponseNode);
}
}
}
/**
* Nampv 22/08/2016
*
*/
private void buildTreeReserveInfo() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<ReserveInfo> lstReserveInfos = reserveInfoDAO.findReserveInfoByConditions(lstCatID);
for (ReserveInfo reserveinfo : lstReserveInfos) {
if(!isFoundNode(reserveinfo))
continue;
TreeNode catNode = mapCatNode.get(reserveinfo.getCategoryId());
if (catNode != null) {
TreeNode reserveinfoNode = new OcsTreeNode(reserveinfo, catNode);
settingNewTreeNode(reserveinfo, reserveinfoNode);
}
}
}
private void buildTreePolicyProfile() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<ProfilePep> lstProfilePeps = profilePepDAO.findProfilePepByCategoryId(lstCatID);
for (ProfilePep profilePep : lstProfilePeps) {
if(!isFoundNode(profilePep))
continue;
TreeNode catNode = mapCatNode.get(profilePep.getCategoryId());
if (catNode != null) {
TreeNode profilePepNode = new OcsTreeNode(profilePep, catNode);
settingNewTreeNode(profilePep, profilePepNode);
List<PccRule> lstPccRules = pccRuleDAO.findPccRuleByPoliciProfile(profilePep.getProfilePepId());
for (PccRule pccRule : lstPccRules) {
TreeNode pccRuleNode = new OcsTreeNode(pccRule, profilePepNode);
settingNewTreeNode(pccRule, pccRuleNode);
}
}
}
}
private void buildTreePccrule() {
// Build children categories
buildTreeByCatType(treeType, root);
// Add reserveInfo to Category children
List<PccRule> lstPccRules = pccRuleDAO.findPccRuleByCategoryId(lstCatID);
for (PccRule pccRule : lstPccRules) {
if(!isFoundNode(pccRule))
continue;
TreeNode catNode = mapCatNode.get(pccRule.getCategoryId());
if (catNode != null) {
TreeNode ruleNode = new OcsTreeNode(pccRule, catNode);
settingNewTreeNode(pccRule, ruleNode);
}
}
}
private void buildTreeByCatType(String treeType, TreeNode root) {
Map<Long, String> mapType = CategoryType.getCatTypesByTreeType(treeType);
Iterator<Long> it = mapType.keySet().iterator();
while (it.hasNext()) {
Long catType = it.next();
Category cat = new Category();
cat.setTreeType(treeType);
cat.setCategoryName(mapType.get(catType));
cat.setCategoryType(catType);
cat.setCategoryId(0);
TreeNode node = new OcsTreeNode(cat, root);
node.setExpanded(true);
mapCatFirstNode.put(catType, node);
buildTreeByCat(catType, node);
}
}
private void buildTreeByCat(Long catType, TreeNode rootCatType) {
List<Category> lstCat = new ArrayList<>();
if (catType == CategoryType.SYS_SYS_CONFIG) {
lstCat = catDao.findByTypeWithoutDomain(catType);
} else {
lstCat = catDao.findByType(catType);
}
List<TreeNode> lstNodeNew = new ArrayList<TreeNode>();
List<TreeNode> lstNodeNotAdded = new ArrayList<TreeNode>();
for (Category cat : lstCat) {
if (cat.getCategoryParentId() == null || cat.getCategoryParentId() == 0) {
TreeNode node = new OcsTreeNode(cat, rootCatType);
lstNodeNew.add(node);
} else {
boolean isFound = false;
for (TreeNode parentNode : lstNodeNew) {
if (cat.getCategoryParentId() == ((Category) parentNode.getData()).getCategoryId()) {
TreeNode node = new OcsTreeNode(cat, parentNode);
lstNodeNew.add(node);
isFound = true;
break;
}
}
if (!isFound) {
TreeNode node = new OcsTreeNode(cat, null);
lstNodeNotAdded.add(node);
lstNodeNew.add(node);
}
}
}
for (TreeNode node : lstNodeNotAdded) {
for (TreeNode nodeAdded : lstNodeNew) {
if (((Category) node.getData()).getCategoryParentId() == ((Category) nodeAdded.getData())
.getCategoryId()) {
node.setParent(nodeAdded);
nodeAdded.getChildren().add(node);
break;
}
}
}
for (TreeNode node : lstNodeNew) {
Category cat = (Category) node.getData();
// node.setExpanded(true);
node.setType(TreeNodeType.CATEGORY);
lstCatID.add(cat.getCategoryId());
mapCatNode.put(cat.getCategoryId(), node);
getListNodeByObject(cat).add(node);
}
}
private void removeTreeNode(TreeNode parentNode, BaseEntity objEntity) {
List<TreeNode> lstChildren = parentNode.getChildren();
if (lstChildren == null || lstChildren.isEmpty())
return;
for (TreeNode childNode : lstChildren) {
BaseEntity data = (BaseEntity) childNode.getData();
if (objEntity.getUniqueKey().equals(data.getUniqueKey())) {
parentNode.getChildren().remove(childNode);
childNode.setParent(null);
return;
}
removeTreeNode(childNode, objEntity);
}
}
public void removeTreeNodeAll(BaseEntity objEntity) {
List<TreeNode> lstNode = getListNodeByObject(objEntity);
Iterator<TreeNode> it = lstNode.iterator();
while (it.hasNext()) {
TreeNode node = it.next();
TreeNode parentNode = node.getParent();
parentNode.getChildren().remove(node);
node.setParent(null);
it.remove();
}
}
/************ BUILD TREE - END *****************/
/************ EVENT - BEGIN ********************/
public void onSearchTree() {
buildTree(treeType);
if(!CommonUtil.isEmpty(txtTreeSearch)) {
setExpandedRecursively(root, true, true);
removeEmptyCatNode(root);
}
}
private boolean isFoundNode(BaseEntity objEntity) {
if(CommonUtil.isEmpty(txtTreeSearch))
return true;
if(objEntity.getNodeName() != null && objEntity.getNodeName().toLowerCase().contains(txtTreeSearch.toLowerCase()))
return true;
return false;
}
private boolean removeEmptyCatNode(TreeNode treeNode) {
if(treeNode != root && !(treeNode.getData() instanceof Category))
return false;
List<TreeNode> lstChildrenNode = treeNode.getChildren();
int countChildren = lstChildrenNode.size();
int countChildrenRemoved = 0;
Iterator<TreeNode> it = lstChildrenNode.iterator();
while(it.hasNext()) {
TreeNode childNode = it.next();
if(removeEmptyCatNode(childNode)) {
// childNode.setExpanded(false);
// countChildrenRemoved++;
Category childCat = (Category)childNode.getData();
if(childCat.getCategoryId() > 0) {
it.remove();
// lstCatID.remove(childCat.getCategoryId());
// mapCatNode.remove(childCat.getCategoryId());
countChildrenRemoved++;
}
}
}
if(countChildren == countChildrenRemoved)
return true;
else
return false;
}
public void onNodeExpand(NodeExpandEvent nodeExpandEvent) {
}
public void onNodeCollapse(NodeCollapseEvent nodeCollapseEvent) {
TreeNode node = nodeCollapseEvent.getTreeNode();
node.setExpanded(false);
}
private NodeSelectEvent nodeSelectEvent;
public NodeSelectEvent getNodeSelectEvent() {
return nodeSelectEvent;
}
public void setNodeSelectEvent(NodeSelectEvent nodeSelectEvent) {
this.nodeSelectEvent = nodeSelectEvent;
}
public void onNodeSelectContext(NodeSelectEvent event) {
nodeSelectEvent = event;
}
public void onNodeSelect(NodeSelectEvent nodeSlectedEvent) {
TreeNode treeNode = nodeSlectedEvent.getTreeNode();
currentEntity = (BaseEntity) treeNode.getData();
if (currentEntity == null)
return;
if (currentEntity instanceof Category) {
// Category
setContentTitle(super.readProperties("title.category"));
category = (Category) currentEntity;
setSelectCategoryNode(category);
selectedCatType = category.getCategoryType();
} else {
hideAllCategoryComponent();
if (currentEntity instanceof Parameter) {
setContentTitle(super.readProperties("parameter.title"));
setParameterProperties(false, ((Parameter) currentEntity).getCategoryId(), ((Parameter) currentEntity), false);
} else if (currentEntity instanceof ReserveInfo) {
setContentTitle(super.readProperties("title.ReserveInfo"));
setReserveInfoProperties(false, ((ReserveInfo) currentEntity).getCategoryId(), ((ReserveInfo) currentEntity), false);
} else if (currentEntity instanceof TriggerOcs) {
setContentTitle(super.readProperties("triggerOcs.title"));
setTriggerOcsProperties(false, ((TriggerOcs) currentEntity).getCategoryId(),
((TriggerOcs) currentEntity), false);
} else if (currentEntity instanceof TriggerType) {
setContentTitle(super.readProperties("triggerType.title"));
setTriggerTypeProperties(false, ((TriggerType) currentEntity).getCategoryId(),
((TriggerType) currentEntity), false);
} else if (currentEntity instanceof TriggerDestination) {
setContentTitle(super.readProperties("triggerDes.title"));
setTriggerDesProperties(false, ((TriggerDestination) currentEntity).getCategoryId(),
((TriggerDestination) currentEntity), false);
} else if (currentEntity instanceof Zone) {
setContentTitle(super.readProperties("zone.title"));
setZoneProperties(false, ((Zone) currentEntity).getZoneMapId(), ((Zone) currentEntity));
} else if (currentEntity instanceof GeoHomeZone) {
setContentTitle(super.readProperties("geohome.title"));
setGeoHomeProperties(false, ((GeoHomeZone) currentEntity).getCategoryId(),
((GeoHomeZone) currentEntity), false);
} else if (currentEntity instanceof ZoneMap) {
setContentTitle(super.readProperties("zonemap.title"));
setZoneMapProperties(false, ((ZoneMap) currentEntity).getCategoryId(), ((ZoneMap) currentEntity), false);
} else if (currentEntity instanceof BillingCycleType) {
setContentTitle(super.readProperties("billingcycleType.title"));
setBillingcycleProperties(false, ((BillingCycleType) currentEntity).getCategoryId(),
((BillingCycleType) currentEntity), false);
} else if (currentEntity instanceof UnitType) {
setContentTitle(super.readProperties("unittype.title"));
setUnitTypeProperties(false, ((UnitType) currentEntity).getCategoryId(), ((UnitType) currentEntity), false);
} else if (currentEntity instanceof StateType) {
setContentTitle(super.readProperties("stateset.title"));
setStateTypeProperties(false, ((StateType) currentEntity).getCategoryId(), ((StateType) currentEntity), false);
} else if (currentEntity instanceof StateGroup) {
setContentTitle(super.readProperties("stateset.stateGroup"));
setStateGroupProperties(false, ((StateGroup) currentEntity).getCategoryId(),
((StateGroup) currentEntity), false);
} else if (currentEntity instanceof PccRule) {
setContentTitle(super.readProperties("title.PR"));
setPccRuleProperties(false, ((PccRule) currentEntity).getCategoryId(), ((PccRule) currentEntity), false, false);
} else if (currentEntity instanceof ProfilePep) {
setContentTitle(super.readProperties("title.PEPP"));
setPolicyProfileProperties(false, ((ProfilePep) currentEntity).getCategoryId(),
((ProfilePep) currentEntity), false);
} else if (currentEntity instanceof BalType) {
setContentTitle(super.readProperties("baltype.title"));
setBalTypeProperties(false, ((BalType) currentEntity).getCategoryId(), ((BalType) currentEntity), false);
} else if (currentEntity instanceof TriggerMsg) {
setContentTitle(super.readProperties("triggerMsg.title"));
setTriggerMsgProperties(false, ((TriggerMsg) currentEntity).getCategoryId(),
((TriggerMsg) currentEntity), false);
} else if (currentEntity instanceof Service) {
setContentTitle(super.readProperties("service.title"));
setServiceProperties(false, ((Service) currentEntity).getCategoryId(), ((Service) currentEntity), false);
} else if (currentEntity instanceof MapSharebalBal) {
setContentTitle(super.readProperties("title.MapShareBal"));
setMapShareBalProperties(false, ((MapSharebalBal) currentEntity).getCategoryId(),
((MapSharebalBal) currentEntity), false);
} else if (currentEntity instanceof MapAcmbalBal) {
setContentTitle(super.readProperties("title.MapAcmBal"));
setMapAcmBalProperties(false, ((MapAcmbalBal) currentEntity).getCategoryId(),
((MapAcmbalBal) currentEntity), false);
} else if (currentEntity instanceof CdrService) {
setContentTitle(super.readProperties("title.CdrService"));
setCdrServiceProperties(false, ((CdrService) currentEntity).getCategoryId(),
((CdrService) currentEntity), false);
} else if (currentEntity instanceof CdrTemplate) {
setContentTitle(super.readProperties("title.CdrTemplate"));
setCdrTemplateProperties(false, ((CdrTemplate) currentEntity).getCategoryId(),
((CdrTemplate) currentEntity), false);
} else if (currentEntity instanceof CdrGenFilename) {
setContentTitle(super.readProperties("title.CdrGenFileName"));
setCdrGenFileNameProperties(false, ((CdrGenFilename) currentEntity).getCategoryId(),
((CdrGenFilename) currentEntity), false);
} else if (currentEntity instanceof CdrProcessConfig) {
setContentTitle(super.readProperties("title.CdrProcessConfig"));
setCdrProcessConfigProperties(false, ((CdrProcessConfig) currentEntity).getCategoryId(),
((CdrProcessConfig) currentEntity), false);
} else if (currentEntity instanceof SystemConfig) {
setContentTitle(super.readProperties("title.SystemConfig"));
setSystemConfigProperties(false, ((SystemConfig) currentEntity).getCategoryId(),
((SystemConfig) currentEntity), false);
} else if (currentEntity instanceof Threshold) {
setPage("baltype");
setContentTitle(super.readProperties("baltype.title"));
Threshold threshold = (Threshold) nodeSlectedEvent.getTreeNode().getData();
balTypeBean.refreshThresHold(threshold);
mapShareBalBean.setFormType("");
mapAcmBalBean.setFormType("");
} else if (currentEntity instanceof StatisticItem) {
setContentTitle(super.readProperties("statisticItem.title"));
setStatisticItemProperties(false, ((StatisticItem) currentEntity).getCategoryId(),
((StatisticItem) currentEntity), false);
} else if (currentEntity instanceof SmsNotifyTemplate) {
setContentTitle(super.readProperties("smsNotifyTemplate.title"));
setSmsNotifyTemplateProperties(false, ((SmsNotifyTemplate) currentEntity).getCategoryId(),
((SmsNotifyTemplate) currentEntity), false);
} else if (currentEntity instanceof CssUssdResponse) {
setContentTitle(super.readProperties("cssUssdResponse.title"));
setCssUssdResponseProperties(false, ((CssUssdResponse) currentEntity).getCategoryId(),
((CssUssdResponse) currentEntity), false);
}
}
}
// Nampv setSelectCategoryNode khi click node category
private void setSelectCategoryNode(Category cat) {
long catId = cat.getCategoryId();
if (catId <= 0) {
// Select node ngoai cung
setPage("hiden");
setFormType("cat-list");
loadListCategory(cat.getCategoryType());
setShowBtnCatNew(true);
} else {
// Select node con
setFormType("cat-form");
categoryParentId = cat.getCategoryParentId() == null ? 0 : cat.getCategoryParentId().longValue();
setCategory(cat);
searchCatSub(catId);
setCategoryTitle("Sub-Categories of " + cat.getCategoryName());
isEditing = true;
searchCatParent(cat.getCategoryType(), cat.getCategoryId());
switch (treeType) {
case TreeType.CATALOG_PARAMETER:
setParameterProperties(true, catId, null, false);
break;
case TreeType.CATALOG_RESERVE_INFO:
setReserveInfoProperties(true, catId, null, false);
break;
case TreeType.CATALOG_TRIGGER_OCS:
if (cat.getCategoryType() == CategoryType.CTL_TO_TRIGGER_OCS) {
setTriggerOcsProperties(true, catId, null, false);
}
if (cat.getCategoryType() == CategoryType.CTL_TT_TRIGGER_TYPE) {
setTriggerTypeProperties(true, catId, null, false);
}
break;
case TreeType.CATALOG_TRIGGER_MESSAGE:
setTriggerMsgProperties(true, catId, null, false);
break;
case TreeType.CATALOG_TRIGGER_DESTINATION:
setTriggerDesProperties(true, catId, null, false);
break;
case TreeType.CATALOG_SERVICE:
setServiceProperties(true, catId, null, false);
break;
case TreeType.CATALOG_CDR:
// onSelectCDR(treeNode);
break;
case TreeType.CATALOG_ZONE_DATA:
setZoneMapProperties(true, catId, null, false);
// setZoneProperties(true, zoneMapId, null);
break;
case TreeType.CATALOG_GEO_HOME:
setGeoHomeProperties(true, catId, null, false);
break;
case TreeType.CATALOG_BILLING_CYCLE:
setBillingcycleProperties(true, catId, null, false);
break;
case TreeType.CATALOG_UNIT_TYPE:
setUnitTypeProperties(true, catId, null, false);
break;
case TreeType.CATALOG_STATE_SET:
if (cat.getCategoryType() == CategoryType.CTL_STATEGROUP) {
setStateGroupProperties(true, catId, null, false);
} else if (cat.getCategoryType() == CategoryType.CTL_STATETYPE) {
setStateTypeProperties(true, catId, null, false);
}
break;
case TreeType.POLICY_PCC_RULE:
setPccRuleProperties(true, catId, null, false, false);
break;
case TreeType.POLICY_POLICY_PROFILE:
setPolicyProfileProperties(true, catId, null, false);
break;
case TreeType.CATALOG_BALANCE:
if (cat.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE) {
setBalTypeProperties(true, catId, null, false);
}
if (cat.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE_ACC) {
setBalTypeProperties(true, catId, null, false);
}
if (cat.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE_ACCOUNT_MAPPING) {
setMapShareBalProperties(true, catId, null, false);
}
if (cat.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE_ACM_MAPPING) {
setMapAcmBalProperties(true, catId, null, false);
}
break;
case TreeType.CATALOG_CDR_SERVICE:
setCdrServiceProperties(true, catId, null, false);
break;
case TreeType.CATALOG_CDR_TEMPLATE:
setCdrTemplateProperties(true, catId, null, false);
break;
case TreeType.CATALOG_CDR_GEN_FILENAME:
setCdrGenFileNameProperties(true, catId, null, false);
break;
case TreeType.CATALOG_CDR_PROCESS_CONFIG:
setCdrProcessConfigProperties(true, catId, null, false);
break;
case TreeType.SYS_SYS_CONFIG:
setSystemConfigProperties(true, catId, null, false);
break;
case TreeType.CATALOG_STATISTIC_ITEM:
setStatisticItemProperties(true, catId, null, false);
break;
case TreeType.CATALOG_SMS_NOTIFY_TEMPLATE:
setSmsNotifyTemplateProperties(true, catId, null, false);
break;
case TreeType.CATALOG_CSS_USSD_RESPONSE:
setCssUssdResponseProperties(true, catId, null, false);
break;
default:
break;
}
}
}
// Nampv setPropertyDetail khi click node con cuoi cung
public void hideAllCategoryComponent() {
setFormType("hide-all-cat");
}
@ManagedProperty("#{policyProfileBean}")
private PolicyProfileBean policyProfileBean;
public void setPolicyProfileBean(PolicyProfileBean policyProfileBean) {
this.policyProfileBean = policyProfileBean;
}
@ManagedProperty("#{pccRuleBean}")
private PCCRuleBean pccRuleBean;
public void setPccRuleBean(PCCRuleBean pccRuleBean) {
this.pccRuleBean = pccRuleBean;
}
@ManagedProperty("#{reserveBean}")
private ReserveInfoBean reserveInfoBean;
public void setReserveInfoBean(ReserveInfoBean reserveInfoBean) {
this.reserveInfoBean = reserveInfoBean;
}
/**
* Nampv setPropertyOfReserveInfo
*/
private void setReserveInfoProperties(boolean selectCat, Long categoryId, ReserveInfo reserveInfo, boolean createNew) {
if(createNew) {
reserveInfoBean.setCategoryID(categoryId);
reserveInfoBean.commandAddNew();
} else if (selectCat) {
reserveInfoBean.setFormType("list-reserveinfo-by-category");
reserveInfoBean.loadReserveInfoByCategory(categoryId);
reserveInfoBean.setEditting(true);
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.execute("$('.rVClearFilter').click();");
} else {
hideAllCategoryComponent();
reserveInfoBean.setFormType("detail-reserveinfo");
reserveInfoBean.setReserveInfoUI(reserveInfo);
reserveInfoBean.setEditting(true);
reserveInfoBean.setApply(true);
reserveInfoBean.loadCategoriesOfRI();
hideAllCategoryComponent();
}
}
public void setUnitTypeProperties(boolean selectCat, Long categoryId, UnitType unitType, boolean createNew) {
if(createNew) {
unitBean.setCategory(category);
unitBean.commandAddNewUnitType();
} else if (selectCat) {
unitBean.refreshCategories(category);
} else {
unitBean.refreshUnitType(unitType);
hideAllCategoryComponent();
}
}
public void setBalTypeProperties(boolean selectCat, Long categoryId, BalType balType, boolean createNew) {
setPage("baltype");
if(createNew) {
balTypeBean.setCategory(category);
balTypeBean.commandAddNewBalType();
} else if (selectCat) {
balTypeBean.refreshCategories(category);
} else {
balTypeBean.refreshBalType(balType);
hideAllCategoryComponent();
}
mapShareBalBean.setFormType("");
mapAcmBalBean.setFormType("");
}
private void setMapShareBalProperties(boolean selectCat, Long categoryId, MapSharebalBal mapShareBal, boolean createNew) {
setPage("baltype");
if(createNew) {
mapShareBalBean.setCategory(category);
mapShareBalBean.commandAddNewMapShareBal();
} else if (selectCat) {
mapShareBalBean.refreshCategoriesofMapShare(category);
} else {
mapShareBalBean.refreshMapShareBal(mapShareBal);
hideAllCategoryComponent();
}
balTypeBean.setFormType("");
mapAcmBalBean.setFormType("");
}
public void setCdrServiceProperties(boolean selectCat, Long categoryId, CdrService cdrService, boolean createNew) {
if(createNew) {
cdrServiceBean.setCategoryId(categoryId);
cdrServiceBean.btnAddNew();
} else if (selectCat) {
cdrServiceBean.setConditionFormType("category");
cdrServiceBean.getListCdrServiceByCategoryId(categoryId, 1);
cdrServiceBean.setCategoryId(categoryId);
super.resetDataTable("form-category:ID_RoleTable");
} else {
hideAllCategoryComponent();
setContentTitle(super.readProperties("title.CdrService"));
cdrServiceBean.getLoadComboListCategory();
cdrServiceBean.setConditionFormType("detail");
cdrServiceBean.setDataByTreeNode(cdrService);
cdrServiceBean.setCategoryId(cdrService.getCategoryId());
}
}
public void setCdrTemplateProperties(boolean selectCat, Long categoryId, CdrTemplate cdrTemplate, boolean createNew) {
if(createNew) {
cdrTemplateBean.setCategoryId(categoryId);
cdrTemplateBean.addNewTemplate();
} else if (selectCat) {
cdrTemplateBean.setFormType("category");
cdrTemplateBean.getListCdrTemplateByCategoryId(categoryId);
cdrTemplateBean.setCategoryId(categoryId);
super.resetDataTable("form-template-category:tableCdrTemplate");
} else {
hideAllCategoryComponent();
setContentTitle(super.readProperties("title.CdrTemplate"));
cdrTemplateBean.setFormType("detail");
cdrTemplateBean.setDataByTreeNode(cdrTemplate);
cdrTemplateBean.setCategoryId(cdrTemplate.getCategoryId());
cdrTemplateBean.setEditting(false);
cdrTemplateBean.getLoadComboListCategory();
}
}
public void setCdrGenFileNameProperties(boolean selectCat, Long categoryId, CdrGenFilename cdrGenFilename, boolean createNew) {
if(createNew) {
cdrGenFileNameBean.setCategoryId(categoryId);
cdrGenFileNameBean.addNewGenFileName();
} else if (selectCat) {
cdrGenFileNameBean.setFormType("category");
cdrGenFileNameBean.getListCdrGenFileNameByCategoryId(categoryId, 1);
cdrGenFileNameBean.setCategoryId(categoryId);
super.resetDataTable("form-template-category:tableCdrGenFileName");
} else {
hideAllCategoryComponent();
setContentTitle(super.readProperties("title.CdrGenFileName"));
cdrGenFileNameBean.setFormType("detail");
cdrGenFileNameBean.setDataByTreeNode(cdrGenFilename);
cdrGenFileNameBean.setCategoryId(cdrGenFilename.getCategoryId());
cdrGenFileNameBean.setEditting(false);
}
}
public void setCdrProcessConfigProperties(boolean selectCat, Long categoryId, CdrProcessConfig cdrProcessConfig, boolean createNew) {
if(createNew) {
cdrProcessConfigBean.setCategoryId(categoryId);
cdrProcessConfigBean.addNewProcessConfig();
} else if (selectCat) {
cdrProcessConfigBean.setFormType("category");
cdrProcessConfigBean.getListCdrProcessConfigByCategoryId(categoryId, 1);
cdrProcessConfigBean.setCategoryId(categoryId);
super.resetDataTable("form-ProcessConfig-category:tableCdrProcessConfig");
} else {
hideAllCategoryComponent();
setContentTitle(super.readProperties("title.CdrProcessConfig"));
cdrProcessConfigBean.setFormType("detail");
cdrProcessConfigBean.setDataByTreeNode(cdrProcessConfig);
cdrProcessConfigBean.setCategoryId(cdrProcessConfig.getCategoryId());
cdrProcessConfigBean.setEditting(false);
}
}
private void setMapAcmBalProperties(boolean selectCat, Long categoryId, MapAcmbalBal mapAcmBal, boolean createNew) {
setPage("baltype");
if(createNew) {
mapAcmBalBean.setCategory(category);
mapAcmBalBean.commandAddNewMapAcmBal();
} else if (selectCat) {
mapAcmBalBean.refreshCategoriesofMapAcm(category);
} else {
mapAcmBalBean.refreshMapAcmBal(mapAcmBal);
hideAllCategoryComponent();
}
mapShareBalBean.setFormType("");
balTypeBean.setFormType("");
}
private void setZoneMapProperties(boolean selectCat, Long categoryId, ZoneMap zoneMap, boolean createNew) {
if(createNew) {
zoneMapBean.setCategory(category);;
zoneMapBean.commandAddNewZoneMap();
} else if (selectCat) {
zoneMapBean.refreshCategories(category);
} else {
zoneMapBean.refreshZoneMap(zoneMap);
hideAllCategoryComponent();
}
}
private void setZoneProperties(boolean selectCat, Long zoneMapId, Zone zone) {
if (!selectCat) {
zoneMapBean.refreshZone(zone);
zoneMapBean.setApply(true);
hideAllCategoryComponent();
}
}
private void setTriggerDesProperties(boolean selectCat, Long categoryId, TriggerDestination triggerDestination, boolean createNew) {
if(createNew) {
triggerDesBean.setCategoryID(categoryId);
triggerDesBean.commandAddNewTriggerDes();
} else if (selectCat) {
triggerDesBean.setFormType("list-triggerdes-by-category");
triggerDesBean.loadTriggerDesByCategory(categoryId);
} else {
triggerDesBean.refreshTriggerDes(triggerDestination);
triggerDesBean.setEditting(true);
triggerDesBean.setApply(true);
triggerDesBean.loadCategoriesOfTD();
hideAllCategoryComponent();
}
}
private void setGeoHomeProperties(boolean selectCat, Long categoryId, GeoHomeZone geoHomeZone, boolean createNew) {
if(createNew) {
geoBean.setCategory(category);
geoBean.commandAddNewGeoHome();
} else if (selectCat) {
geoBean.refreshCategories(category);
} else {
setContentTitle(super.readProperties("geohome.title"));
geoBean.refreshGeoHome(geoHomeZone);
hideAllCategoryComponent();
}
}
public void setParameterProperties(boolean selectCat, Long categoryId, Parameter parameter, boolean createNew) {
if(createNew) {
parameterBean.setCategoryID(categoryId);
parameterBean.commandAddNew();
} else if (selectCat) {
parameterBean.setFormType("list-parameter-by-category");
parameterBean.loadParameterByCategory(categoryId);
parameterBean.setEditting(true);
} else {
parameterBean.setFormType("detail-parameter");
parameterBean.setParameterUI(parameter);
parameterBean.setEditting(true);
parameterBean.setApply(true);
parameterBean.loadCategoriesOfPara();
hideAllCategoryComponent();
}
}
private void setStateTypeProperties(boolean selectCat, Long categoryId, StateType stateType, boolean createNew) {
if(createNew) {
stateSetBean.setCategoryID(categoryId);
stateSetBean.commandAddNew();
} else if (selectCat) {
stateSetBean.setFormType("list-statetype-by-category");
stateSetBean.loadStateTypeByCategory(category.getCategoryId());
stateSetBean.setEditting(true);
stateSetBean.setEdittingStateGroup(true);
} else {
stateSetBean.setFormType("detail-statetype");
stateSetBean.setStateTypeUI(stateType);
stateSetBean.setEditting(true);
stateSetBean.setApply(true);
stateSetBean.setEdittingStateGroup(true);
hideAllCategoryComponent();
}
}
private void setStateGroupProperties(boolean selectCat, Long categoryId, StateGroup stateGroup, boolean createNew) {
if(createNew) {
stateSetBean.setCategoryID(categoryId);
stateSetBean.commandAddNewStateGroup();
} else if (selectCat) {
stateSetBean.setFormType("list-stategroup-by-category");
stateSetBean.loadStateGroupByCategory(category.getCategoryId());
stateSetBean.setEditting(true);
stateSetBean.setEdittingStateGroup(true);
// RequestContext requestContext = RequestContext.getCurrentInstance();
// requestContext.execute("$('.stateGroupTableClearFilter').click();");
} else {
stateSetBean.setFormType("detail-stategroup");
stateSetBean.setStateGroupUI(stateGroup);
stateSetBean.setEditting(true);
stateSetBean.setApply(true);
stateSetBean.setEdittingStateGroup(true);
hideAllCategoryComponent();
}
}
private void setTriggerOcsProperties(boolean selectCat, Long categoryId, TriggerOcs triggerOcs, boolean createNew) {
setPage("trigger_ocs");
if(createNew) {
triggerOcsBean.setCategoryID(categoryId);;
triggerOcsBean.commandAddNewTriggerOcs();
} else if (selectCat) {
triggerOcsBean.setFormType("list-trigger-ocs");
triggerOcsBean.loadTriggerOcsByCategory(categoryId);
triggerOcsBean.setEditting(true);
triggerOcsBean.setEdittingTriggerType(true);
} else {
triggerOcsBean.setFormType("detail-trigger-ocs");
triggerOcsBean.setTriggerOcsUI(triggerOcs);
triggerOcsBean.setEditting(true);
triggerOcsBean.setApply(true);
triggerOcsBean.setEdittingTriggerType(true);
triggerOcsBean.loadCategoriesOfTO();
hideAllCategoryComponent();
}
}
private void setTriggerTypeProperties(boolean selectCat, Long categoryId, TriggerType triggerType, boolean createNew) {
setPage("trigger_ocs");
if(createNew) {
triggerOcsBean.setCategoryID(categoryId);;
triggerOcsBean.commandAddNewTriggerType();
} else if (selectCat) {
triggerOcsBean.setFormType("list-trigger-type");
triggerOcsBean.loadTriggerTypeByCategory(categoryId);
triggerOcsBean.setEditting(true);
triggerOcsBean.setEdittingTriggerType(true);
} else {
triggerOcsBean.setFormType("detail-trigger-type");
triggerOcsBean.setTriggerTypeUI(triggerType);
triggerOcsBean.setEditting(true);
triggerOcsBean.setApply(true);
triggerOcsBean.setEdittingTriggerType(true);
triggerOcsBean.loadCategoriesOfTT();
hideAllCategoryComponent();
}
}
private void setTriggerMsgProperties(boolean selectCat, Long categoryId, TriggerMsg triggerMsg, boolean createNew) {
setPage("trigger_msg");
if(createNew) {
triggerMsgBean.setCategoryID(categoryId);
triggerMsgBean.commandAddNewTriggerMsg();
} else if (selectCat) {
triggerMsgBean.setFormType("list-trigger-msg");
triggerMsgBean.loadTriggerMsgByCategory(category.getCategoryId());
triggerMsgBean.setEditting(true);
} else {
triggerMsgBean.setFormType("detail-trigger-msg");
triggerMsgBean.setTriggerMsgUI(triggerMsg);
triggerMsgBean.setEditting(true);
triggerMsgBean.setApply(true);
triggerMsgBean.loadCategoriesOfTM();
hideAllCategoryComponent();
}
}
private void setServiceProperties(boolean selectCat, Long categoryId, Service service, boolean createNew) {
if(createNew) {
serviceBean.setCategoryID(categoryId);
serviceBean.commandAddNew();
} else if (selectCat) {
serviceBean.setFormType("list-service");
serviceBean.loadServiceByCategory(category.getCategoryId());
serviceBean.setEditting(true);
} else {
serviceBean.setFormType("detail-service");
serviceBean.setServiceUI(service);
serviceBean.setEditting(true);
serviceBean.setApply(true);
serviceBean.loadCategoriesOfService();
hideAllCategoryComponent();
}
}
private void setBillingcycleProperties(boolean selectCat, Long categoryId, BillingCycleType billingCycleType, boolean createNew) {
if(createNew) {
billingCycleTypeBean.setCategoryID(categoryId);
billingCycleTypeBean.commandAddNew();
} else if (selectCat) {
billingCycleTypeBean.setFormType("list-billing-cycle-type-by-category");
billingCycleTypeBean.loadBillingCycleTypeByCategory(categoryId);
billingCycleTypeBean.setEditting(true);
// RequestContext requestContext =
// RequestContext.getCurrentInstance();
// requestContext.execute("$('.billingCycleCateTableClearFilter').click();");
} else {
billingCycleTypeBean.setFormType("detail-billing-cycle-type");
billingCycleTypeBean.setBillingCycleTypeUI(billingCycleType);
billingCycleTypeBean.setEditting(true);
billingCycleTypeBean.setApply(true);
billingCycleTypeBean.loadListBillingCycleDB(billingCycleType.getBillingCycleTypeId());
// billingCycleTypeBean.loadCalcUnit();
billingCycleTypeBean.loadCalcUnitDB();
billingCycleTypeBean.resetDataTable();
hideAllCategoryComponent();
}
}
public void setPolicyProfileProperties(boolean selectCat, Long categoryId, ProfilePep profilePep, boolean createNew) {
setPage("policy_profile");
if(createNew) {
policyProfileBean.setCategoryID(categoryId);
policyProfileBean.btnNew();
} else if (selectCat) {
policyProfileBean.setFormType("category");
policyProfileBean.getListPolicyProfileBeanByCategoryId(categoryId);
policyProfileBean.setPolicyProfileTitle(super.readProperties("title.ProfilePep"));
policyProfileBean.updateUI();
policyProfileBean.setCategoryID(categoryId);
} else {
hideAllCategoryComponent();
policyProfileBean.setFormType("detail");
policyProfileBean.setDataByTreeNode(profilePep);
policyProfileBean.setEditting(false);
policyProfileBean.findListPccRule(profilePep.getProfilePepId());
policyProfileBean.loadCategory();
}
}
public void setPccRuleProperties(boolean selectCat, Long categoryId, PccRule pccRule, boolean parentEdit, boolean createNew) {
setPage("pcc_rule");
if(createNew) {
pccRuleBean.setCategoryID(categoryId);
pccRuleBean.btnAddNewPccRule();
} else if (selectCat) {
pccRuleBean.setFormType("category");
pccRuleBean.getListPccRuleByCategoryId(categoryId);
pccRuleBean.setPccRuleTitle(super.readProperties("title.PccRule"));
pccRuleBean.updateUI();
pccRuleBean.setCategoryID(categoryId);
} else {
hideAllCategoryComponent();
pccRuleBean.setFormType("detail");
pccRuleBean.setDataByTreeNode(pccRule);
pccRuleBean.setEditting(false);
if(parentEdit) {
pccRuleBean.setEditting(true);
}
pccRuleBean.loadCategory();
}
}
private void setSystemConfigProperties(boolean selectCat, Long categoryId, SystemConfig systemConfig, boolean createNew) {
if(createNew) {
systemConfigBean.setCategoryID(categoryId);
systemConfigBean.btnNew();
} else {
systemConfigBean.refreshSysConfig(categoryId, systemConfig);
}
}
private void setStatisticItemProperties(boolean selectCat, Long categoryId, StatisticItem statisticItem, boolean createNew) {
if(createNew) {
statisticItemBean.setCategory(category);
statisticItemBean.addNewStatistic();
} else if (selectCat) {
statisticItemBean.refreshCategories(category);
} else {
statisticItemBean.refreshStatisticItem(statisticItem);
hideAllCategoryComponent();
}
}
private void setSmsNotifyTemplateProperties(boolean selectCat, Long categoryId, SmsNotifyTemplate smsNotifyTemplate, boolean createNew) {
if(createNew) {
smsNotiTemBean.setCategory(category);
smsNotiTemBean.addNewSMS();
} else if (selectCat) {
smsNotiTemBean.refreshCategories(category);
} else {
smsNotiTemBean.refreshSMS(smsNotifyTemplate);
hideAllCategoryComponent();
}
}
private void setCssUssdResponseProperties(boolean selectCat, Long categoryId, CssUssdResponse cssUssdResponse, boolean createNew) {
if (createNew) {
cssUssdResponseBean.setCategory(category);
cssUssdResponseBean.addNewCSS();
} else if (selectCat) {
cssUssdResponseBean.refreshCategories(category);
} else {
cssUssdResponseBean.refreshCSS(cssUssdResponse);
hideAllCategoryComponent();
}
}
public void collapseAll() {
setExpandedRecursively(root, false, false);
}
public void expandAll() {
setExpandedRecursively(root, true, false);
}
private void setExpandedRecursively(final TreeNode node, final boolean expanded, boolean catOnly) {
if (node.getChildren() == null)
return;
if(catOnly) {
if(node == root || node.getData() instanceof Category) {
for (final TreeNode child : node.getChildren()) {
setExpandedRecursively(child, expanded, catOnly);
}
if(expanded) {
node.setExpanded(expanded);
} else {
// Chi collapse toi cat co Id > 0
if(node.getData() instanceof Category && ((Category)node.getData()).getCategoryId() > 0) {
node.setExpanded(expanded);
}
}
}
} else {
for (final TreeNode child : node.getChildren()) {
setExpandedRecursively(child, expanded, catOnly);
}
node.setExpanded(expanded);
}
}
public boolean removeTreeNode(BaseEntity objEntity, BaseEntity parentEntity) {
TreeNode currentNode = this.getTreeNodeByObject(objEntity, parentEntity);
if (currentNode == null)
return false;
TreeNode parentNode = currentNode.getParent();
if (parentNode != null) {
parentNode.getChildren().remove(currentNode);
currentNode.setParent(null);
getListNodeByObject(objEntity).remove(currentNode);
return true;
}
return false;
}
private TreeNode getTreeNodeByObject(BaseEntity obj, BaseEntity objParent) {
if (obj == null || objParent == null)
return null;
List<TreeNode> lstObjNode = mapListNode.get(obj.getUniqueKey());
List<TreeNode> lstParentNode = mapListNode.get(objParent.getUniqueKey());
if (lstObjNode == null || lstParentNode == null)
return null;
for (TreeNode parentNode : lstParentNode) {
List<TreeNode> lstChildOfParent = parentNode.getChildren();
for (TreeNode node : lstChildOfParent) {
for (TreeNode objNode : lstObjNode) {
if (objNode == node)
return objNode;
}
}
}
return null;
}
private List<TreeNode> getListNodeByObject(BaseEntity objEntity) {
List<TreeNode> lst = mapListNode.get(objEntity.getUniqueKey());
if (lst == null) {
lst = new ArrayList<>();
mapListNode.put(objEntity.getUniqueKey(), lst);
}
return lst;
}
public void updateTreeNode(BaseEntity obj, Category objCategory, List lstChildObject) {
this.setCatNodeParent(obj, objCategory);
this.updateTreeNode(obj, lstChildObject);
}
private void setCatNodeParent(BaseEntity obj, Category objCategory) {
if (objCategory == null)
return;
TreeNode catNode = mapCatNode.get(objCategory.getCategoryId());
if (catNode == null)
return;
TreeNode nodeCurrent = null;
List<TreeNode> lstNode = this.getListNodeByObject(obj);
for (TreeNode node : lstNode) {
if (node.getParent().getData() instanceof Category) {
nodeCurrent = node;
break;
}
}
if (nodeCurrent != null) {
BaseEntity nodeObj = (BaseEntity) nodeCurrent.getData();
if (nodeObj != obj)
HibernateUtil.copyEntityProperties(BaseEntity.class, obj, nodeObj, true);
TreeNode oldParentNode = nodeCurrent.getParent();
if (oldParentNode != catNode) {
oldParentNode.getChildren().remove(nodeCurrent);
nodeCurrent.setParent(catNode);
if (catNode != null)
catNode.getChildren().add(nodeCurrent);
}
} else {
TreeNode newNode = new OcsTreeNode(obj, catNode);
settingNewTreeNode(obj, newNode);
}
}
private void updateTreeNode(BaseEntity obj, List lstObjChildren) {
List<TreeNode> lstTreeNode = this.getListNodeByObject(obj);
for (TreeNode nodeParent : lstTreeNode) {
BaseEntity objNode = (BaseEntity) nodeParent.getData();
HibernateUtil.copyEntityProperties(obj, objNode);
if (lstObjChildren == null || lstObjChildren.size() <= 0)
continue;
// Tim nhung childnode ko thuoc trong list con
List<TreeNode> lstCurrentChildren = nodeParent.getChildren();
List<TreeNode> lstChildren2Remove = new ArrayList<TreeNode>();
for (TreeNode childNode : lstCurrentChildren) {
boolean found = false;
BaseEntity childNodeEntity = (BaseEntity) childNode.getData();
for (int i = 0; i < lstObjChildren.size(); i++) {
BaseEntity objChild = (BaseEntity) lstObjChildren.get(i);
if (objChild.getUniqueKey().equals(childNodeEntity.getUniqueKey())) {
HibernateUtil.copyEntityProperties(objChild, childNodeEntity);
found = true;
break;
}
}
if (!found) {
lstChildren2Remove.add(childNode);
}
}
// Remove nhung child ko thuoc list con
for (TreeNode childRemove : lstChildren2Remove) {
lstCurrentChildren.remove(childRemove);
childRemove.setParent(null);
getListNodeByObject((BaseEntity) childRemove.getData()).remove(childRemove);
}
// Add cac con moi vao node
for (int i = 0; i < lstObjChildren.size(); i++) {
BaseEntity objChild = (BaseEntity) lstObjChildren.get(i);
if (getTreeNodeByObject(objChild, obj) == null) {
TreeNode newChildNode = new OcsTreeNode(objChild, nodeParent);
settingNewTreeNode(objChild, newChildNode);
}
}
}
}
private void settingNewTreeNode(BaseEntity objEntity, TreeNode node) {
getListNodeByObject(objEntity).add(node);
setTypeAndDumpNode(objEntity, node);
}
private void setTypeAndDumpNode(BaseEntity objEntity, TreeNode node) {
if (objEntity instanceof Service) {
node.setType(TreeNodeType.CAT_SERVICE);
} else if (objEntity instanceof Parameter) {
node.setType(TreeNodeType.CAT_PARAMETER);
} else if (objEntity instanceof BillingCycleType) {
node.setType(TreeNodeType.CAT_BILLING_CYCLE);
} else if (objEntity instanceof UnitType) {
node.setType(TreeNodeType.CAT_UNIT_TYPE);
} else if (objEntity instanceof BalType) {
node.setType(TreeNodeType.CAT_BAL_TYPE);
} else if (objEntity instanceof StateGroup) {
node.setType(TreeNodeType.CAT_STATE_GROUP);
} else if (objEntity instanceof StateType) {
node.setType(TreeNodeType.CAT_STATE_TYPE);
} else if (objEntity instanceof ReserveInfo) {
node.setType(TreeNodeType.CAT_RESERVE_INFO);
} else if (objEntity instanceof TriggerOcs) {
node.setType(TreeNodeType.CAT_TRIGGER_OCS);
} else if (objEntity instanceof TriggerDestination) {
node.setType(TreeNodeType.CAT_TRIGGER_DESTINATION);
} else if (objEntity instanceof TriggerMsg) {
node.setType(TreeNodeType.CAT_TRIGGER_MSG);
} else if (objEntity instanceof GeoHomeZone) {
node.setType(TreeNodeType.CAT_GEO_HOME_ZONE);
} else if (objEntity instanceof TriggerType) {
node.setType(TreeNodeType.CAT_TRIGGER_TYPE);
} else if (objEntity instanceof ZoneMap) {
node.setType(TreeNodeType.CAT_ZONE_MAP);
} else if (objEntity instanceof MapSharebalBal) {
node.setType(TreeNodeType.CAT_MAP_SHARE_BAL);
} else if (objEntity instanceof MapAcmbalBal) {
node.setType(TreeNodeType.CAT_MAP_ACM_BAL);
} else if (objEntity instanceof CdrService) {
node.setType(TreeNodeType.CAT_CDR_SERVICE);
} else if (objEntity instanceof CdrTemplate) {
node.setType(TreeNodeType.CAT_CDR_TEMP);
} else if (objEntity instanceof CdrGenFilename) {
node.setType(TreeNodeType.CAT_CDR_GEN_FILENAME);
} else if (objEntity instanceof CdrProcessConfig) {
node.setType(TreeNodeType.CAT_CDR_PROCESS_CFG);
} else if (objEntity instanceof ProfilePep) {
node.setType(TreeNodeType.POLICY_PEP_PROFILE);
} else if (objEntity instanceof PccRule) {
node.setType(TreeNodeType.POLICY_PCC_RULE);
} else if (objEntity instanceof SystemConfig) {
node.setType(TreeNodeType.SETTING_SYS_COMFIG);
} else if (objEntity instanceof StatisticItem) {
node.setType(TreeNodeType.CAT_STATISTIC_ITEM);
} else if (objEntity instanceof SmsNotifyTemplate) {
node.setType(TreeNodeType.CAT_SMS_NOTIFY_TEMPLATE);
} else if (objEntity instanceof CssUssdResponse) {
node.setType(TreeNodeType.CAT_CSS_USSD_RESPONSE);
}
}
public void addChildCatContext(NodeSelectEvent nodeSelectEvent) {
this.onNodeSelect(nodeSelectEvent);
btnCatShowDlg(null);
}
public void addChildObjectContext(NodeSelectEvent nodeSelectEvent) {
if (nodeSelectEvent.getTreeNode().getData() instanceof Category) {
category = (Category) nodeSelectEvent.getTreeNode().getData();
if (category.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE || category.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE_ACC) {
setBalTypeProperties(false, category.getCategoryId(), null, true);
} else if (category.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE_ACCOUNT_MAPPING) {
setMapShareBalProperties(false, category.getCategoryId(), null, true);
} else if (category.getCategoryType() == CategoryType.CTL_BL_BAL_TYPE_ACM_MAPPING) {
setMapAcmBalProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_PARAMETER) {
setParameterProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_UT_RESERVE_INFO) {
setReserveInfoProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_TO_TRIGGER_OCS) {
setTriggerOcsProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_TT_TRIGGER_TYPE) {
setTriggerTypeProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_TD_TRIGGER_DESTINATION) {
setTriggerDesProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_TM_TRIGGER_MESSAGE) {
setTriggerMsgProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_SERVICE) {
setServiceProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_CDR_SERVICE) {
setCdrServiceProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_CDR_TEMPLATE) {
setCdrTemplateProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_CDR_GEN_FILENAME) {
setCdrGenFileNameProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_CDR_PROCESS_CONFIG) {
setCdrProcessConfigProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_ZD_ZONE_DATA) {
setZoneMapProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_GHZ_GEO_HOME_ZONE) {
setGeoHomeProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_BILLING_CYCLE) {
setBillingcycleProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_UT_UNIT_TYPE) {
setUnitTypeProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_STATETYPE) {
setStateTypeProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_STATEGROUP) {
setStateGroupProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.PLC_PPP_POLICY_PROFILE) {
setPolicyProfileProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.PLC_PR_PCC_RULE) {
setPccRuleProperties(false, category.getCategoryId(), null, false, true);
} else if(category.getCategoryType() == CategoryType.SYS_SYS_CONFIG) {
setSystemConfigProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_STATISTIC_ITEM) {
setStatisticItemProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_SMS_NOTIFY_TEMPLATE) {
setSmsNotifyTemplateProperties(false, category.getCategoryId(), null, true);
} else if(category.getCategoryType() == CategoryType.CTL_CSS_USSD_RESPONSE) {
setCssUssdResponseProperties(false, category.getCategoryId(), null, true);
}
}
}
public void removeCatContext(NodeSelectEvent nodeSelectEvent) {
Category cat = (Category) nodeSelectEvent.getTreeNode().getData();
deleteCategory(cat);
}
public void moveUpCategory() {
if (selectedNode != null) {
List<TreeNode> lstChildOfParent = selectedNode.getParent().getChildren();
int idx = lstChildOfParent.indexOf(selectedNode);
if (idx > 0) {
Category cat = (Category) selectedNode.getData();
if (catDao.moveUpDown(true, cat)) {
lstChildOfParent.remove(idx);
lstChildOfParent.add(idx - 1, selectedNode);
}
}
}
}
public void moveDownCategory() {
if (selectedNode != null) {
List<TreeNode> lstChildOfParent = selectedNode.getParent().getChildren();
int idx = lstChildOfParent.indexOf(selectedNode);
if (idx < lstChildOfParent.size() - 1) {
Category cat = (Category) selectedNode.getData();
if (catDao.moveUpDown(false, cat)) {
lstChildOfParent.remove(idx);
lstChildOfParent.add(idx + 1, selectedNode);
}
}
}
}
public void moveUpTreeNode(BaseEntity objEntity) {
List<TreeNode> lstNode = getListNodeByObject(objEntity);
for (TreeNode node : lstNode) {
List<TreeNode> lstChildOfParent = node.getParent().getChildren();
int idx = lstChildOfParent.indexOf(node);
if (idx > 0) {
lstChildOfParent.remove(idx);
lstChildOfParent.add(idx - 1, node);
}
}
}
public void moveDownTreeNode(BaseEntity objEntity) {
List<TreeNode> lstNode = getListNodeByObject(objEntity);
for (TreeNode node : lstNode) {
List<TreeNode> lstChildOfParent = node.getParent().getChildren();
int idx = lstChildOfParent.indexOf(node);
if (idx < lstChildOfParent.size() - 1) {
lstChildOfParent.remove(idx);
lstChildOfParent.add(idx + 1, node);
}
}
}
/************ EVENT - END *****************/
/************ CATEGORY - BEGIN ************/
private Category category;
private Long categoryParentId;
private Long categoryFirst;
private List<Category> listCatParent;
private List<Category> listAllCategory;
private List<Category> listCatSub;
private boolean isEditing;
private String categoryTitle;
private CategoryDAO catDao;
private Category catParentDump;
private Long selectedCatType;
private List<SelectItem> listCatType;
public void defaulData() {
catParentDump = new Category();
catParentDump.setCategoryName("");
listCatParent = new ArrayList<Category>();
listCatSub = new ArrayList<Category>();
listAllCategory = new ArrayList<Category>();
catDao = new CategoryDAO();
}
private int itemParentCategory;
public int getItemParentCategory() {
return itemParentCategory;
}
public void setItemParentCategory(int itemParentCategory) {
this.itemParentCategory = itemParentCategory;
}
// lay danh sach category con thuoc category cha
private void searchCatSub(Long categoryId) {
listCatSub = catDao.loadListCategoryByParentId(categoryId);
}
// lay sanh sach category khong phai la chinh no de lam cha
private void searchCatParent(Long catType, long catId) {
listCatParent = catDao.findByTypeAndNotEqualForSelectbox(catType, catId);
listCatParent.add(0, catParentDump);
}
private void initCategory() {
Category currentCat = category;
category = new Category();
category.setTreeType(treeType);
categoryParentId = 0L;
formType = "cat-form";
if (currentCat != null) {
selectedCatType = currentCat.getCategoryType();
category.setCategoryType(selectedCatType);
}
searchCatParent(selectedCatType, category.getCategoryId());
}
private void initCategoryType() {
listCatType = new ArrayList<>();
Map<Long, String> mapCatType = CategoryType.getCatTypesByTreeType(treeType);
Iterator<Long> it = mapCatType.keySet().iterator();
SelectItem item;
while (it.hasNext()) {
long catType = it.next();
item = new SelectItem(catType, mapCatType.get(catType));
listCatType.add(item);
}
}
public void btnCatNew() {
initCategory();
isEditing = true;
}
public void btnCatCancel() {
initCategory();
isEditing = false;
}
public void btnCatSave() {
doSaveCategory(category, categoryParentId);
}
private boolean doSaveCategory(Category objCat, Long catParentId) {
objCat.setCategoryType(selectedCatType);
if (catParentId > 0)
objCat.setCategoryParentId(catParentId);
else
objCat.setCategoryParentId(null);
List<Category> lstCheck = catDao.findDuplicateName(objCat);
if (lstCheck != null && !lstCheck.isEmpty()) {
super.showMessageERROR("common.save", " Category ", "common.duplicateName");
return false;
}
if (objCat.getCategoryId() > 0) {
// Edit
if (catParentId == objCat.getCategoryId() || catDao.isContainInTree(catParentId, objCat.getCategoryId())) {
this.showMessageWARN("common.save", " Category ", "cat.saveWarnRecursive");
return false;
}
catDao.saveOrUpdate(objCat);
if (catParentId <= 0) {
// Do nothing
} else {
if (catParentId != this.category.getCategoryId()) {
listCatSub.remove(objCat);
}
}
// Update treenode
TreeNode parentNode = mapCatNode.get(catParentId);
if (parentNode == null)
parentNode = mapCatFirstNode.get(objCat.getCategoryType());
TreeNode node = mapCatNode.get(objCat.getCategoryId());
Category nodeCat = (Category) node.getData();
if (nodeCat != objCat)
HibernateUtil.copyEntityProperties(Category.class, objCat, nodeCat, true);
TreeNode oldParent = node.getParent();
if (oldParent != parentNode) {
if (oldParent != null)
oldParent.getChildren().remove(node);
node.setParent(parentNode);
parentNode.getChildren().add(node);
}
} else {
// New
catDao.saveOrUpdate(objCat);
if (catParentId <= 0) {
listAllCategory.add(objCat);
} else {
if (catParentId == this.category.getCategoryId()) {
listCatSub.add(objCat);
}
}
// Add node vao tree
TreeNode parentNode = mapCatNode.get(catParentId);
if (parentNode == null)
parentNode = mapCatFirstNode.get(objCat.getCategoryType());
// Tim vi tri cua node category con cuoi cung cua parentNode de add vao
List<TreeNode> lstChildren = parentNode.getChildren();
int idxLastChild = 0;
for(TreeNode node : lstChildren) {
if(node.getData() instanceof Category) {
idxLastChild++;
} else {
break;
}
}
TreeNode node = new OcsTreeNode(objCat, parentNode);
node.setType(TreeNodeType.CATEGORY);
parentNode.getChildren().remove(node);
parentNode.getChildren().add(idxLastChild, node);
lstCatID.add(objCat.getCategoryId());
mapCatNode.put(objCat.getCategoryId(), node);
getListNodeByObject(objCat).add(node);
}
// btnCatCancel();
this.showMessageINFO("common.save", " Category ");
return true;
}
public void editCategory(Category cat) {
category = cat;
setCategoryParentId(cat.getCategoryParentId());
setEditing(true);
searchCatParent(category.getCategoryType(), category.getCategoryId());
setSelectCategoryNode(cat);
}
public void deleteCategory(Category category) {
if (category != null) {
catDao.delete(category);
listCatSub.remove(category);
listAllCategory.remove(category);
TreeNode node = mapCatNode.remove(category.getCategoryId());
if (node != null) {
node.getParent().getChildren().remove(node);
node.setParent(null);
}
this.showMessageINFO("common.delete", " Category ");
}
}
// type: 1- su kien click node cha ;
public List<Category> loadListCategory(Long categoryType) {
listAllCategory = catDao.loadListCategoryByTypeNoParent(categoryType);
return listAllCategory;
}
/********* CATEGORY - END ************/
/********* CATEGORY DLG - BEGIN ************/
private Category dlgCategory;
private Long dlgCategoryParentId;
private List<Category> listCatParentDlg;
public void btnCatShowDlg(Category cat) {
if (cat == null) {
// New child cat
dlgCategory = new Category();
dlgCategory.setTreeType(treeType);
dlgCategoryParentId = category.getCategoryId();
dlgCategory.setCategoryType(selectedCatType);
} else {
// Edit child cat
dlgCategory = cat;
dlgCategoryParentId = cat.getCategoryParentId();
}
searchCatParentDlg(selectedCatType, dlgCategory.getCategoryId());
}
public void btnCatSaveDlg() {
if (this.doSaveCategory(dlgCategory, dlgCategoryParentId)) {
RequestContext context = RequestContext.getCurrentInstance();
context.execute("PF('dlgCategory').hide();");
}
}
private void searchCatParentDlg(Long catType, long catId) {
if(catType == CategoryType.SYS_SYS_CONFIG) {
listCatParentDlg = catDao.findByTypeAndNotEqualForSelectboxWithoutDomain(catType, catId);
} else {
listCatParentDlg = catDao.findByTypeAndNotEqualForSelectbox(catType, catId);
}
listCatParentDlg.add(0, catParentDump);
}
/********* CATEGORY DLG - END ************/
/********* GET SET - BEGIN ***********/
public TreeNode getRoot() {
return root;
}
public void setRoot(TreeNode root) {
this.root = root;
}
public TreeNode getSelectedNode() {
return selectedNode;
}
public void setSelectedNode(TreeNode selectedNode) {
this.selectedNode = selectedNode;
}
public String getFormType() {
return formType;
}
public void setFormType(String formType) {
this.formType = formType;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public String getTreeType() {
return treeType;
}
public void setTreeType(String treeType) {
this.treeType = treeType;
}
public Long getCategoryParentId() {
return categoryParentId;
}
public void setCategoryParentId(Long categoryParentId) {
this.categoryParentId = categoryParentId;
}
public List<Category> getListCatParent() {
return listCatParent;
}
public void setListCatParent(List<Category> listParent) {
this.listCatParent = listParent;
}
public List<Category> getListSubCategory() {
return listCatSub;
}
public void setListSubCategory(List<Category> listSubCategory) {
this.listCatSub = listSubCategory;
}
public boolean isEditing() {
return isEditing;
}
public void setEditing(boolean isEditing) {
this.isEditing = isEditing;
}
public String getCategoryTitle() {
return categoryTitle;
}
public void setCategoryTitle(String categoryTitle) {
this.categoryTitle = categoryTitle;
}
public List<Category> getListAllCategory() {
return listAllCategory;
}
public void setListAllCategory(List<Category> listAllCategory) {
this.listAllCategory = listAllCategory;
}
public long getCategoryFirst() {
return categoryFirst;
}
public void setCategoryFirst(long categoryFirst) {
this.categoryFirst = categoryFirst;
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}
public List<SelectItem> getListCatType() {
return listCatType;
}
public void setListCatType(List<SelectItem> listCatType) {
this.listCatType = listCatType;
}
public Long getSelectedCatType() {
return selectedCatType;
}
public void setSelectedCatType(Long selectedCatType) {
this.selectedCatType = selectedCatType;
}
public boolean isShowBtnCatNew() {
return showBtnCatNew;
}
public void setShowBtnCatNew(boolean showBtnCatNew) {
this.showBtnCatNew = showBtnCatNew;
}
public String getContentTitle() {
return contentTitle;
}
public void setContentTitle(String contentTitle) {
this.contentTitle = contentTitle;
}
private String page;
public Category getDlgCategory() {
return dlgCategory;
}
public void setDlgCategory(Category dlgCategory) {
this.dlgCategory = dlgCategory;
}
public Long getDlgCategoryParentId() {
return dlgCategoryParentId;
}
public void setDlgCategoryParentId(Long dlgCategoryParentId) {
this.dlgCategoryParentId = dlgCategoryParentId;
}
public List<Category> getListCatParentDlg() {
return listCatParentDlg;
}
public void setListCatParentDlg(List<Category> listCatParentDlg) {
this.listCatParentDlg = listCatParentDlg;
}
public CdrServiceDAO getCdrServiceDAO() {
return cdrServiceDAO;
}
public void setCdrServiceDAO(CdrServiceDAO cdrServiceDAO) {
this.cdrServiceDAO = cdrServiceDAO;
}
public CdrTemplateDAO getCdrTemplateDAO() {
return cdrTemplateDAO;
}
public void setCdrTemplateDAO(CdrTemplateDAO cdrTemplateDAO) {
this.cdrTemplateDAO = cdrTemplateDAO;
}
public CdrGenFilenameDAO getCdrGenFilenameDAO() {
return cdrGenFilenameDAO;
}
public void setCdrGenFilenameDAO(CdrGenFilenameDAO cdrGenFilenameDAO) {
this.cdrGenFilenameDAO = cdrGenFilenameDAO;
}
public CdrProcessConfigDAO getCdrProcessConfigDAO() {
return cdrProcessConfigDAO;
}
public void setCdrProcessConfigDAO(CdrProcessConfigDAO cdrProcessConfigDAO) {
this.cdrProcessConfigDAO = cdrProcessConfigDAO;
}
public String getTxtTreeSearch() {
return txtTreeSearch;
}
public void setTxtTreeSearch(String txtTreeSearch) {
this.txtTreeSearch = txtTreeSearch;
}
/****** GET SET - END *************/
}
|
[
"[email protected]"
] | |
30126d6d81903c5fc985dcc55bc90053ff1a88a6
|
f38e43e7fa1787a71ed15bade7034a29e7d90e37
|
/src/main/java/pages/GoogleMainPage.java
|
f8993a1e4443558b04347774ae3b80728d7d94f4
|
[] |
no_license
|
00doublezero/selenium-gmail-test
|
189748899a065c5abee95a222477b323656e646a
|
87960d5958bf1a994df5e3884b16a2ebbdd781ac
|
refs/heads/master
| 2020-03-20T06:47:54.405076 | 2018-04-05T08:50:39 | 2018-04-05T08:50:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 357 |
java
|
package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class GoogleMainPage extends AbstractPage {
public GoogleMainPage(WebDriver driver) {
super(driver);
}
public boolean isLoggedOut(String email) {
return driver.findElements(By.cssSelector("[title*='"+email+"']")).size() == 0;
}
}
|
[
"[email protected]"
] | |
4614ed4116763176605c47b5d4e89828227851e1
|
5fa0f10292de20f4226743b36259b9e51e837936
|
/Hibernate Config/without-config-xml/src/main/java/com/tszyi/entity/Book.java
|
3033acf7893cadcf30c69bfd52499c005a28a6b5
|
[] |
no_license
|
tszyi/hibernate.practice
|
b884a0a14198315ec880fbfff273431b2ea46a86
|
aa27c11a46dc7165d156be8e4550122596ac0a76
|
refs/heads/master
| 2020-03-14T23:53:58.846622 | 2018-05-14T17:13:59 | 2018-05-14T17:13:59 | 131,855,373 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,223 |
java
|
package com.tszyi.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
@Entity
@Table(name = "book")
public class Book {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "title", nullable = false)
private String title;
@Column(name = "isbn", nullable = false)
private String isbn;
@OneToOne
@JoinColumn(name="author_id")
@Cascade(value=CascadeType.ALL)
private Author author;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public Author getAuthor() {
return author;
}
public void setAuthor(Author author) {
this.author = author;
}
}
|
[
"[email protected]"
] | |
017d0e9fa02d8007763a54fcbaff965369b647d7
|
2bea504fe3b48a360c7763eb9f73b6eb4a0c83cd
|
/src/test/java/com/cybertek/runners/FailRunner.java
|
52d9700a650eeacfdcebb3f2c642f2ad06464d2d
|
[] |
no_license
|
mgbre2/Own_Project
|
ed969849287320e851bdb3bcfc1f07c1429a409b
|
1581547f02529448d9508f497cb2992186184115
|
refs/heads/master
| 2022-09-14T12:25:06.936919 | 2020-01-05T18:06:30 | 2020-01-05T18:06:30 | 195,585,570 | 0 | 0 | null | 2022-09-08T01:01:21 | 2019-07-06T21:44:20 |
HTML
|
UTF-8
|
Java
| false | false | 513 |
java
|
package com.cybertek.runners;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {
"json:target/cucumber.json",
"html:target/cucumber/",
"rerun:target/rerun.txt"},
features = "src/test/resources/features",
glue = "com/cybertek/step_definitions"
, dryRun = false
, tags = "@practice"
)
public class FailRunner {
}
|
[
"[email protected]"
] | |
e3e0904088f0b6924ee936fedc007e9a793af197
|
7af5a55fc99bb29dcbb1201d462d078ff3a72034
|
/app/src/main/java/ru/geekbrains/android3_7/view/RepoRVAdapter.java
|
9458cd35bae4b6e6e52c2cf7363b0fef1d168129
|
[] |
no_license
|
IgorRAzumov/android_pop_lib_homework_7
|
432c52b0eaa21507f24e56e7831811c3aa6d60ee
|
597718c7a3590a0c868580c57e5d2b40996fbd12
|
refs/heads/master
| 2020-03-20T21:51:19.543533 | 2018-06-18T13:44:26 | 2018-06-18T13:44:26 | 137,764,590 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,588 |
java
|
package ru.geekbrains.android3_7.view;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import ru.geekbrains.android3_7.R;
import ru.geekbrains.android3_7.presenter.IRepoListPresenter;
/**
* Created by stanislav on 3/15/2018.
*/
public class RepoRVAdapter extends RecyclerView.Adapter<RepoRVAdapter.ViewHolder>
{
IRepoListPresenter presenter;
public RepoRVAdapter(IRepoListPresenter presenter)
{
this.presenter = presenter;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_repo, parent, false));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position)
{
presenter.bindRepoListRow(position, holder);
}
@Override
public int getItemCount()
{
return presenter.getRepoCount();
}
public class ViewHolder extends RecyclerView.ViewHolder implements RepoRowView {
@BindView(R.id.tv_title) TextView titleTextView;
public ViewHolder(View itemView)
{
super(itemView);
ButterKnife.bind(this, itemView);
}
@Override
public void setTitle(String title)
{
titleTextView.setText(title);
}
}
}
|
[
"[email protected]"
] | |
aeb99860685dd5351d24ba67117d5dfdf2cf158c
|
c35739be60f974c5e96bf20086ed05e54411e5b4
|
/app/src/main/java/com/dream/wanandroid/ui/like/fragment/LikeFragment.java
|
d653269df86fec7502efee30d4fdfbb62047037c
|
[] |
no_license
|
sweetying520/WanAndroid
|
62e62f1f962eedf35c1173c7fca7008e22497410
|
adc300446fd80414f48239f9d41917c84d49aec2
|
refs/heads/master
| 2020-03-13T21:27:46.851695 | 2018-05-09T10:49:36 | 2018-05-09T10:49:36 | 131,296,871 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,737 |
java
|
package com.dream.wanandroid.ui.like.fragment;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.dream.wanandroid.R;
import com.dream.wanandroid.base.fragment.AbstractRootFragment;
import com.dream.wanandroid.common.MyConstant;
import com.dream.wanandroid.contract.like.LikeContract;
import com.dream.wanandroid.model.bean.BaseResponse;
import com.dream.wanandroid.model.bean.main.collect.FeedArticleData;
import com.dream.wanandroid.model.bean.main.collect.FeedArticleListData;
import com.dream.wanandroid.presenter.like.LikePresenter;
import com.dream.wanandroid.ui.mainpager.adapter.HomePagerAdapter;
import com.dream.wanandroid.utils.CommonUtils;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
/**
* Created by Administrator on 2018/5/6.
*/
public class LikeFragment extends AbstractRootFragment<LikePresenter> implements LikeContract.View{
@BindView(R.id.normal_view)
SmartRefreshLayout smartRefreshLayout;
@BindView(R.id.like_rv)
RecyclerView mRecyclerView;
private HomePagerAdapter mAdapter;
private List<FeedArticleData> dataList;
private boolean isRefresh = true;
private int mCurrentPage = 1;
@Override
protected void initInject() {
getFragmentComponent().inject(this);
}
public static LikeFragment getInstance(String params1, String params2){
LikeFragment fragment = new LikeFragment();
Bundle bundle = new Bundle();
bundle.putString(MyConstant.ARG_PARAM1,params1);
bundle.putString(MyConstant.ARG_PARAM2,params2);
fragment.setArguments(bundle);
return fragment;
}
@Override
protected int getLayoutId() {
return R.layout.fragment_like;
}
@Override
protected void initEventAndData() {
super.initEventAndData();
initRecyclerView();
setRefresh();
mPresenter.getCollectList(mCurrentPage);
if(CommonUtils.isNetworkConnected()){
showLoadingView();
}
}
private void initRecyclerView() {
dataList = new ArrayList<>();
mAdapter = new HomePagerAdapter(R.layout.item_home_pager, dataList);
mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
mRecyclerView.setAdapter(mAdapter);
}
@Override
public void showCollectList(BaseResponse<FeedArticleListData> listDataBaseResponse) {
if(listDataBaseResponse == null || listDataBaseResponse.getData() == null){
showCollectListFailed();
return;
}
if(listDataBaseResponse.getData().getDatas().size() > 0){
if(isRefresh){
mAdapter.replaceData(listDataBaseResponse.getData().getDatas());
}else {
mAdapter.addData(listDataBaseResponse.getData().getDatas());
}
}else {
CommonUtils.showMessage(_mActivity,getString(R.string.load_more_no_data));
}
showNormalView();
}
@Override
public void showCollectListFailed() {
showErrorView();
CommonUtils.showSnackMessage(_mActivity,getString(R.string.failed_to_obtain_article_list));
}
private void setRefresh(){
smartRefreshLayout.setOnRefreshListener(refreshLayout -> {
isRefresh = true;
mCurrentPage = 1;
mPresenter.getCollectList(mCurrentPage);
});
smartRefreshLayout.setOnLoadMoreListener(refreshLayout -> {
isRefresh = false;
mCurrentPage++;
mPresenter.getCollectList(mCurrentPage);
});
}
}
|
[
"[email protected]"
] | |
119afde2d56bc0638c6726809567eed9f30b0afa
|
7af6ecb1ecdc4d1f1fc639a6b191a210cc0a3482
|
/hhzmy/src/main/java/com/hhzmy/test/LoginActivity.java
|
c6fabae8dedc0786fcc3449d8895fed997e06f57
|
[] |
no_license
|
USMengXiangyang/ShiXunYi
|
8a3f9e89ae86b446d6472347e884a87a546dc818
|
7157d4c6165329438601db4395ea9b38b9fec976
|
refs/heads/master
| 2020-06-16T16:35:24.808931 | 2016-12-29T13:51:35 | 2016-12-29T13:51:35 | 75,082,999 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,185 |
java
|
package com.hhzmy.test;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.Toast;
import com.hhzmy.view.Code;
import com.umeng.socialize.UMAuthListener;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;
import java.util.Map;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener, TextWatcher {
private ImageView log_back;
private EditText user_phone;
private EditText user_password;
private RadioButton log_icon1;
private EditText log_img_yan;//文本框的值
private ImageView log_icon2; //图标 //确定和刷新验证码
private Button my_bt_log;
private ImageView qq;
private ImageView weixin;
private ImageView wangyi;
private RadioButton zuce;
private String str_userphone;
private String str_userpass;
String getCode=null; //获取验证码的值
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
initView();
str_userphone = user_phone.getText().toString().trim();
str_userpass = user_password.getText().toString().trim();
user_phone.addTextChangedListener(new PhoneTextWatcher(user_phone));
// getCode=Code.getInstance().getCode(); //获取显示的验证码
log_icon2.setImageBitmap(Code.getInstance().getBitmap());
/*log_icon1.setImageRes(R.mipmap.icon_display,R.mipmap.icon_hidden,R.mipmap.icon_hidden);
//设置开关的默认状态 true开启状态
log_icon1.setToggleState(true);*/
//设置开关的监听
/*log_icon1.setOnToggleStateListener(new MyToggle.OnToggleStateListener() {
@Override
public void onToggleState(boolean state) {
if(state){
Toast.makeText(getApplicationContext(), "开关开启", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "开关关闭", Toast.LENGTH_SHORT).show();
}
}
});*/
}
private void initView() {
log_back = (ImageView) findViewById(R.id.log_back);
log_back.setOnClickListener(this);
user_phone = (EditText) findViewById(R.id.user_phone);
user_password = (EditText) findViewById(R.id.user_password);
log_icon1 = (RadioButton) findViewById(R.id.log_icon1);
log_icon1.setOnClickListener(this);
log_img_yan = (EditText) findViewById(R.id.log_img_yan);
log_icon2 = (ImageView) findViewById(R.id.log_icon2);
log_icon2.setOnClickListener(this);
my_bt_log = (Button) findViewById(R.id.my_bt_login);
my_bt_log.setOnClickListener(this);
qq = (ImageView) findViewById(R.id.qq);
qq.setOnClickListener(this);
weixin = (ImageView) findViewById(R.id.weixin);
weixin.setOnClickListener(this);
wangyi = (ImageView) findViewById(R.id.wangyi);
wangyi.setOnClickListener(this);
zuce = (RadioButton) findViewById(R.id.zuce);
zuce.setOnClickListener(this);
user_phone.addTextChangedListener(this);
user_password.addTextChangedListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
//返回图标
case R.id.log_back:
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(intent);
break;
//密码图标
case R.id.log_icon1:
break;
//动态验证码
case R.id.log_icon2:
log_icon2.setImageBitmap(Code.getInstance().getBitmap());
getCode=Code.getInstance().getCode();
break;
//注册图标
case R.id.zuce:
Intent intent1 = new Intent(LoginActivity.this, ZuceActivity.class);
startActivity(intent1);
break;
//登陆按钮
case R.id.my_bt_login:
String v_code=log_img_yan.getText().toString().trim();
if(v_code==null||v_code.equals("")){
Toast.makeText(LoginActivity.this, "没有填写验证码", 2).show();
}else if(!v_code.equals(getCode)){
Toast.makeText(LoginActivity.this, "验证码填写不正确", 2).show();
}else{
Toast.makeText(LoginActivity.this, "操作成功", 2).show();
}
break;
//第三方登陆
case R.id.qq:
UMShareAPI mShareAPI = UMShareAPI.get(LoginActivity.this );
mShareAPI.getPlatformInfo(LoginActivity.this, SHARE_MEDIA.QQ, umAuthListener);
break;
case R.id.weixin:
UMShareAPI mShareAPI1 = UMShareAPI.get(LoginActivity.this );
mShareAPI1.getPlatformInfo(LoginActivity.this, SHARE_MEDIA.WEIXIN, umAuthListener);
break;
case R.id.wangyi:
Log.e("****","微博登陆");
UMShareAPI mShareAPI2 = UMShareAPI.get(LoginActivity.this );
mShareAPI2.getPlatformInfo(LoginActivity.this, SHARE_MEDIA.SINA, umAuthListener);
break;
}
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (str_userphone != null && str_userpass != null) {
my_bt_log.setBackground(getResources().getDrawable(R.drawable.bg_edittext_selecter));
}
}
@Override
public void afterTextChanged(Editable editable) {
}
private UMAuthListener umAuthListener = new UMAuthListener() {
@Override
public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
Toast.makeText(getApplicationContext(), "Authorize succeed", Toast.LENGTH_SHORT).show();
}
@Override
public void onError(SHARE_MEDIA platform, int action, Throwable t) {
Toast.makeText( getApplicationContext(), "Authorize fail", Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel(SHARE_MEDIA platform, int action) {
Toast.makeText( getApplicationContext(), "Authorize cancel", Toast.LENGTH_SHORT).show();
}
};
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
}
}
|
[
"[email protected]"
] | |
827f44e1106e9e25f4f37e3fb393daa4ed06a89e
|
ec26c467d3193ee22ab17374921b5f54ed216dc7
|
/src/main/java/com/agung/prediksi/entity/Data.java
|
d82d6457fef3fc7601d399fa7d5fc413c610b17a
|
[] |
no_license
|
yyleon/Product-Defect-Prediction-RL
|
47da24288588cc1f7568d273d068a146928a763e
|
8d91da7ec6e628a48c15b3b2883843689034b75d
|
refs/heads/master
| 2022-01-07T15:51:08.073827 | 2019-04-18T13:35:03 | 2019-04-18T13:35:03 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 840 |
java
|
/*
* Data.java
* template-maven
*
* Created by Agung Pramono on 08/08/2017
* Copyright (c) 2017 Java Development. All rights reserved.
*/
package com.agung.prediksi.entity;
/**
*
* @author agung
*/
public class Data {
private Integer tanggal;
private Double suhuRuangan;
private Double jumlahCacat;
public Integer getTanggal() {
return tanggal;
}
public void setTanggal(Integer tanggal) {
this.tanggal = tanggal;
}
public Double getSuhuRuangan() {
return suhuRuangan;
}
public void setSuhuRuangan(Double suhuRuangan) {
this.suhuRuangan = suhuRuangan;
}
public Double getJumlahCacat() {
return jumlahCacat;
}
public void setJumlahCacat(Double jumlahCacat) {
this.jumlahCacat = jumlahCacat;
}
}
|
[
"[email protected]"
] | |
7eaef694a5aca808f69d99d0164be563e808984d
|
1d045aa07cd64f4707b46c478e96b324212c7c4e
|
/src/com/sid/core/StaticInstanceBlock.java
|
9799af515d17399473ec4fafe9b423b388b2c1f6
|
[] |
no_license
|
siddharth27/helloworld
|
06e2c945253a2fe068fd89797e2c4726fa37e676
|
59096e49001173dd8cf91ba29883c26dc5234502
|
refs/heads/master
| 2020-12-24T14:52:44.376931 | 2015-10-17T18:12:14 | 2015-10-17T18:12:14 | 8,737,288 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 477 |
java
|
package com.sid.core;
public class StaticInstanceBlock {
static{
System.out.println("Siddharth");
}
{
System.out.println("2");
}
{
System.out.println("3");
}
StaticInstanceBlock(){
System.out.println("instantiated");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
StaticInstanceBlock obj1 = new StaticInstanceBlock();
StaticInstanceBlock obj2 = new StaticInstanceBlock();
}
}
|
[
"[email protected]"
] | |
d8865e62a8d388b7d14e1dbe792318665afe8149
|
973a4a1041f4b350e726a50aae13cd50bc733540
|
/codechef/CLFIBD.java
|
9b67b498b9f1ce0c2d9cd8bca2ff47cdb9eeca56
|
[] |
no_license
|
ankitraj827/codechef-practice-programs
|
513b5a49bd3ce29530d12caf5665c33f3fb783ec
|
cfb492c76b16036b48394d196f684b2c5ba7292d
|
refs/heads/master
| 2020-03-22T10:08:21.529764 | 2018-07-05T18:04:16 | 2018-07-05T18:04:16 | 139,883,330 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,533 |
java
|
import java.io.*;
import java.util.*;
class CLFIBD
{
public static void main(String []rk) throws IOException
{
InputStreamReader inr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(inr);
int n=Integer.parseInt(br.readLine());
while(n-- > 0)
{
String str=br.readLine();
ArrayList<Character> al5=new ArrayList<>();
TreeSet<Character> t1=new TreeSet<>();
for(int i=0;i<str.length();i++)
{
int o=(int)str.charAt(i);
if(o<=122 && o>=97)
{
t1.add(str.charAt(i));
al5.add(str.charAt(i));
}
}
if(t1.size()<3)
{
System.out.println("Dynamic");
continue;
}
Collections.sort(al5);
Iterator it=t1.iterator();
ArrayList<Integer> al2=new ArrayList<>();
int j=0;
outer:
while(it.hasNext())
{
char ch=(char)it.next();
//System.out.println(ch);
int count=0;
while(j<al5.size())
{
//System.out.println(al5.get(j));
if(ch==al5.get(j) && j==al5.size()-1)
{
count++;
j++;
al2.add(count);
}
else if(ch==al5.get(j))
{
count++;
j++;
}
else
{
al2.add(count);
continue outer;
}
}
}
Collections.sort(al2);
int flag=0;
for(int i=0;i<al2.size()-2;i++)
{
int m1=al2.get(i);
int m2=al2.get(i+1);
int m3=al2.get(i+2);
if((m1+m2)==m3)
{
flag=1;
break;
}
}
if(flag==0)
{
System.out.println("Not");
}
else
{
System.out.println("Dynamic");
}
}
}
}
|
[
"[email protected]"
] | |
ebd4aca376ab0c16a5a7c6107fc3ba5a26f59b4b
|
1bddb3fe57506f4af99223b48e987e81f4898273
|
/src/com/monster/learn/FindDuplicate.java
|
df61c8fc7c5a1cf1679e1fbf25ec50729e4f4915
|
[
"MIT"
] |
permissive
|
lybvinci/leetcode_practices
|
82cf46025d81cbaa6ac899d9faa3d8cf73b1a216
|
ba8de653a6737bc89d61d804491bff9bd401e2f9
|
refs/heads/master
| 2022-12-22T11:14:17.856062 | 2022-12-22T07:08:14 | 2022-12-22T07:08:14 | 138,813,322 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 350 |
java
|
package com.monster.learn;
//66.44%
public class FindDuplicate {
public int findDuplicate(int[] nums) {
int[] dup = new int[nums.length + 1];
for (int i = 0; i < nums.length; i++) {
dup[nums[i]]++;
if (dup[nums[i]] == 2) {
return nums[i];
}
}
return -1;
}
}
|
[
"[email protected]"
] | |
2988824edc71d8cb9f1000f1311360f66a3592c4
|
603b90b829a5c4c8ec37113d8a47d504414c4c4a
|
/src/main/java/ru/dsoccer1980/messages/MessageResolverUtil.java
|
daaba579057eae2113e61d6790b46684899b62ec
|
[] |
no_license
|
dsoccer1980/smartid
|
c6b5a5106cbbb016fb79114a96f1be60a988fff1
|
8ae6c52e4959f14202d6c4aa732dd233a931da69
|
refs/heads/master
| 2023-01-29T09:30:38.614929 | 2020-12-04T11:24:26 | 2020-12-04T11:24:26 | 318,494,793 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 693 |
java
|
package ru.dsoccer1980.messages;
import org.springframework.binding.message.MessageBuilder;
import org.springframework.binding.message.MessageResolver;
public class MessageResolverUtil {
/**
* Get messageResolver for error messages by message code.
*/
public static MessageResolver getErrorMessageResolver(MessageInterface messageInterface) {
return new MessageBuilder().error().code(messageInterface.getMessageCode()).build();
}
/**
* Get messageResolver for info messages by message code.
*/
public static MessageResolver getInfoMessageResolver(MessageInterface messageInterface) {
return new MessageBuilder().info().code(messageInterface.getMessageCode()).build();
}
}
|
[
"[email protected]"
] | |
dfddea81e37245e35865cf2ae16e47e36593c5b5
|
6461f7e74d4dcbfabca914bbe0ef08e61ec3c790
|
/spring_sample/src/main/java/com/Yz/service/CustomerService.java
|
99407d70460af5a4b534f12450ae9dab408b50b3
|
[] |
no_license
|
lvzhuye/YzSpringDemo
|
caced392de4c5f3a2f6f7353d6736bcf20e1b097
|
4d6f230c0db463ee5f759852c56955c8e827db03
|
refs/heads/master
| 2021-05-07T17:28:17.131105 | 2017-10-29T12:27:06 | 2017-10-29T12:27:06 | 108,732,264 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 145 |
java
|
package com.Yz.service;
import java.util.List;
import com.Yz.model.Customer;
public interface CustomerService {
List<Customer> findAll();
}
|
[
"[email protected]"
] | |
c709cea1ea699890e7a1a48b47cb85e7c63b6435
|
93989de829a1c1ffc86095ad034af3a1a5708f13
|
/latte-ec/build/generated/source/apt/release/com/flj/latte/ec/sign/SignUpDelegate_ViewBinding.java
|
c818634875d6a239c49e2d2012eb3605a9727383
|
[] |
no_license
|
xiu307/d1nj4n
|
c0c820b9d56ea182a0ae0e0eb55348e89f3a2ddd
|
42e268327a6f62d3613e1c1d7dec66fa3f79e44e
|
refs/heads/master
| 2021-09-08T20:55:55.594860 | 2018-03-12T06:33:56 | 2018-03-12T06:33:56 | 124,844,529 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,467 |
java
|
// Generated code from Butter Knife. Do not modify!
package com.flj.latte.ec.sign;
import android.support.annotation.CallSuper;
import android.support.annotation.UiThread;
import android.support.design.widget.TextInputEditText;
import android.view.View;
import butterknife.Unbinder;
import butterknife.internal.DebouncingOnClickListener;
import butterknife.internal.Utils;
import com.diabin.latte.ec.R;
import java.lang.IllegalStateException;
import java.lang.Override;
public class SignUpDelegate_ViewBinding implements Unbinder {
private SignUpDelegate target;
private View view2131558609;
private View view2131558610;
@UiThread
public SignUpDelegate_ViewBinding(final SignUpDelegate target, View source) {
this.target = target;
View view;
target.mName = Utils.findRequiredViewAsType(source, R.id.edit_sign_up_name, "field 'mName'", TextInputEditText.class);
target.mEmail = Utils.findRequiredViewAsType(source, R.id.edit_sign_up_email, "field 'mEmail'", TextInputEditText.class);
target.mPhone = Utils.findRequiredViewAsType(source, R.id.edit_sign_up_phone, "field 'mPhone'", TextInputEditText.class);
target.mPassword = Utils.findRequiredViewAsType(source, R.id.edit_sign_up_password, "field 'mPassword'", TextInputEditText.class);
target.mRePassword = Utils.findRequiredViewAsType(source, R.id.edit_sign_up_re_password, "field 'mRePassword'", TextInputEditText.class);
view = Utils.findRequiredView(source, R.id.btn_sign_up, "method 'onClickSignUp'");
view2131558609 = view;
view.setOnClickListener(new DebouncingOnClickListener() {
@Override
public void doClick(View p0) {
target.onClickSignUp();
}
});
view = Utils.findRequiredView(source, R.id.tv_link_sign_in, "method 'onClickLink'");
view2131558610 = view;
view.setOnClickListener(new DebouncingOnClickListener() {
@Override
public void doClick(View p0) {
target.onClickLink();
}
});
}
@Override
@CallSuper
public void unbind() {
SignUpDelegate target = this.target;
if (target == null) throw new IllegalStateException("Bindings already cleared.");
this.target = null;
target.mName = null;
target.mEmail = null;
target.mPhone = null;
target.mPassword = null;
target.mRePassword = null;
view2131558609.setOnClickListener(null);
view2131558609 = null;
view2131558610.setOnClickListener(null);
view2131558610 = null;
}
}
|
[
"[email protected]"
] | |
411b6300576280bcc9cfdf29f106a0ebe4dc2c90
|
f2d85e3f5d6dcac0a7b18cbfef6d6b7c62ab570a
|
/rdma-based-storm/storm-core/src/jvm/org/apache/storm/utils/ShellBoltMessageQueue.java
|
33505f7e2d30d256a793bd00d11869affb9c6a10
|
[
"Apache-2.0",
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"GPL-1.0-or-later"
] |
permissive
|
dke-knu/i2am
|
82bb3cf07845819960f1537a18155541a1eb79eb
|
0548696b08ef0104b0c4e6dec79c25300639df04
|
refs/heads/master
| 2023-07-20T01:30:07.029252 | 2023-07-07T02:00:59 | 2023-07-07T02:00:59 | 71,136,202 | 8 | 14 |
Apache-2.0
| 2023-07-07T02:00:31 | 2016-10-17T12:29:48 |
Java
|
UTF-8
|
Java
| false | false | 4,249 |
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.storm.utils;
import org.apache.storm.multilang.BoltMsg;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* A data structure for ShellBolt which includes two queues (FIFO),
* which one is for task ids (unbounded), another one is for bolt msg (bounded).
*/
public class ShellBoltMessageQueue implements Serializable {
private final LinkedList<List<Integer>> taskIdsQueue = new LinkedList<>();
private final LinkedBlockingQueue<BoltMsg> boltMsgQueue;
private final ReentrantLock takeLock = new ReentrantLock();
private final Condition notEmpty = takeLock.newCondition();
public ShellBoltMessageQueue(int boltMsgCapacity) {
if (boltMsgCapacity <= 0) {
throw new IllegalArgumentException();
}
this.boltMsgQueue = new LinkedBlockingQueue<>(boltMsgCapacity);
}
public ShellBoltMessageQueue() {
this(Integer.MAX_VALUE);
}
/**
* put list of task id to its queue
* @param taskIds task ids that received the tuples
*/
public void putTaskIds(List<Integer> taskIds) {
takeLock.lock();
try {
taskIdsQueue.add(taskIds);
notEmpty.signal();
} finally {
takeLock.unlock();
}
}
/**
* put bolt message to its queue
* @param boltMsg BoltMsg to pass to subprocess
* @throws InterruptedException
*/
public void putBoltMsg(BoltMsg boltMsg) throws InterruptedException {
boltMsgQueue.put(boltMsg);
takeLock.lock();
try {
notEmpty.signal();
} finally {
takeLock.unlock();
}
}
/**
* poll() is a core feature of ShellBoltMessageQueue.
* It retrieves and removes the head of one queues, waiting up to the
* specified wait time if necessary for an element to become available.
* There's priority that what queue it retrieves first, taskIds is higher than boltMsgQueue.
*
* @param timeout how long to wait before giving up, in units of unit
* @param unit a TimeUnit determining how to interpret the timeout parameter
* @return List\<Integer\> if task id is available,
* BoltMsg if task id is not available but bolt message is available,
* null if the specified waiting time elapses before an element is available.
* @throws InterruptedException
*/
public Object poll(long timeout, TimeUnit unit) throws InterruptedException {
takeLock.lockInterruptibly();
long nanos = unit.toNanos(timeout);
try {
// wait for available queue
while (taskIdsQueue.peek() == null && boltMsgQueue.peek() == null) {
if (nanos <= 0) {
return null;
}
nanos = notEmpty.awaitNanos(nanos);
}
// taskIds first
List<Integer> taskIds = taskIdsQueue.peek();
if (taskIds != null) {
taskIds = taskIdsQueue.poll();
return taskIds;
}
// boltMsgQueue should have at least one entry at the moment
return boltMsgQueue.poll();
} finally {
takeLock.unlock();
}
}
}
|
[
"[email protected]"
] | |
9bffddebc7bebfc38c5110edc0c4de890a19c636
|
59fb07b4eac93a8c495ec50d2191798e34cbc3a9
|
/nifi-signal-messenger-processors/src/test/java/org/signal/TestPutSignalMessageForGroups.java
|
c80f2f39052fb8408c7404f7a6af505c61ec830c
|
[] |
no_license
|
christofferlind/nifi-signal-messenger
|
d7a3b71d51a2209eba73b09113d781537139fff6
|
705079cc6a49115fc93f4c5edddd3950ea51f301
|
refs/heads/master
| 2023-06-26T05:39:25.322253 | 2023-05-06T13:33:41 | 2023-05-06T13:33:41 | 249,559,773 | 4 | 1 | null | 2023-06-14T22:42:53 | 2020-03-23T22:39:03 |
Java
|
UTF-8
|
Java
| false | false | 6,647 |
java
|
package org.signal;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import org.apache.nifi.reporting.InitializationException;
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.signal.model.SignalData;
import org.signal.model.SignalMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestPutSignalMessageForGroups extends AbstractMultiNumberTest {
private static final String TEST_GROUP = System.getenv("nifi-signal-messenger.test.group");
private static final Logger LOGGER = LoggerFactory.getLogger(TestPutSignalMessage.class);
private TestRunner runner;
@Before
public void init() throws InitializationException {
if(isSettingsEmpty()) {
return;
}
runner = TestRunners.newTestRunner(PutSignalMessage.class);
setSignaleService(runner);
runner.setProperty(AbstractSignalSenderProcessor.PROP_SIGNAL_SERVICE, serviceIdentifierA);
runner.enableControllerService(serviceA);
}
@After
public void deactivate() throws InitializationException {
if(runner == null)
return;
if(runner.isControllerServiceEnabled(serviceA)) {
runner.disableControllerService(serviceA);
}
}
@Test
public void putGroupMessage() throws InterruptedException {
if(isSettingsEmpty()) {
IllegalStateException exc = new IllegalStateException("No configuration set, skipping test");
LOGGER.warn(exc.getMessage(), exc);
return;
}
String content = "Testing " + TestPutSignalMessageForGroups.class.getSimpleName() + " " + Math.random();
AtomicReference<String> refContent = new AtomicReference<String>(null);
AtomicReference<String> refGroup = new AtomicReference<String>(null);
Consumer<SignalData> listener = msg -> {
if(!numberB.equals(msg.getAccount()))
return;
refGroup.set(msg.getGroupName());
if(msg instanceof SignalMessage)
refContent.set(((SignalMessage) msg).getMessage());
};
serviceA.addMessageListener(listener);
runner.clearTransferState();
runner.setProperty(AbstractSignalSenderProcessor.PROP_GROUPS, TEST_GROUP);
runner.setProperty(PutSignalMessage.PROP_MESSAGE_CONTENT, content);
runner.setProperty(AbstractSignalSenderProcessor.PROP_ACCOUNT, numberA);
runner.enqueue("");
runner.run();
String result = Constants.getAndWait(refContent);
serviceA.removeMessageListener(listener);
runner.assertAllFlowFilesTransferred(AbstractSignalSenderProcessor.SUCCESS);
assertEquals(content, result);
assertEquals(TEST_GROUP, refGroup.get());
}
@Test
public void putGroupMessageContent() throws InterruptedException {
if(isSettingsEmpty()) {
IllegalStateException exc = new IllegalStateException("No configuration set, skipping test");
LOGGER.warn(exc.getMessage(), exc);
return;
}
String content = "Testing " + TestPutSignalMessageForGroups.class.getSimpleName() + " " + Math.random();
AtomicReference<String> refContent = new AtomicReference<String>(null);
AtomicReference<String> refGroup = new AtomicReference<String>(null);
Consumer<SignalData> listener = msg -> {
if(!numberB.equals(msg.getAccount()))
return;
refGroup.set(msg.getGroupName());
if(msg instanceof SignalMessage)
refContent.set(((SignalMessage) msg).getMessage());
};
serviceA.addMessageListener(listener);
runner.clearTransferState();
runner.setProperty(AbstractSignalSenderProcessor.PROP_GROUPS, TEST_GROUP);
runner.setProperty(AbstractSignalSenderProcessor.PROP_ACCOUNT, numberA);
runner.enqueue(content.getBytes(StandardCharsets.UTF_8));
runner.run();
String result = Constants.getAndWait(refContent);
serviceA.removeMessageListener(listener);
runner.assertAllFlowFilesTransferred(AbstractSignalSenderProcessor.SUCCESS);
assertEquals(content, result);
assertEquals(TEST_GROUP, refGroup.get());
}
@Test
public void putGroupMessageOnlyOnce() throws InterruptedException {
if(isSettingsEmpty()) {
IllegalStateException exc = new IllegalStateException("No configuration set, skipping test");
LOGGER.warn(exc.getMessage(), exc);
return;
}
String content = "Testing " + TestPutSignalMessageForGroups.class.getSimpleName() + " " + Math.random();
AtomicReference<String> refContent = new AtomicReference<String>(null);
AtomicReference<String> refGroup = new AtomicReference<String>(null);
AtomicInteger counter = new AtomicInteger(0);
Consumer<SignalData> listener = msg -> {
if(!numberB.equals(msg.getAccount()))
return;
refGroup.set(msg.getGroupName());
if(msg instanceof SignalMessage) {
SignalMessage signalMessage = (SignalMessage) msg;
System.out.println("TEST Received: " + signalMessage.toString() + " " + signalMessage.getMessage() + " @ " + signalMessage.getTimestamp());
refContent.set(signalMessage.getMessage());
counter.incrementAndGet();
}
};
serviceA.addMessageListener(listener);
runner.clearTransferState();
runner.setProperty(AbstractSignalSenderProcessor.PROP_GROUPS, TEST_GROUP + ", " + TEST_GROUP);
runner.setProperty(PutSignalMessage.PROP_MESSAGE_CONTENT, content);
runner.setProperty(AbstractSignalSenderProcessor.PROP_ACCOUNT, numberA);
runner.enqueue("");
runner.run();
String result = Constants.getAndWait(refContent);
serviceA.removeMessageListener(listener);
runner.assertAllFlowFilesTransferred(AbstractSignalSenderProcessor.SUCCESS, 1);
assertEquals(content, result);
assertEquals(TEST_GROUP, refGroup.get());
assertEquals(1, counter.get());
}
@Test
public void putGroupMessageMissingGroup() {
if(isSettingsEmpty()) {
IllegalStateException exc = new IllegalStateException("No configuration set, skipping test");
LOGGER.warn(exc.getMessage(), exc);
return;
}
runner.clearTransferState();
runner.setProperty(AbstractSignalSenderProcessor.PROP_GROUPS, TEST_GROUP + " missing" + Math.random()*10_000);
runner.setProperty(PutSignalMessage.PROP_MESSAGE_CONTENT, "Testing Group Message");
runner.enqueue(new byte[0]);
runner.run();
runner.assertAllFlowFilesTransferred(AbstractSignalSenderProcessor.FAILURE);
}
}
|
[
"[email protected]"
] | |
9a358cc06313e75964827dff5519ee6df48a60e2
|
a5405ac91419c34a1e8a7e2eee29766a9bda5031
|
/Step17_InputOutput/src/test/main/MainClass08.java
|
3ffe92f610fc8265bd60cdebed4bb0b7dfcdeb7d
|
[] |
no_license
|
kinhoz9321/java_work3
|
fe4ff2bc4536838dd4d6c3836581cce919c91a49
|
c10a9cdc31f4cd709978e0bdb36c532cff2f80db
|
refs/heads/master
| 2023-02-20T02:33:36.034905 | 2021-01-24T14:30:24 | 2021-01-24T14:30:24 | 313,877,247 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 592 |
java
|
package test.main;
import java.io.File;
public class MainClass08 {
public static void main(String[] args) {
//*c:/에 access 할 수 있는* File 객체 생성해서 참조값을 myFile에 담기
File myFile=new File("c:/");
//c:/하위의 파일목록을 파일 배열로 얻어내기
File[] files=myFile.listFiles();
//확장 for문 사용하기
for(File tmp:files) {
if(tmp.isDirectory()) {//파일 디렉토리가 존재한다면
System.out.println("[" +tmp.getName()+" ]");
}else {//그렇지 않다면
System.out.println(tmp.getName());
}
}
}
}
|
[
"[email protected]"
] | |
7c8aeb72558437f94d1435be5651cf43d9591394
|
19e98807f582e69a7307266d5c6dbca4742e0f6e
|
/app/src/main/java/com/tanpengxfdl/ppjoke/MainActivity.java
|
46b70f462d61e5e9103ddf25dea98bcc86d0aaaa
|
[
"MIT"
] |
permissive
|
17803909286/tp_ppjoke
|
e09037cbd170d689505af23803c283936e62823f
|
da9b7b4215ed852c482a2d85e19cd2b91685a43d
|
refs/heads/main
| 2023-03-29T12:14:56.028512 | 2021-03-26T02:49:27 | 2021-03-26T02:49:27 | 350,674,104 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,248 |
java
|
package com.tanpengxfdl.ppjoke;
import android.os.Bundle;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BottomNavigationView navView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
}
}
|
[
"[email protected]"
] | |
7391d81c0ca354478211d1024369a8365cfb2f2c
|
8d5e1f1dc8348560c401922f8cbb72e03bc04394
|
/app/build/generated/source/apt/debug/talex/zsw/baseproject/activity/ScrollerNumberPickerActivity$$ViewBinder.java
|
06655d4b8399fb9b44d540021c5f6f4715254d8c
|
[] |
no_license
|
luyulove001/BaseLibrary-master
|
7d5f9ec16b1bbd30fab4e971d0a6ed93bb9f24c4
|
5338a1f02b66646d0bfdca43ea2a4705ceb93c90
|
refs/heads/master
| 2021-01-21T19:40:05.968511 | 2017-06-06T08:27:47 | 2017-06-06T08:28:14 | 92,149,283 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,234 |
java
|
// Generated code from Butter Knife. Do not modify!
package talex.zsw.baseproject.activity;
import android.view.View;
import butterknife.ButterKnife.Finder;
import butterknife.ButterKnife.ViewBinder;
public class ScrollerNumberPickerActivity$$ViewBinder<T extends talex.zsw.baseproject.activity.ScrollerNumberPickerActivity> implements ViewBinder<T> {
@Override public void bind(final Finder finder, final T target, Object source) {
View view;
view = finder.findRequiredView(source, 2131427660, "field 'mPicker1'");
target.mPicker1 = finder.castView(view, 2131427660, "field 'mPicker1'");
view = finder.findRequiredView(source, 2131427661, "field 'mPicker2'");
target.mPicker2 = finder.castView(view, 2131427661, "field 'mPicker2'");
view = finder.findRequiredView(source, 2131427662, "field 'mPicker3'");
target.mPicker3 = finder.castView(view, 2131427662, "field 'mPicker3'");
view = finder.findRequiredView(source, 2131427558, "field 'mTextView'");
target.mTextView = finder.castView(view, 2131427558, "field 'mTextView'");
}
@Override public void unbind(T target) {
target.mPicker1 = null;
target.mPicker2 = null;
target.mPicker3 = null;
target.mTextView = null;
}
}
|
[
"[email protected]"
] | |
eab711e6dca31c1256a1a42b1cf6cefa3a8fc4b6
|
180fea4ee0515cd06aa86c55aa8cef6c1609f1b4
|
/app/src/main/java/com/example/movies_api/models/Episode.java
|
6d3ba2c7dd10fa78f0bbb26fc40bdee0807f38aa
|
[] |
no_license
|
obeidareda37/Movie_api
|
50accc64ab7f602288539a99d047c98c8ce2af71
|
dfd641113d2a3769316125179a5c1c4d86279c3b
|
refs/heads/master
| 2023-05-10T14:25:13.849620 | 2021-05-26T17:17:18 | 2021-05-26T17:17:18 | 371,087,359 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 597 |
java
|
package com.example.movies_api.models;
import com.google.gson.annotations.SerializedName;
public class Episode {
@SerializedName("season")
private String season;
@SerializedName("episode")
private String episode;
@SerializedName("name")
private String name;
@SerializedName("air_date")
private String airDate;
public String getSeason() {
return season;
}
public String getEpisode() {
return episode;
}
public String getName() {
return name;
}
public String getAirDate() {
return airDate;
}
}
|
[
"[email protected]"
] | |
2b1b63c5eccb625e97696c2d04c8febba29ce026
|
83b993af27c2e613d520c8eede5112e221f61d1c
|
/src/main/java/com/walmart/store/recruiting/ticket/domain/SeatImpl.java
|
8f374b7452d908e4daa54189f238182941fa8263
|
[] |
no_license
|
Friat/ticket-service-exercise
|
70ce576c10b6f81ae06da9cbb1310e6d5f6bdb42
|
8f8ed6b9b2be16e44e756a7abab0afa7b6b7cffa
|
refs/heads/master
| 2020-12-31T03:35:55.540575 | 2016-07-13T18:44:11 | 2016-07-13T18:46:10 | 63,256,467 | 0 | 0 | null | 2016-07-13T15:11:08 | 2016-07-13T15:11:07 | null |
UTF-8
|
Java
| false | false | 1,600 |
java
|
package com.walmart.store.recruiting.ticket.domain;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
public class SeatImpl implements Seat {
private int seatId;
private int levelId;
private int seatNumber;
private SeatHold seatHold;
public SeatImpl(int seatId, int levelId, int i, SeatHold seatHold) {
this.seatId = seatId;
this.levelId = levelId;
this.seatNumber = i;
this.seatHold = seatHold;
}
@Override
public SeatHold getSeatHold() {
return seatHold;
}
@Override
public void setSeatHold(SeatHold seatHold) {
this.seatHold = seatHold;
}
@Override
public int getSeatId() {
return seatId;
}
@Override
public void setSeatId(int seatId) {
this.seatId = seatId;
}
@Override
public int getSeatNumber() {
return seatNumber;
}
@Override
public void setSeatNumber(int seatNumber) {
this.seatNumber = seatNumber;
}
@Override
public int getLevelId() {
return levelId;
}
@Override
public void setLevelId(int levelId) {
this.levelId = levelId;
}
@Override
public boolean isAvailable() {
return (this.getSeatHold() == null
|| (this.getSeatHold().getResearvedOn() == null || !this.getSeatHold().getResearvedOn().isPresent())
&& ChronoUnit.SECONDS.between(this.getSeatHold().getHeldOn().get(), LocalDateTime.now()) > AppSettings.TICKET_HOLD_PERIOD);
}
}
|
[
"[email protected]"
] | |
400b0a962f31381cb921328e98074fe3e46c05f9
|
495f6ce747a995996ecf42b58f6767f55d3e7d51
|
/tests/hcom_test/src/main/java/com/epam/hcomtest/datastore/model/DataStoreReader.java
|
c36c41a33c44f0fc3c0f0b1841c3dd559f7d7e59
|
[] |
no_license
|
Yg0R2/mentoring
|
7412304f446b32fbe6602b784c2164d565e227ff
|
4473cf3b2a2821f408635455c77dd2527c389a9d
|
refs/heads/master
| 2021-01-21T21:06:26.614481 | 2017-10-24T23:59:53 | 2017-11-20T16:11:27 | 92,306,635 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 324 |
java
|
package com.epam.hcomtest.datastore.model;
import com.epam.hcomtest.datastore.exception.InvalidDataStoreFormatException;
import com.epam.hcomtest.resource.Resource;
import java.util.List;
public interface DataStoreReader {
List<Resource> readResources(String resourceName) throws InvalidDataStoreFormatException;
}
|
[
"[email protected]"
] | |
cad1edb9e09c6660c0306aa03a16e2cbdf1574bc
|
db4dbfb3cc8b203824f4d5685366c5d58e86d6c9
|
/TecnoLibWeb/src/java/javabeans/IdiomaBean.java
|
3a9b08600d31a13882f50b9a2438380c669f7e07
|
[
"Apache-2.0"
] |
permissive
|
EliaGM/ProyectoWEBsegundaparte
|
c0de4ff243a54cfac813c6602fbdda7abd6ac635
|
4851f1979a0d8c5f4553e8701e9c58c852999464
|
refs/heads/master
| 2020-03-12T21:49:57.857988 | 2018-04-24T10:15:57 | 2018-04-24T10:15:57 | 130,835,468 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,225 |
java
|
package javabeans;
import ejbs.DatosSesionLocal;
import java.util.ArrayList;
import java.util.Locale;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
@ManagedBean(name = "idiomaBean")
@RequestScoped
public class IdiomaBean {
private ArrayList<String> todosIdioma = null;
public IdiomaBean() {
System.out.println("CONSTRUCTOR IDIOMA");
todosIdioma = new ArrayList<>();
todosIdioma.add("es");
todosIdioma.add("en");
}
public void cambiarIdioma() {
System.out.println("CAMBIO IDIOMA");
FacesContext fc = FacesContext.getCurrentInstance();
ExternalContext excontext = fc.getExternalContext();
HttpSession sesion = (HttpSession) excontext.getSession(true);
DatosSesionLocal datos = (DatosSesionLocal) sesion.getAttribute("datosSesion");
FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(datos.getLanguage()));
}
public ArrayList<String> getIdiomas() {
return todosIdioma;
}
}
|
[
"[email protected]"
] | |
00ef931a2ff5ad1b3d8b0f6690bb1a1b593a9718
|
beb56325976455887a6548183d9edc2573b7d4ae
|
/Registration.java
|
31922377298e660f8c56a2e291841cb9463063ee
|
[] |
no_license
|
DivyeshVariya/DivyeshVariya_javaProject
|
2c3c33e2af28b0d0312b8682850f08c43d14aa8b
|
3337773027a5f84668e4498ccde4ca12ebe51f01
|
refs/heads/main
| 2023-04-30T18:12:40.883965 | 2021-05-07T14:43:28 | 2021-05-07T14:43:28 | 349,357,958 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 15,074 |
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 inventorymanagement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
*
* @author Chirag
*/
public class Registration extends javax.swing.JFrame {
/**
* Creates new form Registration
*/
public Registration() {
initComponents();
//setExtendedState(JFrame.MAXIMIZED_BOTH);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
txtname = new javax.swing.JTextField();
txtuser_name = new javax.swing.JTextField();
txtmobile_no = new javax.swing.JTextField();
txtpassward_com = new javax.swing.JPasswordField();
txtpassward = new javax.swing.JPasswordField();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel1.setBackground(new java.awt.Color(255, 204, 0));
jLabel1.setFont(new java.awt.Font("Lucida Sans Typewriter", 1, 48)); // NOI18N
jLabel1.setText("Registration");
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
jLabel2.setText("Name");
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
jLabel3.setText("User Name");
jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
jLabel4.setText("Password");
jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
jLabel5.setText("Conform Passward");
jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
jLabel6.setText("Mobile No");
jButton1.setFont(new java.awt.Font("Times New Roman", 0, 36)); // NOI18N
jButton1.setText("Register");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
txtname.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N
txtuser_name.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N
txtuser_name.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtuser_nameActionPerformed(evt);
}
});
txtmobile_no.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N
txtpassward_com.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N
txtpassward.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N
jButton2.setFont(new java.awt.Font("Times New Roman", 0, 36)); // NOI18N
jButton2.setText("Go To Login ");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(51, 51, 51)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4)
.addComponent(jLabel3)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(58, 58, 58)
.addComponent(jLabel6)))
.addGap(81, 81, 81)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtname, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtpassward, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtuser_name, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtpassward_com, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtmobile_no, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(169, 169, 169)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(124, 124, 124)
.addComponent(jLabel2))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(75, 75, 75)
.addComponent(jButton1)
.addGap(175, 175, 175)
.addComponent(jButton2)))
.addContainerGap(143, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jLabel1)
.addGap(69, 69, 69)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtname, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(41, 41, 41)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtuser_name, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(txtpassward, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(38, 38, 38)
.addComponent(jLabel4)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(txtpassward_com, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(39, 39, 39)
.addComponent(jLabel5)))
.addGap(35, 35, 35)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtmobile_no)
.addComponent(jLabel6))
.addGap(53, 53, 53)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(58, Short.MAX_VALUE))
);
getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, 810, 680));
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void txtuser_nameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtuser_nameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtuser_nameActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
try {
int result=JOptionPane.showConfirmDialog(null,"Do you want to Register yourself ?","Alert...",JOptionPane.YES_NO_OPTION);
if(JOptionPane.YES_OPTION==result)
{
/// Class.forName("com.mysql.jdbc.Driver");
Connection con;
PreparedStatement register;
String name=txtname.getText();
String user_name=txtuser_name.getText();
String passward=txtpassward.getText();
String passward_com=txtpassward_com.getText();
String mobile_no=txtmobile_no.getText();
if(passward.compareTo(passward_com)==0)
{
String query;
query = "INSERT INTO `registration`( `Name`, `User_name`, `Passward`, `Mobile_no`) VALUES (?,?,?,?)";
con =DriverManager.getConnection("jdbc:mysql://localhost/invmngtdb2","root","");
register= con.prepareStatement(query);
register.setString(1,name);
register.setString(2,user_name);
register.setString(3,passward);
register.setString(4,mobile_no);
register.executeUpdate();
txtname.setText("");
txtuser_name.setText("");
txtpassward.setText("");
txtpassward_com.setText("");
txtmobile_no.setText("");
}
else
{
JOptionPane.showMessageDialog(null,"Entered Passward and Confirm passward both doesnot match... Try again...");
txtname.setText("");
txtuser_name.setText("");
txtpassward.setText("");
txtpassward_com.setText("");
txtmobile_no.setText("");
}
}
else
{
Login obj=new Login();
obj.setVisible(true);
setVisible(false);
}
// if(Dialogresult == JOptionPane.YES_OPTION)
//{
//}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ex);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
Login obj=new Login();
obj.setVisible(true);
setVisible(false);
}//GEN-LAST:event_jButton2ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(() -> {
new Registration().setVisible(true);
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField txtmobile_no;
private javax.swing.JTextField txtname;
private javax.swing.JPasswordField txtpassward;
private javax.swing.JPasswordField txtpassward_com;
private javax.swing.JTextField txtuser_name;
// End of variables declaration//GEN-END:variables
}
|
[
"[email protected]"
] | |
4fcb3136dbcb025b9080c17e946ee714dcb4c028
|
bf3bd417c8655e50b61a814b7d5e3a7587aba89f
|
/core/src/main/java/br/com/educ4/core/ports/driven/security/AuthUserIdPort.java
|
0c4170dfc54ff41093402f16b5348fbacc67ef57
|
[] |
no_license
|
thiago1fc3/educ4
|
4e3a169886ebe9b5ae4d73862b8ccf37911b1f65
|
72c7b74613904504cb6193afb583adf51a7ca48c
|
refs/heads/main
| 2023-07-14T15:42:14.831717 | 2021-08-23T16:55:30 | 2021-08-23T16:55:30 | 315,930,910 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 142 |
java
|
package br.com.educ4.core.ports.driven.security;
public interface AuthUserIdPort {
String getUserId(String jwt, String fingerprint);
}
|
[
"[email protected]"
] | |
1eddb02b0133cc55cbb9956fcc56d3a451c30e1c
|
cec2ba559d91cc99f5be395e081ea1d05a0341ec
|
/vividus-plugin-web-app/src/test/java/org/vividus/ui/web/action/search/LinkUrlPartSearchTests.java
|
78ce1334eb95af25fcac05bf9190a94fb872e2be
|
[
"Apache-2.0"
] |
permissive
|
fireflysvet/vividus
|
66aed830b446272f6aef6c9b06f36a23f63a7ec6
|
00efe48704c26e4002a0b6e43f45b0fc09190c13
|
refs/heads/master
| 2023-04-04T01:20:12.500911 | 2020-08-03T10:42:13 | 2020-08-03T10:42:13 | 285,602,526 | 0 | 1 |
Apache-2.0
| 2020-08-06T15:12:07 | 2020-08-06T15:12:06 | null |
UTF-8
|
Java
| false | false | 5,333 |
java
|
/*
* Copyright 2019-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.vividus.ui.web.action.search;
import static com.github.valfirst.slf4jtest.LoggingEvent.info;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.List;
import com.github.valfirst.slf4jtest.TestLogger;
import com.github.valfirst.slf4jtest.TestLoggerFactory;
import com.github.valfirst.slf4jtest.TestLoggerFactoryExtension;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.jupiter.MockitoExtension;
import org.openqa.selenium.By;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;
import org.vividus.ui.web.util.LocatorUtil;
@ExtendWith({ MockitoExtension.class, TestLoggerFactoryExtension.class })
class LinkUrlPartSearchTests
{
private static final String HREF = "href";
private static final String URL_PART = "urlPart";
private static final String URL = "url" + URL_PART;
private static final String OTHER_URL = "otherUrl";
private static final By LINK_URL_PART_LOCATOR = By.xpath(".//a[contains (translate(@href,"
+ " 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), \"urlpart\")]");
private static final String LINK_WITH_PART_URL_PATTERN = ".//a[contains(@href, %s)]";
private static final String TOTAL_NUMBER_OF_ELEMENTS = "Total number of elements found {} is equal to {}";
private final TestLogger logger = TestLoggerFactory.getTestLogger(AbstractElementSearchAction.class);
private List<WebElement> webElements;
@Mock
private WebElement webElement;
@Mock
private SearchContext searchContext;
@Mock
private SearchParameters parameters;
@Spy
private LinkUrlPartSearch spy;
@InjectMocks
private LinkUrlPartSearch search;
@BeforeEach
void beforeEach()
{
webElements = new ArrayList<>();
webElements.add(webElement);
}
@Test
void testSearchLinksByUrlPart()
{
assertEquals(webElements, captureFoundElements(true, URL, HREF, URL_PART));
}
@Test
void testSearchLinksByUrlPartCaseInsensitive()
{
assertEquals(webElements, captureFoundElements(false, URL, HREF, URL_PART));
}
@Test
void testSearchLinksByUrlPartNotMatch()
{
assertTrue(captureFoundElements(true, OTHER_URL, HREF, URL_PART).isEmpty());
}
@Test
void testSearchLinksByUrlPartNotMatchCaseInsensitive()
{
assertTrue(captureFoundElements(false, OTHER_URL, HREF, URL_PART).isEmpty());
}
@Test
void testSearchLinksByUrlPartNoHref()
{
when(webElement.getAttribute(HREF)).thenReturn(null);
List<WebElement> foundElements = search.filter(webElements, URL_PART);
assertTrue(foundElements.isEmpty());
}
@Test
void testSearchContextCaseSensitive()
{
when(parameters.getValue()).thenReturn(URL_PART);
search.setCaseSensitiveSearch(true);
spy = Mockito.spy(search);
spy.search(searchContext, parameters);
By locator = LocatorUtil.getXPathLocator(LINK_WITH_PART_URL_PATTERN, URL_PART);
verify(spy).findElements(searchContext, locator, parameters);
assertThat(logger.getLoggingEvents(), equalTo(List.of(info(TOTAL_NUMBER_OF_ELEMENTS, locator, 0))));
}
@Test
void testSearchContextCaseInsensitive()
{
when(parameters.getValue()).thenReturn(URL_PART);
search.setCaseSensitiveSearch(false);
spy = Mockito.spy(search);
spy.search(searchContext, parameters);
verify(spy).findElements(searchContext, LINK_URL_PART_LOCATOR, parameters);
assertThat(logger.getLoggingEvents(),
equalTo(List.of(info(TOTAL_NUMBER_OF_ELEMENTS, LINK_URL_PART_LOCATOR, 0))));
}
@Test
void testSearchContextNull()
{
when(parameters.getValue()).thenReturn(URL_PART);
List<WebElement> foundElements = search.search(null, parameters);
assertTrue(foundElements.isEmpty());
}
private List<WebElement> captureFoundElements(Boolean equals, String url, String actualHref, String currentUrl)
{
search.setCaseSensitiveSearch(equals);
when(webElement.getAttribute(actualHref)).thenReturn(url);
return search.filter(webElements, currentUrl);
}
}
|
[
"[email protected]"
] | |
c235550e1801fb0200c2ffb403aaa07b61b9fc4b
|
172fff43885c3ac8e2a0e34376c5b9bfc1d47b61
|
/src/main/java/com/telek/elec/protocal/codec/Decoder.java
|
766975f9d9f6f4a62fccbfce55f482e24b10556c
|
[] |
no_license
|
liuning587/elec
|
e58fa72574648aa29eea73b0b1c0739d496c03f3
|
7c8705d62102945d6c2d5027ab2cd341379a5edf
|
refs/heads/master
| 2022-03-01T18:40:44.097709 | 2019-07-17T03:36:25 | 2019-07-18T03:20:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 679 |
java
|
package com.telek.elec.protocal.codec;
import com.telek.elec.protocal.Packet;
import com.telek.elec.protocal.block.Seq;
import com.telek.elec.protocal.block.SeqCache;
import com.telek.elec.protocal.exeception.DecodeException;
import com.telek.elec.protocal.unwrapper.UnwrapperChain;
import lombok.extern.slf4j.Slf4j;
import java.nio.ByteBuffer;
/**
* Created by PETER on 2015/3/14.
*/
@Slf4j
public class Decoder {
// 解码链
private UnwrapperChain unwrapperChain = new UnwrapperChain();
public Packet decode(final ByteBuffer in) throws DecodeException {
Packet out = new Packet();
unwrapperChain.decode(in, out);
return out;
}
}
|
[
"[email protected]"
] | |
2d0e95a187fa3768878d528fc41a9b9d49c5a003
|
e0325559b961813dd37752ab8dd3043295ffb12d
|
/app/src/main/java/org/gandroid/motif/Gridmenu.java
|
4a8261239d19baf5b5f6956423c99f19d93cd029
|
[] |
no_license
|
Cytherie/finalMotif
|
d2b4bb5704a46e9b8248982a5795821c0ebb3cbc
|
f236c5b3d397eb22bb78701ea1826da163bbc705
|
refs/heads/master
| 2021-05-04T21:58:24.578976 | 2018-02-02T14:18:54 | 2018-02-02T14:18:54 | 119,990,216 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,007 |
java
|
package org.gandroid.motif;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.Toast;
public class Gridmenu extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gridmenu);
// TO CHECK IF THIS IS THE FIRST TIME RUN OF APPLICATION
Boolean isFirstRun= getSharedPreferences("PREFERENCE",MODE_PRIVATE)
.getBoolean("isfirstrun",true);
if (isFirstRun) {
Toast.makeText(Gridmenu.this, "First run", Toast.LENGTH_LONG).show();
Intent stores = new Intent(Gridmenu.this, Welcomescreen.class);
startActivity(stores);
getSharedPreferences("PREFERENCE", MODE_PRIVATE).edit().putBoolean("isfirstrun", false).commit();
}
CardView Ptracker = findViewById(R.id.MPtracker);
CardView MCalendar = findViewById(R.id.MCalendar);
CardView PHistory = findViewById(R.id.MPhistory);
CardView Methods = findViewById(R.id.MMethods);
CardView Videos = findViewById(R.id.MVideos);
CardView Aboutus = findViewById(R.id.MAboutus);
Ptracker.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent redirect = new Intent(Gridmenu.this,Periodtracker.class);
startActivity(redirect);
}
});
MCalendar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent redirect = new Intent(Gridmenu.this,CalendarView.class);
startActivity(redirect);
}
});
PHistory.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent redirect = new Intent(Gridmenu.this,ViewListContents.class);
startActivity(redirect);
}
});
Methods.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent redirect = new Intent(Gridmenu.this,MethodsArticle.class);
startActivity(redirect);
}
});
Videos.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent redirect = new Intent(Gridmenu.this,Videos.class);
startActivity(redirect);
}
});
Aboutus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(Gridmenu.this, "This feature is unavailable right now.", Toast.LENGTH_LONG).show();
}
});
}
}
|
[
"[email protected]"
] | |
8bfae9fd1f682d7453e0ddf60de326470ef4f69f
|
45b61b4005c517970651cc3a8def6767124d05e4
|
/src/main/java/com/cyc/concurrency/countdownlatch/CountDownlatchTest.java
|
28101b3a5ac119059b7cd5bfb204ab9d62728026
|
[] |
no_license
|
cyceason/jdk
|
14b026f5d7fa48d93b9523ee155dbd213d59760e
|
cd64036939497bd9aede38c43381c097d945019c
|
refs/heads/master
| 2022-07-03T21:16:21.188834 | 2020-01-27T09:54:44 | 2020-01-27T09:54:44 | 98,040,763 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,139 |
java
|
package com.cyc.concurrency.countdownlatch;
import java.util.concurrent.CountDownLatch;
/**
* CountDownLatch, 一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个线程一直等待。
* Created by cyc_e on 2018/4/28.
*/
public class CountDownlatchTest {
public static void main(String[] args) throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(5);
for (int i = 0; i < 5; i++) {
new Thread(new readNum(i, countDownLatch)).start();
}
countDownLatch.await();
System.out.println("线程执行结束。。。。");
}
static class readNum implements Runnable {
private int id;
private CountDownLatch latch;
public readNum(int id, CountDownLatch latch) {
this.id = id;
this.latch = latch;
}
@Override
public void run() {
synchronized (this) {
System.out.println("线程组任务" + id + "结束,其他任务继续");
latch.countDown();
}
}
}
}
|
[
"[email protected]"
] | |
7c23284cf88daa8e276a23240117010d05cca64f
|
6baf1fe00541560788e78de5244ae17a7a2b375a
|
/hollywood/com.oculus.systemux-SystemUX/sources/com/google/errorprone/annotations/Immutable.java
|
f6f3377526a2477de24de0bdabf85e266d524b26
|
[] |
no_license
|
phwd/quest-tracker
|
286e605644fc05f00f4904e51f73d77444a78003
|
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
|
refs/heads/main
| 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null |
UTF-8
|
Java
| false | false | 443 |
java
|
package com.google.errorprone.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface Immutable {
String[] containerOf() default {};
}
|
[
"[email protected]"
] | |
78d2db4e71b7a095ceeb448b1173b63f1e55aa45
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/MATE-20_EMUI_11.0.0/src/main/java/com/android/server/webkit/WebViewUpdateServiceShellCommand.java
|
7381a5e53ee352cc8798a4d8cc7693b0ec6e5b24
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,768 |
java
|
package com.android.server.webkit;
import android.os.RemoteException;
import android.os.ShellCommand;
import android.webkit.IWebViewUpdateService;
import java.io.PrintWriter;
class WebViewUpdateServiceShellCommand extends ShellCommand {
final IWebViewUpdateService mInterface;
WebViewUpdateServiceShellCommand(IWebViewUpdateService service) {
this.mInterface = service;
}
/* JADX WARNING: Removed duplicated region for block: B:23:0x0045 A[Catch:{ RemoteException -> 0x005d }] */
/* JADX WARNING: Removed duplicated region for block: B:31:0x0058 A[Catch:{ RemoteException -> 0x005d }] */
public int onCommand(String cmd) {
boolean z;
if (cmd == null) {
return handleDefaultCommands(cmd);
}
PrintWriter pw = getOutPrintWriter();
try {
int hashCode = cmd.hashCode();
if (hashCode != -1857752288) {
if (hashCode != -1381305903) {
if (hashCode == 436183515 && cmd.equals("disable-multiprocess")) {
z = true;
if (z) {
return setWebViewImplementation();
}
if (z) {
return enableMultiProcess(true);
}
if (!z) {
return handleDefaultCommands(cmd);
}
return enableMultiProcess(false);
}
} else if (cmd.equals("set-webview-implementation")) {
z = false;
if (z) {
}
}
} else if (cmd.equals("enable-multiprocess")) {
z = true;
if (z) {
}
}
z = true;
if (z) {
}
} catch (RemoteException e) {
pw.println("Remote exception: " + e);
return -1;
}
}
private int setWebViewImplementation() throws RemoteException {
PrintWriter pw = getOutPrintWriter();
String shellChosenPackage = getNextArg();
if (shellChosenPackage == null) {
pw.println("Failed to switch, no PACKAGE provided.");
pw.println("");
helpSetWebViewImplementation();
return 1;
}
String newPackage = this.mInterface.changeProviderAndSetting(shellChosenPackage);
if (shellChosenPackage.equals(newPackage)) {
pw.println("Success");
return 0;
}
pw.println(String.format("Failed to switch to %s, the WebView implementation is now provided by %s.", shellChosenPackage, newPackage));
return 1;
}
private int enableMultiProcess(boolean enable) throws RemoteException {
PrintWriter pw = getOutPrintWriter();
this.mInterface.enableMultiProcess(enable);
pw.println("Success");
return 0;
}
public void helpSetWebViewImplementation() {
PrintWriter pw = getOutPrintWriter();
pw.println(" set-webview-implementation PACKAGE");
pw.println(" Set the WebView implementation to the specified package.");
}
public void onHelp() {
PrintWriter pw = getOutPrintWriter();
pw.println("WebView updater commands:");
pw.println(" help");
pw.println(" Print this help text.");
pw.println("");
helpSetWebViewImplementation();
pw.println(" enable-multiprocess");
pw.println(" Enable multi-process mode for WebView");
pw.println(" disable-multiprocess");
pw.println(" Disable multi-process mode for WebView");
pw.println();
}
}
|
[
"[email protected]"
] | |
e480eccba80da2eff3e05831f7adfcfa933ca941
|
de88fc6388d9ac1469b91d55a31b8844be318ac0
|
/src/abe/CiphertextSerParameter.java
|
2a0f7e2ba380e0cbd36089ce26463e3ae25e86bc
|
[
"MIT"
] |
permissive
|
VasilikiKim/ABE
|
cf9d9fb5ea45acc37fe71133d7b6ba3752a42905
|
89058c89af038a77501a285784b6a3f535621cbf
|
refs/heads/main
| 2023-08-28T09:31:29.354851 | 2021-11-16T12:50:40 | 2021-11-16T12:50:40 | 428,160,257 | 6 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,712 |
java
|
package abe;
import utils.PairingUtils;
import it.unisa.dia.gas.jpbc.Element;
import it.unisa.dia.gas.jpbc.Pairing;
import it.unisa.dia.gas.jpbc.PairingParameters;
import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory;
import java.util.Arrays;
import java.util.Map;
public class CiphertextSerParameter extends HeaderSerParameter {
/**
*
*/
private static final long serialVersionUID = 1L;
private transient Element C;//C
private final byte[] byteArrayC;
public CiphertextSerParameter(
PairingParameters pairingParameters, Element C, Element Cprime,
Map<String, Element> C1s, Map<String, Element> D1s) {
super(pairingParameters, Cprime, C1s, D1s);
this.C = C.getImmutable();
this.byteArrayC = this.C.toBytes();
}
public Element getC() { return this.C.duplicate(); }
@Override
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
}
if (anObject instanceof CiphertextSerParameter) {
CiphertextSerParameter that = (CiphertextSerParameter) anObject;
return PairingUtils.isEqualElement(this.C, that.C)
&& Arrays.equals(this.byteArrayC, that.byteArrayC)
&& super.equals(anObject);
}
return false;
}
private void readObject(java.io.ObjectInputStream objectInputStream)
throws java.io.IOException, ClassNotFoundException {
objectInputStream.defaultReadObject();
Pairing pairing = PairingFactory.getPairing(this.getParameters());
this.C = pairing.getGT().newElementFromBytes(this.byteArrayC).getImmutable();
}
}
|
[
"[email protected]"
] | |
4056262a2a1df12ec395c27b49f281b69472a88e
|
78acecc41820b599e9106a80bf1eefd560d9ed89
|
/x5/src/main/java/com/example/x5/OpenFileActivity.java
|
c02fde8f32a6c52a3eece07a690e48635c21128e
|
[] |
no_license
|
CornColor/Pig
|
be9a14c41f7ecb36b67bb7f923f580044d3006a6
|
fef07e74bc6b7cb27ceb78dc2af75987d1daca47
|
refs/heads/master
| 2020-12-06T12:49:45.268811 | 2020-03-09T07:49:42 | 2020-03-09T07:49:42 | 232,467,033 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,285 |
java
|
package com.example.x5;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.tencent.smtt.sdk.QbSdk;
import com.tencent.smtt.sdk.TbsReaderView;
import java.io.File;
public class OpenFileActivity extends Activity implements TbsReaderView.ReaderCallback {
TbsReaderView mTbsReaderView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_open_file);
mTbsReaderView = new TbsReaderView(this, this);
RelativeLayout rootRl = (RelativeLayout) findViewById(R.id.rl_root);
rootRl.addView(mTbsReaderView, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
String filePath = getIntent().getStringExtra("filePath");
findViewById(R.id.vt_tv_left).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
displayFile(filePath);
}
public static void start(Context context, String filePath) {
Intent intent = new Intent();
intent.putExtra("filePath", filePath);
intent.setClass(context, OpenFileActivity.class);
context.startActivity(intent);
}
@Override
public void onCallBackAction(Integer integer, Object o, Object o1) {
}
@Override
protected void onDestroy() {
super.onDestroy();
mTbsReaderView.onStop();
}
private void displayFile(String filePath) {
Bundle bundle = new Bundle();
bundle.putString("filePath",filePath);
bundle.putString("tempPath", Environment.getExternalStorageDirectory().getPath());
boolean result = mTbsReaderView.preOpen(parseFormat(filePath), false);
if (result) {
mTbsReaderView.openFile(bundle);
}
}
private String parseFormat(String fileName) {
return fileName.substring(fileName.lastIndexOf(".") + 1);
}
}
|
[
"[email protected]"
] | |
7980b56b634fc8cceebfebba1d4e031cca7cdf6e
|
382e34ffe34d03ce39b0cfa4416f40fe7c95c585
|
/Algorithms2021/AlgorithmsStudy/src/study/algorithms/mezero/programmers/java/Solution8.java
|
aafe4dda12c53b99a19b1af8f30b55937b66cc2b
|
[] |
no_license
|
mezeeeeeero/algo_study
|
24f6b610ab366535b289d66cca22bcd1185ce9d1
|
e8ae67e19f080cdc9798aa02bbab24ac19bb6025
|
refs/heads/main
| 2023-05-20T21:17:40.888246 | 2021-06-15T01:14:21 | 2021-06-15T01:14:21 | 347,778,452 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,355 |
java
|
package study.algorithms.mezero.programmers.java;
import java.util.ArrayList;
public class Solution8 {
public int solution(int[][] board, int[] moves) {
int answer = 0;
ArrayList<Integer> basket = new ArrayList<>();
int[][] temp = new int[board.length][board.length];
temp = exchange(board, temp);
for(int i = 0; i < moves.length; i++){
int index = moves[i] -1;
for(int j = 0; j < temp.length; j++){
if(temp[index][j]!=0){
// PUSH
basket.add(temp[index][j]);
temp[index][j] = 0;
//POP
if(basket.size()>1){
if(basket.get(basket.size()-1) == basket.get(basket.size()-2)){
answer = answer+2;
basket.remove(basket.size()-1);
basket.remove(basket.size()-1);
}
}
break;
}
}
}
return answer;
}
public static int[][] exchange(int[][] board, int[][] temp){
for(int i =0; i < board.length; i++){
for(int j= 0; j < board.length; j++){
temp[i][j] = board[j][i];
}
}
return temp;
}
}
|
[
"[email protected]"
] | |
707a9474abcfc6fc1893ea4ef6310ab198fb57e0
|
4e8b79b9c31532f12c3f6699a6c0fcbab353b40d
|
/src/main/java/kowelka/server/KowelkaServer.java
|
78881628cd8fab5253c10232c4273b4cbe2698b4
|
[] |
no_license
|
Peter2121/Kowelka-Server
|
099f764750fdcf4cee30303b0ae8d2be04205998
|
21660df3915c5067e42fb2715bee02450da1fef8
|
refs/heads/master
| 2020-03-10T19:33:18.394064 | 2018-04-14T20:03:22 | 2018-04-14T20:03:22 | 129,550,166 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,616 |
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 kowelka.server;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author peter
*/
public class KowelkaServer {
static final int MAX_PROD = 1024;
public static void main(String[] args) {
KowelkaServer kow = new KowelkaServer();
kow.start(args);
}
void start(String[] args) {
Connection connection = null;
Prod[] Products;
Products = new Prod[MAX_PROD];
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Cannot load PostgreSQL JDBC Driver");
e.printStackTrace();
return;
}
try {
connection = DriverManager.getConnection(
"jdbc:postgresql://192.168.211.231:5432/kowelka",
"root", "123456");
} catch (SQLException e) {
System.out.println("Connection Failed!");
e.printStackTrace();
return;
}
int i=0;
try {
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery( "SELECT public.prod.id as prod_id, public.prod.name as prod_name, public.cat.name as cat_name" +
" FROM public.prod, public.cat" +
" WHERE public.prod.id_cat=public.cat.id");
i=0;
while ( rs.next() && i<MAX_PROD ) {
Prod prod = new Prod();
prod.setId(rs.getLong("prod_id"));
prod.setName(rs.getString ("prod_name"));
prod.setCatname(rs.getString ("cat_name"));
Products[i]=prod;
i++;
}
rs.close();
st.close();
} catch (SQLException se) {
System.err.println("SQLException creating the list of products");
System.err.println(se.getMessage());
}
Integer imax=i;
System.out.println("\nid\tProduct\tCategory");
for(i=0;i<imax;i++) {
System.out.println("\n"+Products[i].getId().toString()+"\t"+Products[i].getName()+"\t"+Products[i].getCatname());
}
System.out.println("\n"+"Total:"+imax.toString()+"\n");
}
}
|
[
"[email protected]"
] | |
8d95749cac9839a38ac1d93300228d8b33dd15fa
|
97c82aefc7a21303ce8e14c5721e690b8fae7f28
|
/src/Transcription.java
|
66068bf8442916ad81d968374c1d9507b4609407
|
[] |
no_license
|
Zak-Olyarnik/Remote_Checkers
|
f7555c2fb9774616662f4153f10a3ec943ef66d8
|
2b7ae6c46593b985cdc80490a3bd6cc357c720ec
|
refs/heads/master
| 2021-01-23T04:58:55.058235 | 2018-04-03T01:32:43 | 2018-04-03T01:32:43 | 86,262,397 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,391 |
java
|
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
public class Transcription
{
private static Transcription singleton;
private Socket clientSocket; // connection to server
private ObjectOutputStream out; // stream to write to server
private ObjectInputStream in; // stream to read from server
private String server; // connection ip
private int port = 9900; // connection port
private Byte messageType; // signifies type of message to be received next
private String message; // text message
private Board newBoard; // board update
private int res; // result of message dialog click
private Transcription()
{ }
// implements singleton
public static Transcription getTranscription()
{
if(singleton == null)
{ singleton = new Transcription(); }
return singleton;
}
// makes connection to server
public void connect()
{
readFile();
try
{
clientSocket = new Socket(server, port);
out = new ObjectOutputStream(clientSocket.getOutputStream());
in = new ObjectInputStream(clientSocket.getInputStream());
messageType = in.readByte();
if(messageType == 'C')
{
String color = in.readUTF();
GameScreen.getGameScreen().setColor(color);
}
}
catch (IOException e)
{ e.printStackTrace(); }
}
// main loop, listens for board updates, messages, and disconnects from server
public void listen()
{
try
{
readloop: while(true)
{
messageType = in.readByte();
switch(messageType)
{
case 'M':
message = in.readUTF();
GameScreen.getGameScreen().displayMessage(message);
break;
case 'B':
newBoard = (Board) in.readObject();
GameScreen.getGameScreen().redraw(newBoard);
break;
case 'E':
message = in.readUTF();
res = GameScreen.getGameScreen().showPopup("Game Over", message);
if (res <= 1)
{
GameScreen.getGameScreen().hide();
MainScreen.getMainScreen().execute();
break readloop;
}
case 'D':
message = in.readUTF();
res = GameScreen.getGameScreen().showPopup("Game Over", message);
if (res <= 1)
{
GameScreen.getGameScreen().hide();
MainScreen.getMainScreen().execute();
break readloop;
}
break;
}
}
sendEnd();
}
catch (IOException | ClassNotFoundException e)
{ e.printStackTrace(); }
finally
{
try
{ clientSocket.close(); }
catch (IOException e)
{ e.printStackTrace(); }
}
}
// sends messages to server, byte followed by space or end message
public void sendMove(Space clicked)
{
try
{
out.reset();
out.writeByte('S');
out.writeObject(clicked);
out.flush();
}
catch (IOException e)
{ e.printStackTrace(); }
}
public void sendEnd()
{
try
{
out.reset();
out.writeByte('E');
out.flush();
}
catch (IOException e)
{ e.printStackTrace(); }
}
// reads Server connection settings from config.txt file
private void readFile()
{
try
{
FileInputStream infile = new FileInputStream(Client.configFile);
BufferedReader in = new BufferedReader(new InputStreamReader(infile));
server = in.readLine();
in.close();
infile.close();
}
catch (IOException e)
{ e.printStackTrace(); }
}
}
|
[
"[email protected]"
] | |
346175ae56c0c388027ea8353bcd93fa57a80e93
|
b91a7a28c51380504b9ae5a9ea05a753484f6ab4
|
/test/com/atuldwivedi/dsusingjava/stack/StackUsingArrayTest.java
|
520b4a540c9a726f16902d937a1b37c4e5224949
|
[] |
no_license
|
AtulDwivedi/ds-and-algo
|
4cb96ef0976b2917e83ea5e19180a4bd19eb5762
|
b2c93c1db8d96bcf76a7022b351cf325c8c04370
|
refs/heads/master
| 2021-07-18T23:53:58.596172 | 2017-10-27T17:16:23 | 2017-10-27T17:16:23 | 87,726,660 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 684 |
java
|
package com.atuldwivedi.dsusingjava.stack;
import com.atuldwivedi.dsa.ds.stack.StackUsingArray;
public class StackUsingArrayTest {
public static void main(String[] args) {
StackUsingArray stack = new StackUsingArray();
//true
System.out.println(stack.empty());
System.out.println("Added: "+stack.push("Dwivedi"));
System.out.println("Added: "+stack.push("Atul"));
System.out.println("Added: "+stack.push("Anuj"));
System.out.println("Removed: "+stack.pop());
System.out.println("Added: "+stack.push("Amar"));
System.out.println(stack.peek());
//false
System.out.println(stack.empty());
System.out.println(stack.search("Dwivedi"));
}
}
|
[
"[email protected]"
] | |
620693e2f099f243466e4a5a4fa313845beac77c
|
37cb5d55181f33d39ac056552eeee22e4e08f9e1
|
/ly-upload/src/main/java/com/leyou/controller/UploadController.java
|
09777208132a302b81a0b0980452a2cb14d75001
|
[] |
no_license
|
SkyBlueness/leyou
|
2625a51c21a35cc3bc5e2156c891b23830d20b9d
|
c1bbbe40ec82592c6b1b0bebdfaa082ffd5dc279
|
refs/heads/master
| 2020-04-09T00:43:53.574287 | 2019-04-28T23:47:23 | 2019-04-28T23:47:23 | 159,879,086 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,023 |
java
|
package com.leyou.controller;
import com.leyou.service.UploadService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("upload")
public class UploadController {
@Autowired
private UploadService uploadService;
@PostMapping("image")
public ResponseEntity<String>upload(@RequestParam("file") MultipartFile file){
String url = uploadService.upload(file);
if (StringUtils.isBlank(url)){
return new ResponseEntity(HttpStatus.BAD_REQUEST);
}
return ResponseEntity.ok(url);
}
}
|
[
"[email protected]"
] | |
55eebf69a6a8cb9df0fb5d498625fb8b20bf0b87
|
8e59d26d19451fff503d193c404591f241e17b01
|
/src/ooplab6/StringCompare.java
|
185dda6602d2ec1ab665f49cc51271005bb0aef0
|
[] |
no_license
|
Umawadee/OOP_359211110125
|
8771bf55fdae82940325ef75fa52a85200c9aaca
|
a436900d996e39d05ebf9597f6aaa52b57cd51d4
|
refs/heads/master
| 2021-09-07T02:48:02.924120 | 2018-02-16T04:16:56 | 2018-02-16T04:16:56 | 111,053,360 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 957 |
java
|
package ooplab6;
public class StringCompare {
public static void main(String[] args) {
String str1 ="Hello";
String str2 ="Hellooo";
//Compare String
//type 1(==)
if (str1 == str2)System.out.println("true");
else System.out.println(false);
//type 2 (equals () method)
if (str1.equals(str2))System.out.println("true");
else System.out.println("false");
//type 3 (CompareTo () method)
//0 = String is equal.
//ค่าที่ได้เป็นลบ = Left String is less than Right String
//ค่าที่ได้เป็นบวก = Right String is less than Left String
if (str1.compareTo(str2)==0)
System.out.println("true");
else if (str1.compareTo(str2)>=1)
System.out.println("str1 is more than str2");
else
System.out.println("str1 is less than str2");
}//main
}//class
|
[
"[email protected]"
] | |
1f8a771846e7fa02102775ee67533e9db0c7a349
|
9c37d6c0b1593b87dc6fd1c62e47facd326c049c
|
/TPO_02/src/participants/Client.java
|
61cfc7f3b195e1f23163cd8808ff0394e2099b44
|
[] |
no_license
|
mishasbtr/tpo
|
1ee56fa0121dd37ab21c00bca2709e5632afea9a
|
fefa28ba8a990598a38856d71b76b85ab3f420bb
|
refs/heads/master
| 2020-03-18T12:37:57.969803 | 2018-06-19T16:32:58 | 2018-06-19T16:32:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,910 |
java
|
package participants;
import exceptions.Assignment02Exception;
import messages.MessageType;
import messages.Request;
import messages.Response;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.nio.channels.SocketChannel;
public class Client extends Transmitter {
private final static int port = 50012;
private final String host = "localhost";
private SocketChannel channel;
public Client(InetAddress serverAddress, int serverPort) throws IOException {
try {
this.channel = SocketChannel.open();
this.channel.bind(new InetSocketAddress(host, port));
this.channel.configureBlocking(false);
this.channel.connect(new InetSocketAddress(serverAddress, serverPort));
ensureConnection();
} catch (IOException e) {
this.channel.close();
throw new Assignment02Exception(e);
}
System.out.println("Connected to the server " + this.channel.getRemoteAddress());
}
public static void main(String[] args) {
try {
Client client = new Client(InetAddress.getByName(args[0]), Integer.parseInt(args[1]));
String reqStr = extractRequest(args);
client.communicate(reqStr);
} catch (UnknownHostException | NumberFormatException e) {
throw new Assignment02Exception(e);
} catch (IOException e) {
e.printStackTrace();
}
}
public static String extractRequest(String[] args) {
StringBuilder stringBuilder = new StringBuilder();
for (int i = 2; i < args.length - 1; i++) {
stringBuilder.append(args[i] + " ");
}
stringBuilder.append(args[args.length - 1]);
return stringBuilder.toString();
}
//perform communication with the server
public void communicate(String str) {
Request request = Request.parseRequest(str);
if (request.getType() == MessageType.ILLEGAL) {
System.out.println("ILLEGAL REQUEST");
return;
}
sendRequest(request);
System.out.println("SENT REQUEST: " + str);
Response response = getResponse();
System.out.println("RESPONSE: " + response);
}
public void sendRequest(Request request) throws Assignment02Exception {
sendMessage(channel, request.toString());
}
public Response getResponse() {
return Response.parseResponse(receiveMessage(channel));
}
public void ensureConnection() {
try {
while (!channel.finishConnect()) {
System.out.println("sleep" + channel.isConnected());
Thread.sleep(100);
}
} catch (Exception e) {
throw new Assignment02Exception("COULDN'T ESTABLISH CONNECTION", e);
}
}
}
|
[
"[email protected]"
] | |
63a70ee77de302896cd564c3a7ff99ec6a658fc4
|
352ec4b1774224dbb6552a4a3d62de0836efcdea
|
/Equation.java
|
2139c8e7731191bcf7cb767ada0310ac97917830
|
[] |
no_license
|
awesomeKelly04/Java_Chapter2
|
55dfc3698e9ccecfde78217a1a7d4193f2a2473a
|
b8595efe7e019220e4c33bef352e9cef476d1bbd
|
refs/heads/master
| 2020-07-20T07:26:07.618118 | 2019-09-05T16:01:50 | 2019-09-05T16:01:50 | 206,597,970 | 0 | 0 | null | 2019-09-05T16:01:52 | 2019-09-05T15:32:57 |
Java
|
UTF-8
|
Java
| false | false | 642 |
java
|
import java.util.Scanner;
public class Equation{
public static void main (String[] args){
int a, x, y;
Scanner input = new Scanner(System.in);
System.out.println("\nA program to solve y = ax^3 + 7\n");
System.out.print("Enter the value for a: ");
a = input.nextInt();
System.out.print("Enter the value for x: ");
x = input.nextInt();
//y = a * x * x * x + 7; // Correct
//y = a * x * x * (x + 7); // Wrong
//y = (a * x) * x * (x + 7); // Wrong
//y = (a * x) * x * x + 7; // Correct
//y = a * (x * x * x) + 7; // Correct
y = a * x * (x * x + 7);
System.out.printf("The value for y is %d%n", y);
}
}
|
[
"[email protected]"
] | |
9436f7f7a6d0c4e47184227b91709c8cb5dfcfc1
|
e608b881a2308aee36f5b89706555acb8e77b9bf
|
/src/sistemasjym/principal/Main.java
|
aef9057e466f34cc9bd7a69b0f0eeb7b15004e55
|
[] |
no_license
|
lgarciav10/InventarioRodamil
|
85748fd2fa45193d16ebf2c6759392356472b4cf
|
1a85ea213c739604da6992a989b4ce9119b68f19
|
refs/heads/master
| 2020-12-24T18:03:10.699177 | 2015-03-05T20:52:50 | 2015-03-05T20:52:50 | 31,729,583 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,273 |
java
|
package sistemasjym.principal;
import java.io.FileInputStream;
import java.util.Properties;
import javax.swing.JOptionPane;
import sistemasjym.servicios.ConectarServicio;
import sistemasjym.servicios.Conexion;
import sistemasjym.ui.Form_EnviarAProcesar;
import sistemasjym.ui.Form_GestionArticulos1;
public class Main {
public static void main(String[] args) {
try {
FileInputStream propFile = new FileInputStream("src\\sistemasjym\\principal\\configurardb.txt");
Properties p = new Properties(System.getProperties());
p.load(propFile);
System.setProperties(p);
if (System.getProperty("mostrarpropierties").compareTo("si") == 0) {
System.getProperties().list(System.out);
}
} catch (java.io.FileNotFoundException e) {
JOptionPane.showMessageDialog(null, "No se encuentra el archivo de configuracion" + e);
System.exit(-1);
} catch (java.io.IOException w) {
JOptionPane.showMessageDialog(null, "Ocurrio algun error de I/O");
System.exit(-1);
}
try {
Conexion cdb = ConectarServicio.getInstancia().getConexionDb();
} catch (java.lang.ClassNotFoundException e) {
JOptionPane.showMessageDialog(null, "Ocurrio la excepcion" + e.toString());
JOptionPane.showMessageDialog(null, "es probable que no se puede encontrar la clase del conector jdbc" + System.getProperty("driver")
+ "Agregela en su classpath con la opcion -cp");
System.exit(-1);
} catch (java.lang.InstantiationException e) {
JOptionPane.showMessageDialog(null, "Ocurrio un error de instanciamiento" + e.toString());
System.exit(-1);
} catch (java.lang.IllegalAccessException e) {
JOptionPane.showMessageDialog(null, "Ocurrio un error de acceso ilegal" + e.toString());
System.exit(-1);
}
try {
// Frm_Proveedores fr= new Frm_Proveedores();
//Frm_Login fr = new Frm_Login();
//Form_GestionArticulos fr = new Form_GestionArticulos();
//Form_EnviarAProcesar fr = new Form_EnviarAProcesar();
//Form_DevolverArticulo fr = new Form_DevolverArticulo();
Form_GestionArticulos1 fr = new Form_GestionArticulos1();
fr.setVisible(true);
// ControladorProveedor ct = new ControladorProveedor();
// ProveedorConsola pc = new ProveedorConsola(ct);
// pc.accionar();
// } catch (ClassNotFoundException e) {
// System.out.println("Ocurrio la excepcion" + e.toString());
// } catch (InstantiationException e) {
// System.out.println("Ocurrio una excepcion SQL" + e.getMessage());
// } catch (IllegalAccessException e) {
// System.out.println("Ocurrio la excepcion de acceso ilegal" + e.toString());
// } catch (SQLException e) {
// System.out.println("Ocurrio una excepcion SQL" + e.getMessage());
} catch (Error e) {
System.out.println("Ocurrio el error" + e.getMessage());
}
}
}
|
[
"[email protected]"
] | |
ee377cb2c75a5e1d0319e0c6d08720c163d7ebbc
|
a0516fd36c77536d94c722959428e817c48f6ad1
|
/src/ch/fhnw/atlantis/clientClasses/GUI/RulesController.java
|
44e75affd62557c90e2ba98bef38c20b62b26de6
|
[] |
no_license
|
gjasula/AtlantisTeamGerstenland
|
40a671ad84aad31a002907657cf91ae502040c92
|
d69ec9d7f448284247e88990471eeed7ba8cc8c2
|
refs/heads/master
| 2021-01-13T03:40:18.715335 | 2016-12-23T22:58:29 | 2016-12-23T22:58:29 | 77,250,718 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 649 |
java
|
package ch.fhnw.atlantis.clientClasses.GUI;
import javafx.stage.Stage;
/**
* @Author Nadine
*
*/
public class RulesController {
private Model model;
private RulesView view;
public RulesController(Model model) {
this.model = model;
this.view = new RulesView();
}
public void show() {
// view.show(model.getPrimaryStage());
Stage secondStage = new Stage();
secondStage.setX(+400); // geänderte Position gegenüber PrimaryStage (nach rechts)
secondStage.setY(+50); // geänderte Position gegenüber PrimaryStage (nach unten)
view.show(secondStage);
}
}
|
[
"[email protected]"
] | |
b5a52b537252d201e8a536e7a3f71b1125574476
|
13c40df240d33cf71cb630e7b69427eff80d9461
|
/reading/src/main/java/com/xidian/yetwish/reading/framework/common_adapter/OnItemLongClickListener.java
|
47e159f16ecab7e554a099dea379cc863d32589a
|
[
"Apache-2.0"
] |
permissive
|
yetwish/Reading
|
1ca7146e359e648d648f4cb5018ae379e9aec013
|
78691cf5dcd09abe2e3479549d08976550568da5
|
refs/heads/master
| 2021-01-21T14:07:47.653702 | 2016-05-16T07:43:46 | 2016-05-16T07:43:46 | 34,259,215 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 253 |
java
|
package com.xidian.yetwish.reading.framework.common_adapter;
import android.view.View;
/**
* Created by Yetwish on 2016/5/11 0011.
*/
public interface OnItemLongClickListener<T> {
void onItemLongClick(View deleteView, T data, int position);
}
|
[
"[email protected]"
] | |
78a481f220100df8d8df515377390e92a50bcb98
|
7f81be9afd4e4858ab15bea00568eca0bd92d68e
|
/app/src/main/java/online/rh/simpleweather/model/CityList.java
|
8e5a2b1e1fad2bce12dc255ebad2ef178c514d55
|
[] |
no_license
|
wangzhitao/TQ
|
7f41725397929745389b0955c96ccc3543a5bc33
|
91c6ee4e837c266c12721c758fa5fe3c9bb0d396
|
refs/heads/master
| 2020-07-16T08:29:15.969011 | 2019-09-04T10:41:19 | 2019-09-04T10:41:19 | 205,754,560 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 316 |
java
|
package online.rh.simpleweather.model;
/**
* 定制已选城市列表的ListView界面
*
* @author liang
*/
public class CityList {
private String cityName;
public CityList(String cityName) {
this.cityName = cityName;
}
public String getCityName() {
return cityName;
}
}
|
[
"[email protected]"
] | |
7d21bcaae87ca4bc0ac76ba5e2074a3f9fd39cca
|
90acf77e57a237dade3932e2e7c439969bcd2557
|
/IntroJavaProg/src/chapter5/assignment13/Memo.java
|
ae07fc7c5b54d4cdbaffcccbc16eb5903f4029d3
|
[] |
no_license
|
bstockus/ITJ
|
c79fc887480d1b0f7555001bc9db90353f184520
|
b1f8dfc8a74ff56ef76ccc77422d01d90425e5bb
|
refs/heads/master
| 2021-01-22T10:14:42.596829 | 2012-12-17T20:43:38 | 2012-12-17T20:43:38 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,545 |
java
|
package chapter5.assignment13;
import convenience.helpers.Dates;
import convenience.helpers.Input;
import convenience.helpers.Strings;
public class Memo {
public static String NOM_IN;
public static Integer MONTH_IN;
public static Double PERCENT_IN;
public static String FIRST, LAST, MONTH_NAME, NEXT_MONTH_NAME;
public static String GRADE, PLURAL_LAST, PLURAL_FIRST;
public static Double DISCOUNT;
public static Integer NEXT_MONTH;
public static String getGrade(Double percent) {
if (percent == 0) {
return "disconnected";
} else if ((percent > 0) && (percent < 66)) {
return "C";
} else if ((percent >= 66) && (percent < 81)) {
return "B";
} else {
return "A";
}
}
public static Double getDiscount(Double percent) {
if (percent == 0) {
return 0.0;
} else if ((percent > 0) && (percent < 66)) {
return 35.0;
} else if ((percent >= 66) && (percent < 81)) {
return 65.0;
} else {
return 85.0;
}
}
public static void getInput() {
Input input = new Input();
// Ask user for name
String name = input.getString("Please enter your name (format first<space>last)", "NAME", 3);
if (name.indexOf(" ") == -1) {
input.writeMessage("You have entered an incorrect name format. Program will now abort.", "INPUT ERROR", 0);
System.exit(0);
}
// Ask user for month
Integer month = input.getInteger("Please enter today's numeric month (format 1-12)", "MONTH", 3);
if ((month < 1) || (month > 12)) {
input.writeMessage("You have entered an incorrect month. Program will now abort.", "MONTH", 0);
System.exit(0);
}
// Ask user for percent
Double percent = input.getDouble("Please enter your current * Rating (format Decimal)", "* RATING", 3);
Memo.NOM_IN = name;
Memo.MONTH_IN = month;
Memo.PERCENT_IN = percent;
}
public static void processMemo() {
Strings strings = new Strings();
Dates dates = new Dates();
// Find first and last name and the plurals of each
String firstName = strings.getFirstName(Memo.NOM_IN);
String lastName = strings.getLastName(Memo.NOM_IN);
String pluralFirstName = strings.getPluralName(firstName);
String pluralLastName = strings.getPluralName(lastName);
// Find the month name, next month and next month name
String monthName = dates.getMonthName(Memo.MONTH_IN);
Integer nextMonth = dates.getNextMonth(Memo.MONTH_IN);
String nextMonthName = strings.getPluralName(dates.getMonthName(nextMonth));
// Get grade and discount
String grade = Memo.getGrade(Memo.PERCENT_IN);
Double discount = Memo.getDiscount(PERCENT_IN);
Memo.FIRST = firstName;
Memo.LAST = lastName;
Memo.PLURAL_FIRST = pluralFirstName;
Memo.PLURAL_LAST = pluralLastName;
Memo.MONTH_NAME = monthName;
Memo.NEXT_MONTH = nextMonth;
Memo.NEXT_MONTH_NAME = nextMonthName;
Memo.GRADE = grade;
Memo.DISCOUNT = discount;
}
public static void printMemo() {
System.out.printf("To: %s\n\nDear %s,\n\nBelow is the %s %s Energy Audit:\n",
Memo.NOM_IN, Memo.FIRST, Memo.PLURAL_LAST, Memo.MONTH_NAME);
System.out.printf("%1.1f%s = Grade %s\n", Memo.PERCENT_IN, "%", Memo.GRADE);
System.out.printf("%s Grade %s will give you a %1.1f%s discount on %s bill.\n\nThank you for your business.",
Memo.PLURAL_FIRST, Memo.GRADE, Memo.DISCOUNT, "%", Memo.NEXT_MONTH_NAME);
}
public static void main(String[] args) {
Memo.getInput();
Memo.processMemo();
Memo.printMemo();
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.