text
stringlengths 10
2.72M
|
|---|
package com.example.nitiya.searchnonthaburi;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.Thing;
import java.util.ArrayList;
import java.util.HashMap;
public class Manu0012 extends AppCompatActivity {
//Explicit นี่คือการประกาศตัวแปร
protected static final int RESULT_SPEECH = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.manu0011);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
getSupportActionBar().setTitle(Html.fromHtml("<font style='normal' color='#ffffff'>" + "ย้อนกลับ" + " </font>"));
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#99CC33")));
ListView lv = (ListView) findViewById(R.id.listtemple);
Data_temple data_temple = new Data_temple(this);
final ArrayList<HashMap<String, Object>> getType = data_temple.getTypeList();
ListAdapter adapter = new SimpleAdapter(Manu0012.this, getType, R.layout.view_temple, new String[]{DT_temple011.temple_name}, new int[]{R.id.temple_name});
lv.setAdapter(adapter);
//กดแล้วเเข้าไปรายชื่อวัด//
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
int type = Integer.parseInt(String.valueOf(getType.get(position).get(DT_temple011.temple_id)));
Intent objIndent = new Intent(getApplicationContext(), DT_dise011.class);
objIndent.putExtra("temple", type);
startActivity(objIndent);
}
});
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//getSupportActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
getSupportActionBar().setTitle(Html.fromHtml("<font style='normal' color='#ffffff'>" + "ค้นหา9วัดโดยอัติโนมัติ" + " </font>"));
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#99CC33")));
} // Main Method
public int getCount() {
return 9;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
// ปุ่มย้อนกลับแทบบรา
@Override
public void onBackPressed() {
finish();
}
@Override // ย้อนกลับไปหน้า home
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return true;
}
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
public Action getIndexApiAction() {
Thing object = new Thing.Builder()
.setName("Manu0011 Page") // TODO: Define a title for the content shown.
// TODO: Make sure this auto-generated URL is correct.
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
.build();
return new Action.Builder(Action.TYPE_VIEW)
.setObject(object)
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
.build();
}
@Override
public void onStart() {
super.onStart();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
}
} // Main class
|
package com.smxknife.drools.demo02.service;
import com.smxknife.drools.demo02.model.PromoteExecute;
import com.smxknife.drools.demo02.model.RuleResult;
import lombok.extern.slf4j.Slf4j;
import org.kie.internal.command.CommandFactory;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
/**
* @author smxknife
* 2020/6/15
*/
@Slf4j
public class DrlExecute {
private static DecimalFormat df = new DecimalFormat("######0.00");
/**
* 判断购物车中所有参加活动的商品
* @param promoteExecute
* @param moneySum
* @return
*/
public static RuleResult rulePromote(PromoteExecute promoteExecute, Double moneySum) {
// 判断业务规则是否存在
RuleResult ruleResult = new RuleResult();
ruleResult.setMoneySum(moneySum);
log.info("优惠前的价格:{}", moneySum);
// 统计完成后再将参数insert促销规则中
List cmdCondition = new ArrayList<>();
cmdCondition.add(CommandFactory.newInsert(ruleResult));
promoteExecute.getWorkSession().execute(CommandFactory.newBatchExecution(cmdCondition));
log.info("优惠后的价格:{}", ruleResult.getFinallyMoney());
return ruleResult;
}
}
|
package com.tencent.mm.g.a;
public final class ci$a {
public int bJQ = 0;
}
|
/* Directions:
* Write a rehash() method for the hash.java program. It should be called by
* insert() to move the entire hash table to an array about twice as large
* whenever the load factor exceeds 0.5. The new array size should be a prime
* number. Refer to the section “Expanding the Array” in this chapter. Don’t
* forget you’ll need to handle items that have been “deleted,” that is, written
* over with –1.
*/
package chapter11;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Project11_4 {
public static void main(String[] args) throws IOException {
DataItem aDataItem;
int aKey, size, n, keysPerCell;
System.out.print("Enter size of hash table: ");
size = getInt();
System.out.print("Enter initial number of items: ");
n = getInt();
System.out.println();
keysPerCell = 10;
// Make table
HashTable3 theHashTable = new HashTable3(size);
// Insert data
for (int i = 0; i < n; i++) {
aKey = (int) (Math.random() * keysPerCell * size);
aDataItem = new DataItem(aKey);
theHashTable.insert(aDataItem);
}
// Interact with user
while (true) {
System.out.print("Enter the first letter of show, insert, delete, or find: ");
char choice = getChar();
switch (choice) {
case 's':
theHashTable.display();
break;
case 'i':
System.out.print("Enter key value to insert: ");
aKey = getInt();
aDataItem = new DataItem(aKey);
theHashTable.insert(aDataItem);
break;
case 'd':
System.out.print("Enter key value to delete: ");
aKey = getInt();
theHashTable.delete(aKey);
break;
case 'f':
System.out.print("Enter key value to find: ");
aKey = getInt();
aDataItem = theHashTable.find(aKey);
if (aDataItem != null) {
System.out.println("Found " + aKey);
} else
System.out.println("Could not find " + aKey);
break;
default:
System.out.print("Invalid entry\n");
}
}
}
public static String getString() throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
return s;
}
public static char getChar() throws IOException {
String s = getString();
return s.charAt(0);
}
public static int getInt() throws IOException {
String s = getString();
return Integer.parseInt(s);
}
}
// Includes members for rehashing, uses quadratic probing
class HashTable3 {
private DataItem[] hashArray;
private int arraySize;
private DataItem nonItem; // for deleted items
private double loadFactor; // Added for Project11_4
private int numberOfItems; // Added for Project11_4
public HashTable3(int size) {
arraySize = size;
hashArray = new DataItem[arraySize];
nonItem = new DataItem(-1); // deleted items have key of -1
numberOfItems = 0;
setLoadFactor();
}
public int hashFunction(int key) {
return key % arraySize;
}
// -------------------------Added for Project11_4-------------------------//
private void rehash() {
// Copy existing table
DataItem[] temp = new DataItem[arraySize];
System.arraycopy(hashArray, 0, temp, 0, hashArray.length);
// Create expanded table
arraySize = getPrime(arraySize * 2);
DataItem[] newHashArray = new DataItem[arraySize];
hashArray = newHashArray;
numberOfItems = 0;
System.out.println("Table resized to " + hashArray.length);
// Insert items into new table
for (int i = 0; i < temp.length; i++) {
if (temp[i] != null && temp[i].getKey() != -1) {
insert(temp[i]);
}
}
System.out.printf("New load factor: %.2f\n\n", getLoadFactor());
}
private void setLoadFactor() {
loadFactor = (double) numberOfItems / arraySize;
}
private double getLoadFactor() {
return loadFactor;
}
private int getPrime(int min) {
int n = min + 1;
while (true) {
if (isPrime(n)) {
return n;
}
n++;
}
}
private boolean isPrime(int n) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
// -----------------------------------------------------------------------//
// Modified for Project11_4
public void insert(DataItem item) { // assumes table isn't full
int key = item.getKey();
int hashValue = hashFunction(key);
int probeCount = 1;
while (hashArray[hashValue] != null && hashArray[hashValue].getKey() != -1) {
hashValue += probeCount * probeCount;
probeCount++;
hashValue %= arraySize;
}
hashArray[hashValue] = item;
numberOfItems++;
setLoadFactor();
if (loadFactor > 0.5) {
System.out.printf("Current load factor: %.2f\n", getLoadFactor());
rehash();
}
}
public DataItem find(int key) {
int hashValue = hashFunction(key);
int probeCount = 1;
while (hashArray[hashValue] != null) {
if (hashArray[hashValue].getKey() == key) {
return hashArray[hashValue];
}
hashValue += probeCount * probeCount;
probeCount++;
hashValue %= arraySize;
}
return null;
}
// Modified for Project11_4
public DataItem delete(int key) {
int hashValue = hashFunction(key);
int probeCount = 1;
while (hashArray[hashValue] != null) {
if (hashArray[hashValue].getKey() == key) {
DataItem temp = hashArray[hashValue];
hashArray[hashValue] = nonItem;
numberOfItems--;
setLoadFactor();
return temp;
}
hashValue += probeCount * probeCount;
probeCount++;
hashValue %= arraySize;
}
return null;
}
public void display() {
System.out.print("Table: ");
for (int i = 0; i < arraySize; i++) {
if (hashArray[i] != null) {
System.out.print(hashArray[i].getKey() + " ");
} else {
System.out.print("** ");
}
}
System.out.println();
System.out.println();
}
}
|
package com.timmy.advance.slideList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.timmy.R;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2016/7/31.
*/
public class ListAdapter extends ArrayAdapter<String> {
private final Context mContext;
private List<String> mDatas;
public void setData(List<String> mDatas) {
this.mDatas = mDatas;
}
public ListAdapter(Context context) {
super(context, R.layout.item_tab_pager);
this.mContext = context;
mDatas = new ArrayList<>();
}
@Override
public int getCount() {
return mDatas.size();
}
@Override
public String getItem(int position) {
return mDatas.get(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_tab_pager, parent, false);
TextView mContent = (TextView) convertView.findViewById(R.id.tv_content);
mContent.setText(mDatas.get(position));
return convertView;
}
}
|
package com.library.service;
import java.util.List;
import com.library.dao.UserDao;
import com.library.entities.User;
import com.library.utils.MD5Util;
public class UserService {
private UserDao userDao;
public void setUserDao(UserDao userDao) {
this.userDao = userDao;
}
public void delete(int id){
userDao.delete(id);
}
public List<User> getAll(){
return userDao.getAll();
}
public void add(String account,String name,String phone,String address,float balance,int grade,int type,String password){
userDao.add(account, phone, address, balance, grade, type, name, password);
}
public List<User> login(String account,String password){
return userDao.findUser(account, MD5Util.encode(password));
}
public boolean updateStatus(int id,int status){
int count=userDao.updateStatus(id, status);
if(count>0){
return true;
}else{
return false;
}
}
public String alterPassword(String account,String password,String newPwd,String reNewPwd){
if(password.trim().equals("")
||newPwd.trim().equals("")||reNewPwd.trim().equals("")){
return "0"; //ÃÜÂë²»ÄÜΪ¿Õ
}else if(!newPwd.endsWith(reNewPwd)){
return "1";
}else if(userDao.alterPassword(account, MD5Util.encode(password), MD5Util.encode(newPwd))>0){
return "2";
}else{
return "3";
}
}
public String addMonney(String account,float balance){
if(balance<=0){
return "0";
}else if(userDao.addMonney(account, balance)>0){
return "1";
}else{
return "2";
}
}
public String alterInfo(String name,String phone,String address,String account){
if(userDao.alterInfo(name, phone, address, account)>0){
return "1";
}else{
return "0";
}
}
public List<User> findUser(String account){
return userDao.findOne(account);
}
}
|
package com.anexa.livechat.service.api.mail;
import com.anexa.livechat.dto.alert.MailMessageDto;
public interface MailService {
void sendMail(MailMessageDto mailMessage);
}
|
package com.usa.project;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class StepDefinationClass {
WebDriver driver;
HomePageFactoryClass pageFct;
@Given("^User able to open a browser$")
public void user_able_to_open_a_browser() throws Throwable {
driver = browserFactoryClass.getBrowser("chrome", driver);
AjaxElementLocatorFactory factory = new AjaxElementLocatorFactory(driver, 200);
PageFactory.initElements(driver, factory);
pageFct = PageFactory.initElements(driver, HomePageFactoryClass.class);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
@Given("^User able to go AgileTrailblazers homepage$")
public void user_able_to_go_AgileTrailblazers_homepage() throws Throwable {
driver.get(browserFactoryClass.getURL());
}
@When("^User able to put valid username$")
public void user_able_to_put_valid_username() throws Throwable {
pageFct.getUserName().sendKeys("Atique");
}
@When("^User able to put valid email$")
public void user_able_to_put_valid_email() throws Throwable {
pageFct.getEmail().sendKeys("Atique123@gmail.com");
}
@When("^User able to put valid Mobile phone number$")
public void user_able_to_put_valid_Mobile_phone_number() throws Throwable {
pageFct.getPhoneNumber().sendKeys("3232426789");
}
@When("^User able to put valid Office phone number$")
public void user_able_to_put_valid_Office_phone_number() throws Throwable {
pageFct.getOfficePhoneNumber().sendKeys("6546545678");
}
@When("^User able to put email subject$")
public void user_able_to_put_email_subject() throws Throwable {
pageFct.getEmailSubject().sendKeys("Contact AgileTrailblazers management team ");
}
@When("^User able to put email Message$")
public void user_able_to_put_email_Message() throws Throwable {
pageFct.getEmailMassage()
.sendKeys("I need help from AgileTrailblazers management team, please respons with thanks");
}
@When("^User able to click Submit button$")
public void user_able_to_click_Submit_button() throws Throwable {
pageFct.getSubmitbtn().click();
}
@Then("^Validate email deliveed successfully or not$")
public void validate_email_deliveed_successfully_or_not() throws Throwable {
String titlestatus = driver.findElement(By.xpath("//*[@id='success-message']")).getText();
String successfullmsg = "Your message was sent successfully. Thanks.";
if (titlestatus.equalsIgnoreCase(successfullmsg)) {
System.out.println(titlestatus + "::Email send successfully");
System.out.println("<<< Test Passed>>>");
} else {
System.out.println("Highlight empty required fields with message: 'Please fill in the required field'");
System.out.println("<<<<< Test Failed>>>>>>");
driver.quit();
}}}
|
/* ========================================================================
* Copyright 2014 EscherFinal
*
* Licensed under the MIT, The MIT License (MIT)
* Copyright (c) 2014 EscherFinal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
* ========================================================================
Source generated by CrudMaker version 1.0.0.201410152247
*/
package co.edu.uniandes.csw.EscherFinal.usuario.master.logic.ejb;
import co.edu.uniandes.csw.EscherFinal.trabajo.logic.dto.TrabajoDTO;
import co.edu.uniandes.csw.EscherFinal.trabajo.persistence.api.ITrabajoPersistence;
import co.edu.uniandes.csw.EscherFinal.usuario.logic.dto.UsuarioDTO;
import co.edu.uniandes.csw.EscherFinal.usuario.master.logic.api._IUsuarioMasterLogicService;
import co.edu.uniandes.csw.EscherFinal.usuario.master.logic.dto.UsuarioMasterDTO;
import co.edu.uniandes.csw.EscherFinal.usuario.master.persistence.api.IUsuarioMasterPersistence;
import co.edu.uniandes.csw.EscherFinal.usuario.master.persistence.entity.UsuariotrabajoEntity;
import co.edu.uniandes.csw.EscherFinal.usuario.persistence.api.IUsuarioPersistence;
import javax.inject.Inject;
public abstract class _UsuarioMasterLogicService implements _IUsuarioMasterLogicService {
@Inject
protected IUsuarioPersistence usuarioPersistance;
@Inject
protected IUsuarioMasterPersistence usuarioMasterPersistance;
@Inject
protected ITrabajoPersistence trabajoPersistance;
public UsuarioMasterDTO createMasterUsuario(UsuarioMasterDTO usuario) {
UsuarioDTO persistedUsuarioDTO = usuarioPersistance.createUsuario(usuario.getUsuarioEntity());
if (usuario.getCreatetrabajo() != null) {
for (TrabajoDTO trabajoDTO : usuario.getCreatetrabajo()) {
TrabajoDTO createdTrabajoDTO = trabajoPersistance.createTrabajo(trabajoDTO);
UsuariotrabajoEntity usuarioTrabajoEntity = new UsuariotrabajoEntity(persistedUsuarioDTO.getId(), createdTrabajoDTO.getId());
usuarioMasterPersistance.createUsuariotrabajoEntity(usuarioTrabajoEntity);
}
}
// update trabajo
if (usuario.getUpdatetrabajo() != null) {
for (TrabajoDTO trabajoDTO : usuario.getUpdatetrabajo()) {
trabajoPersistance.updateTrabajo(trabajoDTO);
UsuariotrabajoEntity usuarioTrabajoEntity = new UsuariotrabajoEntity(persistedUsuarioDTO.getId(), trabajoDTO.getId());
usuarioMasterPersistance.createUsuariotrabajoEntity(usuarioTrabajoEntity);
}
}
return usuario;
}
public UsuarioMasterDTO getMasterUsuario(Long id) {
return usuarioMasterPersistance.getUsuario(id);
}
public void deleteMasterUsuario(Long id) {
usuarioPersistance.deleteUsuario(id);
}
public void updateMasterUsuario(UsuarioMasterDTO usuario) {
usuarioPersistance.updateUsuario(usuario.getUsuarioEntity());
//---- FOR RELATIONSHIP
// persist new trabajo
if (usuario.getCreatetrabajo() != null) {
for (TrabajoDTO trabajoDTO : usuario.getCreatetrabajo()) {
TrabajoDTO createdTrabajoDTO = trabajoPersistance.createTrabajo(trabajoDTO);
UsuariotrabajoEntity usuarioTrabajoEntity = new UsuariotrabajoEntity(usuario.getUsuarioEntity().getId(), createdTrabajoDTO.getId());
usuarioMasterPersistance.createUsuariotrabajoEntity(usuarioTrabajoEntity);
}
}
// update trabajo
if (usuario.getUpdatetrabajo() != null) {
for (TrabajoDTO trabajoDTO : usuario.getUpdatetrabajo()) {
trabajoPersistance.updateTrabajo(trabajoDTO);
}
}
// delete trabajo
if (usuario.getDeletetrabajo() != null) {
for (TrabajoDTO trabajoDTO : usuario.getDeletetrabajo()) {
usuarioMasterPersistance.deleteUsuariotrabajoEntity(usuario.getUsuarioEntity().getId(), trabajoDTO.getId());
trabajoPersistance.deleteTrabajo(trabajoDTO.getId());
}
}
}
}
|
/*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.cmsfacades.types.modepredicates;
import de.hybris.platform.cmsfacades.data.StructureTypeMode;
import de.hybris.platform.core.model.type.AttributeDescriptorModel;
import java.util.function.BiPredicate;
import org.springframework.beans.factory.annotation.Required;
/**
* BiPredicate that tests if the {@link StructureTypeMode} is the same as defined for this instance of predicate.
*/
public class EqualsModeAttributeBiPredicate implements BiPredicate<AttributeDescriptorModel, StructureTypeMode>
{
private StructureTypeMode mode;
@Override
public boolean test(final AttributeDescriptorModel attributeDescriptorModel, final StructureTypeMode structureTypeMode)
{
return structureTypeMode == mode;
}
protected StructureTypeMode getMode()
{
return mode;
}
@Required
public void setMode(final StructureTypeMode mode)
{
this.mode = mode;
}
}
|
package com.sysh.vo;
import java.io.Serializable;
/**
* 第一书记或者报错干部登陆成功之后的审核,可以看到的大体信息
* Created by sjy Cotter on 2018/8/22.
*/
public class EvidenceFirstModel implements Serializable {
private String id, accountNo,imageType,uploadTime;
//自增长序列,户编号,图片类型,上传时间
public EvidenceFirstModel(String id, String accountNo, String imageType, String uploadTime) {
this.id = id;
this.accountNo = accountNo;
this.imageType = imageType;
this.uploadTime = uploadTime;
}
public EvidenceFirstModel() {
super();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public String getImageType() {
return imageType;
}
public void setImageType(String imageType) {
this.imageType = imageType;
}
public String getUploadTime() {
return uploadTime;
}
public void setUploadTime(String uploadTime) {
this.uploadTime = uploadTime;
}
@Override
public String toString() {
return "EvidenceFirstModel{" +
"id='" + id + '\'' +
", accountNo='" + accountNo + '\'' +
", imageType='" + imageType + '\'' +
", uploadTime='" + uploadTime + '\'' +
'}';
}
}
|
package com.google.android.gms.tagmanager;
public class s$a implements y {
final /* synthetic */ s bbJ;
public s$a(s sVar) {
this.bbJ = sVar;
}
}
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.cice.ejercicios;
import java.util.Scanner;
/**
*
* @author TrendingPC
*/
public class Ejercicio07 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int op = 0;
int a = 0;
int b = 0;
Scanner sc = new Scanner(System.in);
do{
System.out.println("MENU PRINCIPAL CALCULADORA V1.0");
System.out.println("===============================");
System.out.println("Elije una opción");
System.out.println("1- suma");
System.out.println("2- resta");
System.out.println("0- salir");
System.out.println("================================");
System.out.print("Has elejido la opción: ");
op = sc.nextInt();
if (op == 1){
System.out.print("Introduce el numero a: ");
a = sc.nextInt();
System.out.print("Introduce el numero b: ");
b = sc.nextInt();
System.out.println("El resultado de la suma es: " +(a + b));
}else if (op == 2){
System.out.print("Introduce el numero a: ");
a = sc.nextInt();
System.out.print("Introduce el numero b: ");
b = sc.nextInt();
System.out.println("El resultado de la resta es: " + (a - b));
}else{
System.out.println("HASTA PRONTO !!!");
}
}while (op != 0);{
System.out.println("HASTA PRONTO !!!!!");
}
}
}
|
package com.tencent.mm.plugin.collect.ui;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.tencent.mm.plugin.collect.b.e;
import com.tencent.mm.plugin.wxpay.a.g;
import com.tencent.mm.plugin.wxpay.a.i;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.ui.y;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public final class a extends BaseAdapter {
List<com.tencent.mm.plugin.collect.b.a> hWN = new ArrayList();
private Context mContext;
public a(Context context) {
this.mContext = context;
}
public final int getCount() {
return this.hWN.size();
}
public final Object getItem(int i) {
return this.hWN.get(i);
}
public final long getItemId(int i) {
return (long) i;
}
public final View getView(int i, View view, ViewGroup viewGroup) {
if (view == null) {
view = y.gq(this.mContext).inflate(g.collect_bill_item, viewGroup, false);
view.setTag(new a(view));
}
com.tencent.mm.plugin.collect.b.a aVar = (com.tencent.mm.plugin.collect.b.a) this.hWN.get(i);
a aVar2 = (a) view.getTag();
aVar2.hWO.setText(new SimpleDateFormat(this.mContext.getString(i.collect_bill_item_date_day_format)).format(new Date(aVar.timestamp * 1000)));
aVar2.hWP.setText(e.os(aVar.fee));
if (bi.oW(aVar.desc)) {
aVar2.hVS.setVisibility(8);
} else {
aVar2.hVS.setText(aVar.desc);
aVar2.hVS.setVisibility(0);
}
return view;
}
}
|
/* Archivo: ExcepcionAsignaturaNoRegistrada.java
* Autor: Diego Mosquera
* Fecha: 18-06-10
*
*/
package regAcadUtil;
public class ExcepcionAsignaturaNoRegistrada extends Exception
{
public ExcepcionAsignaturaNoRegistrada (String causa)
{
super(causa);
}
}
|
/*
* Copyright(c) 2018 Hemajoo Ltd.
* ---------------------------------------------------------------------------
* This file is part of the Hemajoo's Foundation project which is licensed
* under the Apache license version 2 and use is subject to license terms.
* You should have received a copy of the license with the project's artifact
* binaries and/or sources.
*
* License can be consulted at http://www.apache.org/licenses/LICENSE-2.0
* ---------------------------------------------------------------------------
*/
package com.hemajoo.foundation.common.resource.bundle;
/**
* Enumeration of the resource bundle load strategy type.
* <hr>
* @author <a href="mailto:christophe.resse@gmail.com">Christophe Resse - Hemajoo</a>
* @version 1.0.0
*/
public enum BundleLoadStrategyType
{
/**
* Strict bundle load strategy.
*/
STRICT,
/**
* Lenient bundle load strategy.
*/
LENIENT;
}
|
package com.beiyelin;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@SpringBootApplication
@EnableDiscoveryClient
@RestController
public class SmsApplication {
@RequestMapping(value = "/info", method = RequestMethod.GET)
public Map<String, Object> info() {
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("info", "SMS Service ");
return returnMap;
}
public static void main(String[] args) {
SpringApplication.run(SmsApplication.class, args);
}
}
|
package com.tencent.mm.plugin.downloader.model;
import com.tencent.mm.plugin.downloader.c.a;
public interface m {
long a(a aVar);
long a(e eVar);
int cl(long j);
FileDownloadTaskInfo cm(long j);
boolean cn(long j);
boolean co(long j);
}
|
package org.opentosca.planbuilder.provphase.plugin.invoker.handlers;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.io.FileUtils;
import org.eclipse.core.runtime.FileLocator;
import org.opentosca.planbuilder.model.plan.BuildPlan;
import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference;
import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact;
import org.opentosca.planbuilder.model.tosca.AbstractInterface;
import org.opentosca.planbuilder.model.tosca.AbstractOperation;
import org.opentosca.planbuilder.model.tosca.AbstractParameter;
import org.opentosca.planbuilder.plugins.context.TemplatePlanContext;
import org.opentosca.planbuilder.plugins.context.TemplatePlanContext.Variable;
import org.opentosca.planbuilder.provphase.plugin.invoker.Plugin;
import org.osgi.framework.FrameworkUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class Handler {
private final static Logger LOG = LoggerFactory.getLogger(Handler.class);
private ResourceHandler resHandler;
private DocumentBuilderFactory docFactory;
private DocumentBuilder docBuilder;
public Handler() {
try {
this.resHandler = new ResourceHandler();
this.docFactory = DocumentBuilderFactory.newInstance();
this.docFactory.setNamespaceAware(true);
this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
} catch (ParserConfigurationException e) {
Handler.LOG.error("Couldn't initialize ResourceHandler", e);
}
}
public boolean handle(TemplatePlanContext context, AbstractOperation operation, AbstractImplementationArtifact ia) throws IOException {
// register wsdls and xsd
QName invokerPortType = context.registerPortType(this.resHandler.getServiceInvokerPortType(), this.resHandler.getServiceInvokerWSDLFile());
QName invokerCallbackPortType = context.registerPortType(this.resHandler.getServiceInvokerCallbackPortType(), this.resHandler.getServiceInvokerWSDLFile());
// atleast the xsd should be imported now in the plan
context.registerType(this.resHandler.getServiceInvokerAsyncRequestXSDType(), this.resHandler.getServiceInvokerXSDFile());
context.registerType(this.resHandler.getServiceInvokerAsyncResponseXSDType(), this.resHandler.getServiceInvokerXSDFile());
QName InputMessageId = context.importQName(this.resHandler.getServiceInvokerAsyncRequestMessageType());
String InputMessagePartName = this.resHandler.getServiceInvokerAsyncRequestMessagePart();
QName OutputMessageId = context.importQName(this.resHandler.getServiceInvokerAsyncResponseMessageType());
String OutputMessagePartName = this.resHandler.getServiceInvokerAsyncResponseMessagePart();
// generate partnerlink from the two porttypes
String partnerLinkTypeName = invokerPortType.getLocalPart() + "PLT" + context.getIdForNames();
context.addPartnerLinkType(partnerLinkTypeName, "Requester", invokerCallbackPortType, "Requestee", invokerPortType);
String partnerLinkName = invokerPortType.getLocalPart() + "PL" + context.getIdForNames();
context.addPartnerLinkToTemplateScope(partnerLinkName, partnerLinkTypeName, "Requester", "Requestee", true);
// register request and response message
String requestVariableName = invokerPortType.getLocalPart() + InputMessageId.getLocalPart() + "Request" + context.getIdForNames();
context.addVariable(requestVariableName, BuildPlan.VariableType.MESSAGE, InputMessageId);
String responseVariableName = invokerCallbackPortType.getLocalPart() + OutputMessageId.getLocalPart() + "Response" + context.getIdForNames();
context.addVariable(responseVariableName, BuildPlan.VariableType.MESSAGE, OutputMessageId);
// setup a correlation set for the messages
String correlationSetName = null;
// setup correlation property and aliases for request and response
String correlationPropertyName = invokerPortType.getLocalPart() + "Property" + context.getIdForNames();
context.addProperty(correlationPropertyName, new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd"));
context.addPropertyAlias(correlationPropertyName, InputMessageId, InputMessagePartName, "/" + InputMessageId.getPrefix() + ":" + "MessageID");
context.addPropertyAlias(correlationPropertyName, OutputMessageId, OutputMessagePartName, "/" + OutputMessageId.getPrefix() + ":" + "MessageID");
// register correlationsets
correlationSetName = invokerPortType.getLocalPart() + "CorrelationSet" + context.getIdForNames();
context.addCorrelationSet(correlationSetName, correlationPropertyName);
// fetch "meta"-data for invoker message (e.g. csarid, nodetemplate
// id..)
String csarId = context.getCSARFileName();
QName serviceTemplateId = context.getServiceTemplateId();
boolean isNodeTemplate = true;
String templateId = "";
if (context.getNodeTemplate() != null) {
templateId = context.getNodeTemplate().getId();
} else {
templateId = context.getRelationshipTemplate().getId();
isNodeTemplate = false;
}
String interfaceName = this.findInterfaceForOperation(context, operation);
String operationName = operation.getName();
// fetch the input parameters of the operation and check whether their
// internal or external
// map to store input parameter names to bpel variable names, if value
// is null
// -> parameter is external
Map<String, Variable> internalExternalPropsInput = new HashMap<String, Variable>();
Map<String, Variable> internalExternalPropsOutput = new HashMap<String, Variable>();
for (AbstractParameter para : operation.getInputParameters()) {
Variable propWrapper = context.getPropertyVariable(para.getName());
if (propWrapper == null) {
propWrapper = context.getPropertyVariable(para.getName(), true);
if (propWrapper == null) {
propWrapper = context.getPropertyVariable(para.getName(), false);
}
}
internalExternalPropsInput.put(para.getName(), propWrapper);
}
for (AbstractParameter para : operation.getOutputParameters()) {
Variable propWrapper = context.getPropertyVariable(para.getName());
if (propWrapper == null) {
propWrapper = context.getPropertyVariable(para.getName(), true);
if (propWrapper == null) {
propWrapper = context.getPropertyVariable(para.getName(), false);
}
}
internalExternalPropsOutput.put(para.getName(), propWrapper);
}
// add external props to plan input message
for (String paraName : internalExternalPropsInput.keySet()) {
if (internalExternalPropsInput.get(paraName) == null) {
context.addStringValueToPlanRequest(paraName);
}
}
// add external props to plan output message
for (String paraName : internalExternalPropsOutput.keySet()) {
if (internalExternalPropsOutput.get(paraName) == null) {
context.addStringValueToPlanResponse(paraName);
}
}
// add request message assign to prov phase scope
try {
Node assignNode = this.resHandler.generateInvokerRequestMessageInitAssignTemplateAsNode(csarId, serviceTemplateId, operationName, String.valueOf(System.currentTimeMillis()), requestVariableName, InputMessagePartName, interfaceName, isNodeTemplate, templateId, internalExternalPropsInput);
assignNode = context.importNode(assignNode);
Node addressingCopyInit = this.resHandler.generateAddressingInitAsNode(requestVariableName);
addressingCopyInit = context.importNode(addressingCopyInit);
assignNode.appendChild(addressingCopyInit);
Node addressingCopyNode = this.resHandler.generateAddressingCopyAsNode(partnerLinkName, requestVariableName);
addressingCopyNode = context.importNode(addressingCopyNode);
assignNode.appendChild(addressingCopyNode);
Node replyToCopy = this.resHandler.generateReplyToCopyAsNode(partnerLinkName, requestVariableName, InputMessagePartName, "ReplyTo");
replyToCopy = context.importNode(replyToCopy);
assignNode.appendChild(replyToCopy);
context.getProvisioningPhaseElement().appendChild(assignNode);
} catch (SAXException e) {
Handler.LOG.error("Couldn't generate DOM node for the request message assign element", e);
return false;
}
// invoke service invoker
// add invoke
try {
Node invokeNode = this.resHandler.generateInvokeAsNode("invoke_" + requestVariableName, partnerLinkName, "invokeOperationAsync", invokerPortType, requestVariableName);
Handler.LOG.debug("Trying to ImportNode: " + invokeNode.toString());
invokeNode = context.importNode(invokeNode);
Node correlationSetsNode = this.resHandler.generateCorrelationSetsAsNode(correlationSetName, true);
correlationSetsNode = context.importNode(correlationSetsNode);
invokeNode.appendChild(correlationSetsNode);
context.getProvisioningPhaseElement().appendChild(invokeNode);
} catch (SAXException e) {
Handler.LOG.error("Error reading/writing XML File", e);
return false;
} catch (IOException e) {
Handler.LOG.error("Error reading/writing File", e);
return false;
}
// add receive for service invoker callback
try {
Node receiveNode = this.resHandler.generateReceiveAsNode("receive_" + responseVariableName, partnerLinkName, "callback", invokerCallbackPortType, responseVariableName);
receiveNode = context.importNode(receiveNode);
Node correlationSetsNode = this.resHandler.generateCorrelationSetsAsNode(correlationSetName, false);
correlationSetsNode = context.importNode(correlationSetsNode);
receiveNode.appendChild(correlationSetsNode);
context.getProvisioningPhaseElement().appendChild(receiveNode);
} catch (SAXException e1) {
Handler.LOG.error("Error reading/writing XML File", e1);
return false;
} catch (IOException e1) {
Handler.LOG.error("Error reading/writing File", e1);
return false;
}
// process response message
// add assign for response
try {
Node responseAssignNode = this.resHandler.generateResponseAssignAsNode(responseVariableName, OutputMessagePartName, internalExternalPropsOutput, "assign_" + responseVariableName, OutputMessageId, context.getPlanResponseMessageName(), "payload");
Handler.LOG.debug("Trying to ImportNode: " + responseAssignNode.toString());
responseAssignNode = context.importNode(responseAssignNode);
context.getProvisioningPhaseElement().appendChild(responseAssignNode);
} catch (SAXException e) {
Handler.LOG.error("Error reading/writing XML File", e);
return false;
} catch (IOException e) {
Handler.LOG.error("Error reading/writing File", e);
return false;
}
return true;
}
public boolean handle(TemplatePlanContext context, String templateId, boolean isNodeTemplate, String operationName, String interfaceName, String callbackAddressVarName, Map<String, Variable> internalExternalPropsInput, Map<String, Variable> internalExternalPropsOutput, boolean appendToPrePhase) throws IOException {
// register wsdls and xsd
QName invokerPortType = context.registerPortType(this.resHandler.getServiceInvokerPortType(), this.resHandler.getServiceInvokerWSDLFile());
QName invokerCallbackPortType = context.registerPortType(this.resHandler.getServiceInvokerCallbackPortType(), this.resHandler.getServiceInvokerWSDLFile());
// atleast the xsd should be imported now in the plan
context.registerType(this.resHandler.getServiceInvokerAsyncRequestXSDType(), this.resHandler.getServiceInvokerXSDFile());
context.registerType(this.resHandler.getServiceInvokerAsyncResponseXSDType(), this.resHandler.getServiceInvokerXSDFile());
QName InputMessageId = context.importQName(this.resHandler.getServiceInvokerAsyncRequestMessageType());
String InputMessagePartName = this.resHandler.getServiceInvokerAsyncRequestMessagePart();
QName OutputMessageId = context.importQName(this.resHandler.getServiceInvokerAsyncResponseMessageType());
String OutputMessagePartName = this.resHandler.getServiceInvokerAsyncResponseMessagePart();
// generate partnerlink from the two porttypes
String partnerLinkTypeName = invokerPortType.getLocalPart() + "PLT" + context.getIdForNames();
context.addPartnerLinkType(partnerLinkTypeName, "Requester", invokerCallbackPortType, "Requestee", invokerPortType);
String partnerLinkName = invokerPortType.getLocalPart() + "PL" + context.getIdForNames();
context.addPartnerLinkToTemplateScope(partnerLinkName, partnerLinkTypeName, "Requester", "Requestee", true);
// register request and response message
String requestVariableName = invokerPortType.getLocalPart() + InputMessageId.getLocalPart() + "Request" + context.getIdForNames();
context.addVariable(requestVariableName, BuildPlan.VariableType.MESSAGE, InputMessageId);
String responseVariableName = invokerCallbackPortType.getLocalPart() + OutputMessageId.getLocalPart() + "Response" + context.getIdForNames();
context.addVariable(responseVariableName, BuildPlan.VariableType.MESSAGE, OutputMessageId);
// setup a correlation set for the messages
String correlationSetName = null;
// setup correlation property and aliases for request and response
String correlationPropertyName = invokerPortType.getLocalPart() + "Property" + context.getIdForNames();
context.addProperty(correlationPropertyName, new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd"));
String query = "//*[local-name()=\"MessageID\" and namespace-uri()=\"http://siserver.org/schema\"]";
// "/" + InputMessageId.getPrefix() + ":" + "MessageID"
context.addPropertyAlias(correlationPropertyName, InputMessageId, InputMessagePartName, query);
context.addPropertyAlias(correlationPropertyName, OutputMessageId, OutputMessagePartName, query);
// register correlationsets
correlationSetName = invokerPortType.getLocalPart() + "CorrelationSet" + context.getIdForNames();
context.addCorrelationSet(correlationSetName, correlationPropertyName);
// add external props to plan input message
for (String paraName : internalExternalPropsInput.keySet()) {
if (internalExternalPropsInput.get(paraName) == null) {
context.addStringValueToPlanRequest(paraName);
}
}
// add external props to plan output message
for (String paraName : internalExternalPropsOutput.keySet()) {
if (internalExternalPropsOutput.get(paraName) == null) {
context.addStringValueToPlanResponse(paraName);
}
}
// add request message assign to prov phase scope
try {
Node assignNode = this.resHandler.generateInvokerRequestMessageInitAssignTemplateAsNode(context.getCSARFileName(), context.getServiceTemplateId(), operationName, String.valueOf(System.currentTimeMillis()), requestVariableName, InputMessagePartName, interfaceName, isNodeTemplate, templateId, internalExternalPropsInput);
assignNode = context.importNode(assignNode);
Node addressingCopyInit = this.resHandler.generateAddressingInitAsNode(requestVariableName);
addressingCopyInit = context.importNode(addressingCopyInit);
assignNode.appendChild(addressingCopyInit);
Node addressingCopyNode = this.resHandler.generateAddressingCopyAsNode(partnerLinkName, requestVariableName);
addressingCopyNode = context.importNode(addressingCopyNode);
assignNode.appendChild(addressingCopyNode);
if (callbackAddressVarName == null) {
// if the plan doesn't have an input message for the address of
// the plan itself (for callback/bps2.1.2) we get the address at
// runtime
Node replyToCopy = this.resHandler.generateReplyToCopyAsNode(partnerLinkName, requestVariableName, InputMessagePartName, "ReplyTo");
replyToCopy = context.importNode(replyToCopy);
assignNode.appendChild(replyToCopy);
} else {
// else the address is provided in the input message
Node replyToCopy = this.resHandler.generateCopyFromExternalParamToInvokerNode(requestVariableName, InputMessagePartName, callbackAddressVarName, "ReplyTo");
replyToCopy = context.importNode(replyToCopy);
assignNode.appendChild(replyToCopy);
}
if (appendToPrePhase) {
context.getPrePhaseElement().appendChild(assignNode);
} else {
context.getProvisioningPhaseElement().appendChild(assignNode);
}
} catch (SAXException e) {
Handler.LOG.error("Couldn't generate DOM node for the request message assign element", e);
return false;
}
// invoke service invoker
// add invoke
try {
Node invokeNode = this.resHandler.generateInvokeAsNode("invoke_" + requestVariableName, partnerLinkName, "invokeOperationAsync", invokerPortType, requestVariableName);
Handler.LOG.debug("Trying to ImportNode: " + invokeNode.toString());
invokeNode = context.importNode(invokeNode);
Node correlationSetsNode = this.resHandler.generateCorrelationSetsAsNode(correlationSetName, true);
correlationSetsNode = context.importNode(correlationSetsNode);
invokeNode.appendChild(correlationSetsNode);
if (appendToPrePhase) {
context.getPrePhaseElement().appendChild(invokeNode);
} else {
context.getProvisioningPhaseElement().appendChild(invokeNode);
}
} catch (SAXException e) {
Handler.LOG.error("Error reading/writing XML File", e);
return false;
} catch (IOException e) {
Handler.LOG.error("Error reading/writing File", e);
return false;
}
// add receive for service invoker callback
try {
Node receiveNode = this.resHandler.generateReceiveAsNode("receive_" + responseVariableName, partnerLinkName, "callback", invokerCallbackPortType, responseVariableName);
receiveNode = context.importNode(receiveNode);
Node correlationSetsNode = this.resHandler.generateCorrelationSetsAsNode(correlationSetName, false);
correlationSetsNode = context.importNode(correlationSetsNode);
receiveNode.appendChild(correlationSetsNode);
if (appendToPrePhase) {
context.getPrePhaseElement().appendChild(receiveNode);
} else {
context.getProvisioningPhaseElement().appendChild(receiveNode);
}
} catch (SAXException e1) {
Handler.LOG.error("Error reading/writing XML File", e1);
return false;
} catch (IOException e1) {
Handler.LOG.error("Error reading/writing File", e1);
return false;
}
// process response message
// add assign for response
try {
Node responseAssignNode = this.resHandler.generateResponseAssignAsNode(responseVariableName, OutputMessagePartName, internalExternalPropsOutput, "assign_" + responseVariableName, OutputMessageId, context.getPlanResponseMessageName(), "payload");
Handler.LOG.debug("Trying to ImportNode: " + responseAssignNode.toString());
responseAssignNode = context.importNode(responseAssignNode);
if (appendToPrePhase) {
context.getPrePhaseElement().appendChild(responseAssignNode);
} else {
context.getProvisioningPhaseElement().appendChild(responseAssignNode);
}
} catch (SAXException e) {
Handler.LOG.error("Error reading/writing XML File", e);
return false;
} catch (IOException e) {
Handler.LOG.error("Error reading/writing File", e);
return false;
}
return true;
}
public boolean handle(TemplatePlanContext context, String operationName, String interfaceName, String callbackAddressVarName, Map<String, Variable> internalExternalPropsInput, Map<String, Variable> internalExternalPropsOutput, boolean appendToPrePhase) throws IOException {
// fetch "meta"-data for invoker message (e.g. csarid, nodetemplate
// id..)
boolean isNodeTemplate = true;
String templateId = "";
if (context.getNodeTemplate() != null) {
templateId = context.getNodeTemplate().getId();
} else {
templateId = context.getRelationshipTemplate().getId();
isNodeTemplate = false;
}
return this.handle(context, templateId, isNodeTemplate, operationName, interfaceName, callbackAddressVarName, internalExternalPropsInput, internalExternalPropsOutput, appendToPrePhase);
}
public boolean handleArtifactReferenceUpload(AbstractArtifactReference ref, TemplatePlanContext templateContext, Variable serverIp, Variable sshUser, Variable sshKey, String templateId, boolean appendToPrePhase) throws IOException {
LOG.debug("Handling DA " + ref.getReference());
/*
* Contruct all needed data (paths, url, scripts)
*/
// TODO /home/ec2-user/ or ~ is a huge assumption
// the path to the file on the ubuntu vm being uploaded
String ubuntuFilePath = "~/" + templateContext.getCSARFileName() + "/" + ref.getReference();
String ubuntuFilePathVarName = "ubuntuFilePathVar" + templateContext.getIdForNames();
Variable ubuntuFilePathVar = templateContext.createGlobalStringVariable(ubuntuFilePathVarName, ubuntuFilePath);
// the folder which has to be created on the ubuntu vm
String ubuntuFolderPathScript = "mkdir -p " + this.fileReferenceToFolder(ubuntuFilePath);
String containerAPIAbsoluteURIXPathQuery = this.createXPathQueryForURLRemoteFilePath(ref.getReference());
String containerAPIAbsoluteURIVarName = "containerApiFileURL" + templateContext.getIdForNames();
/*
* create a string variable with a complete URL to the file we want to
* upload
*/
Variable containerAPIAbsoluteURIVar = templateContext.createGlobalStringVariable(containerAPIAbsoluteURIVarName, "");
try {
Node assignNode = this.loadAssignXpathQueryToStringVarFragmentAsNode("assign" + templateContext.getIdForNames(), containerAPIAbsoluteURIXPathQuery, containerAPIAbsoluteURIVar.getName());
assignNode = templateContext.importNode(assignNode);
if (appendToPrePhase) {
templateContext.getPrePhaseElement().appendChild(assignNode);
} else {
templateContext.getProvisioningPhaseElement().appendChild(assignNode);
}
} catch (IOException e) {
LOG.error("Couldn't read internal file", e);
return false;
} catch (SAXException e) {
LOG.error("Couldn't parse internal xml file");
return false;
}
/*
* create the folder the file must be uploaded into
*/
Map<String, Variable> runScriptRequestInputParams = new HashMap<String, Variable>();
String mkdirScriptVarName = "mkdirScript" + templateContext.getIdForNames();
Variable mkdirScriptVar = templateContext.createGlobalStringVariable(mkdirScriptVarName, ubuntuFolderPathScript);
runScriptRequestInputParams.put("hostname", serverIp);
runScriptRequestInputParams.put("sshKey", sshKey);
runScriptRequestInputParams.put("sshUser", sshUser);
runScriptRequestInputParams.put("script", mkdirScriptVar);
this.handle(templateContext, templateId, true, "runScript", "InterfaceUbuntu", "planCallbackAddress_invoker", runScriptRequestInputParams, new HashMap<String, Variable>(), appendToPrePhase);
/*
* append transferFile logic with method: methodname: transferFile
* params: hostname sshUser sshKey targetAbsolutePath
* sourceURLorLocalAbsolutePath
*/
Map<String, Variable> transferFileRequestInputParams = new HashMap<String, Variable>();
transferFileRequestInputParams.put("hostname", serverIp);
transferFileRequestInputParams.put("sshUser", sshUser);
transferFileRequestInputParams.put("sshKey", sshKey);
transferFileRequestInputParams.put("targetAbsolutePath", ubuntuFilePathVar);
transferFileRequestInputParams.put("sourceURLorLocalAbsolutePath", containerAPIAbsoluteURIVar);
this.handle(templateContext, templateId, true, "transferFile", "InterfaceUbuntu", "planCallbackAddress_invoker", transferFileRequestInputParams, new HashMap<String, Variable>(), appendToPrePhase);
return true;
}
/**
* Removes trailing slashes
*
* @param ref a path
* @return a String without trailing slashes
*/
private String fileReferenceToFolder(String ref) {
Handler.LOG.debug("Getting ref to change to folder ref: " + ref);
int lastIndexSlash = ref.lastIndexOf("/");
int lastIndexDot = ref.lastIndexOf(".");
if (lastIndexSlash < lastIndexDot) {
ref = ref.substring(0, lastIndexSlash);
}
Handler.LOG.debug("Returning ref: " + ref);
return ref;
}
/**
* Returns an XPath Query which contructs a valid String, to GET a File from
* the openTOSCA API
*
* @param artifactPath a path inside an ArtifactTemplate
* @return a String containing an XPath query
*/
public String createXPathQueryForURLRemoteFilePath(String artifactPath) {
Handler.LOG.debug("Generating XPATH Query for ArtifactPath: " + artifactPath);
String filePath = "string(concat($input.payload//*[local-name()='csarEntrypoint']/text(),'/Content/" + artifactPath + "'))";
return filePath;
}
/**
* Loads a BPEL Assign fragment which queries the csarEntrypath from the
* input message into String variable.
*
* @param assignName the name of the BPEL assign
* @param xpath2Query the csarEntryPoint XPath query
* @param stringVarName the variable to load the queries results into
* @return a String containing a BPEL Assign element
* @throws IOException is thrown when reading the BPEL fragment form the
* resources fails
*/
public String loadAssignXpathQueryToStringVarFragmentAsString(String assignName, String xpath2Query, String stringVarName) throws IOException {
// <!-- {AssignName},{xpath2query}, {stringVarName} -->
URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle().getResource("assignStringVarWithXpath2Query.xml");
File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath());
String template = FileUtils.readFileToString(bpelFragmentFile);
template = template.replace("{AssignName}", assignName);
template = template.replace("{xpath2query}", xpath2Query);
template = template.replace("{stringVarName}", stringVarName);
return template;
}
/**
* Loads a BPEL Assign fragment which queries the csarEntrypath from the
* input message into String variable.
*
* @param assignName the name of the BPEL assign
* @param csarEntryXpathQuery the csarEntryPoint XPath query
* @param stringVarName the variable to load the queries results into
* @return a DOM Node representing a BPEL assign element
* @throws IOException is thrown when loading internal bpel fragments fails
* @throws SAXException is thrown when parsing internal format into DOM
* fails
*/
public Node loadAssignXpathQueryToStringVarFragmentAsNode(String assignName, String xpath2Query, String stringVarName) throws IOException, SAXException {
String templateString = this.loadAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName);
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(templateString));
Document doc = this.docBuilder.parse(is);
return doc.getFirstChild();
}
private String findInterfaceForOperation(TemplatePlanContext context, AbstractOperation operation) {
List<AbstractInterface> interfaces = null;
if (context.getNodeTemplate() != null) {
interfaces = context.getNodeTemplate().getType().getInterfaces();
} else {
interfaces = context.getRelationshipTemplate().getRelationshipType().getSourceInterfaces();
interfaces.addAll(context.getRelationshipTemplate().getRelationshipType().getTargetInterfaces());
}
if ((interfaces != null) && (interfaces.size() > 0)) {
for (AbstractInterface iface : interfaces) {
for (AbstractOperation op : iface.getOperations()) {
if (op.equals(operation)) {
return iface.getName();
}
}
}
}
return null;
}
}
|
package com.spring.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
public class CSRFHandlerInterceptor implements HandlerInterceptor {
@Value("${unsecuredURLList}")
private String unsecuredURLList;
@Override
public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3)
throws Exception {
// TODO Auto-generated method stub
}
@Override
public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3)
throws Exception {
// TODO Auto-generated method stub
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception {
boolean status = true;
if (!request.getMethod().equalsIgnoreCase("POST")) {
status = true;
} else {
if (request.getRequestURI().startsWith(request.getContextPath() + "/resources")) {
return true;
}
List<String> UrlList = new ArrayList<String>(Arrays.asList(unsecuredURLList.split(",")));
for (String Url : UrlList) {
if (request.getRequestURI().startsWith(request.getContextPath() + Url)) {
return true;
}
}
boolean validTokenResult = CSRFTokenUtil.isValidRequest(request);
if (validTokenResult) {
status = true;
} else {
response.sendRedirect(request.getContextPath() + "/403");
status = false;
}
}
return status;
}
}
|
package model;
import com.google.gson.annotations.SerializedName;
import java.time.LocalDateTime;
import java.util.Objects;
public class Comment {
private long id;
private String content;
@SerializedName(value = "time", alternate = {"creationTime"})
private LocalDateTime time;
public Comment(long id, String content, LocalDateTime time) {
this.id = id;
this.content = content;
this.time = time;
}
public long getId() {
return id;
}
public String getContent() {
return content;
}
public LocalDateTime getTime() {
return time;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Comment comment = (Comment) o;
return id == comment.id;
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@Override
public String toString() {
return "Comment{" +
"id=" + id +
", content='" + content + '\'' +
", time=" + time +
'}';
}
}
|
package io.github.umanking.stack;
import java.util.*;
import java.util.stream.Collectors;
public class FeatureDevelop {
public static void main(String[] args) {
System.out.println(Arrays.toString(
solution(new int[]{93, 30, 55}, new int[]{1, 30, 5})));
}
public static int[] solution(int[] progresses, int[] speeds) {
int[] answer = {};
// 각 작업마다 몇일이 걸릴것인가, 변환한다,
// 위에서 구한 날짜를 가지고, 비교해서 리턴 배열을 만든다.
//이전값이 <= 다음값, 배포 나감
// 이전값 > 다음값이 더 작다면, 배포 안나감 (ount 값 +1 증가.)
Queue<Integer> queue = new LinkedList<>();
// int[] array = new int[progresses.length];
int[] array = new int[progresses.length];
int[] result = new int[progresses.length];
for (int i =0 ; i < progresses.length; i++){
int p = progresses[i];
int s = speeds[i];
int day = getDay(p, s);
queue.offer(day);
array[i] = day;
}
System.out.println(queue);
// 7보다 큰 수가 나올때 까지의 index 총계를 삽입한다.
int size = queue.size();
for (int i = 0; i < size; i++) {
int count = 1;
Integer base = queue.poll();
System.out.println("base = " + base);
for (Integer nextVal : queue) {
System.out.println("nextVal = " + nextVal);
if (base > nextVal) {
System.out.println("카운트 증가 ");
count++;
break;
}else{
break;
}
}
result[i] = count;
}
//이전값이 <= 다음값, 배포 나감
// 이전값 > 다음값이 더 작다면, 배포 안나감 (ount 값 +1 증가.)
return result;
}
private static int getDay(int p, int s){
int n = 1;
// 100같거나 클때까지
// n=1 60, n=2 90 , n=3
while (p + (s * n) < 100){
n++;
}
return n;
}
}
|
@javax.xml.bind.annotation.XmlSchema(namespace = "http://flagservice.big.tuwien.ac.at/")
package ewaMemory.flagService;
|
import java.io.Serializable;
public class BTree
{
private TNode root;
private int t = 2;
private class TNode implements Serializable
{
int keyCount = 0;
boolean leaf = false;
Student[] key = new Student[2*t];
TNode[] ref = new TNode[2*t+1];
}
public void search(String k)
{
search(root, k);
}
private void search(TNode node, String k)
{
int i = 1;
while(i<=node.keyCount && k.compareTo(node.key[i].getUsn())>0)
{
i++;
}
if(i<=node.keyCount && k.compareTo(node.key[i].getUsn()) == 0)
{
System.out.println("USN : " + k + ";CGPA : " + node.key[i].getCgpa());
return;
}
else if(node.leaf)
{
System.out.println("No record found on USN : " + k);
return;
}
else
{
search(node.ref[i], k);
}
}
private void createTree()
{
TNode x = new TNode();
x.leaf = true;
x.keyCount = 0;
root = x;
}
private void splitChild(TNode parent, int pos)
{
TNode nChild = new TNode();
TNode pChild = parent.ref[pos];
nChild.leaf = pChild.leaf;
nChild.keyCount = t-1;
for(int i=1; i<t; i++)
{
nChild.key[i] = pChild.key[i+t];
}
if(!pChild.leaf)
{
for(int i=1; i<=t; i++)
{
nChild.ref[i] = pChild.ref[i+t];
}
}
pChild.keyCount = t-1;
for(int i=parent.keyCount+1; i>pos; i--)
{
parent.ref[i+1] = parent.ref[i];
}
parent.ref[pos+1] = nChild;
for(int i=parent.keyCount; i>=pos; i--)
{
parent.key[i+1] = parent.key[i];
}
parent.key[pos] = pChild.key[t];
parent.keyCount += 1;
}
private void insertNonfull(TNode node, Student k)
{
int i = node.keyCount;
if(node.leaf)
{
while(i>=1 && k.getUsn().compareTo(node.key[i].getUsn())<0)
{
node.key[i+1] = node.key[i];
i = i-1;
}
node.key[i+1] = k;
node.keyCount += 1;
}
else
{
while(i>=1 && k.getUsn().compareTo(node.key[i].getUsn())<0)
{
i = i-1;
}
i = i+1;
if(node.ref[i].keyCount == 2*t-1)
{
splitChild(node, i);
if(k.getUsn().compareTo(node.key[i].getUsn())>0)
{
i = i+1;
}
}
insertNonfull(node.ref[i], k);
}
}
public void insert(Student k)
{
if(root == null)
{
createTree();
}
TNode r = root;
if(r.keyCount == 2*t-1)
{
TNode s = new TNode();
root = s;
s.ref[1] = r;
splitChild(s, 1);
insertNonfull(s, k);
}
else
{
insertNonfull(r, k);
}
}
private void deleteRecursively(TNode node, int i)
{
if(!node.leaf)
{
if(node.ref[i].keyCount > t-1)
{
node.key[i] = node.ref[i].key[node.ref[i].keyCount];
deleteRecursively(node.ref[i], node.ref[i].keyCount);
}
else if(node.ref[i+1].keyCount > t-1)
{
node.key[i] = node.ref[i+1].key[1];
deleteRecursively(node.ref[i], 1);
}
else
{
TNode pChild = node.ref[i];
TNode nChild = node.ref[i+1];
for(int j=1; j<t; j++)
{
pChild.key[t+j] = nChild.key[j];
}
if(!pChild.leaf)
{
for(int j=1; j<=t; j++)
{
pChild.ref[t+j] = nChild.ref[j];
}
}
pChild.key[t] = node.key[i];
pChild.keyCount = 2*t-1;
for(int j=i+1; j<node.keyCount+1; j++)
{
node.ref[j] = node.ref[j+1];
}
for(int j=i; j<node.keyCount; j++)
{
node.key[j] = node.key[j+1];
}
node.keyCount -= 1;
deleteRecursively(node.ref[i], t);
}
}
else
{
while(i<node.keyCount)
{
node.key[i] = node.key[i+1];
}
node.keyCount -= 1;
}
}
private void adjustSubtree(TNode node, int i)
{
if(node.ref[i].keyCount < t)
{
TNode child = node.ref[i];
if(node.ref[i-1] != null && node.ref[i-1].keyCount > t-1)
{
TNode pSibling = node.ref[i-1];
for(int k=child.keyCount; k>=1; k--)
{
child.key[k+1] = child.key[k];
}
for(int k=child.keyCount+1; k>1; k--)
{
child.ref[k+1] = child.ref[k];
}
child.key[1] = node.key[i-1];
node.key[i-1] = pSibling.key[pSibling.keyCount];
child.ref[1] = pSibling.ref[pSibling.keyCount+1];
child.keyCount += 1;
pSibling.keyCount -= 1;
}
else if(node.ref[i+1] != null && node.ref[i+1].keyCount > t-1)
{
TNode nSibling = node.ref[i+1];
child.key[child.keyCount+1] = node.key[i];
node.key[i] = nSibling.key[1];
child.keyCount += 1;
child.ref[child.keyCount+1] = nSibling.ref[1];
for(int k=1; k>nSibling.keyCount; k--)
{
nSibling.key[k] = nSibling.key[k+1];
}
for(int k=1; k>=nSibling.keyCount; k--)
{
nSibling.ref[k] = nSibling.ref[k+1];
}
nSibling.keyCount -= 1;
}
else
{
int k;
if(node.ref[i-1] != null)
{
k = i-1;
}
else k = i+1;
TNode sibling = node.ref[k];
for(int j=1; j<t; j++)
{
child.key[t+j] = sibling.key[j];
}
if(!child.leaf)
{
for(int j=1; j<=t; j++)
{
child.ref[t+j] = sibling.ref[j];
}
}
child.key[t] = node.key[i];
child.keyCount = 2*t-1;
for(int j=i+1; j<node.keyCount+1; j++)
{
node.ref[j] = node.ref[j+1];
}
for(int j=i; j<node.keyCount; j++)
{
node.key[j] = node.key[j+1];
}
node.keyCount -= 1;
}
}
}
private void delete(TNode node, String k)
{
int i = node.keyCount;
while(i>=1 && k.compareTo(node.key[i].getUsn())<0)
{
i--;
}
if(i<=node.keyCount && k.compareTo(node.key[i].getUsn()) == 0)
{
if(node.leaf)
{
while(i<node.keyCount)
{
node.key[i] = node.key[i+1];
i++;
}
node.keyCount -= 1;
}
else
{
deleteRecursively(node, i);
}
}
else if(!node.leaf)
{
i = i+1;
adjustSubtree(node, i);
delete(node.ref[i], k);
}
}
public void delete(String k)
{
delete(root, k);
if(root.keyCount == 0)
{
root = root.ref[1];
}
}
}
|
package Attacks;
import ru.ifmo.se.pokemon.*;
public class BrutalSwing extends PhysicalMove{
public BrutalSwing(){
super(Type.DARK, 60, 100);
}
@Override
protected String describe() {
return "резко разворачивается, чтобы нанести урон хвостом всему, что находится в зоне поражения";
}
}
|
package assemAssist.model.scheduler;
import assemAssist.model.order.OrderVisitor;
import assemAssist.model.order.order.Order;
import assemAssist.model.order.singleTaskOrder.SingleTaskOrder;
import assemAssist.model.order.vehicleOrder.VehicleOrder;
/**
* A class representing an AddToScheduleVisitor. This visitor adds {@link Order}
* s to an appropriate {@link SchedulingAlgorithm}.
*
* @author SWOP Group 3
* @version 3.0
*/
public class AddToScheduleVisitor extends OrderVisitor<Void> {
private SchedulingAlgorithm<VehicleOrder> cars;
private SchedulingAlgorithm<SingleTaskOrder> stps;
/**
* Initialises a new AddToScheduleVisitor with given algorithms.
*
* @param cars
* The VehicleOrders algorithm
* @param stps
* The SingleTaskOrders algorithm
* @throws IllegalArgumentException
* Thrown when one of the supplied arguments is invalid
*/
public AddToScheduleVisitor(SchedulingAlgorithm<VehicleOrder> cars,
SchedulingAlgorithm<SingleTaskOrder> stps) throws IllegalArgumentException {
if (!isValidAlgorithm(cars) || !isValidAlgorithm(stps)) {
throw new IllegalArgumentException("Invalid algorithm");
}
this.cars = cars;
this.stps = stps;
}
/**
* Checks whether or not a given Algorithm of orders is valid.
*
* @param alg
* Algorithm to be checked
* @return True if and only if the given Algorithm is not null
*/
public static boolean isValidAlgorithm(SchedulingAlgorithm<? extends Order> alg) {
return alg != null;
}
/**
* Visit the given vehicle: adds it to the correct Algorithm.
*
* @param vehicle
* VehicleOrder to be added
*/
public Void visit(VehicleOrder vehicle) {
cars.addProcess(vehicle);
return null;
}
/**
* Visit the given singletaskorder: adds it to the correct Algorithm
*
* @param stp
* SingleTaskOrder to be added
*/
public Void visit(SingleTaskOrder stp) {
stps.addProcess(stp);
return null;
}
}
|
/*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*/
package com.cnk.travelogix.date.util;
/**
* Date util Class to verify dates
*/
public class TravelogixDateUtil
{
public boolean validateDate(final String fromDate, final String toDate)
{
if (fromDate.compareTo(toDate) > 0 || fromDate.compareTo(toDate) == 0)
{
return false;
}
return true;
}
}
|
package org.sbbs.app.license.dao;
import java.lang.reflect.Type;
import java.util.Iterator;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.hibernate.validator.internal.metadata.BeanMetaDataManager;
import org.hibernate.validator.internal.metadata.aggregated.BeanMetaData;
import org.hibernate.validator.internal.metadata.core.ConstraintHelper;
import org.hibernate.validator.internal.metadata.core.MetaConstraint;
import org.hibernate.validator.internal.metadata.location.BeanConstraintLocation;
import org.hibernate.validator.internal.metadata.location.MethodConstraintLocation;
import org.junit.Assert;
import org.junit.Test;
import org.sbbs.app.demo.model.DemoEntity;
public class HVDemoEntityTest {
@Test
public void testHv() {
DemoEntity de = new DemoEntity();
de.setIntField( -1 );
de.setStringField( null );
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
Set<ConstraintViolation<DemoEntity>> constraintViolations = validator.validate( de );
Assert.assertEquals( 2, constraintViolations.size() );
// Assert.assertEquals("may not be null", constraintViolations.iterator().next().getMessage());
}
@Test
public void displayDemoVDefine()
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
// factory.
BeanMetaDataManager bm = new BeanMetaDataManager( new ConstraintHelper() );
// Class.forName( "DemoEntity").getClass();
BeanMetaData mata = bm.getBeanMetaData( Class.forName( "org.sbbs.app.demo.model.DemoEntity" ).newInstance().getClass() );
/*
* BeanMetaData mata = bm.getBeanMetaData( DemoEntity.class );
*/
Set<MetaConstraint> dcs = mata.getDirectMetaConstraints();
for ( Iterator iterator = dcs.iterator(); iterator.hasNext(); ) {
MetaConstraint mc = (MetaConstraint) iterator.next();
System.out.println( mc.getElementType().name() );
System.out.println( mc.getLocation().getMember().getName() );
System.out.println( mc.getDescriptor().getAnnotation().annotationType() );
if ( mc.getElementType().name().equals( "FIELD" ) ) {
System.out.println( ( ( (BeanConstraintLocation) mc.getLocation() ).typeOfAnnotatedElement() ) );
Type t = ( (BeanConstraintLocation) mc.getLocation() ).typeOfAnnotatedElement();
System.out.println( t.equals( Integer.class ) );
System.out.println( t.equals( Float.class ) );
}
else {
System.out.println( ( (MethodConstraintLocation) mc.getLocation() ).typeOfAnnotatedElement() );
Type t = ( (MethodConstraintLocation) mc.getLocation() ).typeOfAnnotatedElement();
System.out.println( t.equals( Integer.class ) );
System.out.println( t.equals( Float.class ) );
System.out.println( t.equals( String.class ) );
}
}
Assert.assertNotNull( mata );
}
}
|
package checkedVsUncheckedExceptions;
public class CheckedVsUncheckedExceptions {
public static void main(String[] args) throws Exception {
CheckedVsUncheckedExceptions checkedVsUncheckedExceptions=new CheckedVsUncheckedExceptions();
long time=System.currentTimeMillis();
checkedVsUncheckedExceptions.doJob(10000);
System.out.println(System.currentTimeMillis()-time);
}
public void doJob(long l)throws Exception{
if(l>0){
l--;
doJob(l);
}
}
}
|
package subjects.sample.string;
/**
* @description: 左旋转字符串
* 字符串的左旋转操作是把字符串前面的若干个字符转移到字符串的尾部。请定义一个函数实现字符串左旋转操作的功能。比如,输入字符串"abcdefg"和数字2,
* 该函数将返回左旋转两位得到的结果"cdefgab"。
* <p>
*
* <p>
* 示例 1:
* <p>
* 输入: s = "abcdefg", k = 2
* 输出: "cdefgab"
* 示例 2:
* <p>
* 输入: s = "lrloseumgh", k = 6
* 输出: "umghlrlose"
*
* <p>
* 限制:
* <p>
* 1 <= k < s.length <= 10000
* <p>
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class S58 {
public static String reverseLeftWords(String s, int n) {
return s.substring(n, s.length()) + s.substring(0, n);
}
public static String reverseLeftWords1(String s, int n) {
char[] chars = new char[s.length()];
s.getChars(0, n, chars, s.length() - n);
s.getChars(n, s.length(), chars, 0);
return new String(chars);
}
public static void main(String[] args) {
System.out.println(reverseLeftWords1("abcdefg", 2));
}
}
|
package 多线程.生产者消费者模式.Condition方法;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
//不带打印信息,比较清晰一些
public class proConSimple {
//循环打印abc代码实现中,lock、emptyCondition、fullCondition都是构造函数传参初始化
private static final Lock lock=new ReentrantLock();
private static final Condition emptyCondition=lock.newCondition();
private static final Condition fullCondition=lock.newCondition();
public static class producer extends Thread{
int i=0;
Queue<Integer>queue;
String name;
int maxSize;
public producer(String name, Queue<Integer>queue,int maxSize){
this.name=name;
this.queue=queue;
this.maxSize=maxSize;
}
@Override
public void run(){
while (true){ //注意这里 死循环
lock.lock();
while (queue.size()==maxSize){
try {
fullCondition.await();
}catch (InterruptedException e){
e.printStackTrace();
}
}
queue.offer(i++);
emptyCondition.signalAll();
lock.unlock();
}
}
}
public static class consumer extends Thread{
private Queue<Integer>queue;
String name;
int maxSize;//消费者这个属性没有用
public consumer(String name, Queue<Integer>queue,int maxSize){
this.name=name;
this.maxSize=maxSize;
this.queue=queue;
}
@Override
public void run(){
while (true){
lock.lock();
while (queue.isEmpty()){
System.out.println("队列为空,消费者"+name+" 等待");
try {
emptyCondition.await();
}catch (Exception e){
e.printStackTrace();
}
}
int x=queue.poll();
System.out.println("消费者 "+name+"消费"+x);
fullCondition.signal();
// emptyCondition.signal(); 不写这个也可以
lock.unlock();
try {
Thread.sleep(1000);
}catch (Exception e){
e.printStackTrace();
}
}
}
}
public static void main(String[] args) {
Queue<Integer>queue=new LinkedList<>();
int capcity=5;
Thread producer1=new producer("p1",queue,capcity);
Thread producer2=new producer("p2",queue,capcity);
Thread consumer1=new consumer("c1",queue,capcity);
Thread consumer2=new consumer("c2",queue,capcity);
Thread consumer3=new consumer("c3",queue,capcity);
producer1.start();
producer2.start();
consumer1.start();
consumer2.start();
consumer3.start();
}
}
|
package com.kingcar.rent.pro.adapter.holder;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.kingcar.rent.pro.R;
public class SecondKillBuilder extends BaseHolerBuilder<SecondKillBuilder.ViewHolder>{
public SecondKillBuilder(Context context, ViewGroup parent) {
View view= LayoutInflater.from(context).inflate(R.layout.view_second_kill, parent, false);
viewHolder=new ViewHolder(view);
}
public ViewHolder build(){
return viewHolder;
}
public class ViewHolder extends RecyclerView.ViewHolder{
public ViewHolder(View itemView) {
super(itemView);
init();
}
private void init(){
}
}
}
|
package chapter12.Exercise12_14;
import java.io.File;
import java.util.Scanner;
public class Exercise12_14 {
public static void main(String[] args) throws Exception {
Scanner filePath = new Scanner(System.in);
System.out.println("Enter the file adress");
String adress = filePath.nextLine();
File file = new File(adress);
if (!file.exists()) {
System.out.println("File does not exist");
System.exit(1);
}
double sum = 0;
double length = 0;
try (Scanner input = new Scanner(file);) {
while (input.hasNext()) {
sum += input.nextDouble();
length++;
}
}
System.out.println("File " + file.getName() + "\nThe total is " + sum + "\nThe average is " + sum / length);
}
}
|
interface IFunc<T, R> {
R apply(T t);
}
interface IPred<T> extends IFunc<T, Boolean> {
Boolean apply(T t);
}
interface IList<T> {
// Effect: changes an item according to a given function in this list if it passes the
// predicate
void changeItem(IPred<T> whichOne, IFunc<T, Void> whatToDo);
}
class MtList<T> implements IList<T> {
public void changeItem(IPred<T> whichOne, IFunc<T, Void> whatToDo) {
// TODO Auto-generated method stub
}
}
class ConsList<T> implements IList<T> {
T first;
IList<T> rest;
@Override
public void changeItem(IPred<T> whichOne, IFunc<T, Void> whatToDo) {
if (whichOne.apply(this.first)) {
whatToDo.apply(this.first);
}
else {
this.rest.changeItem(whichOne, whatToDo);
}
}
}
|
package com.decrypt.beeglejobsearch.flow;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.inject.Scope;
/**
* Это аннотация Screen.
* Она понадобится для работы с Flow
* Здесь при помощи рефлексии мы будем получать индетификатор xml ресурса (xml лайаута)
* В текущем контексте ValueObject, KeyObject и Screen это одно и тоже
* Эту аннотацию мы будем добавлять на наши классы-ключи, классы-экраны
*/
@Scope
@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE)
public @interface Screen {
int value();
}
|
package com.qgbase.common.domain;
import com.qgbase.common.enumeration.EnumResultType;
import lombok.Getter;
/**
* 验证结果
*
* @author cuiwei
* @date 2018-5-5
*/
public class BindVerifyResult {
@Getter
private String code;
@Getter
private String msg;
private boolean error;
public static BindVerifyResultBuilder init() {
return new BindVerifyResultBuilder();
}
public boolean hasError() {
return error;
}
private BindVerifyResult() {
}
public static class BindVerifyResultBuilder {
private BindVerifyResult bindVerifyResult;
public BindVerifyResultBuilder() {
bindVerifyResult = new BindVerifyResult();
}
public BindVerifyResultBuilder withMsgAndCode(EnumResultType resultType) {
bindVerifyResult.code = resultType.getCode();
bindVerifyResult.msg = resultType.getMsg();
return this;
}
public BindVerifyResultBuilder withMsgAndCode(String code, String msg) {
bindVerifyResult.code = code;
bindVerifyResult.msg = msg;
return this;
}
public BindVerifyResultBuilder withCode(String code) {
bindVerifyResult.code = code;
return this;
}
public BindVerifyResultBuilder withMsg(String msg) {
bindVerifyResult.msg = msg;
return this;
}
public BindVerifyResultBuilder verifySuccess() {
bindVerifyResult.error = false;
return this;
}
public BindVerifyResultBuilder verifyFiled() {
bindVerifyResult.error = true;
return this;
}
public BindVerifyResult build() {
return bindVerifyResult;
}
}
}
|
package com.bfchengnuo.security.demo.domain;
import lombok.Data;
import java.util.Date;
/**
* @author 冰封承諾Andy
* @date 2019-11-22
*/
@Data
public class RoleAdmin {
/**
* 数据库表主键
*/
private Long id;
/**
* 审计日志,记录条目创建时间,自动赋值,不需要程序员手工赋值
*/
private Date createdTime;
/**
* 角色
*/
private Role role;
/**
* 管理员
*/
private Admin admin;
}
|
package com.innodox.library.repo;
import com.innodox.library.entity.Author;
import com.innodox.library.entity.Book;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface AuthorRepo extends CrudRepository<Author, Long> {
List<Author> findAll();
}
|
package zystudio.cases.dataprocess.db;
import zystudio.mylib.utils.LogUtil;
import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.provider.BaseColumns;
/**
* 这个case用来展示SQLite的转义问题怎么拼,是按照这个弄的
* http://www.2cto.com/database/201212/175598.html 而且发现'
* 在insert时需要转义(''而不用自定义escape符),在like时不需要转义
*
*/
public class CaseLikeEscape {
private static final String TABLE_NAME = "caseEscape";
private static final String CREATE_TEST_TABLE_SQL = "CREATE TABLE IF NOT EXISTS "
+ TABLE_NAME
+ " ( "
+ BaseColumns._ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ " NAME TEXT NOT NULL DEFAULT '',"
+ " VALUE TEXT NOT NULL DEFAULT '' "
+ ")";
private Context mContext;
private static CaseLikeEscape sCase;
public static CaseLikeEscape obtain(Activity act) {
if (sCase == null) {
sCase = new CaseLikeEscape();
sCase.mContext = act;
}
return sCase;
}
public void work() {
createTable();
insertData();
queryCase("%");
LogUtil.log("------------------");
// String str = " '\\%' escape '\' ";
// String str = "\\% escape \\";
String str = "/%";
queryCase(str);
LogUtil.log("------------------");
// 逗号这里发现,在insert的时候必须用''转义,但是在query这里却不用转义..
String douhao = "'";
queryCase(douhao);
}
private void createTable() {
SQLiteDatabase db = DbOpenHelper.getInstance(mContext)
.getWritableDatabase();
db.execSQL(CREATE_TEST_TABLE_SQL);
db.close();
}
private void insertData() {
final String INSERT_SQL_1 = "INSERT INTO " + TABLE_NAME
+ " (NAME,VALUE) VALUES ('%','this is danyin demo')";
final String INSERT_SQL_2 = "INSERT INTO " + TABLE_NAME
+ " (NAME,VALUE) VALUES ('wzy','this is wzy')";
final String INSERT_SQL_3 = "INSERT INTO " + TABLE_NAME
+ " (NAME,VALUE) VALUES ('qq','this is qq case')";
final String INSERT_SQL_4 = "INSERT INTO " + TABLE_NAME
+ " (NAME,VALUE) VALUES ('''','this is douhao case')";
SQLiteDatabase db = DbOpenHelper.getInstance(mContext)
.getWritableDatabase();
db.execSQL(INSERT_SQL_1);
db.execSQL(INSERT_SQL_2);
db.execSQL(INSERT_SQL_3);
db.execSQL(INSERT_SQL_4);
}
private void queryCase(String selectionArgs) {
SQLiteDatabase db = DbOpenHelper.getInstance(mContext)
.getWritableDatabase();
// 最后还是这句话管用了,like 后边的 escape
String selection = "NAME LIKE ? escape '/' ";
Cursor cur = db.query(TABLE_NAME, new String[] { "NAME", "VALUE" },
selection,
new String[] { selectionArgs }, null, null, null);
if (cur != null) {
try {
if (cur.getCount() <= 0) {
LogUtil.log("this query null");
}
while (cur.moveToNext()) {
String name = cur.getString(0);
String value = cur.getString(1);
LogUtil.log(name + "|" + value);
}
} finally {
cur.close();
}
}
}
}
|
package serializabletest;/*
* @author Xingqilin
*
*/
public class Employee implements java.io.Serializable {
private static final long serialVersionUID = -7790488254503454205L;
private String ename;
private String ecoed;
private String eID;
public Employee(String ename, String ecoed, String eID) {
this.ename = ename;
this.ecoed = ecoed;
this.eID = eID;
}
public Employee() {
}
@Override
public String toString() {
return "Employee{" +
"ename='" + ename + '\'' +
", ecoed='" + ecoed + '\'' +
", eID='" + eID + '\'' +
'}';
}
}
|
package pe.gob.trabajo.repository;
import pe.gob.trabajo.domain.Empleador;
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.*;
import java.util.List;
/**
* Spring Data JPA repository for the Empleador entity.
*/
@SuppressWarnings("unused")
@Repository
public interface EmpleadorRepository extends JpaRepository<Empleador, Long> {
@Query("select empleador from Empleador empleador where empleador.nFlgactivo = true")
List<Empleador> findAll_Activos();
@Query("select empleador from Empleador empleador where empleador.pernatural.tipdocident.id=?1 and empleador.pernatural.vNumdoc=?2 and empleador.nFlgactivo = true")
Empleador findEmpleadorPerNaturalByIdentDoc(Long id_tdoc,String ndoc);
@Query("select empleador from Empleador empleador where empleador.perjuridica.tipdocident.id=?1 and empleador.perjuridica.vNumdoc=?2 and empleador.nFlgactivo = true")
Empleador findEmpleadorPerJuridByIdentDoc(Long id_tdoc,String ndoc);
@Query("select empleador from Empleador empleador where empleador.perjuridica.vRazsocial like %?1% and empleador.nFlgactivo = true")
List<Empleador> findEmpleadordByRazsocial(String razsoc);
}
|
package teste;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
public class TesteStream {
public static void main(String[] args) {
List<Curso> cursos = new ArrayList<Curso>();
cursos.add(new Curso("Python", 45));
cursos.add(new Curso("JavaScript", 150));
cursos.add(new Curso("Java 8", 113));
cursos.add(new Curso("C", 55));
cursos.add(new Curso("C#", 66));
cursos.add(new Curso("Cobol", 88));
cursos.add(new Curso("HTML", 95));
System.out.println("************* STREAM 1 *************");
cursos.stream()
.filter(c -> c.getAlunos() >= 60) // where
.map(c -> c.getNome()) // select
.forEach(x -> System.out.print(x + ", ")) // ação
;
System.out.println();
System.out.println("************* STREAM 2 *************");
cursos.stream()
.filter(c -> c.getNome().contains("C"))
.map(Curso::getNome)
.forEach(System.out::println);
System.out.println("************* STREAM 3 *************");
Optional<Integer> optionalStream = cursos.stream()
.filter(c -> c.getAlunos() >= 100)
.map(Curso::getAlunos)
.findFirst();
if (optionalStream.isPresent()) {
System.out.println("Total de Alunos: " + optionalStream.get());
}
System.out.println("************* STREAM 4 *************");
Optional<String> optional2 = cursos.stream()
.filter(c -> c.getNome().contains("Java"))
.map(Curso::getNome)
.findFirst();
if (optional2.isPresent()) {
System.out.println("Curso: " + optional2.get());
}
}
}
class Curso {
private String nome;
private int alunos;
public Curso(String nome, int alunos) {
this.nome = nome;
this.alunos = alunos;
}
public String getNome() {
return nome;
}
public int getAlunos() {
return alunos;
}
}
|
package com.qd.mystudy.sbweb.zmq;
import com.alibaba.fastjson.JSON;
import com.qd.mystudy.sbweb.dao.CallBack;
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMsg;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
/**
* Created by liqingdong on 15/11/9.
*/
public class ZMQREP {
public static void main(String[] args)
{
System.out.println(System.getProperty("user.dir"));
System.out.println(System.getProperty("java.library.path"));
ZContext ctx = new ZContext();
ZMQ.Socket server = ctx.createSocket(ZMQ.REP);
server.bind("tcp://*:5551");
while (true) {
ZMsg msg = ZMsg.recvMsg(server);
{
String obj = new String(msg.getFirst().getData());
System.out.println(JSON.toJSONString(obj));
msg.removeFirst();
}
{
try {
ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(msg.getFirst().getData()));
Object obj = null;
obj = objectInputStream.readObject();
System.out.println(JSON.toJSONString(obj));
msg.removeFirst();
} catch (IOException e) {
e.printStackTrace();
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
{
try {
ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(msg.getFirst().getData()));
CallBack obj = null;
obj = (CallBack) objectInputStream.readObject();
System.out.println(JSON.toJSONString(obj));
obj.callBack(obj.retrieveArgs());
msg.removeFirst();
} catch (IOException e) {
e.printStackTrace();
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
{
try {
ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(msg.getFirst().getData()));
CallBack obj = null;
obj = (CallBack) objectInputStream.readObject();
System.out.println(JSON.toJSONString(obj));
obj.callBack(obj.retrieveArgs());
} catch (IOException e) {
e.printStackTrace();
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
if (msg == null)
break; // Interrupted
msg.send(server);
}
if (Thread.currentThread().isInterrupted())
System.out.printf ("W: interrupted\n");
ctx.destroy();
}
}
|
package ninja.farhood.exercises;
public class Game {
public static void main(String[] args) {
Soldier s = new Soldier(100);
Soldier t = new Soldier(100);
System.out.println(s.getHealth());
s.fight(t);
System.out.println(s.getHealth());
System.out.println(t.getHealth());
System.out.println(s.getHealth());
}
}
|
package com.spring.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.spring.dto.CartDTO;
import com.spring.dto.ShopMemberDTO;
import com.spring.service.CartService;
@Controller
@RequestMapping("/cart")
public class CartController {
@Resource
private CartService cartService;
@RequestMapping(value = "/cart", method = RequestMethod.GET)
public String MyCart(HttpSession session,Model model) throws Exception {
System.out.println("MyCart Session mdto:" + session.getAttribute("mdto"));
String userid = ((ShopMemberDTO)session.getAttribute("mdto")).getUserid();
System.out.println(userid);
if(userid.equals("")) {
return "shop/login";
}else {
List<CartDTO> cartlist = cartService.selectlist(userid);
model.addAttribute("cartlist", cartlist);
return "shop/cart";
}
}
@ResponseBody
@RequestMapping(value="/addCart",method=RequestMethod.POST, produces = "application/text; charset=utf-8")
public String insert(@RequestBody CartDTO cartdto) throws Exception {
System.out.println(cartdto);
cartService.insert(cartdto);
return "장바구니에 추가되었습니다";
}
@RequestMapping(value="/list",method = RequestMethod.GET,produces = "application/text; charset=utf-8")
public String selectList(String userid,Model model) throws Exception {
System.out.println("ordfgdgd"+userid);
List<CartDTO> cartlist = cartService.selectlist(userid);
System.out.println(cartlist);
model.addAttribute("cartlist", cartlist);
return "shop/cart";
}
@ResponseBody
@RequestMapping(value = "/delete",method = RequestMethod.GET)
public Map<String,Integer> delete(int cartnum,String userid,String code,String size, String qty) throws Exception {
cartService.delete(cartnum);
System.out.println("유저아이디"+userid);
int totprice = cartService.totselect(userid);
Map<String, Integer> map = new HashMap<>();
map.put("totprice", totprice);
return map;
}
@RequestMapping(value = "/payment")
public String payment(HttpSession session, String userid,int totprice ,Model model) throws Exception {
List<CartDTO> cartlist = cartService.selectlist(userid);
model.addAttribute("cartlist", cartlist);
model.addAttribute("totprice", totprice);
return "shop/payment";
}
@RequestMapping("/allDelete")
public String allDelete(String userid) throws Exception {
System.out.println("전체삭제:"+ userid);
int cnt = cartService.allDelete(userid);
return "shop/main";
}
}
|
package com.sql.ms3.mavensql;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class LogFileParser {
private FileInputStream stream;
String regex = "(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2}:\\d{2},\\d{3}) \\[(.*)\\] ([^ ]*) +([^ ]*) - (.*)$";
private List<String> s = new ArrayList<>();
public String getResults() {
try {
stream = new FileInputStream("ms3log.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(
stream));
String str;
while ((str = br.readLine()) != null) {
System.out.println(str);
s.add(str);
}
stream.close();
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
Pattern p = Pattern.compile(regex);
for(String string : s ) {
Matcher m = p.matcher(string);
if (m.matches() && m.groupCount() == 6) {
String date = m.group(1);
String time = m.group(2);
String threadId = m.group(3);
String priority = m.group(4);
String category = m.group(5);
String message = m.group(6);
System.out.println("date: " + date);
System.out.println("time: " + time);
System.out.println("threadId: " + threadId);
System.out.println("priority: " + priority);
System.out.println("category: " + category);
System.out.println("message: " + message);
}
}
return null;
}
}
|
package daggerok.account;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import static java.lang.String.format;
@Service
@RequiredArgsConstructor
public class AccountUserDetailsService implements UserDetailsService {
final AccountRepository accountRepository;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return accountRepository.findByUsername(username)
.orElseThrow(() -> new UsernameNotFoundException(format("user '%S' wasn't found.", username)));
}
}
|
package by.epam.concexamples.synchronizer.cyclicbarier;
/**
* Created by Alex on 21.10.2016.
*/
public class Race extends Thread {
@Override
public void run() {
try {
System.out.println("Машина безопасности покидает трассу.");
sleep(3000);
System.out.println("Гонка возобновилась.");
} catch (InterruptedException ex){
ex.printStackTrace();
}
}
}
|
package littleservantmod.profession;
import littleservantmod.api.IServant;
import littleservantmod.entity.EntityLittleServant;
import littleservantmod.entity.ai.EntityAIAttackMelee2;
import littleservantmod.entity.ai.EntityAIEquipShield;
import littleservantmod.entity.ai.EntityAIEquipTool;
import littleservantmod.entity.ai.target.EntityAINearestAttackableTarget2;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntitySilverfish;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityZombie;
public class ProfessionSaber extends ProfessionLSMBase {
@Override
public void initAI(IServant servant) {
super.initAI(servant);
//シールドを持っているときは持ち変える
servant.addAI(200, new EntityAIEquipShield((EntityLittleServant) servant.getEntityInstance()));
//剣を持ち帰る
servant.addAI(200, new EntityAIEquipTool((EntityLittleServant) servant.getEntityInstance(), ServantToolManager.saber));
//攻撃
servant.addAI(500, new EntityAIAttackMelee2((EntityLittleServant) servant.getEntityInstance(), 0.8d, false));
//Target うまい具合に分離したい
servant.addTargetAI(200, new EntityAINearestAttackableTarget2((EntityLittleServant) servant.getEntityInstance(), EntitySpider.class, true));
servant.addTargetAI(200, new EntityAINearestAttackableTarget2((EntityLittleServant) servant.getEntityInstance(), EntityZombie.class, true));
servant.addTargetAI(200, new EntityAINearestAttackableTarget2((EntityLittleServant) servant.getEntityInstance(), EntitySkeleton.class, true));
servant.addTargetAI(200, new EntityAINearestAttackableTarget2((EntityLittleServant) servant.getEntityInstance(), EntitySlime.class, true));
servant.addTargetAI(200, new EntityAINearestAttackableTarget2((EntityLittleServant) servant.getEntityInstance(), EntityMagmaCube.class, true));
servant.addTargetAI(200, new EntityAINearestAttackableTarget2((EntityLittleServant) servant.getEntityInstance(), EntitySilverfish.class, true));
}
@Override
public boolean hasOption(IServant servant) {
return true;
}
}
|
package com.sysh.entity.helpmea;
import java.io.Serializable;
import java.math.BigDecimal;
public class EmploymentDD implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ID
*
* @mbg.generated
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOY_NAME
*
* @mbg.generated
*/
private String employName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ID_NUMBER
*
* @mbg.generated
*/
private String idNumber;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.REGISTERED_RESIDENCE
*
* @mbg.generated
*/
private String registeredResidence;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.SEX
*
* @mbg.generated
*/
private String sex;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.AGE
*
* @mbg.generated
*/
private String age;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.NATION
*
* @mbg.generated
*/
private String nation;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.POLITICAL_OUTLOOK
*
* @mbg.generated
*/
private String politicalOutlook;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.DEGREE_EDUCATION
*
* @mbg.generated
*/
private String degreeEducation;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.HEALTH
*
* @mbg.generated
*/
private String health;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.LABOR_SKILLS
*
* @mbg.generated
*/
private String laborSkills;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.POVERTY_NAME
*
* @mbg.generated
*/
private String povertyName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.MAJORCAUSE
*
* @mbg.generated
*/
private String majorcause;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.MOBILE
*
* @mbg.generated
*/
private String mobile;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_STUDENT
*
* @mbg.generated
*/
private String isStudent;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.FORM_EMPLOYMENT
*
* @mbg.generated
*/
private String formEmployment;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.REGION_EMPLOYMENT
*
* @mbg.generated
*/
private String regionEmployment;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.PLACE_EMPLOYMENT
*
* @mbg.generated
*/
private String placeEmployment;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_WORK
*
* @mbg.generated
*/
private String employmentWork;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_TIME
*
* @mbg.generated
*/
private String employmentTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.SIGNCONTRACT
*
* @mbg.generated
*/
private String signcontract;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_SOCIAL_INSURANCE
*
* @mbg.generated
*/
private String isSocialInsurance;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.MONTHLY_AVERAGE_WAGE
*
* @mbg.generated
*/
private BigDecimal monthlyAverageWage;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.POST_TYPE
*
* @mbg.generated
*/
private String postType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.POST_ADDRESS
*
* @mbg.generated
*/
private String postAddress;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.POST_TYPE_COMPANY
*
* @mbg.generated
*/
private String postTypeCompany;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.RESETTLEMENT_TIME
*
* @mbg.generated
*/
private String resettlementTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.POST_NAME
*
* @mbg.generated
*/
private String postName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.VOCATIONAL_TRAINING
*
* @mbg.generated
*/
private String vocationalTraining;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.TRAIN_TYPE
*
* @mbg.generated
*/
private String trainType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.TRAIN_START_TIME
*
* @mbg.generated
*/
private String trainStartTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.TRAIN_STOP_TIME
*
* @mbg.generated
*/
private String trainStopTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.TRAINING_CATEGORY
*
* @mbg.generated
*/
private String trainingCategory;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.OBTAIN_A_CERTIFICATE
*
* @mbg.generated
*/
private String obtainACertificate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.TRAINING_SUBSIDY
*
* @mbg.generated
*/
private BigDecimal trainingSubsidy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_OBTAIN_EMPLOYMENT
*
* @mbg.generated
*/
private String isObtainEmployment;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.START_TIME
*
* @mbg.generated
*/
private String startTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_TRAIN_ENTREPRENEURSHIP
*
* @mbg.generated
*/
private String isTrainEntrepreneurship;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_TYPE
*
* @mbg.generated
*/
private String entrepreneurshipType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_ADDRESS
*
* @mbg.generated
*/
private String entrepreneurshipAddress;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_NAME
*
* @mbg.generated
*/
private String entrepreneurshipName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.INDUSTRY_CATEGORY
*
* @mbg.generated
*/
private String industryCategory;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_MICROFINANCE
*
* @mbg.generated
*/
private String isMicrofinance;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.LOAN_AMOUNT
*
* @mbg.generated
*/
private BigDecimal loanAmount;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.LABOR_FORCE
*
* @mbg.generated
*/
private Long laborForce;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_REGISTER
*
* @mbg.generated
*/
private String isRegister;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.IS_EMPLOYMENT_DESIRE
*
* @mbg.generated
*/
private String isEmploymentDesire;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_INTENTION
*
* @mbg.generated
*/
private String employmentIntention;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.SALARY_EXPECTATION
*
* @mbg.generated
*/
private BigDecimal salaryExpectation;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_SERVICE_DEMAND
*
* @mbg.generated
*/
private String employmentServiceDemand;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_CONSULTATION
*
* @mbg.generated
*/
private Long employmentConsultation;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_INFO
*
* @mbg.generated
*/
private Long employmentInfo;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.EMPLOYMENT_GUIDANCE
*
* @mbg.generated
*/
private Long employmentGuidance;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.NUMBER_OF_TRAINING
*
* @mbg.generated
*/
private Long numberOfTraining;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ENTREPRENEURIAL_SERVICE
*
* @mbg.generated
*/
private Long entrepreneurialService;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.CAREER_INTRODUCTION
*
* @mbg.generated
*/
private String careerIntroduction;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.SOCIAL_INSURANCE
*
* @mbg.generated
*/
private String socialInsurance;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ENJOY_POST_SUBSIDIES
*
* @mbg.generated
*/
private String enjoyPostSubsidies;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.OTHER_POLICIES
*
* @mbg.generated
*/
private String otherPolicies;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TBL_EMPLOYMENT.ZONE_YEAR
*
* @mbg.generated
*/
private Long zoneYear;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TBL_EMPLOYMENT
*
* @mbg.generated
*/
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ID
*
* @return the value of TBL_EMPLOYMENT.ID
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ID
*
* @param id the value for TBL_EMPLOYMENT.ID
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOY_NAME
*
* @return the value of TBL_EMPLOYMENT.EMPLOY_NAME
*
* @mbg.generated
*/
public String getEmployName() {
return employName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOY_NAME
*
* @param employName the value for TBL_EMPLOYMENT.EMPLOY_NAME
*
* @mbg.generated
*/
public void setEmployName(String employName) {
this.employName = employName == null ? null : employName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ID_NUMBER
*
* @return the value of TBL_EMPLOYMENT.ID_NUMBER
*
* @mbg.generated
*/
public String getIdNumber() {
return idNumber;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ID_NUMBER
*
* @param idNumber the value for TBL_EMPLOYMENT.ID_NUMBER
*
* @mbg.generated
*/
public void setIdNumber(String idNumber) {
this.idNumber = idNumber == null ? null : idNumber.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.REGISTERED_RESIDENCE
*
* @return the value of TBL_EMPLOYMENT.REGISTERED_RESIDENCE
*
* @mbg.generated
*/
public String getRegisteredResidence() {
return registeredResidence;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.REGISTERED_RESIDENCE
*
* @param registeredResidence the value for TBL_EMPLOYMENT.REGISTERED_RESIDENCE
*
* @mbg.generated
*/
public void setRegisteredResidence(String registeredResidence) {
this.registeredResidence = registeredResidence == null ? null : registeredResidence.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.SEX
*
* @return the value of TBL_EMPLOYMENT.SEX
*
* @mbg.generated
*/
public String getSex() {
return sex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.SEX
*
* @param sex the value for TBL_EMPLOYMENT.SEX
*
* @mbg.generated
*/
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.AGE
*
* @return the value of TBL_EMPLOYMENT.AGE
*
* @mbg.generated
*/
public String getAge() {
return age;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.AGE
*
* @param age the value for TBL_EMPLOYMENT.AGE
*
* @mbg.generated
*/
public void setAge(String age) {
this.age = age == null ? null : age.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.NATION
*
* @return the value of TBL_EMPLOYMENT.NATION
*
* @mbg.generated
*/
public String getNation() {
return nation;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.NATION
*
* @param nation the value for TBL_EMPLOYMENT.NATION
*
* @mbg.generated
*/
public void setNation(String nation) {
this.nation = nation == null ? null : nation.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.POLITICAL_OUTLOOK
*
* @return the value of TBL_EMPLOYMENT.POLITICAL_OUTLOOK
*
* @mbg.generated
*/
public String getPoliticalOutlook() {
return politicalOutlook;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.POLITICAL_OUTLOOK
*
* @param politicalOutlook the value for TBL_EMPLOYMENT.POLITICAL_OUTLOOK
*
* @mbg.generated
*/
public void setPoliticalOutlook(String politicalOutlook) {
this.politicalOutlook = politicalOutlook == null ? null : politicalOutlook.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.DEGREE_EDUCATION
*
* @return the value of TBL_EMPLOYMENT.DEGREE_EDUCATION
*
* @mbg.generated
*/
public String getDegreeEducation() {
return degreeEducation;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.DEGREE_EDUCATION
*
* @param degreeEducation the value for TBL_EMPLOYMENT.DEGREE_EDUCATION
*
* @mbg.generated
*/
public void setDegreeEducation(String degreeEducation) {
this.degreeEducation = degreeEducation == null ? null : degreeEducation.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.HEALTH
*
* @return the value of TBL_EMPLOYMENT.HEALTH
*
* @mbg.generated
*/
public String getHealth() {
return health;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.HEALTH
*
* @param health the value for TBL_EMPLOYMENT.HEALTH
*
* @mbg.generated
*/
public void setHealth(String health) {
this.health = health == null ? null : health.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.LABOR_SKILLS
*
* @return the value of TBL_EMPLOYMENT.LABOR_SKILLS
*
* @mbg.generated
*/
public String getLaborSkills() {
return laborSkills;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.LABOR_SKILLS
*
* @param laborSkills the value for TBL_EMPLOYMENT.LABOR_SKILLS
*
* @mbg.generated
*/
public void setLaborSkills(String laborSkills) {
this.laborSkills = laborSkills == null ? null : laborSkills.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.POVERTY_NAME
*
* @return the value of TBL_EMPLOYMENT.POVERTY_NAME
*
* @mbg.generated
*/
public String getPovertyName() {
return povertyName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.POVERTY_NAME
*
* @param povertyName the value for TBL_EMPLOYMENT.POVERTY_NAME
*
* @mbg.generated
*/
public void setPovertyName(String povertyName) {
this.povertyName = povertyName == null ? null : povertyName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.MAJORCAUSE
*
* @return the value of TBL_EMPLOYMENT.MAJORCAUSE
*
* @mbg.generated
*/
public String getMajorcause() {
return majorcause;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.MAJORCAUSE
*
* @param majorcause the value for TBL_EMPLOYMENT.MAJORCAUSE
*
* @mbg.generated
*/
public void setMajorcause(String majorcause) {
this.majorcause = majorcause == null ? null : majorcause.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.MOBILE
*
* @return the value of TBL_EMPLOYMENT.MOBILE
*
* @mbg.generated
*/
public String getMobile() {
return mobile;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.MOBILE
*
* @param mobile the value for TBL_EMPLOYMENT.MOBILE
*
* @mbg.generated
*/
public void setMobile(String mobile) {
this.mobile = mobile == null ? null : mobile.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_STUDENT
*
* @return the value of TBL_EMPLOYMENT.IS_STUDENT
*
* @mbg.generated
*/
public String getIsStudent() {
return isStudent;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_STUDENT
*
* @param isStudent the value for TBL_EMPLOYMENT.IS_STUDENT
*
* @mbg.generated
*/
public void setIsStudent(String isStudent) {
this.isStudent = isStudent == null ? null : isStudent.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.FORM_EMPLOYMENT
*
* @return the value of TBL_EMPLOYMENT.FORM_EMPLOYMENT
*
* @mbg.generated
*/
public String getFormEmployment() {
return formEmployment;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.FORM_EMPLOYMENT
*
* @param formEmployment the value for TBL_EMPLOYMENT.FORM_EMPLOYMENT
*
* @mbg.generated
*/
public void setFormEmployment(String formEmployment) {
this.formEmployment = formEmployment == null ? null : formEmployment.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.REGION_EMPLOYMENT
*
* @return the value of TBL_EMPLOYMENT.REGION_EMPLOYMENT
*
* @mbg.generated
*/
public String getRegionEmployment() {
return regionEmployment;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.REGION_EMPLOYMENT
*
* @param regionEmployment the value for TBL_EMPLOYMENT.REGION_EMPLOYMENT
*
* @mbg.generated
*/
public void setRegionEmployment(String regionEmployment) {
this.regionEmployment = regionEmployment == null ? null : regionEmployment.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.PLACE_EMPLOYMENT
*
* @return the value of TBL_EMPLOYMENT.PLACE_EMPLOYMENT
*
* @mbg.generated
*/
public String getPlaceEmployment() {
return placeEmployment;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.PLACE_EMPLOYMENT
*
* @param placeEmployment the value for TBL_EMPLOYMENT.PLACE_EMPLOYMENT
*
* @mbg.generated
*/
public void setPlaceEmployment(String placeEmployment) {
this.placeEmployment = placeEmployment == null ? null : placeEmployment.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_WORK
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_WORK
*
* @mbg.generated
*/
public String getEmploymentWork() {
return employmentWork;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_WORK
*
* @param employmentWork the value for TBL_EMPLOYMENT.EMPLOYMENT_WORK
*
* @mbg.generated
*/
public void setEmploymentWork(String employmentWork) {
this.employmentWork = employmentWork == null ? null : employmentWork.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_TIME
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_TIME
*
* @mbg.generated
*/
public String getEmploymentTime() {
return employmentTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_TIME
*
* @param employmentTime the value for TBL_EMPLOYMENT.EMPLOYMENT_TIME
*
* @mbg.generated
*/
public void setEmploymentTime(String employmentTime) {
this.employmentTime = employmentTime == null ? null : employmentTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.SIGNCONTRACT
*
* @return the value of TBL_EMPLOYMENT.SIGNCONTRACT
*
* @mbg.generated
*/
public String getSigncontract() {
return signcontract;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.SIGNCONTRACT
*
* @param signcontract the value for TBL_EMPLOYMENT.SIGNCONTRACT
*
* @mbg.generated
*/
public void setSigncontract(String signcontract) {
this.signcontract = signcontract == null ? null : signcontract.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_SOCIAL_INSURANCE
*
* @return the value of TBL_EMPLOYMENT.IS_SOCIAL_INSURANCE
*
* @mbg.generated
*/
public String getIsSocialInsurance() {
return isSocialInsurance;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_SOCIAL_INSURANCE
*
* @param isSocialInsurance the value for TBL_EMPLOYMENT.IS_SOCIAL_INSURANCE
*
* @mbg.generated
*/
public void setIsSocialInsurance(String isSocialInsurance) {
this.isSocialInsurance = isSocialInsurance == null ? null : isSocialInsurance.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.MONTHLY_AVERAGE_WAGE
*
* @return the value of TBL_EMPLOYMENT.MONTHLY_AVERAGE_WAGE
*
* @mbg.generated
*/
public BigDecimal getMonthlyAverageWage() {
return monthlyAverageWage;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.MONTHLY_AVERAGE_WAGE
*
* @param monthlyAverageWage the value for TBL_EMPLOYMENT.MONTHLY_AVERAGE_WAGE
*
* @mbg.generated
*/
public void setMonthlyAverageWage(BigDecimal monthlyAverageWage) {
this.monthlyAverageWage = monthlyAverageWage;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.POST_TYPE
*
* @return the value of TBL_EMPLOYMENT.POST_TYPE
*
* @mbg.generated
*/
public String getPostType() {
return postType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.POST_TYPE
*
* @param postType the value for TBL_EMPLOYMENT.POST_TYPE
*
* @mbg.generated
*/
public void setPostType(String postType) {
this.postType = postType == null ? null : postType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.POST_ADDRESS
*
* @return the value of TBL_EMPLOYMENT.POST_ADDRESS
*
* @mbg.generated
*/
public String getPostAddress() {
return postAddress;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.POST_ADDRESS
*
* @param postAddress the value for TBL_EMPLOYMENT.POST_ADDRESS
*
* @mbg.generated
*/
public void setPostAddress(String postAddress) {
this.postAddress = postAddress == null ? null : postAddress.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.POST_TYPE_COMPANY
*
* @return the value of TBL_EMPLOYMENT.POST_TYPE_COMPANY
*
* @mbg.generated
*/
public String getPostTypeCompany() {
return postTypeCompany;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.POST_TYPE_COMPANY
*
* @param postTypeCompany the value for TBL_EMPLOYMENT.POST_TYPE_COMPANY
*
* @mbg.generated
*/
public void setPostTypeCompany(String postTypeCompany) {
this.postTypeCompany = postTypeCompany == null ? null : postTypeCompany.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.RESETTLEMENT_TIME
*
* @return the value of TBL_EMPLOYMENT.RESETTLEMENT_TIME
*
* @mbg.generated
*/
public String getResettlementTime() {
return resettlementTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.RESETTLEMENT_TIME
*
* @param resettlementTime the value for TBL_EMPLOYMENT.RESETTLEMENT_TIME
*
* @mbg.generated
*/
public void setResettlementTime(String resettlementTime) {
this.resettlementTime = resettlementTime == null ? null : resettlementTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.POST_NAME
*
* @return the value of TBL_EMPLOYMENT.POST_NAME
*
* @mbg.generated
*/
public String getPostName() {
return postName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.POST_NAME
*
* @param postName the value for TBL_EMPLOYMENT.POST_NAME
*
* @mbg.generated
*/
public void setPostName(String postName) {
this.postName = postName == null ? null : postName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.VOCATIONAL_TRAINING
*
* @return the value of TBL_EMPLOYMENT.VOCATIONAL_TRAINING
*
* @mbg.generated
*/
public String getVocationalTraining() {
return vocationalTraining;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.VOCATIONAL_TRAINING
*
* @param vocationalTraining the value for TBL_EMPLOYMENT.VOCATIONAL_TRAINING
*
* @mbg.generated
*/
public void setVocationalTraining(String vocationalTraining) {
this.vocationalTraining = vocationalTraining == null ? null : vocationalTraining.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.TRAIN_TYPE
*
* @return the value of TBL_EMPLOYMENT.TRAIN_TYPE
*
* @mbg.generated
*/
public String getTrainType() {
return trainType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.TRAIN_TYPE
*
* @param trainType the value for TBL_EMPLOYMENT.TRAIN_TYPE
*
* @mbg.generated
*/
public void setTrainType(String trainType) {
this.trainType = trainType == null ? null : trainType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.TRAIN_START_TIME
*
* @return the value of TBL_EMPLOYMENT.TRAIN_START_TIME
*
* @mbg.generated
*/
public String getTrainStartTime() {
return trainStartTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.TRAIN_START_TIME
*
* @param trainStartTime the value for TBL_EMPLOYMENT.TRAIN_START_TIME
*
* @mbg.generated
*/
public void setTrainStartTime(String trainStartTime) {
this.trainStartTime = trainStartTime == null ? null : trainStartTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.TRAIN_STOP_TIME
*
* @return the value of TBL_EMPLOYMENT.TRAIN_STOP_TIME
*
* @mbg.generated
*/
public String getTrainStopTime() {
return trainStopTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.TRAIN_STOP_TIME
*
* @param trainStopTime the value for TBL_EMPLOYMENT.TRAIN_STOP_TIME
*
* @mbg.generated
*/
public void setTrainStopTime(String trainStopTime) {
this.trainStopTime = trainStopTime == null ? null : trainStopTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.TRAINING_CATEGORY
*
* @return the value of TBL_EMPLOYMENT.TRAINING_CATEGORY
*
* @mbg.generated
*/
public String getTrainingCategory() {
return trainingCategory;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.TRAINING_CATEGORY
*
* @param trainingCategory the value for TBL_EMPLOYMENT.TRAINING_CATEGORY
*
* @mbg.generated
*/
public void setTrainingCategory(String trainingCategory) {
this.trainingCategory = trainingCategory == null ? null : trainingCategory.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.OBTAIN_A_CERTIFICATE
*
* @return the value of TBL_EMPLOYMENT.OBTAIN_A_CERTIFICATE
*
* @mbg.generated
*/
public String getObtainACertificate() {
return obtainACertificate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.OBTAIN_A_CERTIFICATE
*
* @param obtainACertificate the value for TBL_EMPLOYMENT.OBTAIN_A_CERTIFICATE
*
* @mbg.generated
*/
public void setObtainACertificate(String obtainACertificate) {
this.obtainACertificate = obtainACertificate == null ? null : obtainACertificate.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.TRAINING_SUBSIDY
*
* @return the value of TBL_EMPLOYMENT.TRAINING_SUBSIDY
*
* @mbg.generated
*/
public BigDecimal getTrainingSubsidy() {
return trainingSubsidy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.TRAINING_SUBSIDY
*
* @param trainingSubsidy the value for TBL_EMPLOYMENT.TRAINING_SUBSIDY
*
* @mbg.generated
*/
public void setTrainingSubsidy(BigDecimal trainingSubsidy) {
this.trainingSubsidy = trainingSubsidy;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_OBTAIN_EMPLOYMENT
*
* @return the value of TBL_EMPLOYMENT.IS_OBTAIN_EMPLOYMENT
*
* @mbg.generated
*/
public String getIsObtainEmployment() {
return isObtainEmployment;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_OBTAIN_EMPLOYMENT
*
* @param isObtainEmployment the value for TBL_EMPLOYMENT.IS_OBTAIN_EMPLOYMENT
*
* @mbg.generated
*/
public void setIsObtainEmployment(String isObtainEmployment) {
this.isObtainEmployment = isObtainEmployment == null ? null : isObtainEmployment.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.START_TIME
*
* @return the value of TBL_EMPLOYMENT.START_TIME
*
* @mbg.generated
*/
public String getStartTime() {
return startTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.START_TIME
*
* @param startTime the value for TBL_EMPLOYMENT.START_TIME
*
* @mbg.generated
*/
public void setStartTime(String startTime) {
this.startTime = startTime == null ? null : startTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_TRAIN_ENTREPRENEURSHIP
*
* @return the value of TBL_EMPLOYMENT.IS_TRAIN_ENTREPRENEURSHIP
*
* @mbg.generated
*/
public String getIsTrainEntrepreneurship() {
return isTrainEntrepreneurship;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_TRAIN_ENTREPRENEURSHIP
*
* @param isTrainEntrepreneurship the value for TBL_EMPLOYMENT.IS_TRAIN_ENTREPRENEURSHIP
*
* @mbg.generated
*/
public void setIsTrainEntrepreneurship(String isTrainEntrepreneurship) {
this.isTrainEntrepreneurship = isTrainEntrepreneurship == null ? null : isTrainEntrepreneurship.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_TYPE
*
* @return the value of TBL_EMPLOYMENT.ENTREPRENEURSHIP_TYPE
*
* @mbg.generated
*/
public String getEntrepreneurshipType() {
return entrepreneurshipType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_TYPE
*
* @param entrepreneurshipType the value for TBL_EMPLOYMENT.ENTREPRENEURSHIP_TYPE
*
* @mbg.generated
*/
public void setEntrepreneurshipType(String entrepreneurshipType) {
this.entrepreneurshipType = entrepreneurshipType == null ? null : entrepreneurshipType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_ADDRESS
*
* @return the value of TBL_EMPLOYMENT.ENTREPRENEURSHIP_ADDRESS
*
* @mbg.generated
*/
public String getEntrepreneurshipAddress() {
return entrepreneurshipAddress;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_ADDRESS
*
* @param entrepreneurshipAddress the value for TBL_EMPLOYMENT.ENTREPRENEURSHIP_ADDRESS
*
* @mbg.generated
*/
public void setEntrepreneurshipAddress(String entrepreneurshipAddress) {
this.entrepreneurshipAddress = entrepreneurshipAddress == null ? null : entrepreneurshipAddress.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_NAME
*
* @return the value of TBL_EMPLOYMENT.ENTREPRENEURSHIP_NAME
*
* @mbg.generated
*/
public String getEntrepreneurshipName() {
return entrepreneurshipName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ENTREPRENEURSHIP_NAME
*
* @param entrepreneurshipName the value for TBL_EMPLOYMENT.ENTREPRENEURSHIP_NAME
*
* @mbg.generated
*/
public void setEntrepreneurshipName(String entrepreneurshipName) {
this.entrepreneurshipName = entrepreneurshipName == null ? null : entrepreneurshipName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.INDUSTRY_CATEGORY
*
* @return the value of TBL_EMPLOYMENT.INDUSTRY_CATEGORY
*
* @mbg.generated
*/
public String getIndustryCategory() {
return industryCategory;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.INDUSTRY_CATEGORY
*
* @param industryCategory the value for TBL_EMPLOYMENT.INDUSTRY_CATEGORY
*
* @mbg.generated
*/
public void setIndustryCategory(String industryCategory) {
this.industryCategory = industryCategory == null ? null : industryCategory.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_MICROFINANCE
*
* @return the value of TBL_EMPLOYMENT.IS_MICROFINANCE
*
* @mbg.generated
*/
public String getIsMicrofinance() {
return isMicrofinance;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_MICROFINANCE
*
* @param isMicrofinance the value for TBL_EMPLOYMENT.IS_MICROFINANCE
*
* @mbg.generated
*/
public void setIsMicrofinance(String isMicrofinance) {
this.isMicrofinance = isMicrofinance == null ? null : isMicrofinance.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.LOAN_AMOUNT
*
* @return the value of TBL_EMPLOYMENT.LOAN_AMOUNT
*
* @mbg.generated
*/
public BigDecimal getLoanAmount() {
return loanAmount;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.LOAN_AMOUNT
*
* @param loanAmount the value for TBL_EMPLOYMENT.LOAN_AMOUNT
*
* @mbg.generated
*/
public void setLoanAmount(BigDecimal loanAmount) {
this.loanAmount = loanAmount;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.LABOR_FORCE
*
* @return the value of TBL_EMPLOYMENT.LABOR_FORCE
*
* @mbg.generated
*/
public Long getLaborForce() {
return laborForce;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.LABOR_FORCE
*
* @param laborForce the value for TBL_EMPLOYMENT.LABOR_FORCE
*
* @mbg.generated
*/
public void setLaborForce(Long laborForce) {
this.laborForce = laborForce;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_REGISTER
*
* @return the value of TBL_EMPLOYMENT.IS_REGISTER
*
* @mbg.generated
*/
public String getIsRegister() {
return isRegister;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_REGISTER
*
* @param isRegister the value for TBL_EMPLOYMENT.IS_REGISTER
*
* @mbg.generated
*/
public void setIsRegister(String isRegister) {
this.isRegister = isRegister == null ? null : isRegister.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.IS_EMPLOYMENT_DESIRE
*
* @return the value of TBL_EMPLOYMENT.IS_EMPLOYMENT_DESIRE
*
* @mbg.generated
*/
public String getIsEmploymentDesire() {
return isEmploymentDesire;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.IS_EMPLOYMENT_DESIRE
*
* @param isEmploymentDesire the value for TBL_EMPLOYMENT.IS_EMPLOYMENT_DESIRE
*
* @mbg.generated
*/
public void setIsEmploymentDesire(String isEmploymentDesire) {
this.isEmploymentDesire = isEmploymentDesire == null ? null : isEmploymentDesire.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_INTENTION
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_INTENTION
*
* @mbg.generated
*/
public String getEmploymentIntention() {
return employmentIntention;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_INTENTION
*
* @param employmentIntention the value for TBL_EMPLOYMENT.EMPLOYMENT_INTENTION
*
* @mbg.generated
*/
public void setEmploymentIntention(String employmentIntention) {
this.employmentIntention = employmentIntention == null ? null : employmentIntention.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.SALARY_EXPECTATION
*
* @return the value of TBL_EMPLOYMENT.SALARY_EXPECTATION
*
* @mbg.generated
*/
public BigDecimal getSalaryExpectation() {
return salaryExpectation;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.SALARY_EXPECTATION
*
* @param salaryExpectation the value for TBL_EMPLOYMENT.SALARY_EXPECTATION
*
* @mbg.generated
*/
public void setSalaryExpectation(BigDecimal salaryExpectation) {
this.salaryExpectation = salaryExpectation;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_SERVICE_DEMAND
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_SERVICE_DEMAND
*
* @mbg.generated
*/
public String getEmploymentServiceDemand() {
return employmentServiceDemand;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_SERVICE_DEMAND
*
* @param employmentServiceDemand the value for TBL_EMPLOYMENT.EMPLOYMENT_SERVICE_DEMAND
*
* @mbg.generated
*/
public void setEmploymentServiceDemand(String employmentServiceDemand) {
this.employmentServiceDemand = employmentServiceDemand == null ? null : employmentServiceDemand.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_CONSULTATION
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_CONSULTATION
*
* @mbg.generated
*/
public Long getEmploymentConsultation() {
return employmentConsultation;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_CONSULTATION
*
* @param employmentConsultation the value for TBL_EMPLOYMENT.EMPLOYMENT_CONSULTATION
*
* @mbg.generated
*/
public void setEmploymentConsultation(Long employmentConsultation) {
this.employmentConsultation = employmentConsultation;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_INFO
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_INFO
*
* @mbg.generated
*/
public Long getEmploymentInfo() {
return employmentInfo;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_INFO
*
* @param employmentInfo the value for TBL_EMPLOYMENT.EMPLOYMENT_INFO
*
* @mbg.generated
*/
public void setEmploymentInfo(Long employmentInfo) {
this.employmentInfo = employmentInfo;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_GUIDANCE
*
* @return the value of TBL_EMPLOYMENT.EMPLOYMENT_GUIDANCE
*
* @mbg.generated
*/
public Long getEmploymentGuidance() {
return employmentGuidance;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.EMPLOYMENT_GUIDANCE
*
* @param employmentGuidance the value for TBL_EMPLOYMENT.EMPLOYMENT_GUIDANCE
*
* @mbg.generated
*/
public void setEmploymentGuidance(Long employmentGuidance) {
this.employmentGuidance = employmentGuidance;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.NUMBER_OF_TRAINING
*
* @return the value of TBL_EMPLOYMENT.NUMBER_OF_TRAINING
*
* @mbg.generated
*/
public Long getNumberOfTraining() {
return numberOfTraining;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.NUMBER_OF_TRAINING
*
* @param numberOfTraining the value for TBL_EMPLOYMENT.NUMBER_OF_TRAINING
*
* @mbg.generated
*/
public void setNumberOfTraining(Long numberOfTraining) {
this.numberOfTraining = numberOfTraining;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ENTREPRENEURIAL_SERVICE
*
* @return the value of TBL_EMPLOYMENT.ENTREPRENEURIAL_SERVICE
*
* @mbg.generated
*/
public Long getEntrepreneurialService() {
return entrepreneurialService;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ENTREPRENEURIAL_SERVICE
*
* @param entrepreneurialService the value for TBL_EMPLOYMENT.ENTREPRENEURIAL_SERVICE
*
* @mbg.generated
*/
public void setEntrepreneurialService(Long entrepreneurialService) {
this.entrepreneurialService = entrepreneurialService;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.CAREER_INTRODUCTION
*
* @return the value of TBL_EMPLOYMENT.CAREER_INTRODUCTION
*
* @mbg.generated
*/
public String getCareerIntroduction() {
return careerIntroduction;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.CAREER_INTRODUCTION
*
* @param careerIntroduction the value for TBL_EMPLOYMENT.CAREER_INTRODUCTION
*
* @mbg.generated
*/
public void setCareerIntroduction(String careerIntroduction) {
this.careerIntroduction = careerIntroduction == null ? null : careerIntroduction.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.SOCIAL_INSURANCE
*
* @return the value of TBL_EMPLOYMENT.SOCIAL_INSURANCE
*
* @mbg.generated
*/
public String getSocialInsurance() {
return socialInsurance;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.SOCIAL_INSURANCE
*
* @param socialInsurance the value for TBL_EMPLOYMENT.SOCIAL_INSURANCE
*
* @mbg.generated
*/
public void setSocialInsurance(String socialInsurance) {
this.socialInsurance = socialInsurance == null ? null : socialInsurance.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ENJOY_POST_SUBSIDIES
*
* @return the value of TBL_EMPLOYMENT.ENJOY_POST_SUBSIDIES
*
* @mbg.generated
*/
public String getEnjoyPostSubsidies() {
return enjoyPostSubsidies;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ENJOY_POST_SUBSIDIES
*
* @param enjoyPostSubsidies the value for TBL_EMPLOYMENT.ENJOY_POST_SUBSIDIES
*
* @mbg.generated
*/
public void setEnjoyPostSubsidies(String enjoyPostSubsidies) {
this.enjoyPostSubsidies = enjoyPostSubsidies == null ? null : enjoyPostSubsidies.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.OTHER_POLICIES
*
* @return the value of TBL_EMPLOYMENT.OTHER_POLICIES
*
* @mbg.generated
*/
public String getOtherPolicies() {
return otherPolicies;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.OTHER_POLICIES
*
* @param otherPolicies the value for TBL_EMPLOYMENT.OTHER_POLICIES
*
* @mbg.generated
*/
public void setOtherPolicies(String otherPolicies) {
this.otherPolicies = otherPolicies == null ? null : otherPolicies.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TBL_EMPLOYMENT.ZONE_YEAR
*
* @return the value of TBL_EMPLOYMENT.ZONE_YEAR
*
* @mbg.generated
*/
public Long getZoneYear() {
return zoneYear;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TBL_EMPLOYMENT.ZONE_YEAR
*
* @param zoneYear the value for TBL_EMPLOYMENT.ZONE_YEAR
*
* @mbg.generated
*/
public void setZoneYear(Long zoneYear) {
this.zoneYear = zoneYear;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TBL_EMPLOYMENT
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
EmploymentDD other = (EmploymentDD) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getEmployName() == null ? other.getEmployName() == null : this.getEmployName().equals(other.getEmployName()))
&& (this.getIdNumber() == null ? other.getIdNumber() == null : this.getIdNumber().equals(other.getIdNumber()))
&& (this.getRegisteredResidence() == null ? other.getRegisteredResidence() == null : this.getRegisteredResidence().equals(other.getRegisteredResidence()))
&& (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
&& (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
&& (this.getNation() == null ? other.getNation() == null : this.getNation().equals(other.getNation()))
&& (this.getPoliticalOutlook() == null ? other.getPoliticalOutlook() == null : this.getPoliticalOutlook().equals(other.getPoliticalOutlook()))
&& (this.getDegreeEducation() == null ? other.getDegreeEducation() == null : this.getDegreeEducation().equals(other.getDegreeEducation()))
&& (this.getHealth() == null ? other.getHealth() == null : this.getHealth().equals(other.getHealth()))
&& (this.getLaborSkills() == null ? other.getLaborSkills() == null : this.getLaborSkills().equals(other.getLaborSkills()))
&& (this.getPovertyName() == null ? other.getPovertyName() == null : this.getPovertyName().equals(other.getPovertyName()))
&& (this.getMajorcause() == null ? other.getMajorcause() == null : this.getMajorcause().equals(other.getMajorcause()))
&& (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
&& (this.getIsStudent() == null ? other.getIsStudent() == null : this.getIsStudent().equals(other.getIsStudent()))
&& (this.getFormEmployment() == null ? other.getFormEmployment() == null : this.getFormEmployment().equals(other.getFormEmployment()))
&& (this.getRegionEmployment() == null ? other.getRegionEmployment() == null : this.getRegionEmployment().equals(other.getRegionEmployment()))
&& (this.getPlaceEmployment() == null ? other.getPlaceEmployment() == null : this.getPlaceEmployment().equals(other.getPlaceEmployment()))
&& (this.getEmploymentWork() == null ? other.getEmploymentWork() == null : this.getEmploymentWork().equals(other.getEmploymentWork()))
&& (this.getEmploymentTime() == null ? other.getEmploymentTime() == null : this.getEmploymentTime().equals(other.getEmploymentTime()))
&& (this.getSigncontract() == null ? other.getSigncontract() == null : this.getSigncontract().equals(other.getSigncontract()))
&& (this.getIsSocialInsurance() == null ? other.getIsSocialInsurance() == null : this.getIsSocialInsurance().equals(other.getIsSocialInsurance()))
&& (this.getMonthlyAverageWage() == null ? other.getMonthlyAverageWage() == null : this.getMonthlyAverageWage().equals(other.getMonthlyAverageWage()))
&& (this.getPostType() == null ? other.getPostType() == null : this.getPostType().equals(other.getPostType()))
&& (this.getPostAddress() == null ? other.getPostAddress() == null : this.getPostAddress().equals(other.getPostAddress()))
&& (this.getPostTypeCompany() == null ? other.getPostTypeCompany() == null : this.getPostTypeCompany().equals(other.getPostTypeCompany()))
&& (this.getResettlementTime() == null ? other.getResettlementTime() == null : this.getResettlementTime().equals(other.getResettlementTime()))
&& (this.getPostName() == null ? other.getPostName() == null : this.getPostName().equals(other.getPostName()))
&& (this.getVocationalTraining() == null ? other.getVocationalTraining() == null : this.getVocationalTraining().equals(other.getVocationalTraining()))
&& (this.getTrainType() == null ? other.getTrainType() == null : this.getTrainType().equals(other.getTrainType()))
&& (this.getTrainStartTime() == null ? other.getTrainStartTime() == null : this.getTrainStartTime().equals(other.getTrainStartTime()))
&& (this.getTrainStopTime() == null ? other.getTrainStopTime() == null : this.getTrainStopTime().equals(other.getTrainStopTime()))
&& (this.getTrainingCategory() == null ? other.getTrainingCategory() == null : this.getTrainingCategory().equals(other.getTrainingCategory()))
&& (this.getObtainACertificate() == null ? other.getObtainACertificate() == null : this.getObtainACertificate().equals(other.getObtainACertificate()))
&& (this.getTrainingSubsidy() == null ? other.getTrainingSubsidy() == null : this.getTrainingSubsidy().equals(other.getTrainingSubsidy()))
&& (this.getIsObtainEmployment() == null ? other.getIsObtainEmployment() == null : this.getIsObtainEmployment().equals(other.getIsObtainEmployment()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getIsTrainEntrepreneurship() == null ? other.getIsTrainEntrepreneurship() == null : this.getIsTrainEntrepreneurship().equals(other.getIsTrainEntrepreneurship()))
&& (this.getEntrepreneurshipType() == null ? other.getEntrepreneurshipType() == null : this.getEntrepreneurshipType().equals(other.getEntrepreneurshipType()))
&& (this.getEntrepreneurshipAddress() == null ? other.getEntrepreneurshipAddress() == null : this.getEntrepreneurshipAddress().equals(other.getEntrepreneurshipAddress()))
&& (this.getEntrepreneurshipName() == null ? other.getEntrepreneurshipName() == null : this.getEntrepreneurshipName().equals(other.getEntrepreneurshipName()))
&& (this.getIndustryCategory() == null ? other.getIndustryCategory() == null : this.getIndustryCategory().equals(other.getIndustryCategory()))
&& (this.getIsMicrofinance() == null ? other.getIsMicrofinance() == null : this.getIsMicrofinance().equals(other.getIsMicrofinance()))
&& (this.getLoanAmount() == null ? other.getLoanAmount() == null : this.getLoanAmount().equals(other.getLoanAmount()))
&& (this.getLaborForce() == null ? other.getLaborForce() == null : this.getLaborForce().equals(other.getLaborForce()))
&& (this.getIsRegister() == null ? other.getIsRegister() == null : this.getIsRegister().equals(other.getIsRegister()))
&& (this.getIsEmploymentDesire() == null ? other.getIsEmploymentDesire() == null : this.getIsEmploymentDesire().equals(other.getIsEmploymentDesire()))
&& (this.getEmploymentIntention() == null ? other.getEmploymentIntention() == null : this.getEmploymentIntention().equals(other.getEmploymentIntention()))
&& (this.getSalaryExpectation() == null ? other.getSalaryExpectation() == null : this.getSalaryExpectation().equals(other.getSalaryExpectation()))
&& (this.getEmploymentServiceDemand() == null ? other.getEmploymentServiceDemand() == null : this.getEmploymentServiceDemand().equals(other.getEmploymentServiceDemand()))
&& (this.getEmploymentConsultation() == null ? other.getEmploymentConsultation() == null : this.getEmploymentConsultation().equals(other.getEmploymentConsultation()))
&& (this.getEmploymentInfo() == null ? other.getEmploymentInfo() == null : this.getEmploymentInfo().equals(other.getEmploymentInfo()))
&& (this.getEmploymentGuidance() == null ? other.getEmploymentGuidance() == null : this.getEmploymentGuidance().equals(other.getEmploymentGuidance()))
&& (this.getNumberOfTraining() == null ? other.getNumberOfTraining() == null : this.getNumberOfTraining().equals(other.getNumberOfTraining()))
&& (this.getEntrepreneurialService() == null ? other.getEntrepreneurialService() == null : this.getEntrepreneurialService().equals(other.getEntrepreneurialService()))
&& (this.getCareerIntroduction() == null ? other.getCareerIntroduction() == null : this.getCareerIntroduction().equals(other.getCareerIntroduction()))
&& (this.getSocialInsurance() == null ? other.getSocialInsurance() == null : this.getSocialInsurance().equals(other.getSocialInsurance()))
&& (this.getEnjoyPostSubsidies() == null ? other.getEnjoyPostSubsidies() == null : this.getEnjoyPostSubsidies().equals(other.getEnjoyPostSubsidies()))
&& (this.getOtherPolicies() == null ? other.getOtherPolicies() == null : this.getOtherPolicies().equals(other.getOtherPolicies()))
&& (this.getZoneYear() == null ? other.getZoneYear() == null : this.getZoneYear().equals(other.getZoneYear()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TBL_EMPLOYMENT
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getEmployName() == null) ? 0 : getEmployName().hashCode());
result = prime * result + ((getIdNumber() == null) ? 0 : getIdNumber().hashCode());
result = prime * result + ((getRegisteredResidence() == null) ? 0 : getRegisteredResidence().hashCode());
result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
result = prime * result + ((getNation() == null) ? 0 : getNation().hashCode());
result = prime * result + ((getPoliticalOutlook() == null) ? 0 : getPoliticalOutlook().hashCode());
result = prime * result + ((getDegreeEducation() == null) ? 0 : getDegreeEducation().hashCode());
result = prime * result + ((getHealth() == null) ? 0 : getHealth().hashCode());
result = prime * result + ((getLaborSkills() == null) ? 0 : getLaborSkills().hashCode());
result = prime * result + ((getPovertyName() == null) ? 0 : getPovertyName().hashCode());
result = prime * result + ((getMajorcause() == null) ? 0 : getMajorcause().hashCode());
result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
result = prime * result + ((getIsStudent() == null) ? 0 : getIsStudent().hashCode());
result = prime * result + ((getFormEmployment() == null) ? 0 : getFormEmployment().hashCode());
result = prime * result + ((getRegionEmployment() == null) ? 0 : getRegionEmployment().hashCode());
result = prime * result + ((getPlaceEmployment() == null) ? 0 : getPlaceEmployment().hashCode());
result = prime * result + ((getEmploymentWork() == null) ? 0 : getEmploymentWork().hashCode());
result = prime * result + ((getEmploymentTime() == null) ? 0 : getEmploymentTime().hashCode());
result = prime * result + ((getSigncontract() == null) ? 0 : getSigncontract().hashCode());
result = prime * result + ((getIsSocialInsurance() == null) ? 0 : getIsSocialInsurance().hashCode());
result = prime * result + ((getMonthlyAverageWage() == null) ? 0 : getMonthlyAverageWage().hashCode());
result = prime * result + ((getPostType() == null) ? 0 : getPostType().hashCode());
result = prime * result + ((getPostAddress() == null) ? 0 : getPostAddress().hashCode());
result = prime * result + ((getPostTypeCompany() == null) ? 0 : getPostTypeCompany().hashCode());
result = prime * result + ((getResettlementTime() == null) ? 0 : getResettlementTime().hashCode());
result = prime * result + ((getPostName() == null) ? 0 : getPostName().hashCode());
result = prime * result + ((getVocationalTraining() == null) ? 0 : getVocationalTraining().hashCode());
result = prime * result + ((getTrainType() == null) ? 0 : getTrainType().hashCode());
result = prime * result + ((getTrainStartTime() == null) ? 0 : getTrainStartTime().hashCode());
result = prime * result + ((getTrainStopTime() == null) ? 0 : getTrainStopTime().hashCode());
result = prime * result + ((getTrainingCategory() == null) ? 0 : getTrainingCategory().hashCode());
result = prime * result + ((getObtainACertificate() == null) ? 0 : getObtainACertificate().hashCode());
result = prime * result + ((getTrainingSubsidy() == null) ? 0 : getTrainingSubsidy().hashCode());
result = prime * result + ((getIsObtainEmployment() == null) ? 0 : getIsObtainEmployment().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getIsTrainEntrepreneurship() == null) ? 0 : getIsTrainEntrepreneurship().hashCode());
result = prime * result + ((getEntrepreneurshipType() == null) ? 0 : getEntrepreneurshipType().hashCode());
result = prime * result + ((getEntrepreneurshipAddress() == null) ? 0 : getEntrepreneurshipAddress().hashCode());
result = prime * result + ((getEntrepreneurshipName() == null) ? 0 : getEntrepreneurshipName().hashCode());
result = prime * result + ((getIndustryCategory() == null) ? 0 : getIndustryCategory().hashCode());
result = prime * result + ((getIsMicrofinance() == null) ? 0 : getIsMicrofinance().hashCode());
result = prime * result + ((getLoanAmount() == null) ? 0 : getLoanAmount().hashCode());
result = prime * result + ((getLaborForce() == null) ? 0 : getLaborForce().hashCode());
result = prime * result + ((getIsRegister() == null) ? 0 : getIsRegister().hashCode());
result = prime * result + ((getIsEmploymentDesire() == null) ? 0 : getIsEmploymentDesire().hashCode());
result = prime * result + ((getEmploymentIntention() == null) ? 0 : getEmploymentIntention().hashCode());
result = prime * result + ((getSalaryExpectation() == null) ? 0 : getSalaryExpectation().hashCode());
result = prime * result + ((getEmploymentServiceDemand() == null) ? 0 : getEmploymentServiceDemand().hashCode());
result = prime * result + ((getEmploymentConsultation() == null) ? 0 : getEmploymentConsultation().hashCode());
result = prime * result + ((getEmploymentInfo() == null) ? 0 : getEmploymentInfo().hashCode());
result = prime * result + ((getEmploymentGuidance() == null) ? 0 : getEmploymentGuidance().hashCode());
result = prime * result + ((getNumberOfTraining() == null) ? 0 : getNumberOfTraining().hashCode());
result = prime * result + ((getEntrepreneurialService() == null) ? 0 : getEntrepreneurialService().hashCode());
result = prime * result + ((getCareerIntroduction() == null) ? 0 : getCareerIntroduction().hashCode());
result = prime * result + ((getSocialInsurance() == null) ? 0 : getSocialInsurance().hashCode());
result = prime * result + ((getEnjoyPostSubsidies() == null) ? 0 : getEnjoyPostSubsidies().hashCode());
result = prime * result + ((getOtherPolicies() == null) ? 0 : getOtherPolicies().hashCode());
result = prime * result + ((getZoneYear() == null) ? 0 : getZoneYear().hashCode());
return result;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TBL_EMPLOYMENT
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", employName=").append(employName);
sb.append(", idNumber=").append(idNumber);
sb.append(", registeredResidence=").append(registeredResidence);
sb.append(", sex=").append(sex);
sb.append(", age=").append(age);
sb.append(", nation=").append(nation);
sb.append(", politicalOutlook=").append(politicalOutlook);
sb.append(", degreeEducation=").append(degreeEducation);
sb.append(", health=").append(health);
sb.append(", laborSkills=").append(laborSkills);
sb.append(", povertyName=").append(povertyName);
sb.append(", majorcause=").append(majorcause);
sb.append(", mobile=").append(mobile);
sb.append(", isStudent=").append(isStudent);
sb.append(", formEmployment=").append(formEmployment);
sb.append(", regionEmployment=").append(regionEmployment);
sb.append(", placeEmployment=").append(placeEmployment);
sb.append(", employmentWork=").append(employmentWork);
sb.append(", employmentTime=").append(employmentTime);
sb.append(", signcontract=").append(signcontract);
sb.append(", isSocialInsurance=").append(isSocialInsurance);
sb.append(", monthlyAverageWage=").append(monthlyAverageWage);
sb.append(", postType=").append(postType);
sb.append(", postAddress=").append(postAddress);
sb.append(", postTypeCompany=").append(postTypeCompany);
sb.append(", resettlementTime=").append(resettlementTime);
sb.append(", postName=").append(postName);
sb.append(", vocationalTraining=").append(vocationalTraining);
sb.append(", trainType=").append(trainType);
sb.append(", trainStartTime=").append(trainStartTime);
sb.append(", trainStopTime=").append(trainStopTime);
sb.append(", trainingCategory=").append(trainingCategory);
sb.append(", obtainACertificate=").append(obtainACertificate);
sb.append(", trainingSubsidy=").append(trainingSubsidy);
sb.append(", isObtainEmployment=").append(isObtainEmployment);
sb.append(", startTime=").append(startTime);
sb.append(", isTrainEntrepreneurship=").append(isTrainEntrepreneurship);
sb.append(", entrepreneurshipType=").append(entrepreneurshipType);
sb.append(", entrepreneurshipAddress=").append(entrepreneurshipAddress);
sb.append(", entrepreneurshipName=").append(entrepreneurshipName);
sb.append(", industryCategory=").append(industryCategory);
sb.append(", isMicrofinance=").append(isMicrofinance);
sb.append(", loanAmount=").append(loanAmount);
sb.append(", laborForce=").append(laborForce);
sb.append(", isRegister=").append(isRegister);
sb.append(", isEmploymentDesire=").append(isEmploymentDesire);
sb.append(", employmentIntention=").append(employmentIntention);
sb.append(", salaryExpectation=").append(salaryExpectation);
sb.append(", employmentServiceDemand=").append(employmentServiceDemand);
sb.append(", employmentConsultation=").append(employmentConsultation);
sb.append(", employmentInfo=").append(employmentInfo);
sb.append(", employmentGuidance=").append(employmentGuidance);
sb.append(", numberOfTraining=").append(numberOfTraining);
sb.append(", entrepreneurialService=").append(entrepreneurialService);
sb.append(", careerIntroduction=").append(careerIntroduction);
sb.append(", socialInsurance=").append(socialInsurance);
sb.append(", enjoyPostSubsidies=").append(enjoyPostSubsidies);
sb.append(", otherPolicies=").append(otherPolicies);
sb.append(", zoneYear=").append(zoneYear);
sb.append("]");
return sb.toString();
}
}
|
package com.yayandroid.customtabsfragment;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import com.yayandroid.customtabsfragment_library.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
public class CustomTabHost extends HorizontalScrollView {
private LinearLayout tabLayout;
private Runnable mTabSelector;
private OnTabReselectedListener mTabReselectedListener;
private OnTabSelectedListener mTabSelectedListener;
private int mMaxTabWidth;
private int mSelectedTabIndex;
private int mLastSelectedTabIndex = -1;
private int mCustomViewId = -1;
private int mTabCount = 0;
public CustomTabHost(Context context) {
super(context);
Init();
}
public CustomTabHost(Context context, AttributeSet attrs) {
super(context, attrs);
Init();
}
public CustomTabHost(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
Init();
}
/**
* Interface for a callback when the selected tab has been reselected.
*/
public interface OnTabReselectedListener {
/**
* Callback when the selected tab has been reselected.
*
* @param position
* Position of the current center item.
*/
void onTabReselected(int position);
}
public void setOnTabReselectedListener(OnTabReselectedListener listener) {
mTabReselectedListener = listener;
}
/**
* Interface for a callback when a tab has selected.
*/
public interface OnTabSelectedListener {
/**
* Callback when the selected tab has been reselected.
*
* @param position
* Position of the current center item.
*/
void onTabSelected(int position);
}
public void setOnTabSelectedListener(OnTabSelectedListener listener) {
mTabSelectedListener = listener;
}
public void Init() {
setHorizontalScrollBarEnabled(false);
tabLayout = new LinearLayout(getContext());
addView(tabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT,
WRAP_CONTENT));
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
final boolean lockedExpanded = widthMode == MeasureSpec.EXACTLY;
setFillViewport(lockedExpanded);
final int childCount = tabLayout.getChildCount();
if (childCount > 1
&& (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST)) {
if (childCount > 2) {
mMaxTabWidth = (int) (MeasureSpec.getSize(widthMeasureSpec) * 0.4f);
} else {
mMaxTabWidth = MeasureSpec.getSize(widthMeasureSpec) / 2;
}
} else {
mMaxTabWidth = -1;
}
final int oldWidth = getMeasuredWidth();
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
final int newWidth = getMeasuredWidth();
if (lockedExpanded && oldWidth != newWidth) {
// Recenter the tab display if we're at a new (scrollable) size.
setCurrentItem(mSelectedTabIndex);
}
}
private void animateToTab(final int position) {
final View tabView = tabLayout.getChildAt(position);
if (mTabSelector != null) {
removeCallbacks(mTabSelector);
}
mTabSelector = new Runnable() {
public void run() {
final int scrollPos = tabView.getLeft()
- (getWidth() - tabView.getWidth()) / 2;
smoothScrollTo(scrollPos, 0);
mTabSelector = null;
}
};
post(mTabSelector);
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
if (mTabSelector != null) {
// Re-post the selector we saved
post(mTabSelector);
}
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (mTabSelector != null) {
removeCallbacks(mTabSelector);
}
}
public void addTab(int index) {
final CustomTabView tabView = new CustomTabView(getContext());
if (getCustomViewId() != -1) {
tabView.SetCustomView();
tabView.setTag(index);
tabView.mIndex = index;
tabView.setFocusable(true);
tabView.setOnClickListener(mTabClickListener);
tabLayout.addView(tabView, new LinearLayout.LayoutParams(0,
WRAP_CONTENT, 1));
}
}
public void setCount(int count) {
this.mTabCount = count;
notifyDataSetChanged();
setCurrentItem(0);
}
public int getCount() {
return mTabCount;
}
public void notifyDataSetChanged() {
tabLayout.removeAllViews();
for (int i = 0; i < mTabCount; i++)
addTab(i);
if (mSelectedTabIndex > mTabCount) {
mSelectedTabIndex = mTabCount - 1;
}
setCurrentItem(mSelectedTabIndex);
requestLayout();
}
public void setCurrentItem(int item) {
mSelectedTabIndex = item;
final int tabCount = tabLayout.getChildCount();
for (int i = 0; i < tabCount; i++) {
final View child = tabLayout.getChildAt(i);
final boolean isSelected = (i == item);
child.setSelected(isSelected);
if (isSelected) {
animateToTab(item);
}
}
if (mLastSelectedTabIndex == mSelectedTabIndex) {
if (mTabReselectedListener != null)
mTabReselectedListener.onTabReselected(mSelectedTabIndex);
} else {
if (mTabSelectedListener != null)
mTabSelectedListener.onTabSelected(mSelectedTabIndex);
}
}
private final OnClickListener mTabClickListener = new OnClickListener() {
public void onClick(View view) {
CustomTabView tabView = (CustomTabView) view;
mLastSelectedTabIndex = mSelectedTabIndex;
mSelectedTabIndex = tabView.getIndex();
setCurrentItem(mSelectedTabIndex);
}
};
private class CustomTabView extends RelativeLayout {
private int mIndex;
public CustomTabView(Context context) {
super(context);
// To use viewpagerindicator's theme:
// super(context, null, R.attr.vpiTabPageIndicatorStyle);
}
public void SetCustomView() {
if (getCustomViewId() != -1) {
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(getCustomViewId(), null);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
lp.addRule(RelativeLayout.CENTER_IN_PARENT);
this.addView(v, lp);
this.setBackgroundResource(R.drawable.tab_selector);
}
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Re-measure if we went beyond our maximum size.
if (mMaxTabWidth > 0 && getMeasuredWidth() > mMaxTabWidth) {
super.onMeasure(MeasureSpec.makeMeasureSpec(mMaxTabWidth,
MeasureSpec.EXACTLY), heightMeasureSpec);
}
}
public int getIndex() {
return mIndex;
}
}
public View getTabItemAtPosition(int position) {
return tabLayout.getChildAt(position);
}
public int getCustomViewId() {
return mCustomViewId;
}
public void setCustomViewId(int mCustomViewId) {
this.mCustomViewId = mCustomViewId;
}
public int getSelectedTabPosition() {
return mSelectedTabIndex;
}
public int getLastSelectedTabPosition() {
return mLastSelectedTabIndex;
}
}
|
package artista;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.SwingConstants;
public class ProfileGUI{
private Graph graph;
private Vertex profileVertex;
private JFrame frame;
JLabel lblNewLabel;
JLabel profileImage;
JLabel username;
JLabel bioDiscrep;
/**
* Create the frame.
*/
public ProfileGUI(Graph graph, int user) {
this.graph = graph;
this.profileVertex = graph.getProfileAccount(user);
initializeProfileGUI();
frame.setVisible(true);
}
public void initializeProfileGUI() {
frame = new JFrame();
frame.getContentPane().setBackground(new Color(0, 191, 255));
frame.getContentPane().setLayout(null);
this.lblNewLabel = new JLabel("ARTISTA");
lblNewLabel.setForeground(new Color(178, 34, 34));
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setFont(new Font("Malayalam MN", Font.BOLD, 60));
lblNewLabel.setBounds(183, 55, 641, 84);
frame.getContentPane().add(lblNewLabel);
this.profileImage = new JLabel("");
profileImage.setBounds(54, 175, 219, 223);
frame.getContentPane().add(profileImage);
this.username = new JLabel(profileVertex.getUserVertex().getUserName());
username.setForeground(new Color(25, 25, 112));
username.setBounds(326, 175, 125, 25);
frame.getContentPane().add(username);
bioDiscrep = new JLabel(profileVertex.getUserVertex().getProfileBio());
bioDiscrep.setBounds(298, 212, 476, 241);
frame.getContentPane().add(bioDiscrep);
frame.setBounds(400, 200, 1000, 1000);
}
}
|
package com.hqhcn.android.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CarinfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CarinfoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andJlcxhIsNull() {
addCriterion("jlcxh is null");
return (Criteria) this;
}
public Criteria andJlcxhIsNotNull() {
addCriterion("jlcxh is not null");
return (Criteria) this;
}
public Criteria andJlcxhEqualTo(String value) {
addCriterion("jlcxh =", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhNotEqualTo(String value) {
addCriterion("jlcxh <>", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhGreaterThan(String value) {
addCriterion("jlcxh >", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhGreaterThanOrEqualTo(String value) {
addCriterion("jlcxh >=", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhLessThan(String value) {
addCriterion("jlcxh <", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhLessThanOrEqualTo(String value) {
addCriterion("jlcxh <=", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhLike(String value) {
addCriterion("jlcxh like", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhNotLike(String value) {
addCriterion("jlcxh not like", value, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhIn(List<String> values) {
addCriterion("jlcxh in", values, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhNotIn(List<String> values) {
addCriterion("jlcxh not in", values, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhBetween(String value1, String value2) {
addCriterion("jlcxh between", value1, value2, "jlcxh");
return (Criteria) this;
}
public Criteria andJlcxhNotBetween(String value1, String value2) {
addCriterion("jlcxh not between", value1, value2, "jlcxh");
return (Criteria) this;
}
public Criteria andKcdddhIsNull() {
addCriterion("kcdddh is null");
return (Criteria) this;
}
public Criteria andKcdddhIsNotNull() {
addCriterion("kcdddh is not null");
return (Criteria) this;
}
public Criteria andKcdddhEqualTo(String value) {
addCriterion("kcdddh =", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhNotEqualTo(String value) {
addCriterion("kcdddh <>", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhGreaterThan(String value) {
addCriterion("kcdddh >", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhGreaterThanOrEqualTo(String value) {
addCriterion("kcdddh >=", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhLessThan(String value) {
addCriterion("kcdddh <", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhLessThanOrEqualTo(String value) {
addCriterion("kcdddh <=", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhLike(String value) {
addCriterion("kcdddh like", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhNotLike(String value) {
addCriterion("kcdddh not like", value, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhIn(List<String> values) {
addCriterion("kcdddh in", values, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhNotIn(List<String> values) {
addCriterion("kcdddh not in", values, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhBetween(String value1, String value2) {
addCriterion("kcdddh between", value1, value2, "kcdddh");
return (Criteria) this;
}
public Criteria andKcdddhNotBetween(String value1, String value2) {
addCriterion("kcdddh not between", value1, value2, "kcdddh");
return (Criteria) this;
}
public Criteria andHpzlIsNull() {
addCriterion("hpzl is null");
return (Criteria) this;
}
public Criteria andHpzlIsNotNull() {
addCriterion("hpzl is not null");
return (Criteria) this;
}
public Criteria andHpzlEqualTo(String value) {
addCriterion("hpzl =", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlNotEqualTo(String value) {
addCriterion("hpzl <>", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlGreaterThan(String value) {
addCriterion("hpzl >", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlGreaterThanOrEqualTo(String value) {
addCriterion("hpzl >=", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlLessThan(String value) {
addCriterion("hpzl <", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlLessThanOrEqualTo(String value) {
addCriterion("hpzl <=", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlLike(String value) {
addCriterion("hpzl like", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlNotLike(String value) {
addCriterion("hpzl not like", value, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlIn(List<String> values) {
addCriterion("hpzl in", values, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlNotIn(List<String> values) {
addCriterion("hpzl not in", values, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlBetween(String value1, String value2) {
addCriterion("hpzl between", value1, value2, "hpzl");
return (Criteria) this;
}
public Criteria andHpzlNotBetween(String value1, String value2) {
addCriterion("hpzl not between", value1, value2, "hpzl");
return (Criteria) this;
}
public Criteria andHphmIsNull() {
addCriterion("hphm is null");
return (Criteria) this;
}
public Criteria andHphmIsNotNull() {
addCriterion("hphm is not null");
return (Criteria) this;
}
public Criteria andHphmEqualTo(String value) {
addCriterion("hphm =", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmNotEqualTo(String value) {
addCriterion("hphm <>", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmGreaterThan(String value) {
addCriterion("hphm >", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmGreaterThanOrEqualTo(String value) {
addCriterion("hphm >=", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmLessThan(String value) {
addCriterion("hphm <", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmLessThanOrEqualTo(String value) {
addCriterion("hphm <=", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmLike(String value) {
addCriterion("hphm like", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmNotLike(String value) {
addCriterion("hphm not like", value, "hphm");
return (Criteria) this;
}
public Criteria andHphmIn(List<String> values) {
addCriterion("hphm in", values, "hphm");
return (Criteria) this;
}
public Criteria andHphmNotIn(List<String> values) {
addCriterion("hphm not in", values, "hphm");
return (Criteria) this;
}
public Criteria andHphmBetween(String value1, String value2) {
addCriterion("hphm between", value1, value2, "hphm");
return (Criteria) this;
}
public Criteria andHphmNotBetween(String value1, String value2) {
addCriterion("hphm not between", value1, value2, "hphm");
return (Criteria) this;
}
public Criteria andJklxIsNull() {
addCriterion("jklx is null");
return (Criteria) this;
}
public Criteria andJklxIsNotNull() {
addCriterion("jklx is not null");
return (Criteria) this;
}
public Criteria andJklxEqualTo(String value) {
addCriterion("jklx =", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxNotEqualTo(String value) {
addCriterion("jklx <>", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxGreaterThan(String value) {
addCriterion("jklx >", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxGreaterThanOrEqualTo(String value) {
addCriterion("jklx >=", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxLessThan(String value) {
addCriterion("jklx <", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxLessThanOrEqualTo(String value) {
addCriterion("jklx <=", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxLike(String value) {
addCriterion("jklx like", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxNotLike(String value) {
addCriterion("jklx not like", value, "jklx");
return (Criteria) this;
}
public Criteria andJklxIn(List<String> values) {
addCriterion("jklx in", values, "jklx");
return (Criteria) this;
}
public Criteria andJklxNotIn(List<String> values) {
addCriterion("jklx not in", values, "jklx");
return (Criteria) this;
}
public Criteria andJklxBetween(String value1, String value2) {
addCriterion("jklx between", value1, value2, "jklx");
return (Criteria) this;
}
public Criteria andJklxNotBetween(String value1, String value2) {
addCriterion("jklx not between", value1, value2, "jklx");
return (Criteria) this;
}
public Criteria andClppxhIsNull() {
addCriterion("clppxh is null");
return (Criteria) this;
}
public Criteria andClppxhIsNotNull() {
addCriterion("clppxh is not null");
return (Criteria) this;
}
public Criteria andClppxhEqualTo(String value) {
addCriterion("clppxh =", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhNotEqualTo(String value) {
addCriterion("clppxh <>", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhGreaterThan(String value) {
addCriterion("clppxh >", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhGreaterThanOrEqualTo(String value) {
addCriterion("clppxh >=", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhLessThan(String value) {
addCriterion("clppxh <", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhLessThanOrEqualTo(String value) {
addCriterion("clppxh <=", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhLike(String value) {
addCriterion("clppxh like", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhNotLike(String value) {
addCriterion("clppxh not like", value, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhIn(List<String> values) {
addCriterion("clppxh in", values, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhNotIn(List<String> values) {
addCriterion("clppxh not in", values, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhBetween(String value1, String value2) {
addCriterion("clppxh between", value1, value2, "clppxh");
return (Criteria) this;
}
public Criteria andClppxhNotBetween(String value1, String value2) {
addCriterion("clppxh not between", value1, value2, "clppxh");
return (Criteria) this;
}
public Criteria andFzjgIsNull() {
addCriterion("fzjg is null");
return (Criteria) this;
}
public Criteria andFzjgIsNotNull() {
addCriterion("fzjg is not null");
return (Criteria) this;
}
public Criteria andFzjgEqualTo(String value) {
addCriterion("fzjg =", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgNotEqualTo(String value) {
addCriterion("fzjg <>", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgGreaterThan(String value) {
addCriterion("fzjg >", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgGreaterThanOrEqualTo(String value) {
addCriterion("fzjg >=", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgLessThan(String value) {
addCriterion("fzjg <", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgLessThanOrEqualTo(String value) {
addCriterion("fzjg <=", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgLike(String value) {
addCriterion("fzjg like", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgNotLike(String value) {
addCriterion("fzjg not like", value, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgIn(List<String> values) {
addCriterion("fzjg in", values, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgNotIn(List<String> values) {
addCriterion("fzjg not in", values, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgBetween(String value1, String value2) {
addCriterion("fzjg between", value1, value2, "fzjg");
return (Criteria) this;
}
public Criteria andFzjgNotBetween(String value1, String value2) {
addCriterion("fzjg not between", value1, value2, "fzjg");
return (Criteria) this;
}
public Criteria andJlcztIsNull() {
addCriterion("jlczt is null");
return (Criteria) this;
}
public Criteria andJlcztIsNotNull() {
addCriterion("jlczt is not null");
return (Criteria) this;
}
public Criteria andJlcztEqualTo(String value) {
addCriterion("jlczt =", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztNotEqualTo(String value) {
addCriterion("jlczt <>", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztGreaterThan(String value) {
addCriterion("jlczt >", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztGreaterThanOrEqualTo(String value) {
addCriterion("jlczt >=", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztLessThan(String value) {
addCriterion("jlczt <", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztLessThanOrEqualTo(String value) {
addCriterion("jlczt <=", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztLike(String value) {
addCriterion("jlczt like", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztNotLike(String value) {
addCriterion("jlczt not like", value, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztIn(List<String> values) {
addCriterion("jlczt in", values, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztNotIn(List<String> values) {
addCriterion("jlczt not in", values, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztBetween(String value1, String value2) {
addCriterion("jlczt between", value1, value2, "jlczt");
return (Criteria) this;
}
public Criteria andJlcztNotBetween(String value1, String value2) {
addCriterion("jlczt not between", value1, value2, "jlczt");
return (Criteria) this;
}
public Criteria andBjIsNull() {
addCriterion("bj is null");
return (Criteria) this;
}
public Criteria andBjIsNotNull() {
addCriterion("bj is not null");
return (Criteria) this;
}
public Criteria andBjEqualTo(String value) {
addCriterion("bj =", value, "bj");
return (Criteria) this;
}
public Criteria andBjNotEqualTo(String value) {
addCriterion("bj <>", value, "bj");
return (Criteria) this;
}
public Criteria andBjGreaterThan(String value) {
addCriterion("bj >", value, "bj");
return (Criteria) this;
}
public Criteria andBjGreaterThanOrEqualTo(String value) {
addCriterion("bj >=", value, "bj");
return (Criteria) this;
}
public Criteria andBjLessThan(String value) {
addCriterion("bj <", value, "bj");
return (Criteria) this;
}
public Criteria andBjLessThanOrEqualTo(String value) {
addCriterion("bj <=", value, "bj");
return (Criteria) this;
}
public Criteria andBjLike(String value) {
addCriterion("bj like", value, "bj");
return (Criteria) this;
}
public Criteria andBjNotLike(String value) {
addCriterion("bj not like", value, "bj");
return (Criteria) this;
}
public Criteria andBjIn(List<String> values) {
addCriterion("bj in", values, "bj");
return (Criteria) this;
}
public Criteria andBjNotIn(List<String> values) {
addCriterion("bj not in", values, "bj");
return (Criteria) this;
}
public Criteria andBjBetween(String value1, String value2) {
addCriterion("bj between", value1, value2, "bj");
return (Criteria) this;
}
public Criteria andBjNotBetween(String value1, String value2) {
addCriterion("bj not between", value1, value2, "bj");
return (Criteria) this;
}
public Criteria andJbrIsNull() {
addCriterion("jbr is null");
return (Criteria) this;
}
public Criteria andJbrIsNotNull() {
addCriterion("jbr is not null");
return (Criteria) this;
}
public Criteria andJbrEqualTo(String value) {
addCriterion("jbr =", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrNotEqualTo(String value) {
addCriterion("jbr <>", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrGreaterThan(String value) {
addCriterion("jbr >", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrGreaterThanOrEqualTo(String value) {
addCriterion("jbr >=", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrLessThan(String value) {
addCriterion("jbr <", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrLessThanOrEqualTo(String value) {
addCriterion("jbr <=", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrLike(String value) {
addCriterion("jbr like", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrNotLike(String value) {
addCriterion("jbr not like", value, "jbr");
return (Criteria) this;
}
public Criteria andJbrIn(List<String> values) {
addCriterion("jbr in", values, "jbr");
return (Criteria) this;
}
public Criteria andJbrNotIn(List<String> values) {
addCriterion("jbr not in", values, "jbr");
return (Criteria) this;
}
public Criteria andJbrBetween(String value1, String value2) {
addCriterion("jbr between", value1, value2, "jbr");
return (Criteria) this;
}
public Criteria andJbrNotBetween(String value1, String value2) {
addCriterion("jbr not between", value1, value2, "jbr");
return (Criteria) this;
}
public Criteria andClzlIsNull() {
addCriterion("clzl is null");
return (Criteria) this;
}
public Criteria andClzlIsNotNull() {
addCriterion("clzl is not null");
return (Criteria) this;
}
public Criteria andClzlEqualTo(String value) {
addCriterion("clzl =", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlNotEqualTo(String value) {
addCriterion("clzl <>", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlGreaterThan(String value) {
addCriterion("clzl >", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlGreaterThanOrEqualTo(String value) {
addCriterion("clzl >=", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlLessThan(String value) {
addCriterion("clzl <", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlLessThanOrEqualTo(String value) {
addCriterion("clzl <=", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlLike(String value) {
addCriterion("clzl like", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlNotLike(String value) {
addCriterion("clzl not like", value, "clzl");
return (Criteria) this;
}
public Criteria andClzlIn(List<String> values) {
addCriterion("clzl in", values, "clzl");
return (Criteria) this;
}
public Criteria andClzlNotIn(List<String> values) {
addCriterion("clzl not in", values, "clzl");
return (Criteria) this;
}
public Criteria andClzlBetween(String value1, String value2) {
addCriterion("clzl between", value1, value2, "clzl");
return (Criteria) this;
}
public Criteria andClzlNotBetween(String value1, String value2) {
addCriterion("clzl not between", value1, value2, "clzl");
return (Criteria) this;
}
public Criteria andKskmIsNull() {
addCriterion("kskm is null");
return (Criteria) this;
}
public Criteria andKskmIsNotNull() {
addCriterion("kskm is not null");
return (Criteria) this;
}
public Criteria andKskmEqualTo(String value) {
addCriterion("kskm =", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmNotEqualTo(String value) {
addCriterion("kskm <>", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmGreaterThan(String value) {
addCriterion("kskm >", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmGreaterThanOrEqualTo(String value) {
addCriterion("kskm >=", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmLessThan(String value) {
addCriterion("kskm <", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmLessThanOrEqualTo(String value) {
addCriterion("kskm <=", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmLike(String value) {
addCriterion("kskm like", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmNotLike(String value) {
addCriterion("kskm not like", value, "kskm");
return (Criteria) this;
}
public Criteria andKskmIn(List<String> values) {
addCriterion("kskm in", values, "kskm");
return (Criteria) this;
}
public Criteria andKskmNotIn(List<String> values) {
addCriterion("kskm not in", values, "kskm");
return (Criteria) this;
}
public Criteria andKskmBetween(String value1, String value2) {
addCriterion("kskm between", value1, value2, "kskm");
return (Criteria) this;
}
public Criteria andKskmNotBetween(String value1, String value2) {
addCriterion("kskm not between", value1, value2, "kskm");
return (Criteria) this;
}
public Criteria andKsldIsNull() {
addCriterion("ksld is null");
return (Criteria) this;
}
public Criteria andKsldIsNotNull() {
addCriterion("ksld is not null");
return (Criteria) this;
}
public Criteria andKsldEqualTo(String value) {
addCriterion("ksld =", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldNotEqualTo(String value) {
addCriterion("ksld <>", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldGreaterThan(String value) {
addCriterion("ksld >", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldGreaterThanOrEqualTo(String value) {
addCriterion("ksld >=", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldLessThan(String value) {
addCriterion("ksld <", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldLessThanOrEqualTo(String value) {
addCriterion("ksld <=", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldLike(String value) {
addCriterion("ksld like", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldNotLike(String value) {
addCriterion("ksld not like", value, "ksld");
return (Criteria) this;
}
public Criteria andKsldIn(List<String> values) {
addCriterion("ksld in", values, "ksld");
return (Criteria) this;
}
public Criteria andKsldNotIn(List<String> values) {
addCriterion("ksld not in", values, "ksld");
return (Criteria) this;
}
public Criteria andKsldBetween(String value1, String value2) {
addCriterion("ksld between", value1, value2, "ksld");
return (Criteria) this;
}
public Criteria andKsldNotBetween(String value1, String value2) {
addCriterion("ksld not between", value1, value2, "ksld");
return (Criteria) this;
}
public Criteria andF1IsNull() {
addCriterion("f1 is null");
return (Criteria) this;
}
public Criteria andF1IsNotNull() {
addCriterion("f1 is not null");
return (Criteria) this;
}
public Criteria andF1EqualTo(String value) {
addCriterion("f1 =", value, "f1");
return (Criteria) this;
}
public Criteria andF1NotEqualTo(String value) {
addCriterion("f1 <>", value, "f1");
return (Criteria) this;
}
public Criteria andF1GreaterThan(String value) {
addCriterion("f1 >", value, "f1");
return (Criteria) this;
}
public Criteria andF1GreaterThanOrEqualTo(String value) {
addCriterion("f1 >=", value, "f1");
return (Criteria) this;
}
public Criteria andF1LessThan(String value) {
addCriterion("f1 <", value, "f1");
return (Criteria) this;
}
public Criteria andF1LessThanOrEqualTo(String value) {
addCriterion("f1 <=", value, "f1");
return (Criteria) this;
}
public Criteria andF1Like(String value) {
addCriterion("f1 like", value, "f1");
return (Criteria) this;
}
public Criteria andF1NotLike(String value) {
addCriterion("f1 not like", value, "f1");
return (Criteria) this;
}
public Criteria andF1In(List<String> values) {
addCriterion("f1 in", values, "f1");
return (Criteria) this;
}
public Criteria andF1NotIn(List<String> values) {
addCriterion("f1 not in", values, "f1");
return (Criteria) this;
}
public Criteria andF1Between(String value1, String value2) {
addCriterion("f1 between", value1, value2, "f1");
return (Criteria) this;
}
public Criteria andF1NotBetween(String value1, String value2) {
addCriterion("f1 not between", value1, value2, "f1");
return (Criteria) this;
}
public Criteria andF2IsNull() {
addCriterion("f2 is null");
return (Criteria) this;
}
public Criteria andF2IsNotNull() {
addCriterion("f2 is not null");
return (Criteria) this;
}
public Criteria andF2EqualTo(String value) {
addCriterion("f2 =", value, "f2");
return (Criteria) this;
}
public Criteria andF2NotEqualTo(String value) {
addCriterion("f2 <>", value, "f2");
return (Criteria) this;
}
public Criteria andF2GreaterThan(String value) {
addCriterion("f2 >", value, "f2");
return (Criteria) this;
}
public Criteria andF2GreaterThanOrEqualTo(String value) {
addCriterion("f2 >=", value, "f2");
return (Criteria) this;
}
public Criteria andF2LessThan(String value) {
addCriterion("f2 <", value, "f2");
return (Criteria) this;
}
public Criteria andF2LessThanOrEqualTo(String value) {
addCriterion("f2 <=", value, "f2");
return (Criteria) this;
}
public Criteria andF2Like(String value) {
addCriterion("f2 like", value, "f2");
return (Criteria) this;
}
public Criteria andF2NotLike(String value) {
addCriterion("f2 not like", value, "f2");
return (Criteria) this;
}
public Criteria andF2In(List<String> values) {
addCriterion("f2 in", values, "f2");
return (Criteria) this;
}
public Criteria andF2NotIn(List<String> values) {
addCriterion("f2 not in", values, "f2");
return (Criteria) this;
}
public Criteria andF2Between(String value1, String value2) {
addCriterion("f2 between", value1, value2, "f2");
return (Criteria) this;
}
public Criteria andF2NotBetween(String value1, String value2) {
addCriterion("f2 not between", value1, value2, "f2");
return (Criteria) this;
}
public Criteria andF3IsNull() {
addCriterion("f3 is null");
return (Criteria) this;
}
public Criteria andF3IsNotNull() {
addCriterion("f3 is not null");
return (Criteria) this;
}
public Criteria andF3EqualTo(String value) {
addCriterion("f3 =", value, "f3");
return (Criteria) this;
}
public Criteria andF3NotEqualTo(String value) {
addCriterion("f3 <>", value, "f3");
return (Criteria) this;
}
public Criteria andF3GreaterThan(String value) {
addCriterion("f3 >", value, "f3");
return (Criteria) this;
}
public Criteria andF3GreaterThanOrEqualTo(String value) {
addCriterion("f3 >=", value, "f3");
return (Criteria) this;
}
public Criteria andF3LessThan(String value) {
addCriterion("f3 <", value, "f3");
return (Criteria) this;
}
public Criteria andF3LessThanOrEqualTo(String value) {
addCriterion("f3 <=", value, "f3");
return (Criteria) this;
}
public Criteria andF3Like(String value) {
addCriterion("f3 like", value, "f3");
return (Criteria) this;
}
public Criteria andF3NotLike(String value) {
addCriterion("f3 not like", value, "f3");
return (Criteria) this;
}
public Criteria andF3In(List<String> values) {
addCriterion("f3 in", values, "f3");
return (Criteria) this;
}
public Criteria andF3NotIn(List<String> values) {
addCriterion("f3 not in", values, "f3");
return (Criteria) this;
}
public Criteria andF3Between(String value1, String value2) {
addCriterion("f3 between", value1, value2, "f3");
return (Criteria) this;
}
public Criteria andF3NotBetween(String value1, String value2) {
addCriterion("f3 not between", value1, value2, "f3");
return (Criteria) this;
}
public Criteria andF4IsNull() {
addCriterion("f4 is null");
return (Criteria) this;
}
public Criteria andF4IsNotNull() {
addCriterion("f4 is not null");
return (Criteria) this;
}
public Criteria andF4EqualTo(String value) {
addCriterion("f4 =", value, "f4");
return (Criteria) this;
}
public Criteria andF4NotEqualTo(String value) {
addCriterion("f4 <>", value, "f4");
return (Criteria) this;
}
public Criteria andF4GreaterThan(String value) {
addCriterion("f4 >", value, "f4");
return (Criteria) this;
}
public Criteria andF4GreaterThanOrEqualTo(String value) {
addCriterion("f4 >=", value, "f4");
return (Criteria) this;
}
public Criteria andF4LessThan(String value) {
addCriterion("f4 <", value, "f4");
return (Criteria) this;
}
public Criteria andF4LessThanOrEqualTo(String value) {
addCriterion("f4 <=", value, "f4");
return (Criteria) this;
}
public Criteria andF4Like(String value) {
addCriterion("f4 like", value, "f4");
return (Criteria) this;
}
public Criteria andF4NotLike(String value) {
addCriterion("f4 not like", value, "f4");
return (Criteria) this;
}
public Criteria andF4In(List<String> values) {
addCriterion("f4 in", values, "f4");
return (Criteria) this;
}
public Criteria andF4NotIn(List<String> values) {
addCriterion("f4 not in", values, "f4");
return (Criteria) this;
}
public Criteria andF4Between(String value1, String value2) {
addCriterion("f4 between", value1, value2, "f4");
return (Criteria) this;
}
public Criteria andF4NotBetween(String value1, String value2) {
addCriterion("f4 not between", value1, value2, "f4");
return (Criteria) this;
}
public Criteria andF5IsNull() {
addCriterion("f5 is null");
return (Criteria) this;
}
public Criteria andF5IsNotNull() {
addCriterion("f5 is not null");
return (Criteria) this;
}
public Criteria andF5EqualTo(String value) {
addCriterion("f5 =", value, "f5");
return (Criteria) this;
}
public Criteria andF5NotEqualTo(String value) {
addCriterion("f5 <>", value, "f5");
return (Criteria) this;
}
public Criteria andF5GreaterThan(String value) {
addCriterion("f5 >", value, "f5");
return (Criteria) this;
}
public Criteria andF5GreaterThanOrEqualTo(String value) {
addCriterion("f5 >=", value, "f5");
return (Criteria) this;
}
public Criteria andF5LessThan(String value) {
addCriterion("f5 <", value, "f5");
return (Criteria) this;
}
public Criteria andF5LessThanOrEqualTo(String value) {
addCriterion("f5 <=", value, "f5");
return (Criteria) this;
}
public Criteria andF5Like(String value) {
addCriterion("f5 like", value, "f5");
return (Criteria) this;
}
public Criteria andF5NotLike(String value) {
addCriterion("f5 not like", value, "f5");
return (Criteria) this;
}
public Criteria andF5In(List<String> values) {
addCriterion("f5 in", values, "f5");
return (Criteria) this;
}
public Criteria andF5NotIn(List<String> values) {
addCriterion("f5 not in", values, "f5");
return (Criteria) this;
}
public Criteria andF5Between(String value1, String value2) {
addCriterion("f5 between", value1, value2, "f5");
return (Criteria) this;
}
public Criteria andF5NotBetween(String value1, String value2) {
addCriterion("f5 not between", value1, value2, "f5");
return (Criteria) this;
}
public Criteria andPkyIsNull() {
addCriterion("pky is null");
return (Criteria) this;
}
public Criteria andPkyIsNotNull() {
addCriterion("pky is not null");
return (Criteria) this;
}
public Criteria andPkyEqualTo(String value) {
addCriterion("pky =", value, "pky");
return (Criteria) this;
}
public Criteria andPkyNotEqualTo(String value) {
addCriterion("pky <>", value, "pky");
return (Criteria) this;
}
public Criteria andPkyGreaterThan(String value) {
addCriterion("pky >", value, "pky");
return (Criteria) this;
}
public Criteria andPkyGreaterThanOrEqualTo(String value) {
addCriterion("pky >=", value, "pky");
return (Criteria) this;
}
public Criteria andPkyLessThan(String value) {
addCriterion("pky <", value, "pky");
return (Criteria) this;
}
public Criteria andPkyLessThanOrEqualTo(String value) {
addCriterion("pky <=", value, "pky");
return (Criteria) this;
}
public Criteria andPkyLike(String value) {
addCriterion("pky like", value, "pky");
return (Criteria) this;
}
public Criteria andPkyNotLike(String value) {
addCriterion("pky not like", value, "pky");
return (Criteria) this;
}
public Criteria andPkyIn(List<String> values) {
addCriterion("pky in", values, "pky");
return (Criteria) this;
}
public Criteria andPkyNotIn(List<String> values) {
addCriterion("pky not in", values, "pky");
return (Criteria) this;
}
public Criteria andPkyBetween(String value1, String value2) {
addCriterion("pky between", value1, value2, "pky");
return (Criteria) this;
}
public Criteria andPkyNotBetween(String value1, String value2) {
addCriterion("pky not between", value1, value2, "pky");
return (Criteria) this;
}
public Criteria andCam1NvrIsNull() {
addCriterion("cam1_nvr is null");
return (Criteria) this;
}
public Criteria andCam1NvrIsNotNull() {
addCriterion("cam1_nvr is not null");
return (Criteria) this;
}
public Criteria andCam1NvrEqualTo(String value) {
addCriterion("cam1_nvr =", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrNotEqualTo(String value) {
addCriterion("cam1_nvr <>", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrGreaterThan(String value) {
addCriterion("cam1_nvr >", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrGreaterThanOrEqualTo(String value) {
addCriterion("cam1_nvr >=", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrLessThan(String value) {
addCriterion("cam1_nvr <", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrLessThanOrEqualTo(String value) {
addCriterion("cam1_nvr <=", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrLike(String value) {
addCriterion("cam1_nvr like", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrNotLike(String value) {
addCriterion("cam1_nvr not like", value, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrIn(List<String> values) {
addCriterion("cam1_nvr in", values, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrNotIn(List<String> values) {
addCriterion("cam1_nvr not in", values, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrBetween(String value1, String value2) {
addCriterion("cam1_nvr between", value1, value2, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrNotBetween(String value1, String value2) {
addCriterion("cam1_nvr not between", value1, value2, "cam1Nvr");
return (Criteria) this;
}
public Criteria andCam1NvrChannelIsNull() {
addCriterion("cam1_nvr_channel is null");
return (Criteria) this;
}
public Criteria andCam1NvrChannelIsNotNull() {
addCriterion("cam1_nvr_channel is not null");
return (Criteria) this;
}
public Criteria andCam1NvrChannelEqualTo(String value) {
addCriterion("cam1_nvr_channel =", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelNotEqualTo(String value) {
addCriterion("cam1_nvr_channel <>", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelGreaterThan(String value) {
addCriterion("cam1_nvr_channel >", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelGreaterThanOrEqualTo(String value) {
addCriterion("cam1_nvr_channel >=", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelLessThan(String value) {
addCriterion("cam1_nvr_channel <", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelLessThanOrEqualTo(String value) {
addCriterion("cam1_nvr_channel <=", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelLike(String value) {
addCriterion("cam1_nvr_channel like", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelNotLike(String value) {
addCriterion("cam1_nvr_channel not like", value, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelIn(List<String> values) {
addCriterion("cam1_nvr_channel in", values, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelNotIn(List<String> values) {
addCriterion("cam1_nvr_channel not in", values, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelBetween(String value1, String value2) {
addCriterion("cam1_nvr_channel between", value1, value2, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam1NvrChannelNotBetween(String value1, String value2) {
addCriterion("cam1_nvr_channel not between", value1, value2, "cam1NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrIsNull() {
addCriterion("cam2_nvr is null");
return (Criteria) this;
}
public Criteria andCam2NvrIsNotNull() {
addCriterion("cam2_nvr is not null");
return (Criteria) this;
}
public Criteria andCam2NvrEqualTo(String value) {
addCriterion("cam2_nvr =", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrNotEqualTo(String value) {
addCriterion("cam2_nvr <>", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrGreaterThan(String value) {
addCriterion("cam2_nvr >", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrGreaterThanOrEqualTo(String value) {
addCriterion("cam2_nvr >=", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrLessThan(String value) {
addCriterion("cam2_nvr <", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrLessThanOrEqualTo(String value) {
addCriterion("cam2_nvr <=", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrLike(String value) {
addCriterion("cam2_nvr like", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrNotLike(String value) {
addCriterion("cam2_nvr not like", value, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrIn(List<String> values) {
addCriterion("cam2_nvr in", values, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrNotIn(List<String> values) {
addCriterion("cam2_nvr not in", values, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrBetween(String value1, String value2) {
addCriterion("cam2_nvr between", value1, value2, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrNotBetween(String value1, String value2) {
addCriterion("cam2_nvr not between", value1, value2, "cam2Nvr");
return (Criteria) this;
}
public Criteria andCam2NvrChannelIsNull() {
addCriterion("cam2_nvr_channel is null");
return (Criteria) this;
}
public Criteria andCam2NvrChannelIsNotNull() {
addCriterion("cam2_nvr_channel is not null");
return (Criteria) this;
}
public Criteria andCam2NvrChannelEqualTo(String value) {
addCriterion("cam2_nvr_channel =", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelNotEqualTo(String value) {
addCriterion("cam2_nvr_channel <>", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelGreaterThan(String value) {
addCriterion("cam2_nvr_channel >", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelGreaterThanOrEqualTo(String value) {
addCriterion("cam2_nvr_channel >=", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelLessThan(String value) {
addCriterion("cam2_nvr_channel <", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelLessThanOrEqualTo(String value) {
addCriterion("cam2_nvr_channel <=", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelLike(String value) {
addCriterion("cam2_nvr_channel like", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelNotLike(String value) {
addCriterion("cam2_nvr_channel not like", value, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelIn(List<String> values) {
addCriterion("cam2_nvr_channel in", values, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelNotIn(List<String> values) {
addCriterion("cam2_nvr_channel not in", values, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelBetween(String value1, String value2) {
addCriterion("cam2_nvr_channel between", value1, value2, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam2NvrChannelNotBetween(String value1, String value2) {
addCriterion("cam2_nvr_channel not between", value1, value2, "cam2NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrIsNull() {
addCriterion("cam3_nvr is null");
return (Criteria) this;
}
public Criteria andCam3NvrIsNotNull() {
addCriterion("cam3_nvr is not null");
return (Criteria) this;
}
public Criteria andCam3NvrEqualTo(String value) {
addCriterion("cam3_nvr =", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrNotEqualTo(String value) {
addCriterion("cam3_nvr <>", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrGreaterThan(String value) {
addCriterion("cam3_nvr >", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrGreaterThanOrEqualTo(String value) {
addCriterion("cam3_nvr >=", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrLessThan(String value) {
addCriterion("cam3_nvr <", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrLessThanOrEqualTo(String value) {
addCriterion("cam3_nvr <=", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrLike(String value) {
addCriterion("cam3_nvr like", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrNotLike(String value) {
addCriterion("cam3_nvr not like", value, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrIn(List<String> values) {
addCriterion("cam3_nvr in", values, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrNotIn(List<String> values) {
addCriterion("cam3_nvr not in", values, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrBetween(String value1, String value2) {
addCriterion("cam3_nvr between", value1, value2, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrNotBetween(String value1, String value2) {
addCriterion("cam3_nvr not between", value1, value2, "cam3Nvr");
return (Criteria) this;
}
public Criteria andCam3NvrChannelIsNull() {
addCriterion("cam3_nvr_channel is null");
return (Criteria) this;
}
public Criteria andCam3NvrChannelIsNotNull() {
addCriterion("cam3_nvr_channel is not null");
return (Criteria) this;
}
public Criteria andCam3NvrChannelEqualTo(String value) {
addCriterion("cam3_nvr_channel =", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelNotEqualTo(String value) {
addCriterion("cam3_nvr_channel <>", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelGreaterThan(String value) {
addCriterion("cam3_nvr_channel >", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelGreaterThanOrEqualTo(String value) {
addCriterion("cam3_nvr_channel >=", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelLessThan(String value) {
addCriterion("cam3_nvr_channel <", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelLessThanOrEqualTo(String value) {
addCriterion("cam3_nvr_channel <=", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelLike(String value) {
addCriterion("cam3_nvr_channel like", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelNotLike(String value) {
addCriterion("cam3_nvr_channel not like", value, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelIn(List<String> values) {
addCriterion("cam3_nvr_channel in", values, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelNotIn(List<String> values) {
addCriterion("cam3_nvr_channel not in", values, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelBetween(String value1, String value2) {
addCriterion("cam3_nvr_channel between", value1, value2, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andCam3NvrChannelNotBetween(String value1, String value2) {
addCriterion("cam3_nvr_channel not between", value1, value2, "cam3NvrChannel");
return (Criteria) this;
}
public Criteria andSerialPort1IsNull() {
addCriterion("serial_port1 is null");
return (Criteria) this;
}
public Criteria andSerialPort1IsNotNull() {
addCriterion("serial_port1 is not null");
return (Criteria) this;
}
public Criteria andSerialPort1EqualTo(String value) {
addCriterion("serial_port1 =", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1NotEqualTo(String value) {
addCriterion("serial_port1 <>", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1GreaterThan(String value) {
addCriterion("serial_port1 >", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1GreaterThanOrEqualTo(String value) {
addCriterion("serial_port1 >=", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1LessThan(String value) {
addCriterion("serial_port1 <", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1LessThanOrEqualTo(String value) {
addCriterion("serial_port1 <=", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1Like(String value) {
addCriterion("serial_port1 like", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1NotLike(String value) {
addCriterion("serial_port1 not like", value, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1In(List<String> values) {
addCriterion("serial_port1 in", values, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1NotIn(List<String> values) {
addCriterion("serial_port1 not in", values, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1Between(String value1, String value2) {
addCriterion("serial_port1 between", value1, value2, "serialPort1");
return (Criteria) this;
}
public Criteria andSerialPort1NotBetween(String value1, String value2) {
addCriterion("serial_port1 not between", value1, value2, "serialPort1");
return (Criteria) this;
}
public Criteria andBaudRate1IsNull() {
addCriterion("baud_rate1 is null");
return (Criteria) this;
}
public Criteria andBaudRate1IsNotNull() {
addCriterion("baud_rate1 is not null");
return (Criteria) this;
}
public Criteria andBaudRate1EqualTo(String value) {
addCriterion("baud_rate1 =", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1NotEqualTo(String value) {
addCriterion("baud_rate1 <>", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1GreaterThan(String value) {
addCriterion("baud_rate1 >", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1GreaterThanOrEqualTo(String value) {
addCriterion("baud_rate1 >=", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1LessThan(String value) {
addCriterion("baud_rate1 <", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1LessThanOrEqualTo(String value) {
addCriterion("baud_rate1 <=", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1Like(String value) {
addCriterion("baud_rate1 like", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1NotLike(String value) {
addCriterion("baud_rate1 not like", value, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1In(List<String> values) {
addCriterion("baud_rate1 in", values, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1NotIn(List<String> values) {
addCriterion("baud_rate1 not in", values, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1Between(String value1, String value2) {
addCriterion("baud_rate1 between", value1, value2, "baudRate1");
return (Criteria) this;
}
public Criteria andBaudRate1NotBetween(String value1, String value2) {
addCriterion("baud_rate1 not between", value1, value2, "baudRate1");
return (Criteria) this;
}
public Criteria andSerialPort2IsNull() {
addCriterion("serial_port2 is null");
return (Criteria) this;
}
public Criteria andSerialPort2IsNotNull() {
addCriterion("serial_port2 is not null");
return (Criteria) this;
}
public Criteria andSerialPort2EqualTo(String value) {
addCriterion("serial_port2 =", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2NotEqualTo(String value) {
addCriterion("serial_port2 <>", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2GreaterThan(String value) {
addCriterion("serial_port2 >", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2GreaterThanOrEqualTo(String value) {
addCriterion("serial_port2 >=", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2LessThan(String value) {
addCriterion("serial_port2 <", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2LessThanOrEqualTo(String value) {
addCriterion("serial_port2 <=", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2Like(String value) {
addCriterion("serial_port2 like", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2NotLike(String value) {
addCriterion("serial_port2 not like", value, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2In(List<String> values) {
addCriterion("serial_port2 in", values, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2NotIn(List<String> values) {
addCriterion("serial_port2 not in", values, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2Between(String value1, String value2) {
addCriterion("serial_port2 between", value1, value2, "serialPort2");
return (Criteria) this;
}
public Criteria andSerialPort2NotBetween(String value1, String value2) {
addCriterion("serial_port2 not between", value1, value2, "serialPort2");
return (Criteria) this;
}
public Criteria andBaudRate2IsNull() {
addCriterion("baud_rate2 is null");
return (Criteria) this;
}
public Criteria andBaudRate2IsNotNull() {
addCriterion("baud_rate2 is not null");
return (Criteria) this;
}
public Criteria andBaudRate2EqualTo(String value) {
addCriterion("baud_rate2 =", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2NotEqualTo(String value) {
addCriterion("baud_rate2 <>", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2GreaterThan(String value) {
addCriterion("baud_rate2 >", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2GreaterThanOrEqualTo(String value) {
addCriterion("baud_rate2 >=", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2LessThan(String value) {
addCriterion("baud_rate2 <", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2LessThanOrEqualTo(String value) {
addCriterion("baud_rate2 <=", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2Like(String value) {
addCriterion("baud_rate2 like", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2NotLike(String value) {
addCriterion("baud_rate2 not like", value, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2In(List<String> values) {
addCriterion("baud_rate2 in", values, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2NotIn(List<String> values) {
addCriterion("baud_rate2 not in", values, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2Between(String value1, String value2) {
addCriterion("baud_rate2 between", value1, value2, "baudRate2");
return (Criteria) this;
}
public Criteria andBaudRate2NotBetween(String value1, String value2) {
addCriterion("baud_rate2 not between", value1, value2, "baudRate2");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxIsNull() {
addCriterion("serial_port1_linux is null");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxIsNotNull() {
addCriterion("serial_port1_linux is not null");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxEqualTo(String value) {
addCriterion("serial_port1_linux =", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxNotEqualTo(String value) {
addCriterion("serial_port1_linux <>", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxGreaterThan(String value) {
addCriterion("serial_port1_linux >", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxGreaterThanOrEqualTo(String value) {
addCriterion("serial_port1_linux >=", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxLessThan(String value) {
addCriterion("serial_port1_linux <", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxLessThanOrEqualTo(String value) {
addCriterion("serial_port1_linux <=", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxLike(String value) {
addCriterion("serial_port1_linux like", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxNotLike(String value) {
addCriterion("serial_port1_linux not like", value, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxIn(List<String> values) {
addCriterion("serial_port1_linux in", values, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxNotIn(List<String> values) {
addCriterion("serial_port1_linux not in", values, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxBetween(String value1, String value2) {
addCriterion("serial_port1_linux between", value1, value2, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort1LinuxNotBetween(String value1, String value2) {
addCriterion("serial_port1_linux not between", value1, value2, "serialPort1Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxIsNull() {
addCriterion("serial_port2_linux is null");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxIsNotNull() {
addCriterion("serial_port2_linux is not null");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxEqualTo(String value) {
addCriterion("serial_port2_linux =", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxNotEqualTo(String value) {
addCriterion("serial_port2_linux <>", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxGreaterThan(String value) {
addCriterion("serial_port2_linux >", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxGreaterThanOrEqualTo(String value) {
addCriterion("serial_port2_linux >=", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxLessThan(String value) {
addCriterion("serial_port2_linux <", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxLessThanOrEqualTo(String value) {
addCriterion("serial_port2_linux <=", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxLike(String value) {
addCriterion("serial_port2_linux like", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxNotLike(String value) {
addCriterion("serial_port2_linux not like", value, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxIn(List<String> values) {
addCriterion("serial_port2_linux in", values, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxNotIn(List<String> values) {
addCriterion("serial_port2_linux not in", values, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxBetween(String value1, String value2) {
addCriterion("serial_port2_linux between", value1, value2, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andSerialPort2LinuxNotBetween(String value1, String value2) {
addCriterion("serial_port2_linux not between", value1, value2, "serialPort2Linux");
return (Criteria) this;
}
public Criteria andCcdjrqIsNull() {
addCriterion("ccdjrq is null");
return (Criteria) this;
}
public Criteria andCcdjrqIsNotNull() {
addCriterion("ccdjrq is not null");
return (Criteria) this;
}
public Criteria andCcdjrqEqualTo(Date value) {
addCriterion("ccdjrq =", value, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqNotEqualTo(Date value) {
addCriterion("ccdjrq <>", value, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqGreaterThan(Date value) {
addCriterion("ccdjrq >", value, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqGreaterThanOrEqualTo(Date value) {
addCriterion("ccdjrq >=", value, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqLessThan(Date value) {
addCriterion("ccdjrq <", value, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqLessThanOrEqualTo(Date value) {
addCriterion("ccdjrq <=", value, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqIn(List<Date> values) {
addCriterion("ccdjrq in", values, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqNotIn(List<Date> values) {
addCriterion("ccdjrq not in", values, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqBetween(Date value1, Date value2) {
addCriterion("ccdjrq between", value1, value2, "ccdjrq");
return (Criteria) this;
}
public Criteria andCcdjrqNotBetween(Date value1, Date value2) {
addCriterion("ccdjrq not between", value1, value2, "ccdjrq");
return (Criteria) this;
}
public Criteria andQzbfqzIsNull() {
addCriterion("qzbfqz is null");
return (Criteria) this;
}
public Criteria andQzbfqzIsNotNull() {
addCriterion("qzbfqz is not null");
return (Criteria) this;
}
public Criteria andQzbfqzEqualTo(Date value) {
addCriterion("qzbfqz =", value, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzNotEqualTo(Date value) {
addCriterion("qzbfqz <>", value, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzGreaterThan(Date value) {
addCriterion("qzbfqz >", value, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzGreaterThanOrEqualTo(Date value) {
addCriterion("qzbfqz >=", value, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzLessThan(Date value) {
addCriterion("qzbfqz <", value, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzLessThanOrEqualTo(Date value) {
addCriterion("qzbfqz <=", value, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzIn(List<Date> values) {
addCriterion("qzbfqz in", values, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzNotIn(List<Date> values) {
addCriterion("qzbfqz not in", values, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzBetween(Date value1, Date value2) {
addCriterion("qzbfqz between", value1, value2, "qzbfqz");
return (Criteria) this;
}
public Criteria andQzbfqzNotBetween(Date value1, Date value2) {
addCriterion("qzbfqz not between", value1, value2, "qzbfqz");
return (Criteria) this;
}
public Criteria andCjsjIsNull() {
addCriterion("cjsj is null");
return (Criteria) this;
}
public Criteria andCjsjIsNotNull() {
addCriterion("cjsj is not null");
return (Criteria) this;
}
public Criteria andCjsjEqualTo(Date value) {
addCriterion("cjsj =", value, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjNotEqualTo(Date value) {
addCriterion("cjsj <>", value, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjGreaterThan(Date value) {
addCriterion("cjsj >", value, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjGreaterThanOrEqualTo(Date value) {
addCriterion("cjsj >=", value, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjLessThan(Date value) {
addCriterion("cjsj <", value, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjLessThanOrEqualTo(Date value) {
addCriterion("cjsj <=", value, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjIn(List<Date> values) {
addCriterion("cjsj in", values, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjNotIn(List<Date> values) {
addCriterion("cjsj not in", values, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjBetween(Date value1, Date value2) {
addCriterion("cjsj between", value1, value2, "cjsj");
return (Criteria) this;
}
public Criteria andCjsjNotBetween(Date value1, Date value2) {
addCriterion("cjsj not between", value1, value2, "cjsj");
return (Criteria) this;
}
public Criteria andGxsjIsNull() {
addCriterion("gxsj is null");
return (Criteria) this;
}
public Criteria andGxsjIsNotNull() {
addCriterion("gxsj is not null");
return (Criteria) this;
}
public Criteria andGxsjEqualTo(Date value) {
addCriterion("gxsj =", value, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjNotEqualTo(Date value) {
addCriterion("gxsj <>", value, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjGreaterThan(Date value) {
addCriterion("gxsj >", value, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjGreaterThanOrEqualTo(Date value) {
addCriterion("gxsj >=", value, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjLessThan(Date value) {
addCriterion("gxsj <", value, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjLessThanOrEqualTo(Date value) {
addCriterion("gxsj <=", value, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjIn(List<Date> values) {
addCriterion("gxsj in", values, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjNotIn(List<Date> values) {
addCriterion("gxsj not in", values, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjBetween(Date value1, Date value2) {
addCriterion("gxsj between", value1, value2, "gxsj");
return (Criteria) this;
}
public Criteria andGxsjNotBetween(Date value1, Date value2) {
addCriterion("gxsj not between", value1, value2, "gxsj");
return (Criteria) this;
}
public Criteria andAssignTimeIsNull() {
addCriterion("assign_time is null");
return (Criteria) this;
}
public Criteria andAssignTimeIsNotNull() {
addCriterion("assign_time is not null");
return (Criteria) this;
}
public Criteria andAssignTimeEqualTo(Date value) {
addCriterion("assign_time =", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeNotEqualTo(Date value) {
addCriterion("assign_time <>", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeGreaterThan(Date value) {
addCriterion("assign_time >", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeGreaterThanOrEqualTo(Date value) {
addCriterion("assign_time >=", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeLessThan(Date value) {
addCriterion("assign_time <", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeLessThanOrEqualTo(Date value) {
addCriterion("assign_time <=", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeIn(List<Date> values) {
addCriterion("assign_time in", values, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeNotIn(List<Date> values) {
addCriterion("assign_time not in", values, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeBetween(Date value1, Date value2) {
addCriterion("assign_time between", value1, value2, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeNotBetween(Date value1, Date value2) {
addCriterion("assign_time not between", value1, value2, "assignTime");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andAudioNvrIpIsNull() {
addCriterion("audio_nvr_IP is null");
return (Criteria) this;
}
public Criteria andAudioNvrIpIsNotNull() {
addCriterion("audio_nvr_IP is not null");
return (Criteria) this;
}
public Criteria andAudioNvrIpEqualTo(String value) {
addCriterion("audio_nvr_IP =", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpNotEqualTo(String value) {
addCriterion("audio_nvr_IP <>", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpGreaterThan(String value) {
addCriterion("audio_nvr_IP >", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpGreaterThanOrEqualTo(String value) {
addCriterion("audio_nvr_IP >=", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpLessThan(String value) {
addCriterion("audio_nvr_IP <", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpLessThanOrEqualTo(String value) {
addCriterion("audio_nvr_IP <=", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpLike(String value) {
addCriterion("audio_nvr_IP like", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpNotLike(String value) {
addCriterion("audio_nvr_IP not like", value, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpIn(List<String> values) {
addCriterion("audio_nvr_IP in", values, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpNotIn(List<String> values) {
addCriterion("audio_nvr_IP not in", values, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpBetween(String value1, String value2) {
addCriterion("audio_nvr_IP between", value1, value2, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrIpNotBetween(String value1, String value2) {
addCriterion("audio_nvr_IP not between", value1, value2, "audioNvrIp");
return (Criteria) this;
}
public Criteria andAudioNvrPortIsNull() {
addCriterion("audio_nvr_port is null");
return (Criteria) this;
}
public Criteria andAudioNvrPortIsNotNull() {
addCriterion("audio_nvr_port is not null");
return (Criteria) this;
}
public Criteria andAudioNvrPortEqualTo(String value) {
addCriterion("audio_nvr_port =", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortNotEqualTo(String value) {
addCriterion("audio_nvr_port <>", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortGreaterThan(String value) {
addCriterion("audio_nvr_port >", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortGreaterThanOrEqualTo(String value) {
addCriterion("audio_nvr_port >=", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortLessThan(String value) {
addCriterion("audio_nvr_port <", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortLessThanOrEqualTo(String value) {
addCriterion("audio_nvr_port <=", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortLike(String value) {
addCriterion("audio_nvr_port like", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortNotLike(String value) {
addCriterion("audio_nvr_port not like", value, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortIn(List<String> values) {
addCriterion("audio_nvr_port in", values, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortNotIn(List<String> values) {
addCriterion("audio_nvr_port not in", values, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortBetween(String value1, String value2) {
addCriterion("audio_nvr_port between", value1, value2, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrPortNotBetween(String value1, String value2) {
addCriterion("audio_nvr_port not between", value1, value2, "audioNvrPort");
return (Criteria) this;
}
public Criteria andAudioNvrAccountIsNull() {
addCriterion("audio_nvr_account is null");
return (Criteria) this;
}
public Criteria andAudioNvrAccountIsNotNull() {
addCriterion("audio_nvr_account is not null");
return (Criteria) this;
}
public Criteria andAudioNvrAccountEqualTo(String value) {
addCriterion("audio_nvr_account =", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountNotEqualTo(String value) {
addCriterion("audio_nvr_account <>", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountGreaterThan(String value) {
addCriterion("audio_nvr_account >", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountGreaterThanOrEqualTo(String value) {
addCriterion("audio_nvr_account >=", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountLessThan(String value) {
addCriterion("audio_nvr_account <", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountLessThanOrEqualTo(String value) {
addCriterion("audio_nvr_account <=", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountLike(String value) {
addCriterion("audio_nvr_account like", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountNotLike(String value) {
addCriterion("audio_nvr_account not like", value, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountIn(List<String> values) {
addCriterion("audio_nvr_account in", values, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountNotIn(List<String> values) {
addCriterion("audio_nvr_account not in", values, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountBetween(String value1, String value2) {
addCriterion("audio_nvr_account between", value1, value2, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrAccountNotBetween(String value1, String value2) {
addCriterion("audio_nvr_account not between", value1, value2, "audioNvrAccount");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordIsNull() {
addCriterion("audio_nvr_password is null");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordIsNotNull() {
addCriterion("audio_nvr_password is not null");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordEqualTo(String value) {
addCriterion("audio_nvr_password =", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordNotEqualTo(String value) {
addCriterion("audio_nvr_password <>", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordGreaterThan(String value) {
addCriterion("audio_nvr_password >", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordGreaterThanOrEqualTo(String value) {
addCriterion("audio_nvr_password >=", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordLessThan(String value) {
addCriterion("audio_nvr_password <", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordLessThanOrEqualTo(String value) {
addCriterion("audio_nvr_password <=", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordLike(String value) {
addCriterion("audio_nvr_password like", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordNotLike(String value) {
addCriterion("audio_nvr_password not like", value, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordIn(List<String> values) {
addCriterion("audio_nvr_password in", values, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordNotIn(List<String> values) {
addCriterion("audio_nvr_password not in", values, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordBetween(String value1, String value2) {
addCriterion("audio_nvr_password between", value1, value2, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrPasswordNotBetween(String value1, String value2) {
addCriterion("audio_nvr_password not between", value1, value2, "audioNvrPassword");
return (Criteria) this;
}
public Criteria andAudioNvrChannelIsNull() {
addCriterion("audio_nvr_channel is null");
return (Criteria) this;
}
public Criteria andAudioNvrChannelIsNotNull() {
addCriterion("audio_nvr_channel is not null");
return (Criteria) this;
}
public Criteria andAudioNvrChannelEqualTo(String value) {
addCriterion("audio_nvr_channel =", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelNotEqualTo(String value) {
addCriterion("audio_nvr_channel <>", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelGreaterThan(String value) {
addCriterion("audio_nvr_channel >", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelGreaterThanOrEqualTo(String value) {
addCriterion("audio_nvr_channel >=", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelLessThan(String value) {
addCriterion("audio_nvr_channel <", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelLessThanOrEqualTo(String value) {
addCriterion("audio_nvr_channel <=", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelLike(String value) {
addCriterion("audio_nvr_channel like", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelNotLike(String value) {
addCriterion("audio_nvr_channel not like", value, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelIn(List<String> values) {
addCriterion("audio_nvr_channel in", values, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelNotIn(List<String> values) {
addCriterion("audio_nvr_channel not in", values, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelBetween(String value1, String value2) {
addCriterion("audio_nvr_channel between", value1, value2, "audioNvrChannel");
return (Criteria) this;
}
public Criteria andAudioNvrChannelNotBetween(String value1, String value2) {
addCriterion("audio_nvr_channel not between", value1, value2, "audioNvrChannel");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
|
package com.xiaofanwo.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
* @author Winfred
* @date 2016年7月1日
* @version V1.0
*/
@Path("user")
public class UserResource {
/**
* Method handling HTTP GET requests. The returned object will be sent to
* the client as "text/plain" media type.
*
* @return String that will be returned as a text/plain response.
*/
@GET
@Produces(MediaType.TEXT_PLAIN)
public String getIt() {
return "Got it!";
}
}
|
package api.longpoll.bots.methods.impl.messages;
import api.longpoll.bots.methods.AuthorizedVkApiMethod;
import api.longpoll.bots.methods.VkApiProperties;
import api.longpoll.bots.model.response.ExtendedVkList;
import api.longpoll.bots.model.response.GenericResponse;
import com.google.gson.annotations.SerializedName;
import java.util.Arrays;
import java.util.List;
/**
* Implements <b>messages.getConversationMembers</b> method.
* <p>
* Returns a list of IDs of users participating in a conversation.
*
* @see <a href="https://vk.com/dev/messages.getConversationMembers">https://vk.com/dev/messages.getConversationMembers</a>
*/
public class GetConversationMembers extends AuthorizedVkApiMethod<GetConversationMembers.Response> {
public GetConversationMembers(String accessToken) {
super(accessToken);
}
@Override
protected String getUrl() {
return VkApiProperties.get("messages.getConversationMembers");
}
@Override
protected Class<Response> getResponseType() {
return Response.class;
}
public GetConversationMembers setPeerId(int peerId) {
return addParam("peer_id", peerId);
}
public GetConversationMembers setFields(String... fields) {
return setFields(Arrays.asList(fields));
}
public GetConversationMembers setFields(List<String> fields) {
return addParam("fields", fields);
}
public GetConversationMembers setGroupId(int groupId) {
return addParam("group_id", groupId);
}
@Override
public GetConversationMembers addParam(String key, Object value) {
return (GetConversationMembers) super.addParam(key, value);
}
/**
* Response to <b>messages.getConversationMembers</b> request.
*/
public static class Response extends GenericResponse<ExtendedVkList<Response.Item>> {
/**
* Response item.
*/
public static class Item {
/**
* Conversation member ID.
*/
@SerializedName("member_id")
private Integer memberId;
/**
* ID of the user who invited this member to the conversation.
*/
@SerializedName("invited_by")
private Integer invitedBy;
/**
* Date of joining the conversation.
*/
@SerializedName("join_date")
private Integer joinDate;
/**
* Whether the user is conversation admin.
*/
@SerializedName("is_admin")
private Boolean admin;
/**
* Whether the user can kick.
*/
@SerializedName("can_kick")
private Boolean canKick;
public Integer getMemberId() {
return memberId;
}
public void setMemberId(Integer memberId) {
this.memberId = memberId;
}
public Integer getInvitedBy() {
return invitedBy;
}
public void setInvitedBy(Integer invitedBy) {
this.invitedBy = invitedBy;
}
public Integer getJoinDate() {
return joinDate;
}
public void setJoinDate(Integer joinDate) {
this.joinDate = joinDate;
}
public Boolean getAdmin() {
return admin;
}
public void setAdmin(Boolean admin) {
this.admin = admin;
}
public Boolean getCanKick() {
return canKick;
}
public void setCanKick(Boolean canKick) {
this.canKick = canKick;
}
@Override
public String toString() {
return "Item{" +
"memberId=" + memberId +
", invitedBy=" + invitedBy +
", joinDate=" + joinDate +
", admin=" + admin +
", canKick=" + canKick +
'}';
}
}
}
}
|
package com.joakims.BST;
public class TreeNode {
private Integer data;
private TreeNode leftChild;
private TreeNode rightChild;
public TreeNode(Integer data) {
this.data = data;
}
public Integer getData() {
return data;
}
// NOTE: WE DO NOT PROVIDE A setData member (SETTER FOR THE DATA MEMBER)), BECAUSE WE WILL SET THE DATA
// THROUGH THE CONSTRUCTOR, AND ONCE SET, THERE IS NO NEED TO CHANGE IT!
// IMMUTABLE OBJECTS ARE GOOD PRACTICE
public TreeNode getLeftChild() {
return leftChild;
}
public void setLeftChild(TreeNode leftChild) {
this.leftChild = leftChild;
}
public TreeNode getRightChild() {
return rightChild;
}
public void setRightChild(TreeNode rightChild) {
this.rightChild = rightChild;
}
// implement the search method:
public TreeNode find(Integer data) {
if(this.data == data) {
return this;
}
if(data < this.data && leftChild != null) {
return leftChild.find(data); // call recursive search on the Left
// Note, that if leftChild is null, and we don't check for this, we will get a NullPointerException,
// so we add the condition (&& leftChild != null)
}
if(data > this.data && rightChild != null) {
return rightChild.find(data);
}
return null; // this means, no TreeNode was found that matches 'data'
}
// INSERT METHOD IN THE TREENODE CLASS
public void insert(Integer data) {
// CHECK IF DATA SHOULD GO ON THE RIGHT HAND SIDE....
if(data >= this.data) { // if data to insert is greater or equal to current Node,
if(this.rightChild == null) { // if the rightChild is empty,
this.rightChild = new TreeNode(data); // create a new child Node and insert the data
} else { // otherwise,
this.rightChild.insert(data); // just insert the data to the rightChild Node recursively.
}
// OR IF IT SHOULD GO ON THE LEFT HAND SIDE....
} else {
if(this.leftChild == null) {
this.leftChild = new TreeNode(data);
} else {
this.leftChild.insert(data); // insert the data recursively
}
}
}
}
|
package com.cm4j.lock;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cm4j.util.ThreadUtil;
/**
* @author yeas.fun
* @since 2021/11/25
*/
public class InternalLock implements AutoCloseable {
private static final Logger log = LoggerFactory.getLogger(InternalLock.class);
/**
* 获取锁的超时时间,单位:s
*/
private final int LOCK_TIME_OUT = 5;
private final Lock lock = new ReentrantLock();
// 当前持有锁的线程
private Thread holdThread;
public void tryLock() {
boolean success = false;
try {
success = lock.tryLock(LOCK_TIME_OUT, TimeUnit.SECONDS);
} catch (InterruptedException ignored) {
}
if (success) {
holdThread = Thread.currentThread();
} else {
// 堆栈信息
String currentStack = ThreadUtil.getThreadStackTrace(Thread.currentThread());
String holdStack = ThreadUtil.getThreadStackTrace(holdThread);
log.error("=========== 获取InternalLock超时,可能发生死锁===========\n【当前线程】堆栈:{}\n{}\n【持有锁线程】堆栈:{}\n{}",
Thread.currentThread(), currentStack, holdThread, holdStack);
throw new RuntimeException("获取InternalLock超时,可能发生死锁");
}
}
@Override
public void close() {
holdThread = null;
lock.unlock();
}
}
|
/**
*
*/
package simplejava.nio.selector;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.CharBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.channels.WritableByteChannel;
import java.util.Iterator;
/**
* @title SelectorTest
*/
public class SelectorTest {
private static final int DEF_PORT = 1234;
private ByteBuffer buff = ByteBuffer.allocate(1024); // new buffer
private ThreadPool threadPool = new ThreadPool(10);
public static void main(String[] args) throws IOException {
SelectorTest test = new SelectorTest();
test.run(DEF_PORT);
}
public void run(int port) throws IOException {
ServerSocketChannel serverChannel = ServerSocketChannel.open();
serverChannel.socket().bind(new InetSocketAddress("localhost", port));
System.out.println("Listening on port " + port);
Selector selector = Selector.open();
serverChannel.configureBlocking(false);
serverChannel.register(selector, SelectionKey.OP_ACCEPT);
buff.order(ByteOrder.BIG_ENDIAN);
while(true) {
int n;
while( (n = selector.select(1 * 1000)) == 0 ); // wait for 1 seconds
if(n > 0) {
Iterator<SelectionKey> it = selector.selectedKeys().iterator();
while(it.hasNext()) {
SelectionKey key = (SelectionKey) it.next();
if(key.isAcceptable()) {
ServerSocketChannel sc = (ServerSocketChannel) key.channel();
SocketChannel channel = sc.accept();
System.out.println("Accept " + channel.getRemoteAddress().toString());
registerChannel(channel, selector, SelectionKey.OP_READ, null);
}
if(key.isReadable()) {
SocketChannel channel = (SocketChannel) key.channel();
System.out.println("Read from " + channel.getRemoteAddress().toString());
readFromChannel(key);
// imitate perform a service call and return an object as result
// this action is usually executed in another thread
// Object result = performService(channel, content);
// register for write, with attachment
// registerChannel(channel, selector, SelectionKey.OP_WRITE, result);
}
// if(key.isWritable()) {
// SocketChannel channel = (SocketChannel) key.channel();
// String msg = (String) key.attachment();
// writeToChannel(channel, msg);
// System.out.println("Send response to " + channel.getRemoteAddress().toString()
// + ": " + msg);
// key.cancel(); // cancel register for this connection
// }
it.remove(); // remove from selected keys
}
}
}
}
// private Object performService(SocketChannel ch, String param) {
// System.out.println("Call service with parameter: " + param);
// return param;
// }
// private String readFromChannel(ReadableByteChannel channel) throws IOException {
// StringBuilder str = new StringBuilder();
// buff.clear();
// while(channel.read(buff) > 0);
// buff.flip();
// while(buff.hasRemaining()) {
// str.append((char) buff.get());
// }
// return str.toString();
// }
private void readFromChannel(SelectionKey key) throws IOException {
WorkerThread t = threadPool.getWorker();
if(t != null) {
t.serviceChannel(key);
}
}
private void writeToChannel(WritableByteChannel channel, String msg) throws IOException {
buff.clear();
buff.put(msg.getBytes());
buff.flip();
channel.write(buff);
}
private void registerChannel(SelectableChannel ch, Selector selector, int ops, Object attach) throws IOException {
if(ch == null)
return;
ch.configureBlocking(false);
ch.register(selector, ops, attach);
}
}
|
package KidneyExchange;
import java.util.ArrayList;
public class Hospital {
private final int hospitalId;
private final int maxSurgeries;
private ArrayList<ExchangePair> pairs;
public Hospital(int hospitalId, int maxSurgeries) {
this.hospitalId = hospitalId;
this.maxSurgeries = maxSurgeries;
this.pairs = new ArrayList<ExchangePair>();
}
public int getHospitalId() {
return hospitalId;
}
public int getMaxSurgeries() {
return maxSurgeries;
}
// Get reference to list of ExchangePairs
public ArrayList<ExchangePair> getPairs() {
return pairs;
}
public int getSize() {
return pairs.size();
}
// Append pair to list
public void addPair(ExchangePair pair) {
pairs.add(pair);
}
// Remove pair from list
public boolean removePair(ExchangePair pair) {
return pairs.remove(pair);
}
public boolean hasPair(ExchangePair pair) {
return pairs.contains(pair);
}
public String toString() {
StringBuilder s = new StringBuilder();
s.append("Hospital: " + hospitalId + ", maxSurgeries=" + maxSurgeries + "\n");
for(ExchangePair pair: pairs) {
if(pair.getCurrentHospital() == hospitalId) {
s.append(pair.toString() + "\n");
} else {
s.append(pair.toString() + " (hospital: " + pair.getCurrentHospital() + ")\n");
}
}
return s.toString();
}
}
|
package ast.expression;
import ast.declaration.*;
public class VariableDeclarationExpression extends Expression {
private VariableDeclaration variableDeclaration;
public VariableDeclarationExpression(VariableDeclaration variableDeclaration) {
super();
this.variableDeclaration = variableDeclaration;
this.addChild(variableDeclaration);
}
}
|
package solve;
import static solve.CrossValue.EPSILON;
/**
* Created by Matthew on 12/12/2017.
*/
public class DoubleUtil {
/**
* allow some reasonable error such that |f(a)-f(b)| < error
* for most continuous functions when
* a = x-dx
* b = x+dx
* where dx = Math.ulp(x)
* @param a
* @param b
* @return error
*/
public static double reasonableError(double a, double b) {
final double minError = Math.sqrt(EPSILON);
double error = maxUlp(a, b);
//square root or square the output resolution to halve the number of LSB that must match
//"close enough"
if(error<1) error = Math.sqrt(error);
if(error>1) error *= error;
//when a/b are 0 ULP can be unreasonably small, so use an arbitrary smallish number, in this case sqrt(epsilon)
error = Math.max(error, minError);
return error;
}
private static final double BASICALLY_INFINITY = 1<<53;
/**
* if a is basically infinity, return actual positive/negative infinity, otherwise return a
* @param a
* @return
*/
public static double fixBasicallyInfinity(double a) {
if(Math.abs(a) > BASICALLY_INFINITY) return Math.signum(a) * Double.POSITIVE_INFINITY;
return a;
}
public static boolean isBasicallyFinite(double a) {
if(!Double.isFinite(a)) return false;
if(!Double.isFinite(fixBasicallyInfinity(a))) return false;
return true;
}
public static double maxUlp(double a, double b) {
return Math.max(Math.ulp(a), Math.ulp(b));
}
public static boolean fuzzyEqual(double a, double b) {
return Math.abs(a-b) < reasonableError(a , b);
}
public static boolean isEqual (double a, double b) {
return Math.abs(a-b) <= 2*maxUlp(a, b);
}
public static boolean compare(double a, double b, boolean greater) {
if (greater) return a>b;
else return a<b;
}
}
|
/*
* 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 DAO;
import Entities.Student;
import Entities.Category;
import Entities.Teacher;
import Entities.Vaccine;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class DBAccess {
private Connection connect = null;
private Statement statement = null;
private PreparedStatement preparedStatement = null;
private ResultSet resultSet = null;
final private String host = "localhost";
final private String user = "root";
final private String passwd = "Boston@23";
// fetch categories
public ArrayList<Category> fetchCategories()throws Exception {
ArrayList<Category> objCategoryList = new ArrayList<Category>();
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/daycare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
preparedStatement = connect
.prepareStatement("SELECT Id, Name, student_capacity, teacher_capacity from daycare.category");
resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
// It is possible to get the columns via name
// also possible to get the columns via the column number
// which starts at 1
// e.g. resultSet.getSTring(2);
Category objCategory = new Category();
objCategory.setId(resultSet.getInt("Id"));
objCategory.setName(resultSet.getString("Name"));
objCategory.setStudent_capacity(resultSet.getInt("student_capacity"));
objCategory.setTeacher_capacity(resultSet.getInt("teacher_capacity"));
objCategoryList.add(objCategory);
}
} catch (Exception e) {
throw e;
} finally {
close();
}
return objCategoryList;
}
// fetch teachers based on category id
public ArrayList<Teacher> fetchTeachers(int categoryId)throws Exception {
System.out.println("fetchTeachers function called : categoryId = " + categoryId);
ArrayList<Teacher> objTeacherList = new ArrayList<Teacher>();
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/daycare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
if(categoryId > 0){
preparedStatement = connect
.prepareStatement("SELECT Id, Name, student_capacity, student_assigned, CategoryName, Classroom FROM daycare.teacher_details WHERE student_assigned < student_capacity AND CategoryId = " + categoryId);
}
else{
preparedStatement = connect
.prepareStatement("SELECT Id, Name, student_capacity, student_assigned, CategoryName, Classroom FROM daycare.teacher_details;");
}
resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
// It is possible to get the columns via name
// also possible to get the columns via the column number
// which starts at 1
// e.g. resultSet.getSTring(2);
Teacher objTeacher = new Teacher();
objTeacher.setId(resultSet.getInt("Id"));
objTeacher.setName(resultSet.getString("Name"));
objTeacher.setStudent_capacity(resultSet.getInt("student_capacity"));
objTeacher.setStudent_assigned(resultSet.getInt("student_assigned"));
objTeacher.setAgeCategoryName(resultSet.getString("CategoryName"));
objTeacher.setClassroomAssigned(Integer.parseInt(resultSet.getString("Classroom")));
objTeacherList.add(objTeacher);
}
} catch (Exception e) {
throw e;
} finally {
close();
}
return objTeacherList;
}
// fetch Students based on category id
public ArrayList<Student> fetchStudents()throws Exception {
System.out.println("fetchStudents function called..." );
ArrayList<Student> objStudentList = new ArrayList<Student>();
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/daycare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
preparedStatement = connect
.prepareStatement("SELECT Id, FirstName, LastName, MotherName,FatherName"
+ ",AgeCategoryId,AgeCategoryName ,RegistrationDate , TeacherID, Teacher_name, DateOfBirth, ClassroomId FROM daycare.student_details where AgeCategoryName = '6-12' or AgeCategoryName = '13-24'; ");
resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
Student objStudent = new Student();
objStudent.setStudentId(resultSet.getInt("Id"));
objStudent.setFirstName(resultSet.getString("FirstName"));
objStudent.setLastName(resultSet.getString("LastName"));
objStudent.setMotherName(resultSet.getString("MotherName"));
objStudent.setFatherName(resultSet.getString("FatherName"));
objStudent.setRegistrationDate(resultSet.getDate("RegistrationDate"));
objStudent.setDateOfBirth(resultSet.getDate("DateOfBirth"));
// Age Category
Category objCategory = new Category();
objCategory.setId(resultSet.getInt("AgeCategoryId"));
objCategory.setName(resultSet.getString("AgeCategoryName"));
objStudent.setAgeCategory(objCategory);
// Teacher Details
Teacher objTeacher = new Teacher();
objTeacher.setId(resultSet.getInt("TeacherID"));
objTeacher.setName(resultSet.getString("Teacher_name"));
objTeacher.setClassroomAssigned(resultSet.getInt("ClassroomId"));
objStudent.setTeacher(objTeacher);
objStudentList.add(objStudent);
}
} catch (Exception e) {
throw e;
} finally {
close();
}
return objStudentList;
}
public ArrayList<Student> fetchStudents2()throws Exception {
System.out.println("fetchStudents function called..." );
ArrayList<Student> objStudentList = new ArrayList<Student>();
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/daycare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
preparedStatement = connect
.prepareStatement("SELECT Id, FirstName, LastName, MotherName,FatherName"
+ ",AgeCategoryId,AgeCategoryName ,RegistrationDate , TeacherID, Teacher_name, DateOfBirth, ClassroomId FROM daycare.student_details where AgeCategoryName = '25-35' or AgeCategoryName = '36-47' or AgeCategoryName = '48-59'; ");
resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
Student objStudent = new Student();
objStudent.setStudentId(resultSet.getInt("Id"));
objStudent.setFirstName(resultSet.getString("FirstName"));
objStudent.setLastName(resultSet.getString("LastName"));
objStudent.setMotherName(resultSet.getString("MotherName"));
objStudent.setFatherName(resultSet.getString("FatherName"));
objStudent.setRegistrationDate(resultSet.getDate("RegistrationDate"));
objStudent.setDateOfBirth(resultSet.getDate("DateOfBirth"));
// Age Category
Category objCategory = new Category();
objCategory.setId(resultSet.getInt("AgeCategoryId"));
objCategory.setName(resultSet.getString("AgeCategoryName"));
objStudent.setAgeCategory(objCategory);
// Teacher Details
Teacher objTeacher = new Teacher();
objTeacher.setId(resultSet.getInt("TeacherID"));
objTeacher.setName(resultSet.getString("Teacher_name"));
objTeacher.setClassroomAssigned(resultSet.getInt("ClassroomId"));
objStudent.setTeacher(objTeacher);
objStudentList.add(objStudent);
}
} catch (Exception e) {
throw e;
} finally {
close();
}
return objStudentList;
}
public void addStudent(Student objStudent) throws Exception{
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/daycare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
// PreparedStatements can use variables and are more efficient
preparedStatement = connect
.prepareStatement("insert into daycare.student_details(FirstName,LastName,FatherName, "
+ "MotherName, AgeCategoryId, RegistrationDate, TeacherID, Teacher_name, DateOfBirth, AgeCategoryName, ClassroomId, RegistrationDue)"
+ " values (?, ?, ?, ?, ? , ?, ?,?,?,?,?, ?)");
preparedStatement.setString(1, objStudent.getFirstName());
preparedStatement.setString(2, objStudent.getLastName());
preparedStatement.setString(3, objStudent.getFatherName());
preparedStatement.setString(4, objStudent.getMotherName());
preparedStatement.setInt(5, objStudent.getAgeCategory().getId());
preparedStatement.setDate(6, new java.sql.Date(objStudent.getRegistrationDate().getYear(), objStudent.getRegistrationDate().getMonth(), objStudent.getRegistrationDate().getDate()));
preparedStatement.setInt(7, objStudent.getTeacher().getId());
preparedStatement.setString(8, objStudent.getTeacher().getName());
preparedStatement.setDate(9, new java.sql.Date(objStudent.getDateOfBirth().getYear(), objStudent.getDateOfBirth().getMonth(), objStudent.getDateOfBirth().getDate()));
preparedStatement.setString(10, objStudent.getAgeCategory().getName());
preparedStatement.setInt(11, objStudent.getTeacher().getClassroomAssigned());
int registeredyear = (objStudent.getRegistrationDate().getYear()+1);
preparedStatement.setDate(12, new java.sql.Date(objStudent.getRegistrationDate().getYear(), objStudent.getRegistrationDate().getMonth(), objStudent.getRegistrationDate().getDate()));
System.out.println(new java.sql.Date(objStudent.getDateOfBirth().getYear(), objStudent.getDateOfBirth().getMonth(), objStudent.getDateOfBirth().getDate()));
preparedStatement.executeUpdate();
// Updating student assigned in teacher counter counter
int current_counter = objStudent.getTeacher().getStudent_assigned();
int increment_counter = current_counter + 1;
System.out.println("Current Student assigned for teacher " + objStudent.getTeacher().getName() + " is :" + objStudent.getTeacher().getStudent_assigned());
preparedStatement = connect.prepareStatement("Update teacher_details SET student_assigned = "
+ increment_counter + " WHERE Id = " + objStudent.getTeacher().getId() +";");
preparedStatement.executeUpdate();
} catch (Exception e) {
throw e;
} finally {
close();
}
}
// Add student
public void addVaacine(Student objStudent) throws Exception{
int id = 1;
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/DayCare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
System.out.println("Inside AddVaccine Method");
// PreparedStatements can use variables and are more efficient
preparedStatement = connect
.prepareStatement("Update daycare.student_details SET HIB_Dose1 = ?, DTap_Dose1 = ?,DTap_Dose2 = ?, DTap_Dose3 = ?, DTap_Dose4 = ?, Polio_Dose1 = ?, Polio_Dose2 = ?, Polio_Dose3 = ?, Hepatitis_Dose1 = ?, Hepatitis_Dose2 = ?, Hepatitis_Dose3 = ?, MMR_Dose1= ?, Varicella_Dose1 = ? WHERE id = "+ objStudent.getStudentId() +";");
//+ "+,DTap_Dose1 = ?,DTap_Dose2 = ?, DTap_Dose3 = ?, DTap_Dose4 = ?, Polio_Dose1 = ?, Polio_Dose2 = ?, Polio_Dose3 = ? WHERE id = "+ id +";");
// + "MMR_Dose1= ?, Hepatitis_Dose1 = ?, Hepatitis_Dose2 = ?, Hepatitis_Dose3 = ?, Varicella_Dose1 = ? WHERE id = "+ id +";");
preparedStatement.setDate(1, new java.sql.Date(objStudent.getHIB_Dose1().getYear(), objStudent.getHIB_Dose1().getMonth(), objStudent.getHIB_Dose1().getDay()));
System.out.println(new java.sql.Date(objStudent.getHIB_Dose1().getYear(), objStudent.getHIB_Dose1().getMonth(), objStudent.getHIB_Dose1().getDay()));
System.out.println("Update daycare.student_details SET HIB_Dose1 = ? WHERE FirstName = "+ objStudent.getFirstName() +";");
//System.out.println(objStudent.getHIB_Dose1().getMonth());
//System.out.println(objStudent.getHIB_Dose1().getDay());
preparedStatement.setDate(2, new java.sql.Date(objStudent.getDTap_Dose1().getYear(), objStudent.getDTap_Dose1().getMonth(), objStudent.getDTap_Dose1().getDate()));
preparedStatement.setDate(3, new java.sql.Date(objStudent.getDTap_Dose2().getYear(), objStudent.getDTap_Dose2().getMonth(), objStudent.getDTap_Dose2().getDate()));
preparedStatement.setDate(4, new java.sql.Date(objStudent.getDTap_Dose3().getYear(), objStudent.getDTap_Dose3().getMonth(), objStudent.getDTap_Dose3().getDate()));
preparedStatement.setDate(5, new java.sql.Date(objStudent.getDTap_Dose4().getYear(), objStudent.getDTap_Dose4().getMonth(), objStudent.getDTap_Dose4().getDate()));
preparedStatement.setDate(6, new java.sql.Date(objStudent.getPolio_Dose1().getYear(), objStudent.getPolio_Dose1().getMonth(), objStudent.getPolio_Dose1().getDate()));
preparedStatement.setDate(7, new java.sql.Date(objStudent.getPolio_Dose2().getYear(), objStudent.getPolio_Dose2().getMonth(), objStudent.getPolio_Dose2().getDate()));
preparedStatement.setDate(8, new java.sql.Date(objStudent.getPolio_Dose3().getYear(), objStudent.getPolio_Dose3().getMonth(), objStudent.getPolio_Dose3().getDate()));
preparedStatement.setDate(9, new java.sql.Date(objStudent.getMMR_Dose1().getYear(), objStudent.getMMR_Dose1().getMonth(), objStudent.getMMR_Dose1().getDate()));
preparedStatement.setDate(10, new java.sql.Date(objStudent.getHepatitis_Dose1().getYear(), objStudent.getHepatitis_Dose1().getMonth(), objStudent.getHepatitis_Dose1().getDate()));
preparedStatement.setDate(11, new java.sql.Date(objStudent.getHepatitis_Dose2().getYear(), objStudent.getHepatitis_Dose2().getMonth(), objStudent.getHepatitis_Dose2().getDate()));
preparedStatement.setDate(12, new java.sql.Date(objStudent.getHepatitis_Dose3().getYear(), objStudent.getHepatitis_Dose3().getMonth(), objStudent.getHepatitis_Dose3().getDate()));
preparedStatement.setDate(13, new java.sql.Date(objStudent.getVaricella_Dose1().getYear(), objStudent.getVaricella_Dose1().getMonth(), objStudent.getVaricella_Dose1().getDate()));
preparedStatement.executeUpdate();
} catch (Exception e) {
throw e;
} finally {
close();
}
}
public void addVaacine2(Student objStudent) throws Exception{
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/DayCare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
System.out.println("Inside AddVaccine Method");
// PreparedStatements can use variables and are more efficient
preparedStatement = connect
.prepareStatement("Update daycare.student_details SET DTap_Dose1 = ? , DTap_Dose2 = ?, DTap_Dose3 = ?, DTap_Dose4 = ?, DTap_Dose5 = ?, Polio_Dose1 = ?, Polio_Dose2 = ?, Polio_Dose3 = ?, Polio_Dose4 = ?, MMR_Dose1= ?, MMR_Dose2= ?, Hepatitis_Dose1 = ?, Hepatitis_Dose2 = ?, Hepatitis_Dose3 = ? WHERE id = " + objStudent.getStudentId()+";");
// + "DTap_Dose2 = ?, DTap_Dose3 = ?, DTap_Dose4 = ?, DTap_Dose5 = ? " WHERE id = "+ objStudent.getStudentId()+";);
//+ ", Polio_Dose1 = ?, Polio_Dose2 = ?, Polio_Dose3 = ?, Polio_Dose4 = ?, MMR_Dose1= ?, MMR_Dose2= ?, Hepatitis_Dose1 = ?, Hepatitis_Dose2 = ?, Hepatitis_Dose3 = ?, Varicella_Dose1 = ?, Varicella_Dose2 = ? WHERE id = "+ objStudent.getStudentId() +";");
//+ "+,DTap_Dose1 = ?,DTap_Dose2 = ?, DTap_Dose3 = ?, DTap_Dose4 = ?, Polio_Dose1 = ?, Polio_Dose2 = ?, Polio_Dose3 = ? WHERE id = "+ id +";");
// + "MMR_Dose1= ?, Hepatitis_Dose1 = ?, Hepatitis_Dose2 = ?, Hepatitis_Dose3 = ?, Varicella_Dose1 = ? WHERE id = "+ id +";")
//System.out.println(new java.sql.Date(objStudent.getHIB_Dose1().getYear(), objStudent.getHIB_Dose1().getMonth(), objStudent.getHIB_Dose1().getDay()));
//System.out.println("Update daycare.student_details SET HIB_Dose1 = ? WHERE FirstName = "+ objStudent.getFirstName() +";");
//System.out.println(objStudent.getHIB_Dose1().getMonth());
//System.out.println(objStudent.getHIB_Dose1().getDay());
// System.out.println("Student ID is --------- "+objStudent.getStudentId());
System.out.println("Before Statement");
System.out.println("You reached till Here");
preparedStatement.setDate(1, new java.sql.Date(objStudent.getDTap_Dose1().getYear(), objStudent.getDTap_Dose1().getMonth(), objStudent.getDTap_Dose1().getDate()));
preparedStatement.setDate(2, new java.sql.Date(objStudent.getDTap_Dose2().getYear(), objStudent.getDTap_Dose2().getMonth(), objStudent.getDTap_Dose2().getDate()));
preparedStatement.setDate(3, new java.sql.Date(objStudent.getDTap_Dose3().getYear(), objStudent.getDTap_Dose3().getMonth(), objStudent.getDTap_Dose3().getDate()));
preparedStatement.setDate(4, new java.sql.Date(objStudent.getDTap_Dose4().getYear(), objStudent.getDTap_Dose4().getMonth(), objStudent.getDTap_Dose4().getDate()));
preparedStatement.setDate(5, new java.sql.Date(objStudent.getDTap_Dose5().getYear(), objStudent.getDTap_Dose5().getMonth(), objStudent.getDTap_Dose5().getDate()));
System.out.println("You reached till Here ---------2");
preparedStatement.setDate(6, new java.sql.Date(objStudent.getPolio_Dose1().getYear(), objStudent.getPolio_Dose1().getMonth(), objStudent.getPolio_Dose1().getDate()));
preparedStatement.setDate(7, new java.sql.Date(objStudent.getPolio_Dose2().getYear(), objStudent.getPolio_Dose2().getMonth(), objStudent.getPolio_Dose2().getDate()));
preparedStatement.setDate(8, new java.sql.Date(objStudent.getPolio_Dose3().getYear(), objStudent.getPolio_Dose3().getMonth(), objStudent.getPolio_Dose3().getDate()));
preparedStatement.setDate(9, new java.sql.Date(objStudent.getPolio_Dose4().getYear(), objStudent.getPolio_Dose4().getMonth(), objStudent.getPolio_Dose4().getDate()));
preparedStatement.setDate(10, new java.sql.Date(objStudent.getMMR_Dose1().getYear(), objStudent.getMMR_Dose1().getMonth(), objStudent.getMMR_Dose1().getDate()));
preparedStatement.setDate(11, new java.sql.Date(objStudent.getMMR_Dose2().getYear(), objStudent.getMMR_Dose2().getMonth(), objStudent.getMMR_Dose2().getDate()));
preparedStatement.setDate(12, new java.sql.Date(objStudent.getHepatitis_Dose1().getYear(), objStudent.getHepatitis_Dose1().getMonth(), objStudent.getHepatitis_Dose1().getDate()));
preparedStatement.setDate(13, new java.sql.Date(objStudent.getHepatitis_Dose2().getYear(), objStudent.getHepatitis_Dose2().getMonth(), objStudent.getHepatitis_Dose2().getDate()));
preparedStatement.setDate(14, new java.sql.Date(objStudent.getHepatitis_Dose3().getYear(), objStudent.getHepatitis_Dose3().getMonth(), objStudent.getHepatitis_Dose3().getDate()));
/*preparedStatement.setDate(15, new java.sql.Date(objStudent.getVaricella_Dose1().getYear(), objStudent.getVaricella_Dose1().getMonth(), objStudent.getVaricella_Dose1().getDate()));
preparedStatement.setDate(16, new java.sql.Date(objStudent.getVaricella_Dose2().getYear(), objStudent.getVaricella_Dose2().getMonth(), objStudent.getVaricella_Dose2().getDate()));
*/preparedStatement.executeUpdate();
} catch (Exception e) {
throw e;
} finally {
close();
}
}
public void addStudentData(Student objStudent)throws Exception {
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/daycare?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
// PreparedStatements can use variables and are more efficient
preparedStatement = connect
.prepareStatement("insert into daycare.student_details values (default, ?, ?, ?, ? , ?, ?)");
preparedStatement.setString(1, objStudent.getFirstName());
preparedStatement.setString(2, objStudent.getLastName());
preparedStatement.setString(3, "TestWebpage");
preparedStatement.setDate(4, new java.sql.Date(2009, 12, 11));
preparedStatement.setString(5, "TestSummary");
preparedStatement.setString(6, "TestComment");
preparedStatement.executeUpdate();
preparedStatement = connect
.prepareStatement("SELECT myuser, webpage, datum, summary, COMMENTS from feedback.comments");
resultSet = preparedStatement.executeQuery();
writeResultSet(resultSet);
} catch (Exception e) {
throw e;
} finally {
close();
}
}
public void readDataBase(Student objStudent) throws Exception {
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://" + host + "/feedback?"
+ "user=" + user + "&password=" + passwd );
// Statements allow to issue SQL queries to the database
statement = connect.createStatement();
// PreparedStatements can use variables and are more efficient
preparedStatement = connect
.prepareStatement("insert into feedback.comments values (default, ?, ?, ?, ? , ?, ?)");
// "myuser, webpage, datum, summary, COMMENTS from feedback.comments");
// Parameters start with 1
preparedStatement.setString(1, objStudent.getFirstName());
preparedStatement.setString(2, objStudent.getLastName());
preparedStatement.setString(3, "TestWebpage");
preparedStatement.setDate(4, new java.sql.Date(2009, 12, 11));
preparedStatement.setString(5, "TestSummary");
preparedStatement.setString(6, "TestComment");
preparedStatement.executeUpdate();
preparedStatement = connect
.prepareStatement("SELECT myuser, webpage, datum, summary, COMMENTS from feedback.comments");
resultSet = preparedStatement.executeQuery();
writeResultSet(resultSet);
} catch (Exception e) {
throw e;
} finally {
close();
}
}
private void writeMetaData(ResultSet resultSet) throws SQLException {
// Now get some metadata from the database
// Result set get the result of the SQL query
System.out.println("The columns in the table are: ");
System.out.println("Table: " + resultSet.getMetaData().getTableName(1));
for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){
System.out.println("Column " +i + " "+ resultSet.getMetaData().getColumnName(i));
}
}
private void writeResultSet(ResultSet resultSet) throws SQLException {
// ResultSet is initially before the first data set
while (resultSet.next()) {
// It is possible to get the columns via name
// also possible to get the columns via the column number
// which starts at 1
// e.g. resultSet.getSTring(2);
String user = resultSet.getString("myuser");
String website = resultSet.getString("webpage");
String summary = resultSet.getString("summary");
Date date = resultSet.getDate("datum");
String comment = resultSet.getString("comments");
System.out.println("User: " + user);
System.out.println("Website: " + website);
System.out.println("Summary: " + summary);
System.out.println("Date: " + date);
System.out.println("Comment: " + comment);
}
}
// You need to close the resultSet
private void close() {
try {
if (resultSet != null) {
resultSet.close();
}
if (statement != null) {
statement.close();
}
if (connect != null) {
connect.close();
}
} catch (Exception e) {
}
}
}
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ThreadServer;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
*
* @author Administrator
*/
public class GroupServer {
private int port=8008;
private ServerSocket serverSocket;
private ExecutorService executorService; //线程池
private final int POOL_SIZE=12; //单个CPU时线程池中工作线程的数目
private static ArrayList<Socket> groupMembers=new ArrayList<Socket> (100);
public GroupServer() throws IOException {
serverSocket = new ServerSocket(port);
//创建线程池
//Runtime的availableProcessors()方法返回当前系统的CPU的数目
//系统的CPU越多,线程池中工作线程的数目也越多
executorService= Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors() * POOL_SIZE);
System.out.println("服务器启动");
}
public static void sendToAllMembers(String msg)throws IOException{
PrintWriter pw;
Socket tempSocket;
OutputStream socketOut;
for(int i=0; i<groupMembers.size();i++){
tempSocket=groupMembers.get(i); //取出一个在线成员
socketOut =tempSocket.getOutputStream();
pw=new PrintWriter(new OutputStreamWriter(socketOut,"GB2312"),true);
pw.println(msg);
System.out.println("sendtoall-->"+msg);
}
}//群组发送结束。
public static void removeMember(Socket socket){
groupMembers.remove(socket);//删除一个成员
}
public void service() {
while (true) {
Socket socket=null;
try {
socket = serverSocket.accept(); //监听客户请求, 处于阻塞状态.
//接受一个客户请求,从线程池中拿出一个线程专门处理该客户.
groupMembers.add(socket);
executorService.execute(new GroupHandler(socket));
}catch (IOException e) { e.printStackTrace(); }
}
}
public static void main(String args[])throws IOException {
new GroupServer().service();
}
}
class GroupHandler implements Runnable{
private Socket socket;
public GroupHandler(Socket socket){
this.socket=socket;
}
private PrintWriter getWriter(Socket socket)throws IOException{
OutputStream socketOut = socket.getOutputStream();
return new PrintWriter(new OutputStreamWriter(socketOut,"GB2312"),true);
}
private BufferedReader getReader(Socket socket)throws IOException{
InputStream socketIn = socket.getInputStream();
return new BufferedReader(new InputStreamReader(socketIn,"GB2312"));
}
public String echo(String msg) {
return "echo:" + msg;
}
public void run(){
try {
System.out.println("New connection accepted " +
socket.getInetAddress() + ":" +socket.getPort());
BufferedReader br =getReader(socket);
PrintWriter pw = getWriter(socket);
String msg = null;
while ((msg = br.readLine()) != null) {
GroupServer.sendToAllMembers(msg);
// pw.println(echo(msg));
System.out.println("groupserver-->"+msg);
if (msg.contains("bye".subSequence(0, 2))){
System.out.println( socket.getInetAddress() + ":" +"Exit");
break;
}
}
}catch (IOException e) {
e.printStackTrace();
}finally {
try{
if(socket!=null){
GroupServer.removeMember(socket);
socket.close();
}
}catch (IOException e) {e.printStackTrace();}
}
}
}
|
package fr.cgi.heritage;
public class Polymorphisme
{
public static void main( String[] args )
{
// un Kiwi est un Oiseau
Oiseau oiseau;
oiseau = new Kiwi();
oiseau.presenteToi();
oiseau.chante();
testOiseau( oiseau );
// un Paon est un Oiseau
Oiseau paon = new Paon( 4 );
paon.presenteToi();
paon.chante();
// paon.faitLaRoue();
testOiseau( paon );
faitFaireLaRoue( paon );
// faitFaireLaRoue( oiseau );
faitFaireLaRoue( new Paon( 33 ) );
}
static void faitFaireLaRoue( Oiseau oiseau )
{
Paon paon = (Paon) oiseau;
paon.faitLaRoue();
}
static void testOiseau( Oiseau oiseau )
{
// l'opérateur instanceof permet de savoir si un objet du type demandé
if( oiseau instanceof Paon )
{
System.out.println( "C'est un Paon !!!" );
Paon paon = (Paon) oiseau;
paon.faitLaRoue();
}
else
{
System.out.println( "Ce n'est pas un paon" );
}
}
}
|
package com.jim.multipos.utils.usb_barcode;
public class BarcodeReadEvent {
String barcode;
public BarcodeReadEvent(String barcode) {
this.barcode = barcode;
}
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
}
|
package com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.AdLandingPageComponent.component.widget;
import android.view.View;
class a$d implements Runnable {
final /* synthetic */ a nGD;
private a$d(a aVar) {
this.nGD = aVar;
}
/* synthetic */ a$d(a aVar, byte b) {
this(aVar);
}
public final void run() {
if (a.k(this.nGD).get() != null) {
((View) a.k(this.nGD).get()).startAnimation(a.l(this.nGD));
}
}
}
|
/*
* Copyright 2002-2014 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
*
* 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.springframework.integration.splunk.support;
import java.io.IOException;
import java.net.Socket;
import com.splunk.Args;
import com.splunk.Index;
import com.splunk.Receiver;
import com.splunk.Service;
import org.springframework.integration.splunk.core.ServiceFactory;
import org.springframework.util.Assert;
/**
*
* DataWriter to stream data into Splunk using an optional index. If no index specified,
* the main default index is used.
*
* @author Jarred Li
* @author David Turanski
* @author Olivier Lamy
* @since 1.0
*/
public class SplunkIndexWriter extends AbstractSplunkDataWriter {
private String index;
public SplunkIndexWriter(ServiceFactory serviceFactory, Args args) {
super(serviceFactory, args);
}
@Override
protected Socket createSocket(Service service) throws IOException {
Index indexObject = null;
Receiver receiver = null;
Socket socket = null;
if (index != null) {
indexObject = service.getIndexes().get(index);
Assert.notNull(indexObject, String.format("cannot find index [%s]", index));
socket = indexObject.attach(args);
}
else {
receiver = service.getReceiver();
socket = receiver.attach(args);
}
if (logger.isDebugEnabled()) {
logger.debug(String.format("created a socket on %s", socket.getRemoteSocketAddress()));
}
return socket;
}
public String getIndex() {
return index;
}
public void setIndex(String index) {
this.index = index;
}
}
|
package de.marko.pentest.parser;
import de.marko.pentest.db.VulnDB;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Properties;
import org.apache.commons.dbcp2.BasicDataSource;
import org.hibernate.cfg.AvailableSettings;
/**
* @author marko
* @version 1.0.0.
* @date 05.01.2018
*/
public class DatabaseTest {
public void setup(String database) throws IOException {
ClassLoader classLoader = getClass().getClassLoader();
File dbconfig = new File(classLoader.getResource("vuln.properties").getFile());
Properties dbProps = new Properties();
dbProps.load(Files.newInputStream(dbconfig.toPath()));
BasicDataSource dbcpDataSource = new BasicDataSource();
dbcpDataSource.setUrl(dbProps.getProperty(AvailableSettings.URL));
dbcpDataSource.setDriverClassName(dbProps.getProperty(AvailableSettings.DRIVER));
dbcpDataSource.setMaxOpenPreparedStatements(50);
dbcpDataSource.setTestOnBorrow(true);
dbcpDataSource
.setValidationQuery(dbProps.getProperty("hibernate.dbcp.validationQuery"));
dbcpDataSource.setValidationQueryTimeout(900);
dbProps.remove(AvailableSettings.URL);
dbProps.remove(AvailableSettings.USER);
dbProps.remove(AvailableSettings.PASS);
dbProps.remove(AvailableSettings.DRIVER);
dbProps.remove("hibernate.dbcp.validationQuery");
// lade von properties
VulnDB.initialize(database, dbProps, dbcpDataSource);
}
}
|
package com.practice.movieinfoservice.resources;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.practice.movieinfoservice.models.Movie;
@RestController
@RequestMapping("/movies")
public class MovieResource {
@RequestMapping("/{movieId}")
public Movie getMovieInfo(@PathVariable String movieId) {
return new Movie(movieId, movieId + " Movie", movieId + " Description");
}
}
|
package com.tencent.mm.ui.chatting;
import com.tencent.mm.model.au;
import com.tencent.mm.ui.appbrand.c.a;
class AppBrandServiceChattingUI$a$7 implements a {
final /* synthetic */ AppBrandServiceChattingUI.a tGQ;
AppBrandServiceChattingUI$a$7(AppBrandServiceChattingUI.a aVar) {
this.tGQ = aVar;
}
public final void cra() {
this.tGQ.hideVKB();
au.Em().H(new Runnable() {
public final void run() {
AppBrandServiceChattingUI.a.h(AppBrandServiceChattingUI$a$7.this.tGQ);
}
});
}
}
|
import java.util.Stack;
/**
*
*/
/**
* @author jinweizhang
*
*/
public class ValidParentheses {
/**
* @param args
*
* Given a string containing just the characters '(', ')', '{', '}',
* '[' and ']', determine if the input string is valid.
*
* An input string is valid if:
*
* Open brackets must be closed by the same type of brackets. Open
* brackets must be closed in the correct order. Note that an empty
* string is also considered valid.
*
* Example 1:
*
* Input: "()" Output: true
*
* Example 2:
*
* Input: "()[]{}" Output: true
*
* Example 3:
*
* Input: "(]" Output: false
*
* Example 4:
*
* Input: "([)]" Output: false
*
* Example 5:
*
* Input: "{[]}" Output: true
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
SolutionVaild fuck = new SolutionVaild();
boolean flag = fuck.isValid("()");
System.out.println(flag);
}
}
// loop through the string and find the matched characters
class SolutionVaild {
public boolean isValid(String s) {
if(s.length()%2 != 0) return false;
Stack<Character> numberSt = new Stack<Character>();
// numberSt.push(s.charAt(0));
for (int i = 0; i < s.length(); i++) {
// Character c = new Character(s.charAt(i));
switch (s.charAt(i)) {
case '(':
numberSt.push('(');
break;
case '{':
numberSt.push('{');
break;
case '[':
numberSt.push('[');
break;
case ')':
if (numberSt.size() == 0||!numberSt.pop().equals('(')) {
return false;
}
break;
case '}':
if (numberSt.size() == 0||!numberSt.pop().equals('{')) {
return false;
}
break;
case ']':
if (numberSt.size() == 0||!numberSt.pop().equals('[')) {
return false;
}
break;
default:
break;
}
}
return true;
}
}
|
/**
* ************************************************************************
* Copyright (C) 2010 Atlas of Living Australia All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* *************************************************************************
*/
package au.org.ala.spatial.analysis.service;
import au.org.ala.spatial.analysis.maxent.MaxentService;
import au.org.ala.spatial.util.AnalysisJob;
import au.org.ala.spatial.util.AnalysisJobAloc;
import au.org.ala.spatial.util.StreamGobbler;
import java.io.File;
/**
* Gets the submitted parameters and runs a Aloc model
*
* @author ajayr
*/
public class AlocServiceImpl implements MaxentService {
AlocSettings cmdAloc = null;
public AlocServiceImpl() {
cmdAloc = new AlocSettings();
}
public AlocSettings getAlocSettings() {
return cmdAloc;
}
public void setAlocSettings(AlocSettings cmdAloc) {
this.cmdAloc = cmdAloc;
}
/**
* The generateSessionDirectory allows creating a session directory
*
* @param thePath
* @return
*/
private File generateSessionDirectory(String thePath) {
File fDir = null;
try {
//fDir = new File(cmdPath + sessionId);
fDir = new File(thePath);
fDir.mkdir();
} catch (Exception e) {
}
return fDir;
}
/**
* The process method sets up the parameters and runs the Aloc process
*
* @return success int value if the process was successful
*/
@Override
public int process(AnalysisJob job) {
return runCommand(cmdAloc.toString(), job);
}
/**
* The runCommand method does the fork'ing
*
* @param command The command to be run
* @return success int value if the process was successful
*/
private int runCommand(String command, AnalysisJob job) {
Runtime runtime = Runtime.getRuntime();
try {
String[] acmd = new String[3];
acmd[0] = "cmd.exe";
acmd[1] = "/C";
acmd[2] = command;
System.out.println("Exec'ing " + command);
Process proc = runtime.exec(command);
// any error message?
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR", job);
// any output?
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT", job);
// kick them off
errorGobbler.start();
outputGobbler.start();
System.out.printf("Output of running %s is:", command);
int exitVal = proc.waitFor();
errorGobbler.interrupt();
outputGobbler.interrupt();
// any error???
return exitVal;
} catch (Exception e) {
e.printStackTrace(System.out);
}
return 1;
}
public int process(AnalysisJobAloc job) {
AlocThread mt = new AlocThread(cmdAloc.toString(), job);
mt.start();
while (mt.isAlive() && (job == null || !job.isCancelled())) {
try {
Thread.sleep(100);
} catch (InterruptedException ex) {
//wake up
}
}
try {
mt.kill(); //in case it is still running, AlocThread will end now
} catch (Exception e) {
}
return mt.exitValue;
}
}
class AlocThread extends Thread {
public int exitValue = -1;
String command;
Process proc;
AnalysisJobAloc job;
public AlocThread(String command_, AnalysisJobAloc job) {
command = command_;
this.job = job;
setPriority(Thread.MIN_PRIORITY);
}
public void kill() {
proc.destroy();
}
/**
* The runCommand method does the fork'ing
*
* @param command The command to be run
* @return success int value if the process was successful
*/
public void run() {
Runtime runtime = Runtime.getRuntime();
try {
String[] acmd = new String[3];
acmd[0] = "cmd.exe";
acmd[1] = "/C";
acmd[2] = command;
System.out.println("Exec'ing " + command);
proc = runtime.exec(command);
// any error message?
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR", job);
// any output?
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT", job);
// kick them off
errorGobbler.start();
outputGobbler.start();
System.out.printf("Output of running %s is:", command);
int exitVal = proc.waitFor();
errorGobbler.interrupt();
outputGobbler.interrupt();
// any error???
exitValue = exitVal;
return;
} catch (Exception e) {
e.printStackTrace(System.out);
}
exitValue = 1;
}
}
|
package in.vaksys.vivekpk.fragments;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import in.vaksys.vivekpk.R;
/**
* A simple {@link Fragment} subclass.
*/
public class ServiceFragment extends Fragment {
private TextView tvDate;
private DatePickerDialog fromDatePickerDialog;
private SimpleDateFormat dateFormatter;
private String SelectedDate;
public static final String TAG = "DATE";
private LinearLayout linearVehicle, linearAddVehicle, linearServiceDueDate;
private Button btn_addVehicle, btn_setAlert;
public ServiceFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_service, container, false);
tvDate = (TextView) rootView.findViewById(R.id.tv_date);
setDateTimeField();
dateFormatter = new SimpleDateFormat("dd-MM-yyyy", Locale.US);
tvDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SelectfromDate();
}
/*@Override
public boolean onTouch(View v, MotionEvent event) {
SelectfromDate();
return true;
}
*/
});
linearVehicle = (LinearLayout) rootView.findViewById(R.id.linearVehicleDetails);
linearServiceDueDate = (LinearLayout) rootView.findViewById(R.id.linearServiceDueDate);
linearAddVehicle = (LinearLayout) rootView.findViewById(R.id.linearAddVehicle);
btn_addVehicle = (Button) rootView.findViewById(R.id.btn_addVehicle);
btn_setAlert = (Button) rootView.findViewById(R.id.btn_setAlert);
btn_addVehicle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
linearVehicle.setVisibility(View.VISIBLE);
linearAddVehicle.setVisibility(View.GONE);
linearServiceDueDate.setVisibility(View.VISIBLE);
}
});
btn_setAlert.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.remind_me);
Button btn_done = (Button) dialog.findViewById(R.id.btn_done);
btn_done.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
Toast.makeText(getActivity(), "Reminder Set", Toast.LENGTH_SHORT).show();
}
});
dialog.show();
}
});
return rootView;
}
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.US);
Calendar c = Calendar.getInstance();
private void SelectfromDate() {
String formattedDate = sdf.format(c.getTime()); // current date
Date d = null;
try {
d = sdf.parse(formattedDate);
} catch (ParseException e) {
Log.e(TAG, "SelectfromDate: " + e);
}
fromDatePickerDialog.getDatePicker().setMinDate(d.getTime());
fromDatePickerDialog.show();
}
private void setDateTimeField() {
Calendar newCalendar = Calendar.getInstance();
fromDatePickerDialog = new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
Calendar newDate = Calendar.getInstance();
newDate.set(year, monthOfYear, dayOfMonth);
SelectedDate = dateFormatter.format(newDate.getTime());
tvDate.setText(SelectedDate);
}
}, newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));
}
}
|
package com.example.suyash.hexatime;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.provider.AlarmClock;
import android.service.wallpaper.WallpaperService;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.os.Handler;
import java.util.Date;
/**
* Created by suyash on 6/7/18.
*/
public class LiveWallpaper extends WallpaperService{
static float x,y;
String curTime;
@Override
public Engine onCreateEngine() {
return new WallpaperEngine();
}
private class WallpaperEngine extends Engine{
private final Handler handler = new Handler();
private final Runnable runnable = new Runnable() {
@Override
public void run() {
draw();
}
};
private Paint paint = new Paint();
int width, height;
boolean visible = true;
public WallpaperEngine(){
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#ffffff"));
paint.setStyle(Paint.Style.FILL);
paint.setTextSize(120);
handler.post(runnable);
}
@Override
public void onVisibilityChanged(boolean visible){
this.visible = visible;
if(visible){
handler.post(runnable);
}else {
handler.removeCallbacks(runnable);
}
}
@Override
public void onSurfaceDestroyed(SurfaceHolder holder){
super.onSurfaceDestroyed(holder);
}
@Override
public void onSurfaceChanged(SurfaceHolder holder,int format,int width,int height){
this.width = width;
this.height = height;
super.onSurfaceChanged(holder,format,width,height);
}
@Override
public void onTouchEvent(MotionEvent event){
float X = event.getX();
float Y = event.getY();
Rect rect = new Rect();
paint.getTextBounds(curTime,0,curTime.length(),rect);
if (rect.contains((int)(X-x),(int)(Y-y))) {
Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
super.onTouchEvent(event);
}
private void draw(){
Date date = new Date();
int hours = date.getHours();
int minutes = date.getMinutes();
int seconds = date.getSeconds();
String h = hours + "";
if (hours/10 == 0) h = "0" + hours;
String m = minutes + "";
if (minutes/10 == 0) m = "0" + minutes;
String s = seconds + "";
if (seconds/10 == 0) s = "0" + seconds;
curTime = h + ":" + m + ":" + s;
int color = Color.parseColor("#" + h + m + s);
SurfaceHolder holder = getSurfaceHolder();
Canvas canvas = holder.lockCanvas();
if (canvas != null){
canvas.drawColor(color);
x = (canvas.getWidth() / 2) - (paint.measureText(curTime) / 2);
y = (canvas.getHeight() / 2) - ((paint.ascent() + paint.descent()) / 2);
canvas.drawText(curTime,x,y,paint);
holder.unlockCanvasAndPost(canvas);
}
handler.removeCallbacks(runnable);
if (visible){
handler.postDelayed(runnable,1000);
}
}
}
}
|
package com.qgbase.biz.huodong.domain;
import com.qgbase.common.domain.TBaseEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.qgbase.excel.annotation.ExcelColumn;
import java.util.Date;
/**
* Created by Mark on 2019-10-29
* 主要用于:活动门店 实体类定义,此代码为自动生成
*/
@Data
@Entity
@Table(name = "hd_huodong2shop")
public class HdHuodong2shop extends TBaseEntity {
@Id
@Column(name = "shop_id",unique = true,columnDefinition = "varchar(64) COMMENT '门店编码'")
@ExcelColumn(columnName="门店编码",order = 2,exportName = "shop_id")
@NotNull(message = "门店编码不能为空")
private String shopId;//create by mark 门店编码
@Column(name = "huodong_id",unique = true,columnDefinition = "varchar(64) COMMENT '活动编号'")
@ExcelColumn(columnName="活动编号",order = 1,exportName = "huodong_id")
@NotNull(message = "活动编号不能为空")
private String huodongId;//create by mark 活动编号
@Column(name = "huodong_title",unique = true,columnDefinition = "varchar(32) COMMENT '主标题'")
@ExcelColumn(columnName="主标题",order = 3,exportName = "huodong_title")
private String huodongTitle;//create by mark 主标题
@Column(name = "huodong_subtitle",unique = true,columnDefinition = "varchar(32) COMMENT '副标题'")
@ExcelColumn(columnName="副标题",order = 4,exportName = "huodong_subtitle")
private String huodongSubtitle;//create by mark 副标题
@Column(name = "user_limit",unique = true,columnDefinition = "int(50) COMMENT '人员上限'")
@ExcelColumn(columnName="人员上限",order = 5,exportName = "user_limit")
private Integer userLimit;//create by mark 人员上限
@Column(name = "huodong_status",unique = true,columnDefinition = "varchar(32) COMMENT '活动状态'")
@ExcelColumn(columnName="活动状态",order = 6,exportName = "huodong_status")
private String huodongStatus;//create by mark 活动状态
@Column(name = "huodong_demo",unique = true,columnDefinition = "varchar(512) COMMENT '活动备注'")
@ExcelColumn(columnName="活动备注",order = 7,exportName = "huodong_demo")
private String huodongDemo;//create by mark 活动备注
@Column(name = "huodong_url",unique = true,columnDefinition = "varchar(512) COMMENT '推广链接'")
@ExcelColumn(columnName="推广链接",order = 8,exportName = "huodong_url")
private String huodongUrl;//create by mark 推广链接
@Override
public String getPKid()
{
return huodongId+shopId;
}
@Override
public String getObjName(){
return "HdHuodong2shop";
}
@Override
public String getObjDesc(){
return "活动门店";
}
}
|
package leetcode;
public class BinarySolution {
/***
* Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
* @param nums sorted input array
* @return a height balanced BST
*/
public TreeNode sortedArrayToBST(int[] nums) {//平衡二叉树的概念,输入可以无序
if (nums.length == 0) {
return null;
}
/**
* 1.放置新节点
* 2.找到不平衡子树及不平衡模式(LL,RR,RL,LR)
* 3.旋转
*/
balancedTreeNode root = new balancedTreeNode(nums[0]);
for (int i = 1; i < nums.length; i++) {
balancedTreeNode curNode = root;
balancedTreeNode insertedNode;
while (true) {//放置新节点
if (nums[i] < curNode.val) {//左子树
if (curNode.left != null) {
curNode = curNode.left;
}else {
insertedNode = new balancedTreeNode(nums[i]);
curNode.setLeftChild(insertedNode);
break;
}
}else {//右子树
if (curNode.right != null) {
curNode = curNode.right;
}else {
insertedNode = new balancedTreeNode(nums[i]);
curNode.setRightChild(insertedNode);
break;
}
}
}
// System.out.println("插入后:");
// printBianryTree(root);
balancedTreeNode unbalancedRoot = updateBalanceFactor(insertedNode);
if (unbalancedRoot != null) {
if (unbalancedRoot.balanceFactor == 2) {
if (unbalancedRoot.left.balanceFactor == -1) {//LR
unbalancedRoot.balanceFactor = -1;
unbalancedRoot.left.balanceFactor = 0;
unbalancedRoot.left.right.balanceFactor = 0;
balancedTreeNode curCopyNode = unbalancedRoot.left;
unbalancedRoot.setLeftChild(curCopyNode.right);
curCopyNode.setRightChild(unbalancedRoot.left.left);
unbalancedRoot.left.setLeftChild(curCopyNode);
}else {//LL
unbalancedRoot.balanceFactor = 0;
unbalancedRoot.left.balanceFactor = 0;
}
//LL&&LR
balancedTreeNode rootCopyNode = new balancedTreeNode(unbalancedRoot);
rootCopyNode.setLeftChild(unbalancedRoot.left.right);
unbalancedRoot.setRightChild(rootCopyNode);
unbalancedRoot.val = unbalancedRoot.left.val;
unbalancedRoot.setLeftChild(unbalancedRoot.left.left);
}else if (unbalancedRoot.balanceFactor == -2) {
if (unbalancedRoot.right.balanceFactor == 1) { //RL
unbalancedRoot.balanceFactor = 1;
unbalancedRoot.right.balanceFactor = 0;
unbalancedRoot.right.left.balanceFactor = 0;
balancedTreeNode curCopyNode = unbalancedRoot.right;
unbalancedRoot.setRightChild(curCopyNode.left);
curCopyNode.setLeftChild(unbalancedRoot.right.right);
unbalancedRoot.right.setRightChild(curCopyNode);
}else {//RR
unbalancedRoot.balanceFactor = 0;
unbalancedRoot.right.balanceFactor = 0;
}
//RR && RL
balancedTreeNode rootCopyNode = new balancedTreeNode(unbalancedRoot);
rootCopyNode.setRightChild(unbalancedRoot.right.left);
unbalancedRoot.setLeftChild(rootCopyNode);
unbalancedRoot.val = unbalancedRoot.right.val;
unbalancedRoot.setRightChild(unbalancedRoot.right.right);
}
}
// System.out.println("调整后:");
// printBianryTree(root);
}
return root;
}
private balancedTreeNode updateBalanceFactor(balancedTreeNode leafNode) {
balancedTreeNode parentNode = leafNode.parent;
balancedTreeNode childNode = leafNode;
while (parentNode != null) {
if (childNode.equals(parentNode.left)) {
parentNode.balanceFactor ++;
}else {
parentNode.balanceFactor --;
}
if (parentNode.balanceFactor == 0) { //停止更新
break;
}
if (Math.abs(parentNode.balanceFactor) == 2) { //找到最小不平衡子树
return parentNode;
}
childNode = parentNode;
parentNode = parentNode.parent;
}
return null;
}
public TreeNode sortedArrayToBST2(int[] nums) {//分治,输入必须有序
return sortedArrayToBST(nums, 0, nums.length-1);
}
private TreeNode sortedArrayToBST(int[] nums,int beginIndex,int endIndex) {//分治
if (beginIndex > endIndex) {
return null;
}
if (beginIndex == endIndex) {
return new TreeNode(nums[beginIndex]);
}
int rootIndex = (beginIndex + endIndex)/2;
TreeNode root = new TreeNode(nums[rootIndex]);
root.left = sortedArrayToBST(nums, beginIndex, rootIndex-1);
root.right = sortedArrayToBST(nums, rootIndex+1, endIndex);
return root;
}
private void printBianryTree(TreeNode root) {
if (root == null || root.left == null && root.right == null) {
return;
}
System.out.print(root.val+"\t");
if (root.left != null) {
System.out.print("left value:\t"+root.left.val+"\t");
}
if (root.right != null) {
System.out.print("right value:\t"+root.right.val+"\t");
}
System.out.print("\n");
printBianryTree(root.left);
printBianryTree(root.right);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
BinarySolution solution = new BinarySolution();
// int array[] = {20,35,40,15,30,25,38};
int array[] = {15,20,25,35,30,38,40};
TreeNode root = solution.sortedArrayToBST2(array);
solution.printBianryTree(root);
}
}
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
class balancedTreeNode extends TreeNode{
balancedTreeNode left;
balancedTreeNode right;
int balanceFactor = 0; //平衡因子
balancedTreeNode parent = null; //指向父节点
public balancedTreeNode(int x) {
// TODO Auto-generated constructor stub
super(x);
}
public balancedTreeNode(balancedTreeNode node) {
// TODO Auto-generated constructor stub
super(node.val);
this.balanceFactor = node.balanceFactor;
this.setLeftChild(node.left);
this.setRightChild(node.right);
}
public void setLeftChild(balancedTreeNode childNode) {
this.left = childNode;
super.left = childNode;
if (childNode != null) {
childNode.parent = this;
}
}
public void setRightChild(balancedTreeNode childNode) {
this.right = childNode;
super.right = childNode;
if (childNode != null) {
childNode.parent = this;
}
}
}
|
package com.pritesh.parkingtrackingsystem;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
public class ExampleUnitTest extends ActivityInstrumentationTestCase2<LoginActivity>
{
private Solo solo;
public ExampleUnitTest()
{
super(LoginActivity.class);
}
public ExampleUnitTest(Class<LoginActivity> activityClass)
{
super(activityClass);
}
public void setUp() throws Exception
{
solo = new Solo(getInstrumentation(), getActivity());
}
@Override
public void tearDown() throws Exception {
solo.finishOpenedActivities();
}
}
|
/*
* Copyright 2015 FUJITSU LIMITED
* Copyright 2016 Hewlett Packard Enterprise Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* 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 monasca.api.infrastructure.persistence.hibernate;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertTrue;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import javax.ws.rs.WebApplicationException;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import monasca.api.domain.exception.EntityNotFoundException;
import monasca.api.domain.model.alarm.Alarm;
import monasca.api.domain.model.alarm.AlarmRepo;
import monasca.common.hibernate.db.AlarmDb;
import monasca.common.hibernate.db.AlarmDefinitionDb;
import monasca.common.hibernate.db.AlarmMetricDb;
import monasca.common.hibernate.db.MetricDefinitionDb;
import monasca.common.hibernate.db.MetricDefinitionDimensionsDb;
import monasca.common.hibernate.db.MetricDimensionDb;
import monasca.common.hibernate.db.SubAlarmDb;
import monasca.common.hibernate.db.SubAlarmDefinitionDb;
import monasca.common.model.alarm.AlarmOperator;
import monasca.common.model.alarm.AlarmSeverity;
import monasca.common.model.alarm.AlarmState;
import monasca.common.model.alarm.AlarmSubExpression;
import monasca.common.model.metric.MetricDefinition;
@Test(groups = "orm")
public class AlarmSqlRepositoryImplTest {
private static final String TENANT_ID = "bob";
private static final String ALARM_ID = "234111";
private static final DateTimeFormatter ISO_8601_FORMATTER = ISODateTimeFormat.dateOptionalTimeParser().withZoneUTC();
private static final DateTimeZone UTC_TIMEZONE = DateTimeZone.forID("UTC");
private SessionFactory sessionFactory;
private AlarmRepo repo;
private Alarm compoundAlarm;
private Alarm alarm1;
private Alarm alarm2;
private Alarm alarm3;
private Transaction tx;
@BeforeMethod
protected void setupClass() throws Exception {
this.sessionFactory = HibernateUtil.getSessionFactory();
this.repo = new AlarmSqlRepoImpl(this.sessionFactory);
this.prepareData(this.sessionFactory);
this.tx = this.sessionFactory.openSession().beginTransaction();
}
@AfterMethod
protected void afterMethod() throws Exception {
this.tx.rollback();
this.sessionFactory.close();
this.sessionFactory = null;
}
private void prepareData(final SessionFactory sessionFactory) {
final DateTime now = new DateTime();
Session session = null;
try {
session = sessionFactory.openSession();
session.beginTransaction();
DateTime timestamp1 = ISO_8601_FORMATTER.parseDateTime("2015-03-14T09:26:53").withZoneRetainFields(UTC_TIMEZONE);
DateTime timestamp2 = ISO_8601_FORMATTER.parseDateTime("2015-03-14T09:26:54").withZoneRetainFields(UTC_TIMEZONE);
DateTime timestamp3 = ISO_8601_FORMATTER.parseDateTime("2015-03-14T09:26:55").withZoneRetainFields(UTC_TIMEZONE);
DateTime timestamp4 = ISO_8601_FORMATTER.parseDateTime("2015-03-15T09:26:53").withZoneRetainFields(UTC_TIMEZONE);
final AlarmDefinitionDb alarmDefinition_90Percent = this.newAlarmDefinition(session,
"1",
TENANT_ID,
"90% CPU",
"avg(cpu.idle_perc{flavor_id=777, image_id=888, device=1}) > 10",
AlarmSeverity.LOW,
"flavor_id,image_id",
true
);
final AlarmDefinitionDb alarmDefinition_50Percent = this.newAlarmDefinition(session,
"234",
TENANT_ID,
"50% CPU",
"avg(cpu.sys_mem{service=monitoring}) > 20 and avg(cpu.idle_perc{service=monitoring}) < 10",
AlarmSeverity.HIGH,
"hostname,region",
true
);
final AlarmDb alarmDb_234111 = new AlarmDb(ALARM_ID, alarmDefinition_50Percent, AlarmState.UNDETERMINED, null, null, timestamp4, timestamp4, timestamp4);
final AlarmDb alarmDb_1 = new AlarmDb("1", alarmDefinition_90Percent, AlarmState.OK, "OPEN", "http://somesite.com/this-alarm-info", timestamp1, timestamp1, timestamp1);
final AlarmDb alarmDb_2 = new AlarmDb("2", alarmDefinition_90Percent, AlarmState.UNDETERMINED, "OPEN", null, timestamp2, timestamp2, timestamp2);
final AlarmDb alarmDb_3 = new AlarmDb("3", alarmDefinition_90Percent, AlarmState.ALARM, null, "http://somesite.com/this-alarm-info", timestamp3, timestamp3, timestamp3);
session.save(alarmDb_1);
session.save(alarmDb_2);
session.save(alarmDb_3);
session.save(alarmDb_234111);
final List<AlarmDb> alarmDbs = Lists.newArrayList(alarmDb_1, alarmDb_2, alarmDb_3);
long subAlarmId = 42;
for (int alarmIndex = 0; alarmIndex < 3; alarmIndex++) {
final SubAlarmDefinitionDb subExpression = this.newSubAlarmDefinition(session, String.format("%d", alarmIndex + subAlarmId), alarmDefinition_50Percent);
session.save(
new SubAlarmDb(
String.valueOf(subAlarmId++),
alarmDbs.get(alarmIndex),
subExpression,
"avg(cpu.idle_perc{flavor_id=777, image_id=888, device=1}) > 10",
now,
now
)
);
}
final MetricDefinitionDb metricDefinition1 = new MetricDefinitionDb(new byte[]{1}, "cpu.idle_perc", "bob", "west");
session.save(metricDefinition1);
final MetricDimensionDb metricDimension1InstanceId = new MetricDimensionDb(new byte[]{1}, "instance_id", "123");
final MetricDimensionDb metricDimensionService = new MetricDimensionDb(new byte[]{1}, "service", "monitoring");
final MetricDimensionDb metricDimension2FlavorId = new MetricDimensionDb(new byte[]{2}, "flavor_id", "222");
session.save(metricDimension1InstanceId);
session.save(metricDimensionService);
session.save(metricDimension2FlavorId);
final MetricDefinitionDimensionsDb metricDefinitionDimensions11 = new MetricDefinitionDimensionsDb(
new byte[]{1, 1},
metricDefinition1,
metricDimension1InstanceId.getId().getDimensionSetId()
);
final MetricDefinitionDimensionsDb metricDefinitionDimensions22 = new MetricDefinitionDimensionsDb(
new byte[]{2, 2},
metricDefinition1,
metricDimension2FlavorId.getId().getDimensionSetId()
);
session.save(metricDefinitionDimensions11);
session.save(metricDefinitionDimensions22);
session.save(new AlarmMetricDb(alarmDbs.get(0), metricDefinitionDimensions11));
session.save(new AlarmMetricDb(alarmDbs.get(0), metricDefinitionDimensions22));
session.save(new AlarmMetricDb(alarmDbs.get(1), metricDefinitionDimensions11));
session.save(new AlarmMetricDb(alarmDbs.get(2), metricDefinitionDimensions22));
alarm1 =
new Alarm("1", "1", "90% CPU", "LOW",
buildAlarmMetrics(
buildMetricDefinition("cpu.idle_perc", "instance_id", "123", "service", "monitoring")
, buildMetricDefinition("cpu.idle_perc", "flavor_id", "222")
)
, AlarmState.OK, "OPEN", "http://somesite.com/this-alarm-info", timestamp1,
timestamp1, timestamp1);
alarm2 =
new Alarm("2", "1", "90% CPU", "LOW", buildAlarmMetrics(buildMetricDefinition("cpu.idle_perc", "instance_id", "123", "service",
"monitoring")), AlarmState.UNDETERMINED, "OPEN", null, timestamp2, timestamp2, timestamp2);
alarm3 =
new Alarm("3", "1", "90% CPU", "LOW", buildAlarmMetrics(buildMetricDefinition("cpu.idle_perc", "flavor_id", "222")), AlarmState.ALARM,
null, "http://somesite.com/this-alarm-info", timestamp3, timestamp3, timestamp3);
final SubAlarmDb subAlarmDb1 = new SubAlarmDb("4343", alarmDb_234111, "avg(cpu.sys_mem{service=monitoring}) > 20", now, now);
final SubAlarmDb subAlarmDb2 = new SubAlarmDb("4242", alarmDb_234111, "avg(cpu.idle_perc{service=monitoring}) < 10", now, now);
session.save(subAlarmDb1);
session.save(subAlarmDb2);
final MetricDefinitionDb metricDefinition111 = new MetricDefinitionDb(new byte[]{1, 1, 1}, "cpu.sys_mem", "bob", "west");
final MetricDefinitionDb metricDefinition112 = new MetricDefinitionDb(new byte[]{1, 1, 2}, "cpu.idle_perc", "bob", "west");
session.save(metricDefinition111);
session.save(metricDefinition112);
final MetricDefinitionDimensionsDb metricDefinitionDimension31 = new MetricDefinitionDimensionsDb(
new byte[]{3, 1},
metricDefinition111,
new byte[]{2, 1}
);
final MetricDefinitionDimensionsDb metricDefinitionDimension32 = new MetricDefinitionDimensionsDb(
new byte[]{3, 2},
metricDefinition112,
new byte[]{2, 2}
);
session.save(metricDefinitionDimension31);
session.save(metricDefinitionDimension32);
session.save(new AlarmMetricDb(alarmDb_234111, metricDefinitionDimension31));
session.save(new AlarmMetricDb(alarmDb_234111, metricDefinitionDimension32));
session.save(new MetricDimensionDb(new byte[]{2, 1}, "service", "monitoring"));
session.save(new MetricDimensionDb(new byte[]{2, 2}, "service", "monitoring"));
session.save(new MetricDimensionDb(new byte[]{2, 1}, "hostname", "roland"));
session.save(new MetricDimensionDb(new byte[]{2, 2}, "hostname", "roland"));
session.save(new MetricDimensionDb(new byte[]{2, 1}, "region", "colorado"));
session.save(new MetricDimensionDb(new byte[]{2, 2}, "region", "colorado"));
session.save(new MetricDimensionDb(new byte[]{2, 2}, "extra", "vivi"));
session.flush();
session.getTransaction().commit();
compoundAlarm =
new Alarm("234111", "234", "50% CPU", "HIGH", buildAlarmMetrics(
buildMetricDefinition("cpu.sys_mem", "hostname", "roland", "region", "colorado", "service", "monitoring"),
buildMetricDefinition("cpu.idle_perc", "extra", "vivi", "hostname", "roland", "region", "colorado", "service", "monitoring")),
AlarmState.UNDETERMINED, null, null, timestamp4, timestamp4, timestamp4);
} finally {
if (session != null) {
session.close();
}
}
}
private SubAlarmDefinitionDb newSubAlarmDefinition(final Session session, final String id, final AlarmDefinitionDb alarmDefinition) {
final DateTime now = DateTime.now();
final SubAlarmDefinitionDb db = new SubAlarmDefinitionDb(
id,
alarmDefinition,
String.format("f_%s", id),
String.format("m_%s", id),
AlarmOperator.GT.toString(),
0.0,
1,
2,
now,
now
);
session.save(db);
return db;
}
private AlarmDefinitionDb newAlarmDefinition(final Session session,
final String id,
final String tenantId,
final String name,
final String expression,
final AlarmSeverity severity,
final String matchBy,
final boolean actionEnabled) {
final DateTime now = DateTime.now();
final AlarmDefinitionDb db = new AlarmDefinitionDb(id, tenantId, name, null, expression, severity, matchBy, actionEnabled, now, now, null);
session.save(db);
return db;
}
private List<MetricDefinition> buildAlarmMetrics(final MetricDefinition... metricDefinitions) {
return Arrays.asList(metricDefinitions);
}
private MetricDefinition buildMetricDefinition(final String metricName, final String... dimensions) {
final Builder<String, String> builder = ImmutableMap.builder();
for (int i = 0; i < dimensions.length; ) {
builder.put(dimensions[i], dimensions[i + 1]);
i += 2;
}
return new MetricDefinition(metricName, builder.build());
}
@Test(groups = "orm")
@SuppressWarnings("unchecked")
public void shouldDelete() {
Session session = null;
repo.deleteById(TENANT_ID, ALARM_ID);
try {
session = sessionFactory.openSession();
List<AlarmDefinitionDb> rows = session
.createCriteria(AlarmDefinitionDb.class, "ad")
.add(Restrictions.eq("ad.id", "234"))
.setReadOnly(true)
.list();
assertEquals(rows.size(), 1, "Alarm Definition was deleted as well");
} finally {
if (session != null) {
session.close();
}
}
}
@Test(groups = "orm", expectedExceptions = EntityNotFoundException.class)
public void shouldThowExceptionOnDelete() {
repo.deleteById(TENANT_ID, "Not an alarm ID");
}
@Test(groups = "orm")
public void shouldFindAlarmSubExpressions() {
final Map<String, AlarmSubExpression> subExpressionMap = repo.findAlarmSubExpressions(ALARM_ID);
assertEquals(subExpressionMap.size(), 2);
assertEquals(subExpressionMap.get("4343"), AlarmSubExpression.of("avg(cpu.sys_mem{service=monitoring}) > 20"));
assertEquals(subExpressionMap.get("4242"), AlarmSubExpression.of("avg(cpu.idle_perc{service=monitoring}) < 10"));
}
@Test(groups = "orm")
public void shouldAlarmSubExpressionsForAlarmDefinition() {
final Map<String, Map<String, AlarmSubExpression>> alarmSubExpressionMap =
repo.findAlarmSubExpressionsForAlarmDefinition(alarm1.getAlarmDefinition().getId());
assertEquals(alarmSubExpressionMap.size(), 3);
long subAlarmId = 42;
for (int alarmId = 1; alarmId <= 3; alarmId++) {
final Map<String, AlarmSubExpression> subExpressionMap = alarmSubExpressionMap.get(String.valueOf(alarmId));
assertEquals(subExpressionMap.get(String.valueOf(subAlarmId)),
AlarmSubExpression.of("avg(cpu.idle_perc{flavor_id=777, image_id=888, device=1}) > 10"));
subAlarmId++;
}
}
@Test(groups = "orm")
public void shouldFind() {
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, null, null, 1, true), alarm1, alarm2);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, null, null, 2, true), alarm1, alarm2, alarm3);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, null, "1", 1, true), alarm2, alarm3);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, null, "2", 1, true), alarm3, compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, null, "3", 1, true), compoundAlarm);
checkUnsortedList(repo.find("Not a tenant id", null, null, null, null, null, null, null, null, null, null, 1, false));
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, null, null, 1, false), alarm1, alarm2, alarm3, compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, compoundAlarm.getAlarmDefinition().getId(), null, null, null, null, null, null, null, null, null, 1, false), compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, "cpu.sys_mem", null, null, null, null, null, null, null, null, 1, false), compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, "cpu.idle_perc", null, null, null, null, null, null, null, null, 1, false), alarm1, alarm2, alarm3, compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, "cpu.idle_perc", ImmutableMap.<String, String>builder().put("flavor_id", "222").build(), null, null, null, null,
null, null, null, 1, false), alarm1, alarm3);
checkUnsortedList(
repo.find(TENANT_ID, null, "cpu.idle_perc", ImmutableMap.<String, String>builder().put("service", "monitoring").put("hostname", "roland")
.build(), null, null, null, null, null, null, null, 1, false), compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, AlarmState.UNDETERMINED, null, null, null, null, null, null, 1, false), alarm2, compoundAlarm);
checkUnsortedList(
repo.find(TENANT_ID, alarm1.getAlarmDefinition().getId(), "cpu.idle_perc", ImmutableMap.<String, String>builder()
.put("service", "monitoring").build(), null, null, null, null, null, null, null, 1, false), alarm1, alarm2);
checkUnsortedList(repo.find(TENANT_ID, alarm1.getAlarmDefinition().getId(), "cpu.idle_perc", null, null, null, null, null, null, null, null, 1, false), alarm1,
alarm2, alarm3);
checkUnsortedList(
repo.find(TENANT_ID, compoundAlarm.getAlarmDefinition().getId(), null, null, AlarmState.UNDETERMINED, null, null, null, null, null, null, 1, false),
compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, "cpu.sys_mem", null, AlarmState.UNDETERMINED, null, null, null, null, null, null, 1, false), compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, "cpu.idle_perc", ImmutableMap.<String, String>builder().put("service", "monitoring").build(),
AlarmState.UNDETERMINED, null, null, null, null, null, null, 1, false), alarm2, compoundAlarm);
checkUnsortedList(
repo.find(TENANT_ID, alarm1.getAlarmDefinition().getId(), "cpu.idle_perc", ImmutableMap.<String, String>builder()
.put("service", "monitoring").build(), AlarmState.UNDETERMINED, null, null, null, null, null, null, 1, false), alarm2);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, DateTime.now(UTC_TIMEZONE), null, null, 0, false));
// checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, ISO_8601_FORMATTER.parseDateTime("2015-03-15T00:00:00Z"), null, 0, false),
// compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, ISO_8601_FORMATTER.parseDateTime("2015-03-14T00:00:00Z"), null, null, 1, false),
alarm1, alarm2, alarm3, compoundAlarm);
}
@Test(groups = "orm")
public void shouldFindById() {
final Alarm alarm = repo.findById(TENANT_ID, compoundAlarm.getId());
assertEquals(alarm.getId(), compoundAlarm.getId());
assertEquals(alarm.getAlarmDefinition(), compoundAlarm.getAlarmDefinition());
assertEquals(alarm.getCreatedTimestamp(), compoundAlarm.getCreatedTimestamp());
assertEquals(alarm.getStateUpdatedTimestamp(), compoundAlarm.getStateUpdatedTimestamp());
assertEquals(alarm.getState(), compoundAlarm.getState());
assertEquals(alarm.getMetrics().size(), compoundAlarm.getMetrics().size());
assertTrue(CollectionUtils.isEqualCollection(alarm.getMetrics(), compoundAlarm.getMetrics()), "Metrics not equal");
}
@Test(groups = "orm", expectedExceptions = EntityNotFoundException.class)
public void shouldFindByIdThrowException() {
repo.findById(TENANT_ID, "Not a valid alarm id");
}
@Test(groups = "orm")
public void shouldUpdate() throws InterruptedException {
final Alarm originalAlarm = repo.findById(TENANT_ID, ALARM_ID);
final DateTime originalStateUpdatedAt = getAlarmStateUpdatedDate(ALARM_ID);
final DateTime originalUpdatedAt = getAlarmUpdatedDate(ALARM_ID);
assertEquals(originalAlarm.getState(), AlarmState.UNDETERMINED);
Thread.sleep(1000);
final Alarm newAlarm = repo.update(TENANT_ID, ALARM_ID, AlarmState.OK, null, null);
final DateTime newStateUpdatedAt = getAlarmStateUpdatedDate(ALARM_ID);
final DateTime newUpdatedAt = getAlarmUpdatedDate(ALARM_ID);
assertNotEquals(newStateUpdatedAt.getMillis(), originalStateUpdatedAt.getMillis(),
"state_updated_at did not change");
assertNotEquals(newUpdatedAt.getMillis(), originalUpdatedAt.getMillis(),
"updated_at did not change");
assertEquals(newAlarm, originalAlarm);
newAlarm.setState(AlarmState.OK);
newAlarm.setStateUpdatedTimestamp(newStateUpdatedAt);
newAlarm.setUpdatedTimestamp(newUpdatedAt);
// Make sure it was updated in the DB
assertEquals(repo.findById(TENANT_ID, ALARM_ID), newAlarm);
Thread.sleep(1000);
final Alarm unchangedAlarm = repo.update(TENANT_ID, ALARM_ID, AlarmState.OK, "OPEN", null);
assertTrue(getAlarmStateUpdatedDate(ALARM_ID).equals(newStateUpdatedAt), "state_updated_at did change");
assertNotEquals(getAlarmUpdatedDate(ALARM_ID).getMillis(), newStateUpdatedAt, "updated_at did not change");
assertEquals(unchangedAlarm, newAlarm);
}
@Test(groups = "orm", expectedExceptions = EntityNotFoundException.class)
public void shouldUpdateThrowException() {
repo.update(TENANT_ID, "Not a valid alarm id", AlarmState.UNDETERMINED, null, null);
}
@Test(groups = "orm")
public void shouldFilterBySeverity() {
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, Lists.newArrayList(AlarmSeverity.LOW), null, null, null, null, null, 1, false),
alarm1, alarm2, alarm3);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, Lists.newArrayList(AlarmSeverity.HIGH), null, null, null, null, null, 1, false),
compoundAlarm);
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, Lists.newArrayList(AlarmSeverity.LOW, AlarmSeverity.HIGH), null, null, null, null, null, 1, false),
alarm1, alarm2, compoundAlarm, alarm3);
// no alarms for those severities
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, Lists.newArrayList(AlarmSeverity.CRITICAL), null, null, null, null, null, 1, false));
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, Lists.newArrayList(AlarmSeverity.MEDIUM), null, null, null, null, null, 1, false));
checkUnsortedList(repo.find(TENANT_ID, null, null, null, null, Lists.newArrayList(AlarmSeverity.CRITICAL, AlarmSeverity.MEDIUM), null, null, null, null, null, 1, false));
}
@Test(groups = "orm")
public void shouldSortBy() {
checkSortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, Lists.newArrayList("state", "severity"), null, 1, false),
alarm1, alarm2, compoundAlarm, alarm3);
checkSortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, Lists.newArrayList("state desc", "severity"), null, 1, false),
alarm3, alarm2, compoundAlarm, alarm1);
checkSortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, Lists.newArrayList("state desc", "severity asc"), null, 1, false),
alarm3, alarm2, compoundAlarm, alarm1);
checkSortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, Lists.newArrayList("state desc", "severity desc"), null, 1, false),
alarm3, compoundAlarm, alarm2, alarm1);
checkSortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, Lists.newArrayList("severity"), null, 1, false),
alarm1, alarm2, alarm3, compoundAlarm);
checkSortedList(repo.find(TENANT_ID, null, null, null, null, null, null, null, null, Lists.newArrayList("severity desc", "alarm_id desc"), null, 1, false),
compoundAlarm, alarm3, alarm2, alarm1);
}
private void checkUnsortedList(List<Alarm> found, Alarm... expected) {
this.checkUnsortedList(found, false, expected);
}
private void checkSortedList(List<Alarm> found, Alarm... expected) {
this.checkUnsortedList(found, true, expected);
}
private void checkUnsortedList(List<Alarm> found, boolean sorted, Alarm... expected) {
assertEquals(found.size(), expected.length);
Alarm actual;
int actualIndex;
for (int expectedIndex = 0; expectedIndex < expected.length; expectedIndex++) {
final Alarm alarm = expected[expectedIndex];
final Optional<Alarm> alarmOptional = FluentIterable
.from(found)
.firstMatch(new Predicate<Alarm>() {
@Override
public boolean apply(@Nullable final Alarm input) {
assert input != null;
return input.getId().equals(alarm.getId());
}
});
assertTrue(alarmOptional.isPresent());
actual = alarmOptional.get();
if (sorted) {
actualIndex = found.indexOf(actual);
assertEquals(expectedIndex, actualIndex);
}
assertEquals(actual, alarm, String.format("%s not equal to %s", actual, alarm));
}
}
private DateTime getAlarmUpdatedDate(final String alarmId) {
return this.getDateField(alarmId, "updatedAt");
}
private DateTime getAlarmStateUpdatedDate(final String alarmId) {
return this.getDateField(alarmId, "stateUpdatedAt");
}
private DateTime getDateField(final String alarmId, final String fieldName) {
Session session = null;
DateTime time = null;
try {
session = sessionFactory.openSession();
final String queryString = String.format("select %s from AlarmDb where id = :alarmId", fieldName);
final List<?> rows = session.createQuery(queryString).setString("alarmId", alarmId).list();
time = new DateTime(((Timestamp) rows.get(0)).getTime(), UTC_TIMEZONE);
} finally {
if (session != null) {
session.close();
}
}
return time;
}
}
|
package net.crunchdroid.service;
import net.crunchdroid.dao.ExpiredAbonnementDao;
import net.crunchdroid.model.ExpiredAbonnement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ExpiredAbonnementService {
@Autowired
private ExpiredAbonnementDao expiredAbonnementDao;
public ExpiredAbonnement save(ExpiredAbonnement expiredAbonnement) {
return expiredAbonnementDao.save(expiredAbonnement);
}
public List<ExpiredAbonnement> findAll() {
return expiredAbonnementDao.findAll();
}
public ExpiredAbonnement getOneById(long id) {
return expiredAbonnementDao.getOne(id);
}
public ExpiredAbonnement update(ExpiredAbonnement expiredAbonnement) {
return this.save(expiredAbonnement);
}
public boolean delete(long id) {
ExpiredAbonnement expiredAbonnement = getOneById(id);
try {
expiredAbonnementDao.delete(expiredAbonnement);
return true;
} catch (Exception e) {
return false;
}
}
}
|
/*
* Copyright 2016 Johns Hopkins University
*
* 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.dataconservancy.cos.osf.client.model;
import com.github.jasminb.jsonapi.RelType;
import com.github.jasminb.jsonapi.ResolutionStrategy;
import com.github.jasminb.jsonapi.annotations.Id;
import com.github.jasminb.jsonapi.annotations.Relationship;
import com.github.jasminb.jsonapi.annotations.Type;
import org.dataconservancy.cos.osf.client.support.DateTimeTransform;
import org.dataconservancy.cos.osf.client.support.JodaSupport;
import org.dataconservancy.cos.rdf.annotations.IndividualUri;
import org.dataconservancy.cos.rdf.annotations.OwlIndividual;
import org.dataconservancy.cos.rdf.annotations.OwlProperty;
import org.dataconservancy.cos.rdf.support.OwlClasses;
import org.dataconservancy.cos.rdf.support.OwlProperties;
import org.joda.time.DateTime;
import java.util.Map;
import static org.dataconservancy.cos.osf.client.support.JodaSupport.DATE_TIME_FORMATTER_ALT;
/**
* Encapsulates an event in the OSF. Events in the OSF are expressed as the JSON-API type "logs".
*
* @author Elliot Metsger (emetsger@jhu.edu)
*/
@Type("logs")
@OwlIndividual(OwlClasses.OSF_EVENT)
public class Log {
@Id
@IndividualUri
private String id;
@OwlProperty(value = OwlProperties.OSF_HAS_LOG_DATE, transform = DateTimeTransform.class)
private DateTime date;
// TODO: verify that osf:eventTarget is the correct semantics for 'node'
@Relationship(value = "node", resolve = true, relType = RelType.RELATED, strategy = ResolutionStrategy.REF)
@OwlProperty(OwlProperties.OSF_HAS_LOG_TARGET)
private String node;
// TODO: verify that osf:eventSource is the correct semantics for 'original_node'
@Relationship(value = "original_node", resolve = true, relType = RelType.RELATED, strategy = ResolutionStrategy.REF)
@OwlProperty(OwlProperties.OSF_HAS_LOG_SOURCE)
private String original_node;
@Relationship(value = "contributors", resolve = true, relType = RelType.RELATED, strategy = ResolutionStrategy.REF)
private String contributors;
@Relationship(value = "user", resolve = true, relType = RelType.RELATED, strategy = ResolutionStrategy.REF)
private String user;
@OwlProperty(OwlProperties.OSF_HAS_LOG_ACTION)
private String action;
private Map<String, ?> params;
/**
*
* @return
*/
public String getAction() {
return action;
}
/**
*
* @param action
*/
public void setAction(final String action) {
this.action = action;
}
/**
*
* @return
*/
public String getId() {
return id;
}
/**
*
* @param id
*/
public void setId(final String id) {
this.id = id;
}
/**
*
* @return
*/
public String getDate() {
if (this.date != null) {
return date.toString(DATE_TIME_FORMATTER_ALT);
}
return null;
}
/**
*
* @param date
*/
public void setDate(final String date) {
if (date != null) {
this.date = JodaSupport.parseDateTime(date);
}
}
/**
*
* @return
*/
public String getNode() {
return node;
}
/**
*
* @param node
*/
public void setNode(final String node) {
this.node = node;
}
/**
*
* @return
*/
public String getOriginal_node() {
return original_node;
}
/**
*
* @param original_node
*/
public void setOriginal_node(final String original_node) {
this.original_node = original_node;
}
/**
*
* @return
*/
public String getContributors() {
return contributors;
}
/**
*
* @param contributors
*/
public void setContributors(final String contributors) {
this.contributors = contributors;
}
/**
*
* @return
*/
public String getUser() {
return user;
}
/**
*
* @param user
*/
public void setUser(final String user) {
this.user = user;
}
/**
*
* @return
*/
public Map<String, ?> getParams() {
return params;
}
/**
*
* @param params
*/
public void setParams(final Map<String, ?> params) {
this.params = params;
}
}
|
package pl.finapi.paypal.util;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Component;
import pl.finapi.paypal.model.Day;
@Component
public class MonthSpeaker {
private final Map<Integer, String> monthIndexToMonthPolishName = new HashMap<>();
{
monthIndexToMonthPolishName.put(1, "styczeń");
monthIndexToMonthPolishName.put(2, "luty");
monthIndexToMonthPolishName.put(3, "marzec");
monthIndexToMonthPolishName.put(4, "kwiecień");
monthIndexToMonthPolishName.put(5, "maj");
monthIndexToMonthPolishName.put(6, "czerwiec");
monthIndexToMonthPolishName.put(7, "lipiec");
monthIndexToMonthPolishName.put(8, "sierpień");
monthIndexToMonthPolishName.put(9, "wrzesień");
monthIndexToMonthPolishName.put(10, "październik");
monthIndexToMonthPolishName.put(11, "listopad");
monthIndexToMonthPolishName.put(12, "grudzień");
}
public String asMonthAndYearSpaceDelimited(Day day) {
// "styczeń 2012"
return monthIndexToMonthPolishName.get(day.getMonth()) + " " + day.getYear();
}
}
|
package com.tfxk.framework.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tfxk.framework.R;
import com.tfxk.framework.adapter.holder.RecyclerViewHolder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Chenchunpeng on 2016/11/1.
*/
public class CommonRecyclerViewAdapter<T> extends RecyclerView.Adapter<RecyclerViewHolder> {
private final Context mContext;
private final int mLayoutId;
private final IRecyclerViewAdapter mICommonAdapter;
private List items;
protected View.OnClickListener mClickListener;
private int mPlaceHolder = R.mipmap.ic_launcher;
public CommonRecyclerViewAdapter(Context context, int layoutId, IRecyclerViewAdapter iCommonAdapter) {
this.items = new ArrayList<>();
this.mContext = context;
this.mLayoutId = layoutId;
this.mICommonAdapter = iCommonAdapter;
if (iCommonAdapter instanceof IRecyclerViewAdpater2) {
((IRecyclerViewAdpater2) iCommonAdapter).attachToAdapter(this);
}
}
public CommonRecyclerViewAdapter(Context context, int layoutId, int placeHolderResId, IRecyclerViewAdapter iCommonAdapter) {
this.items = new ArrayList<>();
this.mContext = context;
this.mLayoutId = layoutId;
this.mPlaceHolder = placeHolderResId;
this.mICommonAdapter = iCommonAdapter;
if (iCommonAdapter instanceof IRecyclerViewAdpater2) {
((IRecyclerViewAdpater2) iCommonAdapter).attachToAdapter(this);
}
}
@Override
public RecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(mLayoutId, parent, false);
return new RecyclerViewHolder(mContext, mPlaceHolder, v);
}
@Override
public void onBindViewHolder(final RecyclerViewHolder holder, int position) {
final T item = (T) items.get(position);
holder.setPosition(position);
mICommonAdapter.getView(holder, item);
}
@Override
public int getItemCount() {
if(items==null)
return 0;
return items.size();
}
public void add(Object item, int position) {
items.add(position, item);
notifyItemInserted(position);
}
public void remove(Object item) {
int position = items.indexOf(item);
items.remove(position);
notifyItemRemoved(position);
}
private static int setColorAlpha(int color, int alpha) {
return (alpha << 24) | (color & 0x00ffffff);
}
public void setList(List list) {
this.items = list;
notifyDataSetChanged();
}
public void setOnClickListener(View.OnClickListener onClickListener) {
this.mClickListener = onClickListener;
}
public View.OnClickListener getOnClickListener() {
return this.mClickListener;
}
public void update() {
notifyDataSetChanged();
}
public Object getItem(int position) {
return items.get(position);
}
public void addList(List list) {
if (list != null) {
items.addAll(list);
notifyDataSetChanged();
}
}
public ArrayList getList() {
return (ArrayList) items;
}
public interface IRecyclerViewAdapter {
void getView(RecyclerViewHolder viewHolder, Object item);
}
public interface IRecyclerViewAdpater2 extends IRecyclerViewAdapter {
void attachToAdapter(RecyclerView.Adapter adapter);
}
}
|
/*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*/
package com.cnk.travelogix.presales.core.service.impl;
import de.hybris.platform.servicelayer.keygenerator.KeyGenerator;
import org.apache.log4j.Logger;
import com.cnk.travelogix.presales.core.service.LeadService;
import com.cnk.travelogix.presales.model.LeadModel;
/**
* Generates code using keyGenerator and set into leadId attribute.
*/
public class DefaultLeadService implements LeadService
{
private static final Logger LOG = Logger.getLogger(DefaultLeadService.class);
private KeyGenerator keyGenerator;
@Override
public void generateLeadId(final LeadModel leadModel)
{
if (leadModel.getLeadId() == null)
{
leadModel.setLeadId("LEAD" + keyGenerator.generate());
LOG.debug("Set new code for Lead Model -" + leadModel.getLeadId());
}
}
/**
* @return the keyGenerator
*/
public KeyGenerator getKeyGenerator()
{
return keyGenerator;
}
/**
* @param keyGenerator
* the keyGenerator to set
*/
public void setKeyGenerator(final KeyGenerator keyGenerator)
{
this.keyGenerator = keyGenerator;
}
}
|
package model;
import java.util.Random;
public enum Status {
available, pending, sold;
public static Status getRandom()
{
Random random = new Random();
int idx = random.nextInt(values().length);
return values()[idx];
}
}
|
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.net.URL;
/**
* This class contains the declaration of all the CocoJNI functions.
*/
public class CocoJNI {
public static final String LIBNAME = "CocoJNI-2.3.0";
public static final String LIBNAMEDLL = LIBNAME + ".dll";
/* Load the library */
static {
URL libname = Thread.currentThread().getContextClassLoader().getResource(LIBNAMEDLL);
try {
if (libname != null) {
File dllFile = new File(LIBNAMEDLL);
if (!dllFile.exists()) {
FileUtils.copyURLToFile(libname, dllFile);
}
System.loadLibrary(LIBNAME);
}
} catch (IOException e) {
e.printStackTrace();
}
}
/* Native methods */
public static native void cocoSetLogLevel(String logLevel);
// Observer
public static native long cocoGetObserver(String observerName, String observerOptions);
public static native void cocoFinalizeObserver(long observerPointer);
public static native long cocoProblemAddObserver(long problemPointer, long observerPointer);
public static native long cocoProblemRemoveObserver(long problemPointer, long observerPointer);
// Suite
public static native long cocoGetSuite(String suiteName, String suiteInstance, String suiteOptions);
public static native void cocoFinalizeSuite(long suitePointer);
// CocoProblem
public static native long cocoSuiteGetNextProblem(long suitePointer, long observerPointer);
public static native long cocoSuiteGetProblem(long suitePointer, long problemIndex);
// Functions
public static native double[] cocoEvaluateFunction(long problemPointer, double[] x);
public static native double[] cocoEvaluateConstraint(long problemPointer, double[] x);
// Getters
public static native int cocoProblemGetDimension(long problemPointer);
public static native int cocoProblemGetNumberOfObjectives(long problemPointer);
public static native int cocoProblemGetNumberOfConstraints(long problemPointer);
public static native double[] cocoProblemGetSmallestValuesOfInterest(long problemPointer);
public static native double[] cocoProblemGetLargestValuesOfInterest(long problemPointer);
public static native String cocoProblemGetId(long problemPointer);
public static native String cocoProblemGetName(long problemPointer);
public static native long cocoProblemGetEvaluations(long problemPointer);
public static native long cocoProblemGetIndex(long problemPointer);
public static native int cocoProblemIsFinalTargetHit(long problemPointer);
}
|
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2015 Paco Avila & Josep Llort
*
* No bytes were intentionally harmed during the development of this application.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.dao;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.openkm.core.DatabaseException;
import com.openkm.dao.bean.DatabaseMetadataSequence;
import com.openkm.dao.bean.DatabaseMetadataType;
import com.openkm.dao.bean.DatabaseMetadataValue;
/**
* ExtensionMetadataDAO
*
* @author pavila
*/
public class DatabaseMetadataDAO {
private static Logger log = LoggerFactory.getLogger(DatabaseMetadataDAO.class);
private DatabaseMetadataDAO() {}
/**
* Create
*/
public static long createValue(DatabaseMetadataValue dmv) throws DatabaseException {
log.debug("createValue({})", dmv);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Long id = (Long) session.save(dmv);
HibernateUtil.commit(tx);
log.debug("createValue: {}", id);
return id;
} catch(HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Update
*/
public static void updateValue(DatabaseMetadataValue dmv) throws DatabaseException {
log.debug("updateValue({})", dmv);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
session.update(dmv);
HibernateUtil.commit(tx);
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
log.debug("updateValue: void");
}
/**
* Delete
*/
public static void deleteValue(long dmvId) throws DatabaseException {
log.debug("deleteValue({})", dmvId);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
DatabaseMetadataValue dmv = (DatabaseMetadataValue) session.load(DatabaseMetadataValue.class, dmvId);
session.delete(dmv);
HibernateUtil.commit(tx);
} catch(HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
log.debug("deleteValue: void");
}
/**
* Find all wiki pages
*/
@SuppressWarnings("unchecked")
public static List<DatabaseMetadataValue> findAllValues(String table) throws DatabaseException {
log.debug("findAllValues({})", table);
String qs = "from DatabaseMetadataValue dmv where dmv.table=:table order by dmv.id asc";
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(qs);
q.setString("table", table);
List<DatabaseMetadataValue> ret = q.list();
HibernateUtil.commit(tx);
log.debug("findAllValues: {}", ret);
return ret;
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Find by pk
*/
public static DatabaseMetadataValue findValueByPk(String table, long id) throws DatabaseException {
log.debug("findValueByPk({}, {})", table, id);
String qs = "from DatabaseMetadataValue dmv where dmv.table=:table and dmv.id=:id";
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
Query q = session.createQuery(qs);
q.setString("table", table);
q.setLong("id", id);
DatabaseMetadataValue ret = (DatabaseMetadataValue) q.setMaxResults(1).uniqueResult();
log.debug("findValueByPk: {}", ret);
return ret;
} catch (HibernateException e) {
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Execute update
*/
public static int executeValueUpdate(String query) throws DatabaseException {
log.debug("executeValueUpdate({})", query);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(query);
int ret = q.executeUpdate();
HibernateUtil.commit(tx);
log.debug("executeValueUpdate: {}", ret);
return ret;
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Execute query
*/
@SuppressWarnings("unchecked")
public static List<DatabaseMetadataValue> executeValueQuery(String query) throws DatabaseException {
log.debug("executeValueQuery({})", query);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(query);
List<DatabaseMetadataValue> ret = q.list();
HibernateUtil.commit(tx);
log.debug("executeValueQuery: {}", ret);
return ret;
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Execute query
*/
public static DatabaseMetadataValue executeValueQueryUnique(String query) throws DatabaseException {
log.debug("executeValueQueryUnique({})", query);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(query);
DatabaseMetadataValue ret = (DatabaseMetadataValue) q.uniqueResult();
HibernateUtil.commit(tx);
log.debug("executeValueQueryUnique: {}", ret);
return ret;
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Execute query
*/
public static List<DatabaseMetadataValue[]> executeMultiValueQuery(String query) throws DatabaseException {
log.debug("executeMultiValueQuery({})", query);
List<DatabaseMetadataValue[]> ret = new ArrayList<DatabaseMetadataValue[]>();
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(query);
for (Object obj : q.list()) {
if (obj instanceof Object[]) {
Object[] objAry = (Object[]) obj;
DatabaseMetadataValue[] tmp = new DatabaseMetadataValue[objAry.length];
for (int i = 0; i < objAry.length; i++) {
if (objAry[i] instanceof DatabaseMetadataValue) {
tmp[i] = (DatabaseMetadataValue) objAry[i];
}
}
ret.add(tmp);
} else if (obj instanceof DatabaseMetadataValue) {
DatabaseMetadataValue[] tmp = new DatabaseMetadataValue[1];
tmp[0] = (DatabaseMetadataValue) obj;
ret.add(tmp);
}
}
HibernateUtil.commit(tx);
log.debug("executeMultiValueQuery: {}", ret);
return ret;
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Create
*/
public static long createType(DatabaseMetadataType dmt) throws DatabaseException {
log.debug("createType({})", dmt);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Long id = (Long) session.save(dmt);
HibernateUtil.commit(tx);
log.debug("createType: {}", id);
return id;
} catch(HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Update
*/
public static void updateType(DatabaseMetadataType dmt) throws DatabaseException {
log.debug("updateType({})", dmt);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
session.update(dmt);
HibernateUtil.commit(tx);
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
log.debug("updateType: void");
}
/**
* Delete
*/
public static void deleteType(long dmtId) throws DatabaseException {
log.debug("deleteType({})", dmtId);
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
DatabaseMetadataType emt = (DatabaseMetadataType) session.load(DatabaseMetadataType.class, dmtId);
session.delete(emt);
HibernateUtil.commit(tx);
} catch(HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
log.debug("deleteType: void");
}
/**
* Find all wiki pages
*/
@SuppressWarnings("unchecked")
public static List<DatabaseMetadataType> findAllTypes(String table) throws DatabaseException {
log.debug("findAllTypes({})", table);
String qs = "from DatabaseMetadataType dmt where dmt.table=:table order by dmt.id asc";
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(qs);
q.setString("table", table);
List<DatabaseMetadataType> ret = q.list();
HibernateUtil.commit(tx);
log.debug("findAllTypes: {}", ret);
return ret;
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
/**
* Get next sequence number
*/
public static long getNextSequenceValue(String table, String column) throws DatabaseException {
log.debug("getNextSequenceValue({}, {})", table, column);
String qs = "from DatabaseMetadataSequence dms where dms.table=:table and dms.column=:column";
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Query q = session.createQuery(qs);
q.setString("table", table);
q.setString("column", column);
DatabaseMetadataSequence dms = (DatabaseMetadataSequence) q.setMaxResults(1).uniqueResult();
if (dms != null) {
// Update already created sequence
dms.setValue(dms.getValue() + 1);
session.update(dms);
} else {
// First sequence use: starts with 1
dms = new DatabaseMetadataSequence();
dms.setTable(table);
dms.setColumn(column);
dms.setValue(1);
session.save(dms);
}
HibernateUtil.commit(tx);
log.debug("getNextSequenceValue: {}", dms.getValue());
return dms.getValue();
} catch (HibernateException e) {
HibernateUtil.rollback(tx);
throw new DatabaseException(e.getMessage(), e);
} finally {
HibernateUtil.close(session);
}
}
}
|
package br.com.keepitup.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@Entity
public class Exercicio {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String nome_exercicio;
private String descricao;
private String imagem;
private Integer repeticoes;
private Integer peso;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome_exercicio() {
return nome_exercicio;
}
public void setNome_exercicio(String nome_exercicio) {
this.nome_exercicio = nome_exercicio;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public String getImagem() {
return imagem;
}
public void setImagem(String imagem) {
this.imagem = imagem;
}
public Integer getRepeticoes() {
return repeticoes;
}
public void setRepeticoes(Integer repeticoes) {
this.repeticoes = repeticoes;
}
public Integer getPeso() {
return peso;
}
public void setPeso(Integer peso) {
this.peso = peso;
}
public Exercicio() {
}
}
|
package com.zhouyi.business.core.model.provincecomprehensive;
import lombok.Data;
/**
* @Author: first
* @Date: 上午9:10 2019/10/31
* @Description: 省厅接口返回数据
**/
@Data
public class ResponseData {
private String status;
private String value;
}
|
/**
* Example For WorkFlowDB DAO Layer
*/
package example;
|
package pe.com.tss.dao;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import pe.com.tss.bean.Country;
import pe.com.tss.bean.Customer;
import pe.com.tss.bean.Vendor;
import pe.com.tss.util.JPAUtil;
public class VendorDao {
public boolean exitsVendor(String code, String name, String vendortype) {
EntityManager em = JPAUtil.getEntityManager();
Query emquery = em.createNamedQuery("Vendor.exitsVendor");
emquery.setParameter("code", code);
emquery.setParameter("name", name);
emquery.setParameter("vendortype", vendortype);
long r = 0;
boolean resultado = false;
r = (long) emquery.getSingleResult();
// em.close();
if (r > 0) {
resultado = true;
}
return resultado;
}
public boolean exitsVendorCode(String code) {
EntityManager em = JPAUtil.getEntityManager();
Query emquery = em.createNamedQuery("Vendor.exitsVendorCode");
emquery.setParameter("code", code);
long r = 0;
boolean resultado = false;
r = (long) emquery.getSingleResult();
// em.close();
if (r > 0) {
resultado = true;
}
return resultado;
}
public Vendor getVendor(String code) {
EntityManager em = JPAUtil.getEntityManager();
Query emquery = em.createNamedQuery("Vendor.getVendor");
emquery.setParameter("code", code);
if (!emquery.getResultList().isEmpty()) {
return (Vendor) emquery.getSingleResult();
} else {
return null;
}
}
public Vendor getVendorName(String name) {
EntityManager em = JPAUtil.getEntityManager();
Query emquery = em.createNamedQuery("Vendor.getVendorName");
emquery.setParameter("name", name);
if (!emquery.getResultList().isEmpty()) {
return (Vendor) emquery.getSingleResult();
} else {
return null;
}
}
public void registrar(Vendor vendor) {
EntityManager em = JPAUtil.getEntityManager();
em.getTransaction().begin();
em.persist(vendor);
em.getTransaction().commit();
}
}
|
package pro.eddiecache.kits;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public abstract class AbstractKitCacheMonitor extends Thread
{
protected final Log log = LogFactory.getLog(this.getClass());
protected static long idlePeriod = 20 * 1000;
protected AtomicBoolean allright = new AtomicBoolean(true);
private AtomicBoolean shutdown = new AtomicBoolean(false);
private Lock lock = new ReentrantLock();
private Condition trigger = lock.newCondition();
public AbstractKitCacheMonitor(String name)
{
super(name);
}
public static void setIdlePeriod(long idlePeriod)
{
if (idlePeriod > AbstractKitCacheMonitor.idlePeriod)
{
AbstractKitCacheMonitor.idlePeriod = idlePeriod;
}
}
public void notifyError()
{
if (allright.compareAndSet(true, false))
{
signalTrigger();
}
}
public void notifyShutdown()
{
if (shutdown.compareAndSet(false, true))
{
signalTrigger();
}
}
private void signalTrigger()
{
try
{
lock.lock();
trigger.signal();
}
finally
{
lock.unlock();
}
}
protected abstract void dispose();
protected abstract void doWork();
@Override
public void run()
{
do
{
if (log.isDebugEnabled())
{
if (allright.get())
{
log.debug("allright = true, cache monitor will wait for an error.");
}
else
{
log.debug("allright = false cache monitor running.");
}
}
if (allright.get())
{
try
{
lock.lock();
trigger.await();
}
catch (InterruptedException ignore)
{
}
finally
{
lock.unlock();
}
}
if (shutdown.get())
{
log.info("Shutting down cache monitor");
dispose();
return;
}
allright.set(true);
if (log.isDebugEnabled())
{
log.debug("Cache monitor running.");
}
doWork();
try
{
if (log.isDebugEnabled())
{
log.debug("Cache monitor sleeping for " + idlePeriod + " between runs.");
}
Thread.sleep(idlePeriod);
}
catch (InterruptedException ex)
{
}
}
while (true);
}
}
|
package com.yixin.kepler.v1.datapackage.dto.yntrust;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* 还款计划DTO
* @author sukang
*/
public class YTRepaySchedulesReqDTO extends YTCommonRequestDTO{
private static final long serialVersionUID = -1722572941005317937L;
@JsonProperty("LoanRepaySchedules")
private List<YTLoanRepaySchedulesDTO> loanRepaySchedules;
public List<YTLoanRepaySchedulesDTO> getLoanRepaySchedules() {
return loanRepaySchedules;
}
public void setLoanRepaySchedules(List<YTLoanRepaySchedulesDTO> loanRepaySchedules) {
this.loanRepaySchedules = loanRepaySchedules;
}
}
|
package co.th.aten.football.ui;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.springframework.richclient.dialog.ApplicationDialog;
/**
* Shows the usage of the confirmation dialog.
*
* @author Jan Hoskens
*
*/
public class ErrorDialog extends ApplicationDialog {
private String message;
public ErrorDialog( Component parent,String title, String message) {
super(title, parent);
this.message = message;
this.getDialog().setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
}
public ErrorDialog() {
}
@Override
protected JComponent createButtonBar() {
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 5));
JButton button = new JButton(" Close ");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onFinish();
}
});
panel.add(button);
return panel;
}
@Override
protected boolean onFinish() {
dispose();
return true;
}
@Override
protected JComponent createDialogContentPane() {
JPanel panel = new JPanel();
JLabel label = new JLabel(message);
panel.add(label);
return panel;
}
}
|
package earth.eu.jtzipi.jbat;
import earth.eu.jtzipi.modules.io.watcher.IWatchEventHandler;
import java.nio.file.Path;
public class RootWatchEventListener implements IWatchEventHandler {
@Override
public EventAction onOverflow( Path path, int i ) {
return null;
}
@Override
public EventAction onCreate( Path path, int i ) {
return null;
}
@Override
public EventAction onModify( Path path, int i ) {
return null;
}
@Override
public EventAction onDelete( Path path, int i ) {
return null;
}
}
|
package com.bw.movie.mvp.view.activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.bw.movie.R;
import com.bw.movie.mvp.model.bean.AttenBean;
import com.bw.movie.mvp.model.bean.UnflowwBean;
import com.bw.movie.mvp.present.AttentPresent;
import com.bw.movie.mvp.present.UnFlowwAttenPresent;
import com.bw.movie.IView.IAttentView;
import com.bw.movie.IView.IUnAttenView;
import com.bw.movie.mvp.view.apdater.FilmApdater;
import com.bw.movie.mvp.view.apdater.MyForseApdater;
import com.bw.movie.mvp.view.apdater.MyStageApdater;
import com.bw.movie.mvp.model.bean.DetailMovie;
import com.bw.movie.mvp.model.bean.FilmBean;
import com.bw.movie.mvp.present.DetaPresent;
import com.bw.movie.mvp.present.FilmPresent;
import com.bw.movie.IView.IDetaView;
import com.bw.movie.IView.IFilmView;
import com.facebook.drawee.view.SimpleDraweeView;
import org.greenrobot.eventbus.EventBus;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.annotations.Nullable;
public class ShowActivity extends AppCompatActivity implements IDetaView, IFilmView,IAttentView,IUnAttenView {
@BindView(R.id.iv_deta_image)
SimpleDraweeView ivDetaImage;
@BindView(R.id.movie_name)
TextView movieName;
@BindView(R.id.tv_deta_name)
TextView tvDetaName;
@BindView(R.id.iv_deta_heart)
ImageView ivDetaHeart;
@Nullable
@BindView(R.id.Film_Recylcer_View)
RecyclerView FilmRecylcerView;
@BindView(R.id.frament)
FrameLayout frament;
private DetaPresent detaPresent;
private PopupWindow popupWindow;
private SimpleDraweeView simp_xView;
private TextView text_biaoaction;
private TextView text_leiaction;
private TextView text_daoaction;
private TextView text_timeaction;
private TextView text_addressaction;
private TextView text_jianjie;
private TextView text_nameaction;
private RecyclerView rece_phont;
private DetailMovie.ResultBean bean;
private RecyclerView StagePecylcerView;
private RecyclerView forse_Recycler_View;
private boolean guanzhu = false;
private String TAG = new String();
private List<FilmBean.ResultBean> filmBeanResult;
private FilmPresent filmPresent;
private int movieId;
private AttentPresent attentPresent;
private SharedPreferences user;
private boolean isLogin;
private UnFlowwAttenPresent unFlowwAttenPresent;
//private List<DetailMovie.ResultBean> list=new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show);
ButterKnife.bind(this);
//EventBus.getDefault().register(this);
inidData();
/**
* 关注
*
* */
user = this.getSharedPreferences("user", Context.MODE_PRIVATE);
isLogin = user.getBoolean("isLogin", true);
ivDetaHeart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (v == ivDetaHeart) {
if(isLogin){
ivDetaHeart.setImageResource(R.drawable.guanzhu1);
attentPresent.getAttent(movieId);
} else{
ivDetaHeart.setImageResource(R.drawable.guanzhu);
unFlowwAttenPresent.getUnfloww(movieId);
}
isLogin=!isLogin;
}
}
});
}
/**
* 详情
*/
@Override
public void success(DetailMovie detailMovie) {
bean = detailMovie.getResult();
ivDetaImage.setImageURI(bean.getImageUrl());
movieName.setText(bean.getName());
movieId = bean.getId();
}
// @Override
// public void onBackPressed() {
//
// if (JZVideoPlayer.backPress()) {
// return;
// }
// super.onBackPressed();
// }
//
// @Override
// protected void onPause(){
// super.onPause();
// JZVideoPlayer.releaseAllVideos();
// }
/**
* EventBus的接收方法
*
* @param context 传递类
*/
/*@Subscribe(threadMode = ThreadMode.MAIN,sticky = true)
public void getEvent(DetailMovie detailMovie){
Log.i("aaa",detailMovie.getResult().getId()+"eventid");
}*/
private void inidData(){
int id = getIntent().getIntExtra("id", 0);
detaPresent = new DetaPresent(this);
detaPresent.getDetaMovie(id);
filmPresent = new FilmPresent(this);
filmPresent.getFilm(1, 1, 15);
//关注
attentPresent = new AttentPresent(this);
//取消关注
unFlowwAttenPresent = new UnFlowwAttenPresent(this);
}
@OnClick({R.id.deta_rb_1, R.id.deta_rb_2, R.id.deta_rb_3, R.id.deta_rb_4, R.id.back, R.id.shop_buytick})
public void onClickView(View v) {
switch (v.getId()) {
case R.id.deta_rb_1:
showPopwindow();//详情
/*if(popupWindow==null){
Log.i("aaa","initDeta()");
}else {
Toast.makeText(this, "没有popupWindow", Toast.LENGTH_SHORT).show();
}*/
break;
case R.id.deta_rb_2:
initForesShwo();//预告
break;
case R.id.deta_rb_3:
showStagePhoto();//剧照
break;
case R.id.deta_rb_4:
initfilm();//影评
break;
case R.id.back:
finish();
break;
case R.id.shop_buytick:
break;
}
}
/**
* 影评
*/
private void initfilm() {
Log.i("initfilm", "initfilm: ===" + filmBeanResult.size());
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.show_pop_film, null);
FilmRecylcerView=view.findViewById(R.id.Film_Recylcer_View);
FilmRecylcerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
FilmRecylcerView.setAdapter(new FilmApdater(this, filmBeanResult));
PopupWindow window = new PopupWindow(view,WindowManager.LayoutParams.MATCH_PARENT, 1000);
window.setFocusable(true);
ColorDrawable dw = new ColorDrawable(0xffffffff);
window.setBackgroundDrawable(dw);
window.setAnimationStyle(R.style.PopupAnimation);
window.showAtLocation(ShowActivity.this.findViewById(R.id.deta_rb_1), Gravity.BOTTOM, 0, 0);
}
private void initForesShwo() {
List<DetailMovie.ResultBean.ShortFilmListBean> shortFilmList = bean.getShortFilmList();
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.show_fores, null);
forse_Recycler_View = view.findViewById(R.id.forse_Recycler_View);
forse_Recycler_View.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
forse_Recycler_View.setAdapter(new MyForseApdater(this, shortFilmList));
PopupWindow window = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, 1000);
window.setFocusable(true);
ColorDrawable dw = new ColorDrawable(0xffffffff);
window.setBackgroundDrawable(dw);
window.setAnimationStyle(R.style.PopupAnimation);
window.showAtLocation(ShowActivity.this.findViewById(R.id.deta_rb_1), Gravity.BOTTOM, 0, 0);
}
private void showStagePhoto() {
List<String> posterList = bean.getPosterList();
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.popu_deta_stagephoto, null);
StagePecylcerView = view.findViewById(R.id.Stage_Pecylcer_View);
StagePecylcerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
StagePecylcerView.setAdapter(new MyStageApdater(ShowActivity.this, posterList));
PopupWindow window = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, 1000);
window.setFocusable(true);
ColorDrawable dw = new ColorDrawable(0xffffffff);
window.setBackgroundDrawable(dw);
window.setAnimationStyle(R.style.PopupAnimation);
window.showAtLocation(ShowActivity.this.findViewById(R.id.deta_rb_1), Gravity.BOTTOM, 0, 0);
}
boolean mIsShowing = false;
/**
* 详情
*/
private void showPopwindow() {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.popu_deta, null);
simp_xView = view.findViewById(R.id.simp_xView);
text_biaoaction = view.findViewById(R.id.text_biaoaction);
text_leiaction = view.findViewById(R.id.text_leiaction);
text_daoaction = view.findViewById(R.id.text_daoaction);
text_timeaction = view.findViewById(R.id.text_timeaction);
text_addressaction = view.findViewById(R.id.text_addressaction);
text_jianjie = view.findViewById(R.id.text_jianjie);
text_nameaction = view.findViewById(R.id.text_nameaction);
PopupWindow window = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, 1200);
window.setFocusable(true);
ColorDrawable dw = new ColorDrawable(0xffffffff);
window.setBackgroundDrawable(dw);
window.setAnimationStyle(R.style.PopupAnimation);
window.showAtLocation(ShowActivity.this.findViewById(R.id.deta_rb_1), Gravity.BOTTOM, 0, 0);
String[] spls = bean.getImageUrl().split("\\|");
Uri parse1 = Uri.parse(spls[0]);
simp_xView.setImageURI(parse1);
tvDetaName.setText(bean.getName());
text_biaoaction.setText(bean.getName());
text_leiaction.setText("类型:" + bean.getMovieTypes());
text_daoaction.setText("导演:" + bean.getDirector());
text_timeaction.setText("时长:" + bean.getDuration());
text_addressaction.setText("产地:" + bean.getPlaceOrigin());
text_jianjie.setText(bean.getSummary());
text_nameaction.setText(bean.getStarring());
}
private void initDeta() {
View inflate = View.inflate(this, R.layout.popu_deta, null);
popupWindow = new PopupWindow(inflate, 200, 300);
popupWindow.setContentView(inflate);
popupWindow.setTouchable(true);
popupWindow.setOutsideTouchable(false);
popupWindow.setFocusable(true);
popupWindow.setBackgroundDrawable(new BitmapDrawable(getResources(), (Bitmap) null));
popupWindow.setAnimationStyle(R.animator.menu_bottombar_in);
mIsShowing = false;
}
/**
* @param filmBean 影评
*/
@Override
public void success(FilmBean filmBean) {
filmBeanResult = filmBean.getResult();
Log.i("aaa", "success: ====" + filmBeanResult.size());
}
//关注
@Override
public void success(AttenBean attenBean) {
String message = attenBean.getMessage();
Log.i("message", "success: ====="+message);
}
//取消关注
@Override
public void success(UnflowwBean unflowwBean) {
String message = unflowwBean.getMessage();
Log.i("message", "success:un ====="+message);
}
@Override
public void Error(String msg) {
Log.i("onError", "Error: ==="+msg);
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
}
|
package cn.com.ykse.santa.web.controller.rest;
import cn.com.ykse.santa.common.enums.ResultCodeEnum;
import cn.com.ykse.santa.repository.dao.UserDOMapper;
import cn.com.ykse.santa.repository.entity.*;
import cn.com.ykse.santa.repository.pagination.Page;
import cn.com.ykse.santa.repository.sort.Sort;
import cn.com.ykse.santa.service.AssemblyService;
import cn.com.ykse.santa.service.DemandService;
import cn.com.ykse.santa.service.PrjService;
import cn.com.ykse.santa.service.UserService;
import cn.com.ykse.santa.service.convertor.BaseConvertor;
import cn.com.ykse.santa.service.enums.DemandStatusEnum;
import cn.com.ykse.santa.service.enums.PrjStatusEnum;
import cn.com.ykse.santa.service.enums.RoleEnum;
import cn.com.ykse.santa.service.executor.InvokeJob;
import cn.com.ykse.santa.service.executor.InvokeService;
import cn.com.ykse.santa.service.executor.impl.RemoveAssemblyAndRelatedUsersJobImpl;
import cn.com.ykse.santa.service.executor.impl.RemoveBranchesJobImpl;
import cn.com.ykse.santa.service.util.DateUtil;
import cn.com.ykse.santa.service.vo.*;
import cn.com.ykse.santa.web.controller.BaseController;
import cn.com.ykse.santa.web.form.*;
import cn.com.ykse.santa.web.protocol.JQueryDTModel;
import cn.com.ykse.santa.web.protocol.Result;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.*;
/**
* Created by youyi on 2016/1/24.
*/
@RestController
@RequestMapping(value = "prj")
public class PrjRestController extends BaseController{
@Value("#{artifactsProperties['artifacts.script.path']}")
private String shellScriptPath;
@Value("#{artifactsProperties['artifacts.script.removeBranch']}")
private String removeBranchScript;
@Autowired
PrjService prjService;
@Autowired
DemandService demandService;
@Autowired
AssemblyService assemblyService;
@Autowired
UserDOMapper userDOMapper;
@Autowired
@Qualifier("invokeService")
private InvokeService invokeService;
@RequestMapping(value = "/list")
public JQueryDTModel list(HttpServletRequest request){
JQueryDTModel model=new JQueryDTModel();
Page page=getPageParmsFromRequest(request);
String q1=request.getParameter("q1");
String q2=request.getParameter("q2");
List<PrjVO> prjs=new ArrayList<>();
Sort sort=getSortInfoFromRequest(request);
if(sort.getSortBy().equalsIgnoreCase("prj_id")){
sort.setSortBy("gmt_create");
sort.setSortDirection("desc");
}
if( (q1==null || q1.isEmpty()) && (q2==null || q2.isEmpty()) ){
prjs=prjService.getAllEnablePrjsForSummary(page,sort);
}else {
if(q1!=null && !q1.isEmpty()){
if(StringUtils.isNumeric(q1)){
PrjVO prj=prjService.getPrjInfoById(Integer.parseInt(q1));
if(prj!=null){
prjs.add(prj);
page.setSearchedRecords(1);
}
}else{
prjs=prjService.searchPrjByPrjName(q1, page, sort);
}
}else if(q2!=null && !q2.isEmpty()){
PrjCretiaForm advancedSeachObj= JSON.parseObject(q2, PrjCretiaForm.class);
PrjDO prjDO=BaseConvertor.convert(advancedSeachObj,PrjDO.class);
String startDate1=advancedSeachObj.getActualPublishStart();
String endDate1=advancedSeachObj.getActualPublishEnd();
String startDate2=advancedSeachObj.getActualStartStart();
String endDate2=advancedSeachObj.getActualStartEnd();
String startDate3=advancedSeachObj.getExpPublishStart();
String endDate3=advancedSeachObj.getExpPublishEnd();
prjs=prjService.advancedSearchPrj(prjDO,startDate1,endDate1,startDate2,endDate2,startDate3,endDate3, page, sort);
}
}
int totalRecords = page!=null ? page.getTotalRecords() : prjs.size();
int searchedRecords = page!=null ? page.getSearchedRecords() : totalRecords;
model.setiTotalRecords(totalRecords);
model.setiTotalDisplayRecords(searchedRecords);
model.setAaData(prjs);
return model;
}
@RequestMapping(value = "/prjsBeAssociating")
public List<PrjDO> prjsBeAssociating(@RequestParam int demandId){
return prjService.getPrjsBeAssociating(demandId);
}
@RequestMapping(value = "/add")
public Result addPrj(@RequestBody AddPrjForm form,HttpServletRequest request) throws Exception {
Result result=new Result();
String me=getRealName(request);
PrjVO prj = BaseConvertor.convert(form,PrjVO.class);
prj.setGmtActualStart(DateUtil.formatDateOnly(new Date()));
prj.setPrjPm(me);
prj.setCreator(me);
prj.setModifier(me);
prj.setPrjStatus(PrjStatusEnum.NEW.getDescription());
boolean isSuccess=prjService.addPrj(prj);
if(isSuccess){
List<UserGroup> ugs=new ArrayList<UserGroup>();
loadUserGroup(form,RoleEnum.DEV,ugs);
loadUserGroup(form,RoleEnum.TEST,ugs);
loadUserGroup(form,RoleEnum.OPS,ugs);
loadUserGroup(form,RoleEnum.DBA,ugs);
int prjId=prj.getPrjId();
isSuccess=prjService.addPrjUsers(prjId,ugs);
Map<String,Object> m=new HashMap<String,Object>();
m.put("id",prjId);
result.setData(m);
}
result.setResultCode(isSuccess? ResultCodeEnum.SUCCESS:ResultCodeEnum.FAIL);
return result;
}
private void loadUserGroup(AddPrjForm form,RoleEnum role,List<UserGroup> ugs){
String[] ids = null;
String roleName="";
switch (role){
case DEV:
ids=form.getDevs();roleName=RoleEnum.DEV.getRoleName();
break;
case TEST:
ids=form.getTests();roleName=RoleEnum.TEST.getRoleName();
break;
case OPS:
ids=form.getOpss();roleName=RoleEnum.OPS.getRoleName();
break;
case DBA:
ids=form.getDbas();roleName=RoleEnum.DBA.getRoleName();
break;
default:break;
}
if(ids!=null){
for(String id : ids){
UserGroup ug=new UserGroup();
ug.setUserId(Integer.parseInt(id));
ug.setRoleName(roleName);
ugs.add(ug);
}
}
}
@RequestMapping(value = "/item")
public ModelAndView detail( @RequestParam int id,HttpServletRequest request) throws UnsupportedEncodingException {
ModelAndView mv=new ModelAndView();
mv.setViewName("prj_item");
PrjVO vo=prjService.getPrjInfoById(id);
mv.addObject("status",vo.getPrjStatus());
mv.addObject("createdDate",vo.getGmtCreate());
mv.addObject("startedDate",vo.getGmtActualStart());
mv.addObject("expPublishDate",vo.getGmtExpectPublish());
mv.addObject("actPublishDate",vo.getGmtActualPublish());
mv.addObject("prjId",vo.getPrjId());
mv.addObject("prjName",vo.getPrjName());
mv.addObject("lastModifyBy",vo.getModifier());
mv.addObject("lastModifyDate",vo.getGmtModified());
mv.addObject("pm",vo.getPrjPm());
String me=getRealName(request);
mv.addObject("isAuthor",vo.getPrjPm().equals(me));
return mv;
}
@RequestMapping(value = "/selectSpecificUsersInPrj")
public Map<String,List<PrjUserCfgVO>> selectSpecificUsersInPrj(@RequestParam int prjId){
return prjService.loadDevTestUsersByPrjId(prjId);
}
@RequestMapping(value = "/get")
public PrjVO get(@RequestParam int id){
return prjService.getPrjInfoById(id);
}
@RequestMapping(value = "/getPrjUsersById")
public List<PrjUserCfgVO> getPrjUsersById(@RequestParam int prjId){
return prjService.loadPrjUsersByPrjId(prjId);
}
@RequestMapping(value = "/update")
public Result editPrj(@RequestBody EditPrjForm editForm,HttpServletRequest request) throws Exception {
Result result=new Result();
String me=getRealName(request);
PrjDO prj = BaseConvertor.convert(editForm,PrjDO.class);
String expectedDate=editForm.getGmtExpectPublish();
if(expectedDate!=null && !expectedDate.isEmpty()){
prj.setGmtExpectPublish(DateUtil.parseDateOnly(expectedDate));
}
prj.setModifier(me);
boolean isSuccess=prjService.updatePrj(prj);
if(isSuccess){
List<UserGroup> ugs=new ArrayList<UserGroup>();
AddPrjForm form=BaseConvertor.convert(editForm,AddPrjForm.class);
loadUserGroup(form,RoleEnum.DEV,ugs);
loadUserGroup(form,RoleEnum.TEST,ugs);
loadUserGroup(form,RoleEnum.OPS,ugs);
loadUserGroup(form,RoleEnum.DBA,ugs);
int prjId=prj.getPrjId();
isSuccess=prjService.updatePrjUsers(prjId,ugs);
}
result.setResultCode(isSuccess? ResultCodeEnum.SUCCESS:ResultCodeEnum.FAIL);
return result;
}
@RequestMapping(value = "/getPrjDemandsByPrjId")
public JQueryDTModel getPrjDemandsByPrjId(@RequestParam int prjId, HttpServletRequest request, HttpServletResponse response){
setRightsToResponseHead(request,response);
JQueryDTModel model=new JQueryDTModel();
List<DemandVO> demands = prjService.getPrjDemandsByPrjId(prjId);
model.setAaData(demands);
return model;
}
private boolean addPrjUserIfNotExist(String realName,int prjId){
int userId=userDOMapper.selectUserIdByRealName(realName);
UserGroup ug=new UserGroup();
ug.setRoleName(RoleEnum.PD.getRoleName());
ug.setUserId(userId);
return prjService.addPrjUserIfNotExist(prjId,ug);
}
@RequestMapping(value = "/associateDemand")
public Result associateDemand(@RequestBody List<PrjAssociatedDemand> pns, HttpServletRequest request) throws UnsupportedEncodingException {
Result result=new Result();
List<PrjDemandCfgVO> vos=BaseConvertor.convertList(pns,PrjDemandCfgVO.class);
boolean isSuccess = prjService.addBatchDemandInPrj(vos);
int prjId=vos.get(0).getPrjId();
for(PrjAssociatedDemand pad : pns){
String userRealName=pad.getPd();
isSuccess=addPrjUserIfNotExist(userRealName,prjId);
if(!isSuccess){
result.setResultCode(ResultCodeEnum.FAIL);
result.setAlertMsg("设置项目PD时出错");
}
}
List<PrjUserCfgVO> prjUsers=prjService.loadPrjUsersByPrjId(prjId);
String pds="";
for(PrjUserCfgVO user : prjUsers){
if(RoleEnum.PD.getRoleName().equals(user.getRoleName())){
pds+=user.getRealName()+" ";
}
}
Map<String, Object> data = new HashMap<>();
data.put("pds",pds);
result.setData(data);
return result;
}
@RequestMapping(value = "/unassociateDemand")
public Result unassociateDemand(@RequestParam int demandId) {
Result result=new Result();
boolean isSuccess=demandService.removeRelatedPrjForDemand(demandId);
if(isSuccess){
DemandDO demand=new DemandDO();
demand.setDemandId(demandId);
demand.setDemandStatus(DemandStatusEnum.TODEVELOP.getDescription());
isSuccess=demandService.updateDemand(demand);
if(!isSuccess){
result.setResultCode(ResultCodeEnum.FAIL);
result.setAlertMsg("恢复需求状态出错");
}
}else {
result.setResultCode(ResultCodeEnum.FAIL);
result.setAlertMsg("取消关联失败");
}
return result;
}
@RequestMapping(value = "/unrelatedDemands")
public JQueryDTModel unrelatedDemands(HttpServletRequest request) throws UnsupportedEncodingException {
JQueryDTModel model=new JQueryDTModel();
Page page=getPageParmsFromRequest(request);
DemandDO seachObj=new DemandDO();
String q=request.getParameter("q");
if(q!=null && !q.isEmpty()) {
seachObj = JSON.parseObject(q, DemandDO.class);
}
List<DemandVO> relatedVOs=prjService.getPrjDemands();
String assigns=getRealName(request);
List<DemandVO> vos=demandService.getDemandListForAssociation(relatedVOs,seachObj,assigns, page);
int totalRecords = page!=null ? page.getTotalRecords() : vos.size();
int searchedRecords = page!=null ? page.getSearchedRecords() : totalRecords;
model.setiTotalRecords(totalRecords);
model.setiTotalDisplayRecords(searchedRecords);
model.setAaData(vos);
return model;
}
@RequestMapping(value = "/setPrjStatusIfAssemblyAdded",method = RequestMethod.POST)
public void setPrjStatusIfAssemblyAdded(@RequestParam int prjId,HttpServletRequest request) throws Exception{
String status=prjService.getPrjInfoById(prjId).getPrjStatus();
if(PrjStatusEnum.getEnumByDescription(status)==PrjStatusEnum.NEW){
String modifier=getRealName(request);
prjService.updateStatus(prjId,PrjStatusEnum.DEVELOPING,modifier);
}
}
@RequestMapping(value = "/files")
public JQueryDTModel getFiles(@RequestParam int prjId){
JQueryDTModel model=new JQueryDTModel();
List<PrjFileVO> vos=prjService.getPrjFilesByPrjId(prjId);
model.setiTotalRecords(vos.size());
model.setiTotalDisplayRecords(vos.size());
model.setAaData(vos);
return model;
}
@RequestMapping(value = "/removeFile")
public Result removeFile(@RequestParam int prjId,@RequestParam int fileId){
Result result=new Result();
boolean isSuccess=prjService.removeRelatedFileForPrj(prjId,fileId);
result.setResultCode(isSuccess?ResultCodeEnum.SUCCESS:ResultCodeEnum.FAIL);
return result;
}
@RequestMapping(value = "/uploadFiles")
public Result uploadFiles(@RequestParam List<MultipartFile> files, @RequestParam int prjId, HttpServletRequest request){
Result result=new Result();
boolean isSuccess;
try{
// isSuccess=prjService.removeRelatedFileForPrj(prjId);
String uploader=getRealName(request);
isSuccess=prjService.addPrjFiles(files,prjId,uploader);
if(!isSuccess){
result.setResultCode(ResultCodeEnum.FAIL);
result.setAlertMsg("添加文件出错");
}
}catch(Exception ex){
result.setResultCode(ResultCodeEnum.FAIL);
result.setAlertMsg(ex.getCause().getMessage());
}
return result;
}
@RequestMapping(value = "/isPrjPublished")
public boolean isPrjPublished(@RequestParam int prjId){
return prjService.isPrjPublished(prjId);
}
@RequestMapping(value = "/close")
public Result close(@RequestParam int prjId,HttpServletRequest request) throws UnsupportedEncodingException {
Result result=new Result();
List<Integer> assemblyIds=assemblyService.getAssemblyIdsByPrjId(prjId);
List<AssemblyDO> assemblyDOs=assemblyService.getBranchNamesAndGitLinksByAssemblyIds(assemblyIds);
List<InvokeJob> jobs = new ArrayList<InvokeJob>();
InvokeJob job1=new RemoveAssemblyAndRelatedUsersJobImpl(assemblyService,assemblyIds);
InvokeJob job2=new RemoveBranchesJobImpl(assemblyService,assemblyDOs,shellScriptPath, removeBranchScript);
jobs.add(job1);
jobs.add(job2);
invokeService.invoke(jobs);
String modifier=getRealName(request);
boolean isClosed=prjService.updateStatus(prjId,PrjStatusEnum.CLOSED,modifier);
if(!isClosed){
result.setResultCode(ResultCodeEnum.FAIL);
}
return result;
}
@RequestMapping(value = "/unclosedPrjs")
public List<PrjDO> getUnclosedPrjs(){
List<PrjDO> prjs=new ArrayList<>();
prjs=prjService.getUnclosedPrjs();
return prjs;
}
}
|
package kimmyeonghoe.cloth.dao.purchase;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import kimmyeonghoe.cloth.dao.map.purchase.PurchaseMap;
import kimmyeonghoe.cloth.domain.purchase.Purchase;
@Repository
public class PurchaseDaoImpl implements PurchaseDao{
@Autowired private PurchaseMap purchaseMap;
@Override
public Purchase selectHistory(String userId) {
return purchaseMap.selectHistory(userId);
}
@Override
public List<Purchase> selectPchsItems(String userId) {
return purchaseMap.selectPchsItems(userId);
}
@Override
public List<Purchase> selectClothNames(String userId) {
return purchaseMap.selectClothNames(userId);
}
@Override
public int insertPurchase(Purchase purchase) {
return purchaseMap.insertPurchase(purchase);
}
@Override
public int insertCloPur(Purchase purchase) {
return purchaseMap.insertCloPur(purchase);
}
}
|
package com.sedwt.icloud.service.impl;
import com.sedwt.icloud.order.StockOrder;
import com.sedwt.icloud.product.Stock;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
/**
* @author : zhang yijun
* @date : 2021/3/17 11:52
* @description : TODO
*/
@Slf4j
@Service
@RabbitListener(queues = "miaosha-queue")
public class RabbitConsumer {
private static final String ORDER_SERVICE_NAME = "order-service";
@Autowired
private RestTemplate restTemplate;
/**
* 创建订单
*
* @param store
*/
@RabbitHandler
public void processOrder(Stock store) {
//调用订单服务创建订单
StockOrder stockOrder = new StockOrder();
stockOrder.setStockId(store.getId());
stockOrder.setName(store.getName());
stockOrder.setCreateTime(new Date());
try {
log.info("即将发送http请求");
ResponseEntity<Integer> entity =
restTemplate.postForEntity("http://" + ORDER_SERVICE_NAME + "/order/create", stockOrder, Integer.class);
log.info("发送HTTP请求成功...{}", entity);
} catch (Exception e) {
log.error("发送http请求异常...{}", e.getMessage());
}
}
}
|
package sellwin.gui;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
// SellWin http://sourceforge.net/projects/sellwincrm
//Contact support@open-app.com for commercial help with SellWin
//This software is provided "AS IS", without a warranty of any kind.
/**
* This class implements the popup date-calendar
* dialog. It is used to edit a date value on
* some of the screens. It pops up when a date
* cell or field is clicked on by the user.
*/
public class DateEditorDialog extends JDialog {
private DatePanel datePanel = new DatePanel();
private JButton okButton = new JButton("Ok");
private final DateEditorDialogListener myEditor;
/**
* construct a date editor dialog
* @param owner the frame that owns this dialog
* @param editor the listener of this dialog that
* receives the date when this dialog hides itself
*/
public DateEditorDialog(Frame owner, DateEditorDialogListener editor) {
super(owner, "Date Editor", true);
myEditor= editor;
Whiteboard wb = MainWindow.getWhiteboard();
setTitle(wb.getLang().getString("dateEditor"));
setFont(MainWindow.LABEL_FONT);
setSize(440, 190);
getContentPane().setLayout(new BorderLayout());
setColors();
setFonts();
okButton.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
myEditor.setDate(datePanel.getDate());
hide();
}
});
getContentPane().add(datePanel, BorderLayout.CENTER);
JPanel buttonPanel = new JPanel();
buttonPanel.add(okButton);
getContentPane().add(buttonPanel, BorderLayout.SOUTH);
WindowListener l = new WindowAdapter() {
public void windowClosed(WindowEvent e) {
}
public void windowClosing(WindowEvent e) {
hide();
}
};
addWindowListener(l);
getRootPane().setDefaultButton(okButton);
}
/**
* set the date this dialog will display
* @param d the date we are setting with
*/
public final void setDate(Date d) {
datePanel.setDate(d);
}
/**
* get the date from this dialog
* @return the date this dialog knows about
*/
public final Date getDate() {
return datePanel.getDate();
}
/**
* set the dialog's colors
*/
private final void setColors() {
}
/**
* set the dialog's fonts
*/
private final void setFonts() {
}
}
|
package com.pingcap.tools.cdb.binlog.instance.spring;
import com.pingcap.tools.cdb.binlog.instance.core.CDBInstance;
import com.pingcap.tools.cdb.binlog.instance.core.CDBInstanceGenerator;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
/**
* Created by iamxy on 2017/2/17.
*/
public class SpringCDBInstanceGenerator implements CDBInstanceGenerator, BeanFactoryAware {
private String defaultName = "instance";
private BeanFactory beanFactory;
@Override
public CDBInstance generate(String destination) {
String beanName = destination;
if (!beanFactory.containsBean(beanName)) {
beanName = defaultName;
}
return (CDBInstance) beanFactory.getBean(beanName);
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = beanFactory;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.