text
stringlengths 10
2.72M
|
|---|
package ru.otus.json.writer.testobjects;
import java.util.ArrayList;
import java.util.Collection;
public class TestWithArrays {
public String value = "TestGson JSON with array";
public int id = 100;
public int[] intArray = {8080, 443, 179, 646};
public Object[] objectArray = {null,
new String(new char['F']),
new String(new char['o']),
new String(new char['o'])};
public Collection<String> stringCollection = new ArrayList<>();
public Collection<Integer> integerCollection = new ArrayList<>();
private String[][] stringArray = {{"One ", "Two ", "Three "}, {"Otus!"}};
public void addStringCollection(String value) {
stringCollection.add(value);
}
public void addObjettsCollection(Integer value) {
integerCollection.add(value);
}
}
|
package com.tencent.mm.ui.chatting.gallery;
import android.graphics.Bitmap;
import com.tencent.mm.a.f.a;
class f$2 implements a<String, Bitmap> {
final /* synthetic */ f tVq;
f$2(f fVar) {
this.tVq = fVar;
}
}
|
package ch03.ex03_01;
import static org.junit.Assert.*;
import org.junit.Test;
public class VehicleTest {
//methodTest
@Test
public void testMethod() {
Vehicle car = new Vehicle("Mike");
car.setVelocity(2.0);
car.setDirection(Math.PI / 2);
double expectedDirection = Math.PI / 2;
assertEquals(new Double(expectedDirection), new Double(car.getDirection()));
car.turn(Math.PI / 2);
expectedDirection = Math.PI;
assertEquals(new Double(expectedDirection), new Double(car.getDirection()));
car.turn(0);
expectedDirection = Math.PI - (Math.PI / 2);
assertEquals(new Double(expectedDirection), new Double(car.getDirection()));
car.turn(1);
expectedDirection = expectedDirection + (Math.PI / 2);
assertEquals(new Double(expectedDirection), new Double(car.getDirection()));
}
}
|
package de.jmda.app.uml.sampletypes;
public interface InterfaceBottom extends InterfaceMiddle { }
|
package com.lr.mapper;
import com.lr.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface UserMapper {
// @Select("select * from user where username=#{username} and password=#{password}")
User login(User user);
List<User> getAllUser();
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
/*@Select("select * from user where username=#{username}")*/
User getUserDetailByUsername(@Param("username") String username);
User getUserById(@Param("userId") Integer userId);
void deleteUserById(@Param("array") Integer[] array);
void addUser(User user);
}
|
public interface Queue {
void enqueue(int elem);
}
|
package com.example.battleroyale;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void goToGame(View view){
Log.i("TestMove", "goToGame!!!!!");
Intent battleIntent = new Intent(this, GameActivity.class);
startActivity(battleIntent);
}
public void goToSettings(View view){
Intent settingsIntent = new Intent(this, SettingsActivity.class);
startActivity(settingsIntent);
}
public void getToProfile(View view) {
Log.i("test", "goToProfile!!!!!");
Intent profileIntent = new Intent(this, ProfileActivity.class);
startActivity(profileIntent);
}
//Main menu background image found from https://www.wallpaperfool.com/java-minimal-wallpaper-8/
//Main menu fist icon found from https://cdn3.iconfinder.com/data/icons/fighting/100/10-512.png
}
|
package com.smxknife.softmarket.sendmsg.domain;
import java.util.List;
public class SendMsg {
private SendType sendType = SendType.sendall;
private Filter filter;
private String[] touser;
private MsgType msgtype;
private int send_ignore_reprint = 0;
private Text text;
private Media media;
private String mediaLabel;
public SendMsg() {
}
public Filter getFilter() {
return filter;
}
public void setFilter(Filter filter) {
this.filter = filter;
}
public MsgType getMsgtype() {
return msgtype;
}
public void setMsgtype(MsgType msgtype) {
this.msgtype = msgtype;
switch (msgtype) {
case text:
this.text = new Text();
this.mediaLabel = msgtype.name();
break;
default:
this.media = new Media();
this.mediaLabel = msgtype.name();
break;
}
}
public int getSend_ignore_reprint() {
return send_ignore_reprint;
}
public void setSend_ignore_reprint(int send_ignore_reprint) {
this.send_ignore_reprint = send_ignore_reprint;
}
public Text getText() {
return text;
}
private void setText(Text text) {
this.text = text;
}
public Media getMedia() {
return media;
}
private void setMedia(Media media) {
this.media = media;
}
public String getMediaLabel() {
return mediaLabel;
}
private void setMediaLabel(String mediaLabel) {
this.mediaLabel = mediaLabel;
}
public SendType getSendType() {
return sendType;
}
public void setSendType(SendType sendType) {
this.sendType = sendType;
}
public String[] getTouser() {
return touser;
}
public void setTouser(String[] touser) {
this.touser = touser;
}
public class Media {
private String media_id;
private String title;
public String getMedia_id() {
return media_id;
}
public void setMedia_id(String media_id) {
this.media_id = media_id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
public enum SendType {
sendall, openid
}
public enum MsgType {
mpnews, // 图文消息
text,
voice,
music,
image,
video,
wxcard // 卡券
}
public class Text {
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
public class Filter {
private boolean is_to_all = true;
List<Long> tag_id;
public boolean isIs_to_all() {
return is_to_all;
}
public void setIs_to_all(boolean is_to_all) {
this.is_to_all = is_to_all;
}
public List<Long> getTag_id() {
return tag_id;
}
public void setTag_id(List<Long> tag_id) {
this.tag_id = tag_id;
}
}
}
|
package com.timmy.highUI.motionEvent.slideDelete;
import android.content.Context;
import android.content.res.Configuration;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.LinearLayout;
import android.widget.Scroller;
import com.timmy.library.util.Logger;
import com.timmy.library.util.Toast;
/**
* Created by admin on 2017/2/22.
* 滑动控件:
* 1.onSizeChange方法获取滑动的左右子控件
* 2.onTouchEvent 方法处理
* down事件获取点击位置
* move事件处理滑动效果(边界值处理)
* up事件处理最后的展示效果(是否大于阈值)
* 3.使用Scroll来进行滑动处理
*/
public class SlideLayout extends LinearLayout implements View.OnClickListener {
private String TAG = this.getClass().getSimpleName();
private View leftChild;
private View rightChild;
// private int rightWidth;
private Scroller scroller;
private float startX;
private float startY;
public SlideLayout(Context context) {
this(context, null);
}
public SlideLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public SlideLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setOrientation(HORIZONTAL);
scroller = new Scroller(getContext());
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//可在该方法中重新设置左右滑动控件的宽高
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
leftChild = getChildAt(0);
rightChild = getChildAt(1);
// rightWidth = rightChild.getWidth();
rightChild.setOnClickListener(this);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
// super.onTouchEvent(event);//为了往子控件传递事件
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
startX = event.getX();
startY = event.getY();
//消费down事件->才能接收到move和up后续事件
return true;
case MotionEvent.ACTION_MOVE:
//x ,y 方向的偏移量
float offsetX = event.getX() - startX;
float offsetY = event.getY() - startY;
//判断是否达到滑动删除资格
if (Math.abs(offsetX) - Math.abs(offsetY) > ViewConfiguration.getTouchSlop()) {
int scrollX = getScrollX();//获取控件滑动的距离
Logger.d(TAG, "scrollX:" + scrollX + ",offsetX:" + offsetX + ",rightWidth:" + rightChild.getWidth());
//边界值处理
if (scrollX + (-offsetX) > rightChild.getWidth() || scrollX + (-offsetX) < 0) {
return true;
}
//滑动
this.scrollBy((int) -offsetX, 0);
startX = event.getX();
startY = event.getY();
return true;
}
break;
case MotionEvent.ACTION_UP:
//up事件,根据滑动的距离决定最后弹回的位置
if (getScrollX() > rightChild.getWidth() / 2) {//滑动超过删除控件宽度一半,最后位置显示全部的删除控件
this.scrollTo(rightChild.getWidth(), 0);
} else {
this.scrollTo(0, 0);
}
break;
}
return super.onTouchEvent(event);
}
@Override
public void onClick(View v) {
Toast.toastShort("点击删除");
}
}
|
package edu.nju.data.daoImpl.http;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import edu.nju.data.config.ApiConfig;
import edu.nju.data.dao.http.Tss_httpDAO;
import edu.nju.data.entity.api.Document;
import edu.nju.data.entity.api.Notification;
import edu.nju.data.util.HttpRequest;
import edu.nju.data.util.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Dora on 2016/7/20.
*/
@Repository
public class Tss_httpDAOImpl implements Tss_httpDAO {
@Autowired
ApiConfig apiConfig;
String s = "{\"id\":1,\"icon\":\"http://www.freeiconspng.com/uploads/powerpoint-icon--office-2011-iconset--hamza-saleem-11.png\",\"url\":\"c://File/first.ppt\",\"title\":\"数据库设计.ppt\"}";
String str = "[{\"id\":16072000000,\"url\":\"c://File/first.ppt\",\"title\":\"first.ppt\",\"icon\":\"http://www.freeiconspng.com/uploads/powerpoint-icon--office-2011-iconset--hamza-saleem-11.png\"},{\"id\":16072000001,\"url\":\"c://File/second.ppt\",\"title\":\"second.ppt\",\"icon\":\"http://www.freeiconspng.com/uploads/powerpoint-icon--office-2011-iconset--hamza-saleem-11.png\"}]";
@Override
public Document getDocumentById(long id) throws IOException{
String s = HttpRequest.sendGet(apiConfig.getTssApiAddress()+"ppt?id="+id);
return getDocumentByString(s);
}
private Document getDocumentByString(String s) throws IOException {
ObjectMapper mapper = new ObjectMapper();
Document document = mapper.readValue(s, Document.class);
return document;
}
@Override
public Pager<Document> searchDocumentsByKeyword(String keyword, int page, int size) throws IOException{
String s = HttpRequest.sendGet(apiConfig.getTssApiAddress()+"ppt/search?key="+keyword);
List<Document> list = new ArrayList<>();
ObjectMapper mapper = new ObjectMapper();
list = mapper.readValue(s, new TypeReference<List<Document>>() {});
Pager<Document> pager = new Pager<Document>(list);
return pager;
}
@Override
public boolean sendNotification(Notification notification) throws IOException {
// String s = HttpRequest.sendPost(apiConfig.getTssApiAddress()+"notification",notification);
// if(s != null)
// return true;
return false;
}
}
|
package tpdev.listeners;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import tpdev.tools.Conteneur;
import tpdev.tools.Tools;
public class VoteListener implements ActionListener {
public void actionPerformed(ActionEvent arg0) {
if (Tools.id == -1) {
Conteneur.infoResponseLabel.setText("Il faut être connecté pour voter !");
return;
}
String snippetID = Conteneur.idSnippetField.getText();
String vote;
if (Conteneur.pourRadio.isSelected()) vote = "true";
else vote = "false";
Tools.envoyerRequete("api2/vote/add?id_snippet="+snippetID+
"&id_user="+Tools.id+"&vote="+vote);
Conteneur.infoResponseLabel.setText("Votre vote est enregistré !");
}
}
|
package com.tuitaking.array;
import com.tuitaking.common.ListNode;
/**
* 给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。
*
* 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。
*
* 您可以假设除了数字 0 之外,这两个数都不会以 0 开头。
*
* 示例:
*
* 输入:(2 -> 4 -> 3) + (5 -> 6 -> 4)
* 输出:7 -> 0 -> 8
* 原因:342 + 465 = 807
*
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/add-two-numbers
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class TwoSum_02 {
// 此方法不能做超出int或者long最大值的解
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
int i = 0 ;
int j=0;
int count=0;
while (l1!=null || l2!=null){
if(l1!=null){
i+=Math.pow(10,count)*l1.val;
l1=l1.next;
}
if(l2!=null){
j+=Math.pow(10,count)*l2.val;
l2=l2.next;
}
count++;
}
int res=i+j;
ListNode head=new ListNode(-1);
ListNode next=head;
while (res!=0){
int tmp=res%10;
ListNode current=new ListNode(tmp);
next.next=current;
next=next.next;
res/=10;
}
if(head.next==null){
return new ListNode(0);
}else {
return head.next;
}
}
// 使用一位计算进位
public ListNode addTwoNumbers_v1(ListNode l1, ListNode l2) {
int pre=0;
ListNode head=new ListNode(-1);
ListNode tail =head;
while (l1!=null || l2!=null){
if(l1!=null && l2!=null){
tail.next=new ListNode((l1.val+l2.val+pre)%10);
pre=(l1.val+l2.val+pre)/10;
tail=tail.next;
}
if(l1==null){
while (l1!=null){
tail.next=new ListNode(l1.val+pre);
tail=tail.next;
pre=0;
}
}
if(l2==null){
while (l2!=null){
tail.next=new ListNode(l2.val+pre);
tail=tail.next;
pre=0;
}
}
}
if(pre!=0){
tail.next=new ListNode(1);
}
return head.next;
}
// leetcode上简洁的代码
public ListNode addTwoNumbers_v2(ListNode l1, ListNode l2) {
ListNode head = new ListNode();
ListNode p = head;
int flag = 0;
while(l1!=null || l2!=null || flag!=0){
p.next = new ListNode();
p = p.next;
Integer num = (l1!=null?l1.val:0)+(l2!=null?l2.val:0)+flag;
p.val = num%10;
flag = num/10;
l1 = l1!=null?l1.next:null;
l2 = l2!=null?l2.next:null;
}
return head.next;
}
}
|
public class EntitiesFactory {
public IEntities createEntities(String type, String word) {
switch (type) {
case "--noun":
case "-n":
return new Noun(word);
case "--adj":
case "-a":
return new Adj(word);
case "--verb":
case "-v":
return new Verb(word);
default:
return new Synonyms(word);
}
}
}
|
package com.mes.old.meta;
// Generated 2017-5-22 1:25:24 by Hibernate Tools 5.2.1.Final
import java.math.BigDecimal;
/**
* SRoleMenu generated by hbm2java
*/
public class SRoleMenu implements java.io.Serializable {
private SRoleMenuId id;
private BigDecimal menuid;
public SRoleMenu() {
}
public SRoleMenu(SRoleMenuId id, BigDecimal menuid) {
this.id = id;
this.menuid = menuid;
}
public SRoleMenuId getId() {
return this.id;
}
public void setId(SRoleMenuId id) {
this.id = id;
}
public BigDecimal getMenuid() {
return this.menuid;
}
public void setMenuid(BigDecimal menuid) {
this.menuid = menuid;
}
}
|
package org.geosopra;
import org.springframework.ui.Model;
public class CO2 implements AnalystIn {
@Override
public void analyse(Datapoint[] dp, Model model){
Durchschnitt.DistanzDurchschnitt distanz = new Durchschnitt.DistanzDurchschnitt();
double ds = distanz.analyseIntern(dp);
double car = Math.round(257 * ds * 100.0) / 100.0;
double scooter = Math.round(126 * ds * 100.0) / 100.0;
double bicycle = Math.round(5 * ds * 100.0) / 100.0;
System.out.println("Der CO2-Ausstoß eines Autos auf der Strecke" +
"beträgt "+ car +" g, der des E-Scooters " + scooter +
" g und der für ein Tretty-Fahrrad " + bicycle + " g.");
System.out.println("Auf der Fahrt mit einem Tretty-Fahrrad wird" +
ersparnis(car,bicycle)+ " Gramm CO2 im Vergleich zu einem" +
"Auto gespart.");
System.out.println("Auf der Fahrt mit einem Tretty-Fahrrad wird" +
ersparnis(scooter,bicycle)+ " Gramm CO2 im Vergleich zu einem" +
"E-Scooter gespart.");
model.addAttribute("CO2_Car", car);
model.addAttribute("CO2_Scooter", scooter);
model.addAttribute("CO2_Bicycle", bicycle);
model.addAttribute("CO2_saving_Car_Tretty", (car-bicycle));
model.addAttribute("CO2_saving_Scooter_Tretty", (scooter-bicycle));
}
/**
* CO2 Ersparnis eines Tretty-Fahrrads gegenüber der selben Durchschnittsstrecke
* mit einem Auto bzw E-Scooter.
*/
public double ersparnis(double a, double b){
return a-b;
// double ersparnisCar = double car - double bicycle;
//double ersparnisScooter = double scooter - double bicycle;
}
@Override
public double getValue(Datapoint dp) {
// TODO Auto-generated method stub
return 0;
}
}
|
/*
* UniTime 3.4 - 3.5 (University Timetabling Application)
* Copyright (C) 2012 - 2013, UniTime LLC, and individual contributors
* as indicated by the @authors tag.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.unitime.timetable.gwt.client.rooms;
import org.unitime.timetable.gwt.client.GwtHint;
import org.unitime.timetable.gwt.command.client.GwtRpcService;
import org.unitime.timetable.gwt.command.client.GwtRpcServiceAsync;
import org.unitime.timetable.gwt.shared.RoomInterface;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* @author Tomas Muller
*/
public class RoomSharingHint {
private static RoomSharingWidget sSharing;
private static long sLastLocationId = -1;
private static GwtRpcServiceAsync RPC = GWT.create(GwtRpcService.class);
public static RoomSharingWidget content(RoomInterface.RoomSharingModel model) {
if (sSharing == null)
sSharing = new RoomSharingWidget(false);
sSharing.setModel(model);
return sSharing;
}
/** Never use from GWT code */
public static void _showRoomSharingHint(JavaScriptObject source, String locationId) {
showHint((Element) source.cast(), Long.valueOf(locationId), false);
}
/** Never use from GWT code */
public static void _showEventAvailabilityHint(JavaScriptObject source, String locationId) {
showHint((Element) source.cast(), Long.valueOf(locationId), true);
}
public static void showHint(final Element relativeObject, final long locationId, boolean eventAvailability) {
sLastLocationId = locationId;
RPC.execute(RoomInterface.RoomSharingRequest.load(locationId, eventAvailability), new AsyncCallback<RoomInterface.RoomSharingModel>() {
@Override
public void onFailure(Throwable caught) {
}
@Override
public void onSuccess(RoomInterface.RoomSharingModel result) {
if (locationId == sLastLocationId && result != null)
GwtHint.showHint(relativeObject, content(result));
}
});
}
public static void hideHint() {
GwtHint.hideHint();
}
public static native void createTriggers()/*-{
$wnd.showGwtRoomAvailabilityHint = function(source, content) {
@org.unitime.timetable.gwt.client.rooms.RoomSharingHint::_showRoomSharingHint(Lcom/google/gwt/core/client/JavaScriptObject;Ljava/lang/String;)(source, content);
};
$wnd.showGwtRoomEventAvailabilityHint = function(source, content) {
@org.unitime.timetable.gwt.client.rooms.RoomSharingHint::_showEventAvailabilityHint(Lcom/google/gwt/core/client/JavaScriptObject;Ljava/lang/String;)(source, content);
};
$wnd.hideGwtRoomAvailabilityHint = function() {
@org.unitime.timetable.gwt.client.rooms.RoomSharingHint::hideHint()();
};
$wnd.hideGwtRoomEventAvailabilityHint = function() {
@org.unitime.timetable.gwt.client.rooms.RoomSharingHint::hideHint()();
};
}-*/;
}
|
package com.example.firstapp;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.SignInAccount;
import com.google.android.material.navigation.NavigationView;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.rengwuxian.materialedittext.MaterialEditText;
public class bestpage extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private DrawerLayout drawer;
SharedPreferences prefs;
public static final String Low_me="help";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bestpage);
Toolbar toolbar=findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
drawer=findViewById(R.id.drawer_layout);
NavigationView navigationView=findViewById(R.id.nav_view);
View headerview=navigationView.getHeaderView(0);
TextView nav=(TextView) headerview.findViewById(R.id.etve);
TextView gm=(TextView) headerview.findViewById(R.id.gm);
/*GoogleSignInAccount signInAccount= GoogleSignIn.getLastSignedInAccount(this);
if(signInAccount!=null){
nav.setText( "welcome "+signInAccount.getDisplayName());
gm.setText(signInAccount.getEmail());
}*/
Intent in=getIntent();
String s1=in.getStringExtra(MainActivity.XML);
prefs = getSharedPreferences("myPref", 0);
String s=prefs.getString("srt",null);
nav.setText("Welcome "+s);
navigationView.setNavigationItemSelectedListener(this);
ActionBarDrawerToggle toggle=new ActionBarDrawerToggle(this,drawer,toolbar,
R.string.navigation_drawer_open,R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
if(savedInstanceState==null) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OnlyFragment()).commit();
}
}
/* c1=findViewById(R.id.cardview);
c1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i1=new Intent(getApplicationContext(),alright.class);
i1.putExtra(Low_me,"CSE");
startActivity(i1);
}
});
c2=findViewById(R.id.cardview1);
c2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i1=new Intent(getApplicationContext(),alright.class);
i1.putExtra(Low_me,"ECE");
startActivity(i1);
}
});
c3=findViewById(R.id.cardview2);
c3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i1=new Intent(getApplicationContext(),alright.class);
i1.putExtra(Low_me,"MEC");
startActivity(i1);
}
});
c4=findViewById(R.id.cardview3);
c4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i1=new Intent(getApplicationContext(),alright.class);
i1.putExtra(Low_me,"EE");
startActivity(i1);
}
});
c5=findViewById(R.id.cardview4);
c5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i1=new Intent(getApplicationContext(),alright.class);
i1.putExtra(Low_me,"CE");
startActivity(i1);
}
});
c6=findViewById(R.id.cardview5);
c6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i1=new Intent(getApplicationContext(),alright.class);
i1.putExtra(Low_me,"COMP");
startActivity(i1);
}
});*/
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
switch (menuItem.getItemId()){
case R.id.nav_message:
//getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,new messageFragment()).commit();
Toast.makeText(this,"this feature will be available soon",Toast.LENGTH_SHORT).show();
break;
case R.id.nav_send:
showDialog();
//Toast.makeText(this,"send",Toast.LENGTH_SHORT).show();
break;
case R.id.nav_share:
Toast.makeText(this,"this feature will be available soon",Toast.LENGTH_SHORT).show();
break;
case R.id.nav_message1:
showDialog1();
// Toast.makeText(this,"message1",Toast.LENGTH_SHORT).show();
break;
case R.id.nav_message2:
Toast.makeText(this,"this feature will be available soon",Toast.LENGTH_SHORT).show();
break;
}
drawer.closeDrawer(GravityCompat.START);
return true;
}
@Override
public void onBackPressed() {
if(drawer.isDrawerOpen(GravityCompat.START)){
drawer.closeDrawer(GravityCompat.START);
}
else {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}
public void showDialog()
{
final AlertDialog.Builder dialog=new AlertDialog.Builder(this);
dialog.setTitle("Feedback Form");
dialog.setMessage("provide us your valuable feedback");
LayoutInflater inflater=this.getLayoutInflater();
View reg_layout=inflater.inflate(R.layout.feedback,null);
final EditText m3=reg_layout.findViewById((R.id.em));
final EditText m1=reg_layout.findViewById(R.id.username);
final EditText m2=reg_layout.findViewById(R.id.feedback);
dialog.setView(reg_layout);
dialog.setPositiveButton("send", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if(TextUtils.isEmpty(m1.getText().toString())){
Toast.makeText(bestpage.this,"please type your username",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(m2.getText().toString())){
Toast.makeText(bestpage.this,"Feedback cannot empty ..",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(m3.getText().toString())){
Toast.makeText(bestpage.this,"please type your email",Toast.LENGTH_SHORT).show();
return;
}
FirebaseDatabase database=FirebaseDatabase.getInstance();
DatabaseReference myref=database.getReference();
myref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
Object value=dataSnapshot.getValue();
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Toast.makeText(bestpage.this, "failed to read value", Toast.LENGTH_SHORT).show();
}
});
myref.child("users").child(m1.getText().toString()).child("username").setValue(m1.getText().toString());
myref.child("users").child(m1.getText().toString()).child("Email").setValue(m3.getText().toString());
myref.child("users").child(m1.getText().toString()).child("feedback").setValue(m2.getText().toString());
Toast.makeText(bestpage.this,"thanks for your feedback",Toast.LENGTH_SHORT).show();
}
});
dialog.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
dialog.show();
}
public void showDialog1() {
final AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle("About");
dialog.setMessage("About this app");
LayoutInflater inflater = this.getLayoutInflater();
View reg_layout1 = inflater.inflate(R.layout.about_us, null);
dialog.setView(reg_layout1);
dialog.show();
}
}
|
package com.akhil.todo.controllers;
import com.akhil.todo.models.User;
import com.akhil.todo.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/user/v1/")
public class UserController {
@Autowired
private UserService userService;
@PostMapping("/create")
public ResponseEntity<User> createUser(@Validated @RequestBody User user) throws Exception {
return ResponseEntity.ok(userService.createNewUser(user));
}
@GetMapping("/{id}")
public ResponseEntity<User> getById(@PathVariable("id") String id){
return ResponseEntity.ok(userService.getById(id));
}
@DeleteMapping("/{id}")
public ResponseEntity deleteById(@PathVariable("id") String id){
userService.deleteById(id);
return ResponseEntity.ok().build();
}
}
|
package fr.capwebct.capdemat.plugins.csvimporters.concerto.service;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
import fr.cg95.cvq.business.request.Request;
import fr.cg95.cvq.business.request.school.SchoolCanteenRegistrationRequest;
import fr.cg95.cvq.business.request.school.SchoolRegistrationRequest;
import fr.cg95.cvq.business.users.Address;
import fr.cg95.cvq.business.users.Adult;
import fr.cg95.cvq.business.users.Child;
import fr.cg95.cvq.business.users.HomeFolder;
import fr.cg95.cvq.business.users.SectionType;
import fr.cg95.cvq.business.users.SexType;
import fr.cg95.cvq.exception.CvqException;
import fr.cg95.cvq.security.SecurityContext;
import fr.cg95.cvq.service.importer.ICsvParserService;
import fr.cg95.cvq.service.request.RequestTestCase;
import fr.cg95.cvq.util.Critere;
public class ConcertoCsvImportServiceTest extends RequestTestCase {
private ByteArrayOutputStream loadData(String path) throws CvqException {
InputStream inputStream = getClass().getResourceAsStream(path);
byte[] inputStreamData = new byte[1024];
int bytesRead;
ByteArrayOutputStream baos = null;
try {
baos = new ByteArrayOutputStream(inputStream.available());
do {
bytesRead = inputStream.read(inputStreamData);
if (bytesRead > 0)
baos.write(inputStreamData, 0, bytesRead);
} while (bytesRead > 0);
inputStream.close();
baos.close();
} catch (IOException e1) {
fail("Unable to load resource : " + path);
throw new CvqException();
}
return baos;
}
public void testConcertoImport() throws Exception {
SecurityContext.setCurrentSite(localAuthorityName, SecurityContext.BACK_OFFICE_CONTEXT);
SecurityContext.setCurrentAgent(agentNameWithCategoriesRoles);
try {
ByteArrayOutputStream csvBaos = loadData("/data/export_inscrits.csv");
ICsvParserService csvParserService =
super.<ICsvParserService>getApplicationBean("cvsParserService");
csvParserService.parseData("Concerto", csvBaos.toByteArray());
SecurityContext.resetCurrentSite();
} catch (Exception e) {
throw new CvqException(e.getMessage());
}
}
public void testTwoChildrenSimpleHomeFolder() throws Exception {
SecurityContext.setCurrentSite(localAuthorityName, SecurityContext.BACK_OFFICE_CONTEXT);
SecurityContext.setCurrentAgent(agentNameWithCategoriesRoles);
try {
ByteArrayOutputStream csvBaos = loadData("/data/two_children_simple_home_folder.csv");
ICsvParserService csvParserService =
super.<ICsvParserService>getApplicationBean("cvsParserService");
csvParserService.parseData("Concerto", csvBaos.toByteArray());
} catch (Exception e) {
throw new CvqException(e.getMessage());
}
List<HomeFolder> allHomeFolders = homeFolderService.getAll(true, true);
assertEquals(allHomeFolders.size(), 1);
HomeFolder homeFolder = allHomeFolders.iterator().next();
assertNotNull(homeFolder);
assertNotNull(homeFolder.getFamilyQuotient());
assertTrue(homeFolder.getFamilyQuotient().contains("013,09"));
Adult homeFolderResponsible =
homeFolderService.getHomeFolderResponsible(homeFolder.getId());
assertNotNull(homeFolderResponsible);
assertEquals(homeFolderResponsible.getLastName(), "KAFKA");
assertEquals(homeFolderResponsible.getFirstName(), "Julie");
assertEquals(homeFolderResponsible.getHomePhone(), "0606060606");
assertEquals(homeFolderResponsible.getTitle().toString(), "Madam");
Address address = homeFolder.getAdress();
assertEquals(address.getPostalCode(), "75012");
assertEquals(address.getCity(), "PARIS");
// TODO Better refactor this, to respect Address Normalisation
assertEquals(address.getStreetName(), "12 RUE DE COTTE");
List<Child> children = homeFolderService.getChildren(homeFolder.getId());
assertEquals(children.size(), 2);
for (Child child : children) {
assertEquals(child.getLastName(), "KAFKA");
if (child.getFirstName().equals("Franz")) {
assertEquals(child.getSex(), SexType.MALE);
Calendar now = GregorianCalendar.getInstance();
now.setTime(child.getBirthDate());
assertEquals(now.get(Calendar.YEAR), 2001);
assertEquals(now.get(Calendar.MONTH), 10);
assertEquals(now.get(Calendar.DAY_OF_MONTH), 18);
} else if (child.getFirstName().equals("Elli")) {
assertEquals(child.getSex(), SexType.FEMALE);
Calendar now = GregorianCalendar.getInstance();
now.setTime(child.getBirthDate());
assertEquals(now.get(Calendar.YEAR), 1998);
assertEquals(now.get(Calendar.MONTH), 6);
assertEquals(now.get(Calendar.DAY_OF_MONTH), 15);
} else {
fail("Found a child with an unexpected first name");
}
Set<Critere> criteriaSet = new HashSet<Critere>(1);
criteriaSet.add(
new Critere(Request.SEARCH_BY_SUBJECT_ID, child.getId(), Critere.EQUALS));
List<Request> childRequests =
requestSearchService.get(criteriaSet, null, null, 0, 0, true);
assertEquals(2, childRequests.size());
for (Request request : childRequests) {
if (request instanceof SchoolRegistrationRequest) {
SchoolRegistrationRequest srr = (SchoolRegistrationRequest) request;
if (child.getFirstName().equals("Franz"))
assertEquals(srr.getSection(), SectionType.THIRD_SECTION);
else
assertEquals(srr.getSection(), SectionType.CE2);
} else if (request instanceof SchoolCanteenRegistrationRequest) {
} else {
fail("Child has an unexpected request registration");
}
}
}
SecurityContext.resetCurrentSite();
}
}
|
package charset_test;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
/**
* Description: 《Java解惑》:解惑18
*
* @author Baltan
* @date 2018/12/24 10:18
*/
public class Test2 {
public static void main(String[] args) throws UnsupportedEncodingException {
// System.out.println(Charset.defaultCharset());
// System.out.println(System.getProperty("file.encoding"));
byte[] bytes = new byte[256];
for (int i = 0; i < 256; i++) {
bytes[i] = (byte) i;
}
/**
* 打印出预期的0-255
*/
String str = new String(bytes, StandardCharsets.ISO_8859_1);
/**
* 下面两种字符集不会打印出0-255
*/
// String str = new String(bytes);
// String str = new String(bytes, StandardCharsets.UTF_8);
// System.out.println(str);
for (int i = 0; i < str.length(); i++) {
System.out.print((int) str.charAt(i) + " ");
}
}
}
|
package core_java_Lab_o4.com.cg.eis.pl;
import core_java_Lab_o4.com.cg.eis.bean.Employee;
public class EmployeeMain {
public static void main(String[] args) {
EmployeeServiceImpl emp = new EmployeeServiceImpl();
Employee emp1 = emp.getEmpDetails();
String scheme = emp.insuranceScheme(emp1.designation, emp1.salary);
Employee person = new Employee(emp1.id,emp1.name,emp1.designation,scheme,emp1.salary);
//System.out.println(emp1.name);
//emp.insuranceScheme();
emp.EmpDetails(person);
}
}
|
package br.com.alura.carteira.infra;
public interface EnviadorDeEmail {
void enviarEmail(String destinatario, String assunto, String mensagem);
}
|
package edu.tsinghua.lumaqq.test;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.poifs.filesystem.DirectoryEntry;
import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.Entry;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class ReadTest {
/**
* @param args
*/
public static void main(String[] args) {
try {
File inputFile = new File("D:\\Temp\\Download\\Software\\zuo.eip");
File extractDir = new File(new File("out"), inputFile.getName()
+ ".extract");
extract(inputFile, extractDir);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @param extractFile
* @throws IOException
* @throws FileNotFoundException
*/
private static void extract(File inputFile, File extractDir) throws IOException,
FileNotFoundException {
POIFSFileSystem system = new POIFSFileSystem(new FileInputStream(
inputFile));
extractDir.mkdir();
mkdir(extractDir, system.getRoot());
}
private static void writeOut(File parent, DocumentEntry doc) {
byte[] buffer = new byte[8192];
try {
FileOutputStream out = new FileOutputStream(new File(parent, doc
.getName()));
DocumentInputStream in = new DocumentInputStream(doc);
int size = in.read(buffer);
if (size == buffer.length) {
out.write(buffer);
} else {
out.write(buffer, 0, size);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private static void mkdir(File parent, DirectoryEntry root) {
for (Iterator it = root.getEntries(); it.hasNext();) {
Entry entry = (Entry) it.next();
if (entry.isDirectoryEntry()) {
DirectoryEntry dir = (DirectoryEntry) entry;
File subDir = new File(parent, dir.getName());
subDir.mkdir();
mkdir(subDir, dir);
} else if (entry.isDocumentEntry()) {
DocumentEntry doc = (DocumentEntry) entry;
writeOut(parent, doc);
} else {
// nothing
}
}
}
}
|
package de.emp2020.alertEditor;
public interface IAlert {
/**
* Use to get the unique identifier of the alert
* @return
* an integer unique among all persistent alerts
*/
public Integer getId ();
/**
* Use to get the Title of the alert
* @return
* a non unique string defined by user input
*/
public String getTitle ();
/**
* Use to get description of the alert
* @return
* a non unique string defined by user input
*/
public String getDescription ();
/**
* Use to get the time of the latest trigger of the specific alert
* @return
* a unix timestamp
*/
public Long getTime ();
}
|
package com.example.ComicToon.Models.RequestResponseModels;
public class ForgotResult {
private String result;
private String key;
public String getResult(){
return this.result;
}
public void setResult(String result){
this.result = result;
}
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @param key the key to set
*/
public void setKey(String key) {
this.key = key;
}
}
|
package com.fanbo.kai.zhihu_funny.utils;
/**
* Created by Kai on 2017/1/21.
* Email: kaihu1989@gmail.com
*/
public class Constants {
public static final String SECTION_ID = "section_id";
}
|
package forex.rates.api.service;
import forex.rates.api.model.entity.CurrencyDefinition;
import forex.rates.api.model.entity.CurrencyRate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import javax.annotation.PostConstruct;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.util.List;
@Component
public class CurrenciesHistoricDataSetEcbImpl implements CurrenciesHistoricDataSet {
private final ExtractedCurrenciesDataSet extractedCurrenciesDataSet;
private Attributes attributesHolder;
@Autowired
public CurrenciesHistoricDataSetEcbImpl(ExtractedCurrenciesDataSet extractedCurrenciesDataSet) {
this.extractedCurrenciesDataSet = extractedCurrenciesDataSet;
}
@Override
public List<CurrencyRate> getCurrencyRates() {
return extractedCurrenciesDataSet.getCurrencyRates();
}
@Override
public List<CurrencyDefinition> getCurrencyDefinitions() {
return extractedCurrenciesDataSet.getCurrencyDefinitions();
}
@PostConstruct
private void extractDataSet() {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
DefaultHandler handler = new DefaultHandler() {
private String dateHolder;
private static final String GENERIC_SERIES_TAG = "generic:Series";
private static final String GENERIC_ATTRIBUTES_TAG = "generic:Attributes";
private static final String GENERIC_VALUE_TAG = "generic:Value";
private static final String GENERIC_OBS_TAG = "generic:Obs";
private static final String GENERIC_OBS_DIMENSION_TAG = "generic:ObsDimension";
private static final String GENERIC_OBS_VALUE_TAG = "generic:ObsValue";
private boolean insideSeries = false;
private boolean insideAttributes = false;
private boolean insideValue = false;
private boolean insideObs = false;
private boolean insideObsDimension = false;
private boolean insideObsValue = false;
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
attributesHolder = attributes;
if (qName.equalsIgnoreCase(GENERIC_SERIES_TAG)) {
extractedCurrenciesDataSet.newCurrency();
insideSeries = true;
}
insideAttributes = qName.equalsIgnoreCase(GENERIC_ATTRIBUTES_TAG);
insideValue = qName.equalsIgnoreCase(GENERIC_VALUE_TAG);
insideObs = qName.equalsIgnoreCase(GENERIC_OBS_TAG);
insideObsDimension = qName.equalsIgnoreCase(GENERIC_OBS_DIMENSION_TAG);
insideObsValue = qName.equalsIgnoreCase(GENERIC_OBS_VALUE_TAG);
}
public void endElement(String uri, String localName, String qName) throws SAXException {
if (qName.equalsIgnoreCase(GENERIC_ATTRIBUTES_TAG) & !insideObs) {
insideAttributes = false;
}
if (qName.equalsIgnoreCase(GENERIC_OBS_TAG)) {
insideObs = false;
}
if (qName.equalsIgnoreCase(GENERIC_SERIES_TAG)) {
extractedCurrenciesDataSet.saveCurrency();
insideSeries = false;
}
}
public void characters(char ch[], int start, int length) throws SAXException {
if (isInsideSeriesAttributesValuesTree()) {
extractedCurrenciesDataSet.addAttribute(
attributesHolder.getValue(0), attributesHolder.getValue(1));
}
if (insideObs && insideObsDimension) {
dateHolder = attributesHolder.getValue(0);
insideObsDimension = false;
}
if (insideObs && insideObsValue) {
extractedCurrenciesDataSet.addRate(dateHolder, attributesHolder.getValue(0));
insideObsValue = false;
}
// System.out.println("First Name : " + new String(ch, start, length));
if (insideValue) {
insideValue = false;
}
}
private boolean isInsideSeriesAttributesValuesTree() {
return insideSeries && insideAttributes && insideValue && !insideObs;
}
};
// TODO: to change to input stream
saxParser.parse("C:\\Users\\WW\\Downloads\\D.USD+PLN.EUR.SP00.xml", handler);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
package com.ssm.po;
import java.util.Date;
/**
* Created by lucky-xin on 2016/09/13.
*/
public class UserCustom extends User {
private static final long serialVersionUID = 1L;
public UserCustom(){}
public UserCustom(String email, String name, String sex, Date birth, String address, String password) {
super(email, name, sex, birth, address, password);
}
}
|
package com.codepath.apps.restclienttemplate;
import android.os.Bundle;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentActivity;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.bumptech.glide.Glide;
import com.codepath.apps.restclienttemplate.models.Tweet;
import org.parceler.Parcels;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
public class DetailsActivity extends AppCompatActivity {
Tweet tweet;
RelativeLayout tvMedia;
ImageView ivProfileImage;
TextView tvBody;
TextView tvScreenName;
TextView tvTime;
ImageView tvImage;
ImageButton retweet;
ImageButton reply;
ImageButton heart;
TwitterClient client;
public static final String TAG = "DetailsActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//set content view only needs to be called once at the top
setContentView(R.layout.activity_details);
tweet = Parcels.unwrap(getIntent().getParcelableExtra("tweet"));
client = TwitterApp.getRestClient(this);
tvMedia = findViewById(R.id.tvMedia);
ivProfileImage = findViewById(R.id.ivProfileImage);
tvBody = findViewById(R.id.tvBody);
tvScreenName = findViewById(R.id.tvScreenName);
tvTime = findViewById(R.id.tvTime);
tvImage = findViewById(R.id.tvImage);
retweet = findViewById(R.id.retweet);
reply = findViewById(R.id.reply);
heart = findViewById(R.id.heart);
tvBody.setText(tweet.body);
tvScreenName.setText(tweet.user.screenName);
tvTime.setText(tweet.relTime);
//load imageurl with Glide (included in build gradle already)
Glide.with(this).load(tweet.user.profileImageUrl).into(ivProfileImage);
Glide.with(this).load(tweet.mediaUrl).centerCrop().transform(new RoundedCornersTransformation(30, 10)).override(1000,500).into(tvImage);
}
}
|
import java.util.Scanner;
public class Numeros {
int num;
public void Numero()
{
Scanner leer=new Scanner(System.in);
System.out.println("Ingresar numero de maximo 4 dijitos :");
num=leer.nextInt();
}
public void Mostrar()
{
Unidad un=new Unidad();
Decenea dec=new Decenea();
Centena cen=new Centena();
UnidadDeMil umil=new UnidadDeMil();
String texto;
if(num>0 && num<10000){
int u = num % 10;
num=num/10;
texto=un.unidad(u);
int d=num%10;
num=num/10;
if(d==1 && u>0)
texto=dec.decena(10+u);
else if (d>0 && u==0)
texto=dec.decena(d);
else if (d>1)
texto=dec.decena(d)+ " y " +texto;
int c=num%10;
num=num/10;
if(u==0 && d==0 && c>0)
texto=cen.centena(c);
else if(c>1 && d>=0)
texto=cen.centena(c)+" "+texto;
else if(c==1 && d>=0)
texto=cen.centena(c)+"to "+texto;
/*else if(c==1 && d==1)
texto=cen.centena(c)+"to "+dec.decena(10+u);*/
/*else if(c>1 && d==0 && u>0)
texto=cen.centena(c)+" "+texto;*/
/*else if(c==1 && d==0 && u>0)
texto=cen.centena(c)+"to "+texto;*/
/*else if(c>1 && d==1)
texto=cen.centena(c)+" "+texto;*/
/*int um=num%10;
num=num/10;
if(um>0 && c==0 && d==0)
texto=umil.Umil(um);
else if(um>0 && c>0 && d==0)
texto=umil.Umil(um)+" "+texto;
else if(um>0 && c>0 && d>0)
texto=umil.Umil(um)+" "+texto;
else if(um>0 && c>0 && d==1)
texto=umil.Umil(um)+" "+texto;*/
texto=umil.Umil(num)+" "+texto;
System.out.println(texto);
}
else System.out.println("NO existe traduccion......");
}
}
|
package cryptotoolbox;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class AES {
public byte[] encrypt(byte[] message,byte[] keyBytes,byte[] ivBlock) throws Exception {
final SecretKey key = new SecretKeySpec(keyBytes, "AES");
final IvParameterSpec iv = new IvParameterSpec(ivBlock);
final Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, key, iv);
final byte[] cipherText = cipher.doFinal(message);
return cipherText;
}
public byte[] decrypt(byte[] message,byte[] keyBytes,byte[] ivBlock) throws Exception {
final SecretKey key = new SecretKeySpec(keyBytes, "AES");
final IvParameterSpec iv = new IvParameterSpec(ivBlock);
final Cipher decipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
decipher.init(Cipher.DECRYPT_MODE, key, iv);
return decipher.doFinal(message);
}
}
|
package com.ifre.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jeecgframework.codegenerate.generate.ICallBack;
import org.jeecgframework.codegenerate.pojo.Columnt;
import org.jeecgframework.codegenerate.util.CodeDateUtils;
import org.jeecgframework.codegenerate.util.CodeResourceUtil;
import com.ifre.entity.brms.BizObjEntity;
import com.ifre.entity.brms.ObjPropEntity;
import com.ifre.entity.brms.RulePckgEntity;
public class GenEntityUtil implements ICallBack {
private BizObjEntity entity;
private RulePckgEntity pckg;
private static final Log log = LogFactory.getLog(GenEntityUtil.class);
private List<ObjPropEntity> objProperties;
public GenEntityUtil(BizObjEntity entity, RulePckgEntity pckg, List<ObjPropEntity> objProperties) {
this.entity = entity;
this.pckg = pckg;
this.objProperties = objProperties;
}
public Map execute() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("bussiPackage", pckg.getAllName().substring(0, pckg.getAllName().lastIndexOf(".")));
data.put("entityPackage", pckg.getName());
data.put("entityName", entity.getName());
data.put("ftl_description", entity.getDescp());
data.put("ftl_create_time", CodeDateUtils.dateToString(new Date()));
try {
List<Columnt> originalColumns = new ArrayList<Columnt>();
for (ObjPropEntity objProp : objProperties) {
Columnt columnt = new Columnt();
columnt.setFieldName(objProp.getPropCode());
columnt.setFieldType(objProp.getType());
columnt.setFiledComment(objProp.getDescp());
columnt.setOptionType(objProp.getIsList());
originalColumns.add(columnt);
}
data.put("originalColumns", originalColumns);
} catch (Exception e) {
e.printStackTrace();
}
return data;
}
public String generateToFile() {
log.info((new StringBuilder("----Entity---Code----Generation----[")).append(entity.getName())
.append("]------- 生成中...").toString());
File file = null;
InputStreamReader inputReader = null;
BufferedReader bufferReader = null;
StringBuffer strBuffer = new StringBuffer();
try {
GenEntityCodeFactory codeFactory = new GenEntityCodeFactory();
codeFactory.setCallBack(this);
codeFactory.invoke("entityBeanTemplate.ftl", "entity");
String line = null;
String fileNamePath = codeFactory.getCodePath("entity", pckg.getAllName().substring(0, pckg.getAllName().lastIndexOf(".")), pckg.getName(), entity.getName());
log.info(fileNamePath);
file = new File(fileNamePath);
InputStream inputStream = new FileInputStream(file);
inputReader = new InputStreamReader(inputStream, "utf-8");
bufferReader = new BufferedReader(inputReader);
while ((line = bufferReader.readLine()) != null) {
strBuffer.append(line);
strBuffer.append("\r\n");
}
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
try {
if (bufferReader != null)
bufferReader.close();
if (inputReader != null)
inputReader.close();
} catch (IOException e) {
e.printStackTrace();
return null;
}
if(file !=null) file.delete();
}
log.info((new StringBuilder("----Entity----Code----Generation-----[")).append(entity.getName())
.append("]------ 生成完成").toString());
log.info(strBuffer.toString());
return strBuffer.toString();
}
public String generateToFile(String templateName) {
log.info((new StringBuilder("----Entity---Code----Generation----[")).append(entity.getName())
.append("]------- 生成中...").toString());
File file = null;
InputStreamReader inputReader = null;
BufferedReader bufferReader = null;
StringBuffer strBuffer = new StringBuffer();
try {
GenEntityCodeFactory codeFactory = new GenEntityCodeFactory();
codeFactory.setCallBack(this);
codeFactory.invoke(templateName+".ftl", "entity");
String line = null;
String fileNamePath = codeFactory.getCodePath("entity", pckg.getAllName().substring(0, pckg.getAllName().lastIndexOf(".")), pckg.getName(), entity.getName());
log.info(fileNamePath);
file = new File(fileNamePath);
InputStream inputStream = new FileInputStream(file);
inputReader = new InputStreamReader(inputStream, "utf-8");
bufferReader = new BufferedReader(inputReader);
while ((line = bufferReader.readLine()) != null) {
strBuffer.append(line);
strBuffer.append("\r\n");
}
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
try {
if (bufferReader != null)
bufferReader.close();
if (inputReader != null)
inputReader.close();
} catch (IOException e) {
e.printStackTrace();
return null;
}
if(file !=null) file.delete();
}
log.info((new StringBuilder("----Entity----Code----Generation-----[")).append(entity.getName())
.append("]------ 生成完成").toString());
log.info(strBuffer.toString());
return strBuffer.toString();
}
/**
* 把输入字符串的首字母改成大写
*
* @param str
* @return
*/
public String initcap(String str) {
char[] ch = str.toCharArray();
if (ch[0] >= 'a' && ch[0] <= 'z') {
ch[0] = (char) (ch[0] - 32);
}
return this.getCamelStr(new String(ch));
}
// 例:user_name --> userName
private String getCamelStr(String s) {
while (s.indexOf("_") > 0) {
int index = s.indexOf("_");
// System.out.println(s.substring(index+1, index+2).toUpperCase());
s = s.substring(0, index) + s.substring(index + 1, index + 2).toUpperCase() + s.substring(index + 2);
}
return s;
}
/**
* 创建.java文件所在路径 和 返回.java文件File对象
*
* @param outDirFile
* 生成文件路径
* @param javaPackage
* java包名
* @param javaClassName
* java类名
* @return
*/
public static File toJavaFilename(File outDirFile, String javaPackage, String javaClassName) {
String packageSubPath = javaPackage.replace('.', '/');
File packagePath = new File(outDirFile, packageSubPath);
File file = new File(packagePath, javaClassName + ".java");
if (!packagePath.exists()) {
packagePath.mkdirs();
}
return file;
}
}
|
package org.twittercity.twittercitymod;
import org.apache.logging.log4j.Logger;
import org.twittercity.twittercitymod.blocks.ModBlocks;
import org.twittercity.twittercitymod.items.ModItems;
import org.twittercity.twittercitymod.proxy.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
/**
* This class is the main class of our mod. When minecraft is executed the methods {@link TwitterCity#preInit}, {@link TwitterCity#init} and {@link TwitterCity#postInit}
* are executed as well to initialize our mod to FML (Forge Mod Loader).
*/
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
public class TwitterCity {
public static Logger logger;
/** The instance of our mod. */
@Instance(Reference.MOD_ID)
public static TwitterCity instance;
/** Instance of our proxy. */
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
/** Calls the preInit in our proxy package to execute the code needed when minecraft is loading, in the side (Client or Server) is should to execute. */
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
logger = e.getModLog();
proxy.preInit(e);
}
/** Calls the init in our proxy package to execute the code needed when minecraft is loading, in the side (Client or Server) is should to execute. */
@EventHandler
public void init(FMLInitializationEvent e) {
proxy.init(e);
}
/** Calls the postInit in our proxy package to execute the code needed when minecraft is loading, in the side (Client or Server) is should to execute. */
@EventHandler
public void postInit(FMLPostInitializationEvent e) {
proxy.postInit(e);
}
/** This method executes when a server is loaded. */
@EventHandler
public void serverLoad (FMLServerStartingEvent e)
{
proxy.serverLoad(e);
}
@Mod.EventBusSubscriber
public static class RegistrationHandler {
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
ModItems.register(event.getRegistry());
}
@SubscribeEvent
public static void registerItems(ModelRegistryEvent event) {
ModItems.registerModels();
}
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
ModBlocks.register(event.getRegistry());
}
}
}
|
package com.tingke.admin.service;
import com.tingke.admin.entity.FrLink;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tingke.admin.model.R;
/**
* <p>
* 服务类
* </p>
*
* @author zhx
* @since 2020-05-31
*/
public interface FrLinkService extends IService<FrLink> {
//快捷链接显示
R selectLink();
//快捷链接分页显示
R selectPageLink(Long page, Long limit,String condition);
//快捷链接添加
R addLink(FrLink frLink);
//快捷链接删除
R deleteLink(String id);
//快捷链接修改
R editLink(FrLink frLink);
//根据id快捷链接
R selectLinkById(String id);
}
|
package com.tencent.mm.g.a;
public final class fi$b {
public boolean aoy;
public String content;
public int state = 0;
}
|
package com.alium.ic.domains;
// Generated 2013-06-19 17:36:03 by Hibernate Tools 3.4.0.CR1
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* PolisaRyzyko generated by hbm2java
*/
@Entity
@Table(name = "polisa_ryzyko", catalog = "finalna")
public class PolisaRyzyko implements java.io.Serializable {
private Integer id;
private Polisa polisa;
private SlowRyzyko slowRyzyko;
private BigDecimal skladka;
private BigDecimal suma;
private Date wd;
private String op;
private Set<PolisaRyzykoElem> polisaRyzykoElems = new HashSet<PolisaRyzykoElem>(
0);
public PolisaRyzyko() {
}
public PolisaRyzyko(Polisa polisa, SlowRyzyko slowRyzyko,
BigDecimal skladka, BigDecimal suma, Date wd, String op) {
this.polisa = polisa;
this.slowRyzyko = slowRyzyko;
this.skladka = skladka;
this.suma = suma;
this.wd = wd;
this.op = op;
}
public PolisaRyzyko(Polisa polisa, SlowRyzyko slowRyzyko,
BigDecimal skladka, BigDecimal suma, Date wd, String op,
Set<PolisaRyzykoElem> polisaRyzykoElems) {
this.polisa = polisa;
this.slowRyzyko = slowRyzyko;
this.skladka = skladka;
this.suma = suma;
this.wd = wd;
this.op = op;
this.polisaRyzykoElems = polisaRyzykoElems;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_polisa", nullable = false)
public Polisa getPolisa() {
return this.polisa;
}
public void setPolisa(Polisa polisa) {
this.polisa = polisa;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_ryzyko", nullable = false)
public SlowRyzyko getSlowRyzyko() {
return this.slowRyzyko;
}
public void setSlowRyzyko(SlowRyzyko slowRyzyko) {
this.slowRyzyko = slowRyzyko;
}
@Column(name = "skladka", nullable = false, precision = 10)
public BigDecimal getSkladka() {
return this.skladka;
}
public void setSkladka(BigDecimal skladka) {
this.skladka = skladka;
}
@Column(name = "suma", nullable = false, precision = 10)
public BigDecimal getSuma() {
return this.suma;
}
public void setSuma(BigDecimal suma) {
this.suma = suma;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "wd", nullable = false, length = 19)
public Date getWd() {
return this.wd;
}
public void setWd(Date wd) {
this.wd = wd;
}
@Column(name = "op", nullable = false, length = 30)
public String getOp() {
return this.op;
}
public void setOp(String op) {
this.op = op;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "polisaRyzyko")
public Set<PolisaRyzykoElem> getPolisaRyzykoElems() {
return this.polisaRyzykoElems;
}
public void setPolisaRyzykoElems(Set<PolisaRyzykoElem> polisaRyzykoElems) {
this.polisaRyzykoElems = polisaRyzykoElems;
}
}
|
package com.yanan.framework.boot;
import com.yanan.framework.plugin.Environment;
public interface EnvironmentBoot {
void start(Environment environment);
void stop(Environment environment);
}
|
package biorimp.optmodel.operators;
import biorimp.optmodel.space.RefactoringOperationSpace;
import edu.wayne.cs.severe.redress2.entity.refactoring.RefactoringOperation;
import edu.wayne.cs.severe.redress2.main.MainPredFormulasBIoRIPM;
import unalcol.clone.Clone;
import unalcol.random.raw.RawGenerator;
import unalcol.search.population.variation.ArityTwo;
import unalcol.types.collection.vector.Vector;
import java.util.List;
/**
* <p>Title: XOver</p>
* <p>Description: The simple point crossover operator (variable length)</p>
* <p>Copyright: Copyright (c) 2010</p>
*
* @author Jonatan Gomez
* @version 1.0
*/
public class RefOperXOver extends ArityTwo<List<RefactoringOperation>> {
/**
* The crossover point of the last xover execution
*/
protected int cross_over_point;
public RefOperXOver() {
}
/**
* Testing function
*/
public static void main(String[] argv) {
//Getting the Metaphor
String userPath = System.getProperty("user.dir");
String[] args = {"-l", "Java", "-p", userPath + "\\test_data\\code\\optimization\\src", "-s", "java/optmodel/fitness "};
MainPredFormulasBIoRIPM init = new MainPredFormulasBIoRIPM();
init.main(args);
//MetaphorCode metaphor = new MetaphorCode(init);
System.out.println("*** Generating a genome of 10 genes randomly ***");
//Creating the Space
RefactoringOperationSpace refactorSpace = new RefactoringOperationSpace(10);
//Visualizing the get() Space
List<RefactoringOperation> refactor = refactorSpace.get();
System.out.println("*** Generating a genome of 20 genes randomly ***");
List<RefactoringOperation> parent1 = refactorSpace.get();
System.out.println(parent1.toString());
System.out.println("*** Generating a genome of 20 genes randomly ***");
List<RefactoringOperation> parent2 = refactorSpace.get();
System.out.println(parent2.toString());
RefOperXOver xover = new RefOperXOver();
System.out.println("*** Applying the croosover ***");
Vector<List<RefactoringOperation>> kids = xover.apply(parent1, parent2);
System.out.println("*** Child 1 ***");
System.out.println(kids.get(0).toString());
System.out.println("*** Child 2 ***");
System.out.println(kids.get(1).toString());
}
/**
* Apply the simple point crossover operation over the given genomes at the given
* cross point
*
* @param child1 The first parent
* @param child2 The second parent
* @param xoverPoint crossover point
* @return The crossover point
*/
public Vector<List<RefactoringOperation>> generates(List<RefactoringOperation> child1, List<RefactoringOperation> child2, int xoverPoint) {
List<RefactoringOperation> child1_1 = (List<RefactoringOperation>) Clone.create(child1);
List<RefactoringOperation> child2_1 = (List<RefactoringOperation>) Clone.create(child2);
cross_over_point = xoverPoint;
if (child1.size() == child2.size()) {
for (int i = xoverPoint; i < child1.size(); i++) {
child1_1.set(i, child2.get(i));
child2_1.set(i, child1.get(i));
}
} else {
System.out.print("Something went wrong with XOVER :( ");
}
Vector<List<RefactoringOperation>> v = new Vector<List<RefactoringOperation>>();
v.add(child1_1);
v.add(child2_1);
return v;
}
/**
* Apply the simple point crossover operation over the given genomes
*
* @param child1 The first parent
* @param child2 The second parent
* @return The crossover point
*/
@Override
public Vector<List<RefactoringOperation>> apply(List<RefactoringOperation> child1, List<RefactoringOperation> child2) {
return generates(child1, child2, RawGenerator.integer(this, Math.min(child1.size(), child2.size())));
}
}
|
package org.sagebionetworks.object.snapshot.worker;
import java.io.IOException;
import java.util.List;
import org.sagebionetworks.asynchronous.workers.changes.BatchChangeMessageDrivenRunner;
import org.sagebionetworks.common.util.progress.ProgressCallback;
import org.sagebionetworks.object.snapshot.worker.utils.ObjectRecordWriter;
import org.sagebionetworks.object.snapshot.worker.utils.ObjectRecordWriterFactory;
import org.sagebionetworks.repo.model.message.ChangeMessage;
import org.springframework.beans.factory.annotation.Autowired;
/**
* This worker listens to object change messages, takes a snapshot of the objects,
* writes them to files, and put the files to S3.
*/
public class ObjectSnapshotWorker implements BatchChangeMessageDrivenRunner {
@Autowired
private ObjectRecordWriterFactory writerFactory;
ObjectSnapshotWorker(){
}
@Override
public void run(ProgressCallback progressCallback, List<ChangeMessage> changeMessages) throws IOException {
// Keep this message invisible
ObjectRecordWriter objectRecordWriter = writerFactory.getObjectRecordWriter(changeMessages.get(0).getObjectType());
objectRecordWriter.buildAndWriteRecords(progressCallback, changeMessages);
}
}
|
package com.kumar.penguingame;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
public class MacoroniActivity extends Activity {
Button b10;
RadioGroup radiogroup9;
RadioButton rb28, rb29, rb30;
int counter = 1;
TextView sc9;
int temp10;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.macoroni);
int v10 = getIntent().getExtras().getInt("val9", -1);
sc9 = (TextView)findViewById(R.id.txt20);
sc9.setText("Score : " + v10 );
radiogroup9 = (RadioGroup) findViewById(R.id.rg10);
rb28 = (RadioButton) findViewById(R.id.macoronibutton7);
rb29 = (RadioButton) findViewById(R.id.galapogosbutton2);
rb30 = (RadioButton) findViewById(R.id.royalbutton8);
b10 = (Button)findViewById(R.id.button1);
rb28.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (counter == 1 ){
temp10 = getIntent().getExtras().getInt("val9", -1) + 5;
counter ++;
sc9.setText("Score : " + temp10);
Toast.makeText(MacoroniActivity.this,rb28.getText(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MacoroniActivity.this, RockhopperActivity.class);
intent.putExtra("val10", temp10);
startActivity(intent);
}else if (counter >1){
Toast.makeText(MacoroniActivity.this," Please Try again ", Toast.LENGTH_SHORT).show();
} }
});
rb29.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (counter == 1 ){
counter ++;
Toast.makeText(MacoroniActivity.this,rb29.getText(), Toast.LENGTH_SHORT).show();
}else if (counter >1){
Toast.makeText(MacoroniActivity.this," Please Try again ", Toast.LENGTH_SHORT).show();
} }
});
rb30.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (counter == 1 ){
counter ++;
Toast.makeText(MacoroniActivity.this,rb30.getText(), Toast.LENGTH_SHORT).show();
}else if (counter >1){
Toast.makeText(MacoroniActivity.this," Please Try again ", Toast.LENGTH_SHORT).show();
} }
});
b10.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(MacoroniActivity.this,rb28.getText(), Toast.LENGTH_SHORT).show();
}
});
}
}
|
package de.zarncke.lib.region;
import de.zarncke.lib.coll.Elements;
import de.zarncke.lib.err.GuardedTest;
public class RegionTest extends GuardedTest
{
public void testConstRegion()
{
assertTrue(Elements
.arrayequals(new byte[] { 3, 3, 3, 3, 3 }, new ConstRegion(5, (byte) 3).toByteArray()));
assertTrue(Elements.arrayequals(new byte[] { 3, 3, 8, 9, 3, 3 }, new ConstRegion(5, (byte) 3).select(2,
1).replace(RegionUtil.asRegion(new byte[] { 8, 9 })).toByteArray()));
}
}
|
package pdl2Explorer.antlr.generated;
import java.util.ArrayList;
public class PDLUnary {
ArrayList<PDLNegation> arrlist;
String operator;
public PDLUnary() {
arrlist = new ArrayList<PDLNegation>();
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public void addNegation(PDLNegation rel) {
arrlist.add(rel);
}
}
|
package ict.kosovo.growth.ora_6;
import java.util.Scanner;
public class Array {
public static void main(String[] args) {
int array[] = {87,54,34,24,56,76,88,98,99};
int total = 0;
for (int number : array)
total += number;
System.out.printf("Total of array elements: %d%n" + total);
}
}
|
package iarfmoose;
import com.github.ocraft.s2client.protocol.data.Abilities;
import com.github.ocraft.s2client.protocol.data.Ability;
import com.github.ocraft.s2client.protocol.data.UnitType;
import com.github.ocraft.s2client.protocol.data.Units;
import com.github.ocraft.s2client.protocol.data.Upgrade;
import com.github.ocraft.s2client.protocol.data.Upgrades;
public abstract class AbilityData {
public static UnitType getResearchStructure(Abilities ability) {
switch(ability) {
case RESEARCH_ZERG_FLYER_ARMOR:
case RESEARCH_ZERG_FLYER_ARMOR_LEVEL1:
case RESEARCH_ZERG_FLYER_ARMOR_LEVEL2:
case RESEARCH_ZERG_FLYER_ARMOR_LEVEL3:
case RESEARCH_ZERG_FLYER_ATTACK:
case RESEARCH_ZERG_FLYER_ATTACK_LEVEL1:
case RESEARCH_ZERG_FLYER_ATTACK_LEVEL2:
case RESEARCH_ZERG_FLYER_ATTACK_LEVEL3:
return Units.ZERG_SPIRE;
case RESEARCH_ZERG_GROUND_ARMOR:
case RESEARCH_ZERG_GROUND_ARMOR_LEVEL1:
case RESEARCH_ZERG_GROUND_ARMOR_LEVEL2:
case RESEARCH_ZERG_GROUND_ARMOR_LEVEL3:
case RESEARCH_ZERG_MELEE_WEAPONS:
case RESEARCH_ZERG_MELEE_WEAPONS_LEVEL1:
case RESEARCH_ZERG_MELEE_WEAPONS_LEVEL2:
case RESEARCH_ZERG_MELEE_WEAPONS_LEVEL3:
case RESEARCH_ZERG_MISSILE_WEAPONS:
case RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL1:
case RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL2:
case RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL3:
return Units.ZERG_EVOLUTION_CHAMBER;
case RESEARCH_ZERGLING_ADRENAL_GLANDS:
case RESEARCH_ZERGLING_METABOLIC_BOOST:
return Units.ZERG_SPAWNING_POOL;
case RESEARCH_ZERG_LAIR_EVOLVE_VENTRAL_SACKS:
return Units.ZERG_LAIR;
case RESEARCH_BURROW:
case RESEARCH_PNEUMATIZED_CARAPACE:
return Units.ZERG_HATCHERY;
case RESEARCH_CENTRIFUGAL_HOOKS:
return Units.ZERG_BANELING_NEST;
case RESEARCH_DRILLING_CLAWS:
case RESEARCH_GLIAL_REGENERATION:
return Units.ZERG_ROACH_WARREN;
case RESEARCH_CHITINOUS_PLATING:
return Units.ZERG_ULTRALISK_CAVERN;
case RESEARCH_GROOVED_SPINES:
case RESEARCH_MUSCULAR_AUGMENTS:
return Units.ZERG_HYDRALISK_DEN;
case RESEARCH_NEURAL_PARASITE:
case RESEARCH_PATHOGEN_GLANDS:
return Units.ZERG_INFESTATION_PIT;
default:
return Units.INVALID;
}
}
public static ProductionType getProductionType(ProductionItem item) {
if (abilityMakesUnit(item.getAbility())) {
return ProductionType.TRAIN;
} else if (abilityMakesUnitFromLarva(item.getAbility())) {
return ProductionType.TRAIN_FROM_LARVA;
} else if (abilityMakesStructure(item.getAbility())) {
return ProductionType.BUILD;
} else if (abilityMakesTech(item.getAbility())) {
return ProductionType.RESEARCH;
} else if (abilityMorphsUnit(item.getAbility())) {
return ProductionType.MORPH;
} else {
return ProductionType.UNKNOWN;
}
}
public static UnitType getCreatedUnitType(Abilities ability) {
switch(ability) {
case TRAIN_BANELING:
return Units.ZERG_BANELING;
case BUILD_BANELING_NEST:
return Units.ZERG_BANELING_NEST;
case MORPH_BROODLORD:
return Units.ZERG_BROODLORD;
case TRAIN_CORRUPTOR:
return Units.ZERG_CORRUPTOR;
case TRAIN_DRONE:
return Units.ZERG_DRONE;
case BUILD_EVOLUTION_CHAMBER:
return Units.ZERG_EVOLUTION_CHAMBER;
case BUILD_EXTRACTOR:
return Units.ZERG_EXTRACTOR;
case MORPH_GREATER_SPIRE:
return Units.ZERG_GREATER_SPIRE;
case BUILD_HATCHERY:
return Units.ZERG_HATCHERY;
case MORPH_HIVE:
return Units.ZERG_HIVE;
case TRAIN_HYDRALISK:
return Units.ZERG_HYDRALISK;
case BUILD_HYDRALISK_DEN:
return Units.ZERG_HYDRALISK_DEN;
case BUILD_INFESTATION_PIT:
return Units.ZERG_INFESTATION_PIT;
case TRAIN_INFESTOR:
return Units.ZERG_INFESTOR;
case MORPH_LAIR:
return Units.ZERG_LAIR;
case MORPH_LURKER_DEN:
return Units.ZERG_LURKER_DEN_MP;
case MORPH_LURKER:
return Units.ZERG_LURKER_MP;
case TRAIN_MUTALISK:
return Units.ZERG_MUTALISK;
case BUILD_NYDUS_WORM:
return Units.ZERG_NYDUS_CANAL;
case BUILD_NYDUS_NETWORK:
return Units.ZERG_NYDUS_NETWORK;
case TRAIN_OVERLORD:
return Units.ZERG_OVERLORD;
case MORPH_OVERLORD_TRANSPORT:
return Units.ZERG_OVERLORD_TRANSPORT;
case MORPH_OVERSEER:
return Units.ZERG_OVERSEER;
case TRAIN_QUEEN:
return Units.ZERG_QUEEN;
case MORPH_RAVAGER:
return Units.ZERG_RAVAGER;
case TRAIN_ROACH:
return Units.ZERG_ROACH;
case BUILD_ROACH_WARREN:
return Units.ZERG_ROACH_WARREN;
case BUILD_SPAWNING_POOL:
return Units.ZERG_SPAWNING_POOL;
case BUILD_SPINE_CRAWLER:
return Units.ZERG_SPINE_CRAWLER;
case BUILD_SPIRE:
return Units.ZERG_SPIRE;
case BUILD_SPORE_CRAWLER:
return Units.ZERG_SPORE_CRAWLER;
case TRAIN_SWARMHOST:
return Units.ZERG_SWARM_HOST_MP;
case TRAIN_ULTRALISK:
return Units.ZERG_ULTRALISK;
case BUILD_ULTRALISK_CAVERN:
return Units.ZERG_ULTRALISK_CAVERN;
case TRAIN_VIPER:
return Units.ZERG_VIPER;
case TRAIN_ZERGLING:
return Units.ZERG_ZERGLING;
default:
return Units.INVALID;
}
}
public static Upgrades getResearchedUpgradeType(Abilities ability) {
switch(ability) {
case RESEARCH_ZERG_FLYER_ARMOR:
case RESEARCH_ZERG_FLYER_ARMOR_LEVEL1:
return Upgrades.ZERG_FLYER_ARMORS_LEVEL1;
case RESEARCH_ZERG_FLYER_ARMOR_LEVEL2:
return Upgrades.ZERG_FLYER_ARMORS_LEVEL2;
case RESEARCH_ZERG_FLYER_ARMOR_LEVEL3:
return Upgrades.ZERG_FLYER_ARMORS_LEVEL3;
case RESEARCH_ZERG_FLYER_ATTACK:
case RESEARCH_ZERG_FLYER_ATTACK_LEVEL1:
return Upgrades.ZERG_FLYER_WEAPONS_LEVEL1;
case RESEARCH_ZERG_FLYER_ATTACK_LEVEL2:
return Upgrades.ZERG_FLYER_WEAPONS_LEVEL2;
case RESEARCH_ZERG_FLYER_ATTACK_LEVEL3:
return Upgrades.ZERG_FLYER_WEAPONS_LEVEL3;
case RESEARCH_ZERG_GROUND_ARMOR:
case RESEARCH_ZERG_GROUND_ARMOR_LEVEL1:
return Upgrades.ZERG_GROUND_ARMORS_LEVEL1;
case RESEARCH_ZERG_GROUND_ARMOR_LEVEL2:
return Upgrades.ZERG_GROUND_ARMORS_LEVEL2;
case RESEARCH_ZERG_GROUND_ARMOR_LEVEL3:
return Upgrades.ZERG_GROUND_ARMORS_LEVEL3;
case RESEARCH_ZERG_MELEE_WEAPONS:
case RESEARCH_ZERG_MELEE_WEAPONS_LEVEL1:
return Upgrades.ZERG_MELEE_WEAPONS_LEVEL1;
case RESEARCH_ZERG_MELEE_WEAPONS_LEVEL2:
return Upgrades.ZERG_MELEE_WEAPONS_LEVEL2;
case RESEARCH_ZERG_MELEE_WEAPONS_LEVEL3:
return Upgrades.ZERG_MELEE_WEAPONS_LEVEL3;
case RESEARCH_ZERG_MISSILE_WEAPONS:
case RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL1:
return Upgrades.ZERG_MISSILE_WEAPONS_LEVEL1;
case RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL2:
return Upgrades.ZERG_MISSILE_WEAPONS_LEVEL2;
case RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL3:
return Upgrades.ZERG_MISSILE_WEAPONS_LEVEL3;
case RESEARCH_ZERGLING_ADRENAL_GLANDS:
return Upgrades.ZERGLING_ATTACK_SPEED;
case RESEARCH_ZERGLING_METABOLIC_BOOST:
return Upgrades.ZERGLING_MOVEMENT_SPEED;
case RESEARCH_ZERG_LAIR_EVOLVE_VENTRAL_SACKS:
return Upgrades.OVERLORD_TRANSPORT;
case RESEARCH_BURROW:
return Upgrades.ZERG_BURROW_MOVE;
case RESEARCH_PNEUMATIZED_CARAPACE:
return Upgrades.OVERLORD_SPEED;
case RESEARCH_CENTRIFUGAL_HOOKS:
return Upgrades.CENTRIFICAL_HOOKS;
case RESEARCH_DRILLING_CLAWS:
return Upgrades.DRILL_CLAWS;
case RESEARCH_GLIAL_REGENERATION:
return Upgrades.GLIALRE_CONSTITUTION;
case RESEARCH_CHITINOUS_PLATING:
return Upgrades.CHITINOUS_PLATING;
case RESEARCH_GROOVED_SPINES:
return Upgrades.EVOLVE_GROOVED_SPINES;
case RESEARCH_MUSCULAR_AUGMENTS:
return Upgrades.EVOLVE_MUSCULAR_AUGMENTS;
case RESEARCH_NEURAL_PARASITE:
return Upgrades.NEURAL_PARASITE;
case RESEARCH_PATHOGEN_GLANDS:
return Upgrades.INFESTOR_ENERGY_UPGRADE;
default:
return Upgrades.INVALID;
}
}
public static UnitType getRequiredTechForMorph(Abilities ability) {
switch(ability) {
case TRAIN_BANELING:
return Units.ZERG_BANELING_NEST;
case MORPH_BROODLORD:
return Units.ZERG_GREATER_SPIRE;
case MORPH_GREATER_SPIRE:
return Units.ZERG_SPIRE;
case MORPH_HIVE:
return Units.ZERG_INFESTATION_PIT;
case MORPH_LAIR:
return Units.ZERG_SPAWNING_POOL;
case MORPH_LURKER:
return Units.ZERG_LURKER_DEN_MP;
case MORPH_LURKER_DEN:
return Units.ZERG_HYDRALISK_DEN;
case MORPH_OVERLORD_TRANSPORT:
case MORPH_OVERSEER:
return Units.ZERG_LAIR;
case MORPH_RAVAGER:
return Units.ZERG_ROACH_WARREN;
case MORPH_SPINE_CRAWLER_UPROOT:
case MORPH_UPROOT:
return Units.ZERG_SPINE_CRAWLER;
case MORPH_ROOT:
case MORPH_SPINE_CRAWLER_ROOT:
return Units.ZERG_SPINE_CRAWLER_UPROOTED;
case MORPH_SPORE_CRAWLER_ROOT:
return Units.ZERG_SPORE_CRAWLER_UPROOTED;
case MORPH_SPORE_CRAWLER_UPROOT:
return Units.ZERG_SPORE_CRAWLER;
default:
return Units.INVALID;
}
}
public static UnitType morphsFrom(Abilities ability) {
switch(ability) {
case TRAIN_BANELING:
return Units.ZERG_ZERGLING;
case MORPH_BROODLORD:
return Units.ZERG_CORRUPTOR;
case MORPH_GREATER_SPIRE:
return Units.ZERG_SPIRE;
case MORPH_HIVE:
return Units.ZERG_LAIR;
case MORPH_LAIR:
return Units.ZERG_HATCHERY;
case MORPH_LURKER:
return Units.ZERG_HYDRALISK;
case MORPH_OVERLORD_TRANSPORT:
return Units.ZERG_OVERLORD;
case MORPH_OVERSEER:
return Units.ZERG_OVERLORD;
case MORPH_RAVAGER:
return Units.ZERG_ROACH;
case MORPH_SPINE_CRAWLER_UPROOT:
case MORPH_UPROOT:
return Units.ZERG_SPINE_CRAWLER;
case MORPH_ROOT:
case MORPH_SPINE_CRAWLER_ROOT:
return Units.ZERG_SPINE_CRAWLER_UPROOTED;
case MORPH_SPORE_CRAWLER_ROOT:
return Units.ZERG_SPORE_CRAWLER_UPROOTED;
case MORPH_SPORE_CRAWLER_UPROOT:
return Units.ZERG_SPORE_CRAWLER;
default:
return Units.INVALID;
}
}
public static boolean abilityMakesUnit(Ability ability) {
if (ability == Abilities.TRAIN_QUEEN) {
return true;
} else {
return false;
}
}
public static boolean abilityMakesUnitFromLarva(Ability ability) {
if (ability == Abilities.TRAIN_CORRUPTOR ||
ability == Abilities.TRAIN_DRONE ||
ability == Abilities.TRAIN_HYDRALISK ||
ability == Abilities.TRAIN_INFESTOR ||
ability == Abilities.TRAIN_MUTALISK ||
ability == Abilities.TRAIN_OVERLORD ||
ability == Abilities.TRAIN_ROACH ||
ability == Abilities.TRAIN_SWARMHOST ||
ability == Abilities.TRAIN_ULTRALISK ||
ability == Abilities.TRAIN_VIPER ||
ability == Abilities. TRAIN_ZERGLING) {
return true;
} else {
return false;
}
}
public static boolean abilityMakesStructure(Ability ability) {
if (ability == Abilities.BUILD_BANELING_NEST ||
ability == Abilities.BUILD_EVOLUTION_CHAMBER ||
ability == Abilities.BUILD_EXTRACTOR ||
ability == Abilities.BUILD_HATCHERY ||
ability == Abilities.BUILD_HYDRALISK_DEN ||
ability == Abilities.BUILD_INFESTATION_PIT ||
ability == Abilities.BUILD_NYDUS_NETWORK ||
ability == Abilities.BUILD_NYDUS_WORM ||
ability == Abilities.BUILD_ROACH_WARREN ||
ability == Abilities.BUILD_SPAWNING_POOL ||
ability == Abilities.BUILD_SPINE_CRAWLER ||
ability == Abilities.BUILD_SPIRE ||
ability == Abilities.BUILD_SPORE_CRAWLER ||
ability == Abilities.BUILD_ULTRALISK_CAVERN ||
ability == Abilities.MORPH_LURKER_DEN) {
return true;
} else {
return false;
}
}
public static boolean abilityMakesTech(Ability ability) {
if (ability == Abilities.RESEARCH_ZERGLING_METABOLIC_BOOST ||
ability == Abilities.RESEARCH_ZERG_FLYER_ARMOR ||
ability == Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL1 ||
ability == Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL2 ||
ability == Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL3 ||
ability == Abilities.RESEARCH_ZERG_FLYER_ATTACK ||
ability == Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL1 ||
ability == Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL2 ||
ability == Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL3 ||
ability == Abilities.RESEARCH_ZERG_GROUND_ARMOR ||
ability == Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL1 ||
ability == Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL2 ||
ability == Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL3 ||
ability == Abilities.RESEARCH_ZERG_MELEE_WEAPONS ||
ability == Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL1 ||
ability == Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL2 ||
ability == Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL3 ||
ability == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS ||
ability == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL1 ||
ability == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL2 ||
ability == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL3 ||
ability == Abilities.RESEARCH_ZERGLING_ADRENAL_GLANDS ||
ability == Abilities.RESEARCH_ZERGLING_METABOLIC_BOOST ||
ability == Abilities.RESEARCH_ZERG_LAIR_EVOLVE_VENTRAL_SACKS ||
ability == Abilities.RESEARCH_BURROW ||
ability == Abilities.RESEARCH_PNEUMATIZED_CARAPACE ||
ability == Abilities.RESEARCH_CENTRIFUGAL_HOOKS ||
ability == Abilities.RESEARCH_DRILLING_CLAWS ||
ability == Abilities.RESEARCH_GLIAL_REGENERATION ||
ability == Abilities.RESEARCH_CHITINOUS_PLATING ||
ability == Abilities.RESEARCH_GROOVED_SPINES ||
ability == Abilities.RESEARCH_MUSCULAR_AUGMENTS ||
ability == Abilities.RESEARCH_NEURAL_PARASITE ||
ability == Abilities.RESEARCH_PATHOGEN_GLANDS) {
return true;
} else {
return false;
}
}
public static boolean abilityMorphsUnit(Ability ability) {
if (ability == Abilities.TRAIN_BANELING ||
ability == Abilities.MORPH_LAIR ||
ability == Abilities.MORPH_BROODLORD ||
ability == Abilities.MORPH_GREATER_SPIRE ||
ability == Abilities.MORPH_HIVE ||
ability == Abilities.MORPH_LAIR ||
ability == Abilities.MORPH_LURKER ||
ability == Abilities.MORPH_OVERLORD_TRANSPORT ||
ability == Abilities.MORPH_OVERSEER ||
ability == Abilities.MORPH_RAVAGER ||
ability == Abilities.MORPH_SPINE_CRAWLER_UPROOT ||
ability == Abilities.MORPH_UPROOT ||
ability == Abilities.MORPH_ROOT ||
ability == Abilities.MORPH_SPINE_CRAWLER_ROOT ||
ability == Abilities.MORPH_SPORE_CRAWLER_ROOT ||
ability == Abilities.MORPH_SPORE_CRAWLER_UPROOT) {
return true;
} else {
return false;
}
}
public static Abilities getAbilityToResearchUpgrade(Upgrade upgrade) {
if (upgrade == Upgrades.ZERG_FLYER_ARMORS_LEVEL1) {
return Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL1;
} else if (upgrade == Upgrades.ZERG_FLYER_ARMORS_LEVEL2) {
return Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL2;
} else if (upgrade == Upgrades.ZERG_FLYER_ARMORS_LEVEL3) {
return Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL3;
} else if (upgrade == Upgrades.ZERG_FLYER_WEAPONS_LEVEL1) {
return Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL1;
} else if (upgrade == Upgrades.ZERG_FLYER_WEAPONS_LEVEL2) {
return Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL2;
} else if (upgrade == Upgrades.ZERG_FLYER_WEAPONS_LEVEL3) {
return Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL3;
} else if (upgrade == Upgrades.ZERG_GROUND_ARMORS_LEVEL1) {
return Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL1;
} else if (upgrade == Upgrades.ZERG_GROUND_ARMORS_LEVEL2) {
return Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL2;
} else if (upgrade == Upgrades.ZERG_GROUND_ARMORS_LEVEL3) {
return Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL3;
} else if (upgrade == Upgrades.ZERG_MELEE_WEAPONS_LEVEL1) {
return Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL1;
} else if (upgrade == Upgrades.ZERG_MELEE_WEAPONS_LEVEL2) {
return Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL2;
} else if (upgrade == Upgrades.ZERG_MELEE_WEAPONS_LEVEL3) {
return Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL3;
} else if (upgrade == Upgrades.ZERG_MISSILE_WEAPONS_LEVEL1) {
return Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL1;
} else if (upgrade == Upgrades.ZERG_MISSILE_WEAPONS_LEVEL2) {
return Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL2;
} else if (upgrade == Upgrades.ZERG_MISSILE_WEAPONS_LEVEL3) {
return Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL3;
} else if (upgrade == Upgrades.ZERGLING_ATTACK_SPEED) {
return Abilities.RESEARCH_ZERGLING_ADRENAL_GLANDS;
} else if (upgrade == Upgrades.ZERGLING_MOVEMENT_SPEED) {
return Abilities.RESEARCH_ZERGLING_METABOLIC_BOOST;
} else if (upgrade == Upgrades.OVERLORD_TRANSPORT) {
return Abilities.RESEARCH_ZERG_LAIR_EVOLVE_VENTRAL_SACKS;
} else if (upgrade == Upgrades.ZERG_BURROW_MOVE) {
return Abilities.RESEARCH_BURROW;
} else if (upgrade == Upgrades.OVERLORD_SPEED) {
return Abilities.RESEARCH_PNEUMATIZED_CARAPACE;
} else if (upgrade == Upgrades.CENTRIFICAL_HOOKS) {
return Abilities.RESEARCH_CENTRIFUGAL_HOOKS;
} else if (upgrade == Upgrades.DRILL_CLAWS) {
return Abilities.RESEARCH_DRILLING_CLAWS;
} else if (upgrade == Upgrades.GLIALRE_CONSTITUTION) {
return Abilities.RESEARCH_GLIAL_REGENERATION;
} else if (upgrade == Upgrades.CHITINOUS_PLATING) {
return Abilities.RESEARCH_CHITINOUS_PLATING;
} else if (upgrade == Upgrades.EVOLVE_GROOVED_SPINES) {
return Abilities.RESEARCH_GROOVED_SPINES;
} else if (upgrade == Upgrades.EVOLVE_MUSCULAR_AUGMENTS) {
return Abilities.RESEARCH_MUSCULAR_AUGMENTS;
} else if (upgrade == Upgrades.NEURAL_PARASITE) {
return Abilities.RESEARCH_NEURAL_PARASITE;
} else if (upgrade == Upgrades.INFESTOR_ENERGY_UPGRADE) {
return Abilities.RESEARCH_PATHOGEN_GLANDS;
} else {
return Abilities.INVALID;
}
}
public static boolean areEquivalent(Ability abilityA, Ability abilityB) {
if (abilityA == abilityB) {
return true;
} else if (compareAbilities(abilityA, abilityB) ||
compareAbilities(abilityB, abilityA)) {
return true;
} else {
return false;
}
}
private static boolean compareAbilities(Ability abilityA, Ability abilityB) {
if (abilityA == Abilities.RESEARCH_ZERG_FLYER_ARMOR &&
(abilityB == Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL1 ||
abilityB == Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL2 ||
abilityB == Abilities.RESEARCH_ZERG_FLYER_ARMOR_LEVEL3)) {
return true;
} else if (abilityA == Abilities.RESEARCH_ZERG_FLYER_ATTACK &&
(abilityB == Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL1 ||
abilityB == Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL2 ||
abilityB == Abilities.RESEARCH_ZERG_FLYER_ATTACK_LEVEL3)) {
return true;
} else if (abilityA == Abilities.RESEARCH_ZERG_GROUND_ARMOR &&
(abilityB == Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL1 ||
abilityB == Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL2 ||
abilityB == Abilities.RESEARCH_ZERG_GROUND_ARMOR_LEVEL3)) {
return true;
} else if (abilityA == Abilities.RESEARCH_ZERG_MELEE_WEAPONS &&
(abilityB == Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL1 ||
abilityB == Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL2 ||
abilityB == Abilities.RESEARCH_ZERG_MELEE_WEAPONS_LEVEL3)) {
return true;
} else if (abilityA == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS &&
(abilityB == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL1 ||
abilityB == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL2 ||
abilityB == Abilities.RESEARCH_ZERG_MISSILE_WEAPONS_LEVEL3)) {
return true;
} else if (abilityA == Abilities.BUILD_CREEP_TUMOR &&
abilityB == Abilities.BUILD_CREEP_TUMOR_QUEEN ||
abilityB == Abilities.BUILD_CREEP_TUMOR_TUMOR) {
}
return false;
}
}
|
package com.example.taobao2;
import androidx.lifecycle.ViewModel;
public class WeitaoViewModel extends ViewModel {
// TODO: Implement the ViewModel
}
|
package com.ericlam.mc.minigames.core.event.player;
import com.ericlam.mc.minigames.core.character.GamePlayer;
import com.ericlam.mc.minigames.core.game.InGameState;
import com.ericlam.mc.minigames.core.main.MinigamesCore;
import org.bukkit.entity.Entity;
import javax.annotation.Nullable;
import java.util.Set;
/**
* 因 CrackShot 而死亡的遊戲玩家事件
*/
public final class CrackShotDeathEvent extends GamePlayerDeathEvent {
private String weaponTitle;
private Entity bullet;
private Set<DamageType> types;
public CrackShotDeathEvent(@Nullable GamePlayer killer, GamePlayer gamePlayer, InGameState state, String weaponTitle, Entity bullet, Set<DamageType> types) {
super(killer, gamePlayer, DeathCause.CRACKSHOT, state, MinigamesCore.getProperties().getMessageGetter().getPure("death-msg.action.".concat(bullet == null ? "normal" : "gun")));
this.weaponTitle = weaponTitle;
this.bullet = bullet;
this.types = types;
}
/**
* @return 傷害類型
* @see DamageType
*/
public Set<DamageType> getDamageTypes() {
return types;
}
/**
* 返回該槍械的 CrackShot Title
*
* @return 該槍械的 CrackShot Title
*/
public String getWeaponTitle() {
return weaponTitle;
}
/**
* 返回子彈實體
* @return 子彈
*/
public Entity getBullet() {
return bullet;
}
/**
* 傷害類型
*/
public enum DamageType {
/**
* 後刺
*/
BACKSTAB,
/**
* 重擊
*/
CRITICAL,
/**
* 爆頭
*/
HEADSHOT
}
}
|
package net.minecraft.entity.monster;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
public abstract class EntityMob extends EntityCreature implements IMob {
public EntityMob(World worldIn) {
super(worldIn);
this.experienceValue = 5;
}
public SoundCategory getSoundCategory() {
return SoundCategory.HOSTILE;
}
public void onLivingUpdate() {
updateArmSwingProgress();
float f = getBrightness();
if (f > 0.5F)
this.entityAge += 2;
super.onLivingUpdate();
}
public void onUpdate() {
super.onUpdate();
if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL)
setDead();
}
protected SoundEvent getSwimSound() {
return SoundEvents.ENTITY_HOSTILE_SWIM;
}
protected SoundEvent getSplashSound() {
return SoundEvents.ENTITY_HOSTILE_SPLASH;
}
public boolean attackEntityFrom(DamageSource source, float amount) {
return isEntityInvulnerable(source) ? false : super.attackEntityFrom(source, amount);
}
protected SoundEvent getHurtSound(DamageSource p_184601_1_) {
return SoundEvents.ENTITY_HOSTILE_HURT;
}
protected SoundEvent getDeathSound() {
return SoundEvents.ENTITY_HOSTILE_DEATH;
}
protected SoundEvent getFallSound(int heightIn) {
return (heightIn > 4) ? SoundEvents.ENTITY_HOSTILE_BIG_FALL : SoundEvents.ENTITY_HOSTILE_SMALL_FALL;
}
public boolean attackEntityAsMob(Entity entityIn) {
float f = (float)getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue();
int i = 0;
if (entityIn instanceof EntityLivingBase) {
f += EnchantmentHelper.getModifierForCreature(getHeldItemMainhand(), ((EntityLivingBase)entityIn).getCreatureAttribute());
i += EnchantmentHelper.getKnockbackModifier((EntityLivingBase)this);
}
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f);
if (flag) {
if (i > 0 && entityIn instanceof EntityLivingBase) {
((EntityLivingBase)entityIn).knockBack((Entity)this, i * 0.5F, MathHelper.sin(this.rotationYaw * 0.017453292F), -MathHelper.cos(this.rotationYaw * 0.017453292F));
this.motionX *= 0.6D;
this.motionZ *= 0.6D;
}
int j = EnchantmentHelper.getFireAspectModifier((EntityLivingBase)this);
if (j > 0)
entityIn.setFire(j * 4);
if (entityIn instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer)entityIn;
ItemStack itemstack = getHeldItemMainhand();
ItemStack itemstack1 = entityplayer.isHandActive() ? entityplayer.getActiveItemStack() : ItemStack.field_190927_a;
if (!itemstack.func_190926_b() && !itemstack1.func_190926_b() && itemstack.getItem() instanceof net.minecraft.item.ItemAxe && itemstack1.getItem() == Items.SHIELD) {
float f1 = 0.25F + EnchantmentHelper.getEfficiencyModifier((EntityLivingBase)this) * 0.05F;
if (this.rand.nextFloat() < f1) {
entityplayer.getCooldownTracker().setCooldown(Items.SHIELD, 100);
this.world.setEntityState((Entity)entityplayer, (byte)30);
}
}
}
applyEnchantments((EntityLivingBase)this, entityIn);
}
return flag;
}
public float getBlockPathWeight(BlockPos pos) {
return 0.5F - this.world.getLightBrightness(pos);
}
protected boolean isValidLightLevel() {
BlockPos blockpos = new BlockPos(this.posX, (getEntityBoundingBox()).minY, this.posZ);
if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
return false;
int i = this.world.getLightFromNeighbors(blockpos);
if (this.world.isThundering()) {
int j = this.world.getSkylightSubtracted();
this.world.setSkylightSubtracted(10);
i = this.world.getLightFromNeighbors(blockpos);
this.world.setSkylightSubtracted(j);
}
return (i <= this.rand.nextInt(8));
}
public boolean getCanSpawnHere() {
return (this.world.getDifficulty() != EnumDifficulty.PEACEFUL && isValidLightLevel() && super.getCanSpawnHere());
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE);
}
protected boolean canDropLoot() {
return true;
}
public boolean func_191990_c(EntityPlayer p_191990_1_) {
return true;
}
}
/* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraft\entity\monster\EntityMob.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
package com.dzz.policy.service.service.policy;
/**
* 转换接口
*
* @author dzz
* @version 1.0.0
* @since 2019年08月20 10:29
*/
@FunctionalInterface
public interface BeanTransformer<T,R> {
/**
* 转换
* @param input 输入
* @return 输出
*/
R transform(T input);
}
|
package test.reg;
import org.junit.Test;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Copyright (c) by www.leya920.com
* All right reserved.
* Create Date: 2016/12/2 10:19
* Create Author: maguoqiang
* File Name: //TODO 该处值应为className
* Last version: 1.0
* Function: //TODO sring CreateBeanFactoryName
* Last Update Date: 2016/12/2 10:19 //TODO 更新者需完成
* Last Update Log: //TODO 更新着需完成
* Comment: //TODO 创建者需完成
**/
public class RegTest {
@Test
public void test01(){
String pw="####1111#";
Pattern p = Pattern.compile("[\\da-zA-Z]+");
Matcher m = p.matcher(pw);
boolean b = m.matches();
System.out.println(b);
}
}
|
package com.koreait.spring;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
public class FamilyMain {
public static void main(String[] args) {
AbstractApplicationContext ctx = new GenericXmlApplicationContext("classpath:familyContext.xml");
Family family1 = ctx.getBean("family1", Family.class);
System.out.println("가족 1 정보");
System.out.println("아빠 : " + family1.getPapaName());
System.out.println("엄마 : " + family1.getMamaName());
Family family2 = ctx.getBean("family2", Family.class);
System.out.println("가족 2 정보");
System.out.println("아빠 : " + family1.getPapaName());
System.out.println("엄마 : " + family1.getMamaName());
ctx.close();
}
}
|
package com.jim.multipos.ui.admin_main_page.fragments.product_class.di;
import android.support.v4.app.Fragment;
import com.jim.multipos.config.scope.PerFragment;
import com.jim.multipos.ui.admin_main_page.fragments.product_class.ProductClassFragment;
import dagger.Binds;
import dagger.Module;
@Module
public abstract class ProductClassModule {
@Binds
@PerFragment
abstract Fragment provideFragment(ProductClassFragment fragment);
}
|
package prog2.ha1.testing;
import java.math.*;
// behaviour inspired by https://www.online-calculator.com/
public class Calculator {
private String screen = "0";
private double latestValue;
private String latestOperation = "";
private String em = "Error";
private String latestScreen = "";
public String readScreen() { // was steht jetzt auf dem Bildschirm
return screen;
}
//Eigene Operation
public double readlv(){return latestValue; }
public String readlO(){return latestOperation; }
public void errorManager()
{
if(screen.equals(em))
{
screen = latestScreen;
}
}
public void pressDigitKey(int digit)
{
// also die Tasten 0-9
if(digit > 9 || digit < 0) throw new IllegalArgumentException();
errorManager();
if(screen.equals("0")) screen = ""
;
if(latestOperation.isEmpty())
{
screen = screen + digit;
}
else
{
latestValue = Double.parseDouble(screen);
screen = Integer.toString(digit);
}
}
public void pressClearKey()
{
// die Taste CE
screen = "0";
latestOperation = "";
latestValue = 0.0;
}
public void pressBinaryOperationKey(String operation) { // also die Tasten /,x,-,+
latestOperation = operation;
}
public void pressUnaryOperationKey(String operation)
{ // also die Tasten Wurzel, %, 1/x
//k1 = Wurzel, k2 = %, k3 = 1/x
errorManager();
switch(operation)
{
case "k1": //Wurzelberechnung
{
if(Double.parseDouble(screen) < 0)
{
latestScreen = screen;
screen = em;
}
else
{
screen = Double.toString(Math.pow(Double.parseDouble(screen),0.5));
}
break;
}
case "k2": //Prozentzahlen
{
screen = Double.toString(Double.parseDouble(screen)/100);
break;
}
case "k3": //1/x
{
if(Double.parseDouble(screen) == 0)
{
latestScreen = screen;
screen = em;
}
else
{
screen = Double.toString(1 / Double.parseDouble(screen));
}
break;
}
default:
}
}
public void pressDotKey()
{ // die Komma- bzw. Punkt-Taste
//if(!screen.endsWith(".")) screen = screen + ".";
errorManager();
if(!screen.contains(".")) screen = screen + "."; //es prueft generell ob ein Punkt enthalten ist und wenn dem so ist koennen keine weiteren hinzugefuegt werden, anstatt einfach nur auf das Ende zu pruefen
} //Wenn Screen bereits einen Punkt am Ende hat, dann darf kein weiterer Punkt gesetzt werden
public void pressNegativeKey() { // die +/- Taste
errorManager();
screen = screen.startsWith("-") ? screen.substring(1) : "-" + screen;
}
public void pressEqualsKey() { // die Taste =
errorManager();
var result = switch(latestOperation) {
case "+" -> latestValue + Double.parseDouble(screen);
case "-" -> latestValue - Double.parseDouble(screen);
case "x" -> latestValue * Double.parseDouble(screen);
case "/" -> latestValue / Double.parseDouble(screen);
default -> throw new IllegalArgumentException();
};
screen = Double.toString(result);
if(screen.endsWith(".0")) screen = screen.substring(0,screen.length()-2);
}
}
|
package hello_test.hello_test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.opera.OperaOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
public class imdbSearch {
private WebDriver driver;
private Map<String, Object> vars;
JavascriptExecutor js;
@BeforeEach
public void setUp() throws MalformedURLException {
//ChromeOptions options = new ChromeOptions()
//OperaOptions options = new OperaOptions()
FirefoxOptions options= new FirefoxOptions();
options.setHeadless(false);
driver = new FirefoxDriver(options);
js = (JavascriptExecutor) driver;
vars = new HashMap<String, Object>();
}
@AfterEach
public void tearDown() {
driver.quit();
}
@Test
public void imdbwandavision() throws InterruptedException {
// Test name: imdb wandavision
// Step # | name | target | value
// 1 | open | / |
driver.get("https://www.imdb.com/");
try {
// 2 posiciona en el frame
driver.switchTo().frame(0);
// 3 busca el boton aceptar
driver.findElement(By.id("introAgreeButton")).click();
}
catch(Exception e) {
System.out.println("No existe ventana 'antes de continuar'");
}
// 4 posiciona frame general
driver.switchTo().defaultContent();
// 5 | click | name=q |
driver.findElement(By.name("q")).click();
// 6 | type | name=q | wandavision
driver.findElement(By.name("q")).sendKeys("wandavision");
// 7 | sendKeys | name=q | ${KEY_ENTER}
driver.findElement(By.name("q")).sendKeys(Keys.ENTER);
WebElement busca = new WebDriverWait(driver, 10)
.until(ExpectedConditions.elementToBeClickable(By.linkText("WandaVision")));
busca.click();
busca = new WebDriverWait(driver, 10)
.until(ExpectedConditions.elementToBeClickable(By.linkText("TRIVIA")));
busca.click();
//Thread.sleep(2000);
// 8 | click | linkText=WandaVision |
//driver.findElement(By.linkText("WandaVision")).click();
//Thread.sleep(2000);
// 9 | click | linkText=TRIVIA |
//driver.findElement(By.linkText("TRIVIA")).click();
}
}
|
package com.oxycab.provider.ui.activity.sociallogin;
import com.oxycab.provider.base.MvpView;
import com.oxycab.provider.data.network.model.Token;
public interface SocialLoginIView extends MvpView {
void onSuccess(Token token);
void onError(Throwable e);
}
|
package com.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "Roles")
public class RoleEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "roleId")
int roleId;
@Column(name = "roleName")
String roleName;
@OneToMany(mappedBy = "role",fetch = FetchType.LAZY,cascade = CascadeType.ALL)
Set<CandidatRoleEntity> candirole = new HashSet<>();
public int getRoleId() {
return roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Set<CandidatRoleEntity> getCandirole() {
return candirole;
}
public void setCandirole(Set<CandidatRoleEntity> candirole) {
this.candirole = candirole;
}
}
|
package com.funkygames.funkyhilo.constants;
/**
* Created by Anabela on 02/08/2015.
*/
public enum Result {
WON, LOST
}
|
package syn.root.user;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.io.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import java.util.logging.Level;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.bukkit.block.Block;
import wickersoft.root.Root;
import wickersoft.root.StringUtil;
import wickersoft.root.YamlConfiguration;
public class UserData {
// Internal
private final File dataFile;
private final Player playerInstance;
private final UUID uuid;
// Persistent
private String dingPatternString = "";
private boolean frozen = false;
private boolean shadowmuted = false;
private boolean undercover = false;
private boolean noPhantom = false;
private String geoLocation = "Unknown";
private String preciseGeoLocation = "Unknown";
private String timeZone = "Unknown";
private final ArrayList<Mark> marks = new ArrayList<>();
private String subtitleLangPair = "";
private String lastKnownIp = "Unknown";
private String lastKnownName = "Unknown";
private final int[] weeklyMetrics = new int[24 * 7];
private final int[] yearlyMetrics = new int[13];
// Transient
private Pattern dingPattern;
private long spamScore = 0;
private long spamTestTime = 0;
private int xrayTestPointer = 0;
private final long[] xrayTestTimes = new long[20];
private boolean dirty = true;
protected UserData(Player base) {
this.playerInstance = base;
this.uuid = base.getUniqueId();
dataFile = new File(Root.instance().getDataFolder(), "users/" + uuid + "/playerdata.yml");
}
protected UserData(UUID uuid) {
this.playerInstance = null;
this.uuid = uuid;
dataFile = new File(Root.instance().getDataFolder(), "users/" + uuid + "/playerdata.yml");
}
public int addMark(Mark mark) {
touch();
marks.add(mark);
return marks.size();
}
public String getDingPattern() {
return dingPatternString;
}
public String getGeoLocation() {
return geoLocation;
}
public String getIp() {
return lastKnownIp;
}
public List<Mark> getMarks() {
return marks;
}
public String getName() {
return lastKnownName;
}
public Player getPlayerInstance() {
return playerInstance;
}
public String getPreciseGeoLocation() {
return preciseGeoLocation;
}
public String getSubtitleLangPair() {
return subtitleLangPair;
}
public String getTimezone() {
return timeZone;
}
public UUID getUUID() {
return uuid;
}
public int[] getWeeklyMetrics() {
return weeklyMetrics;
}
public int[] getYearlyMetrics() {
return yearlyMetrics;
}
public void incrementActivityStatistic(int hour, int dayOfWeek, int month) {
if (month != yearlyMetrics[12]) {
yearlyMetrics[month] = 0;
yearlyMetrics[12] = month;
}
weeklyMetrics[24 * dayOfWeek + hour]++;
yearlyMetrics[month]++;
touch();
}
public boolean isDirty() {
return dirty;
}
public boolean isFrozen() {
return frozen;
}
public boolean isShadowmuted() {
return shadowmuted;
}
public boolean isUndercover() {
return undercover;
}
public boolean matchDingPattern(String message) {
return dingPattern != null
&& dingPattern.matcher(message).find();
}
public void removeMark(int markIndex) {
touch();
marks.remove(markIndex);
}
public void resetXrayWarnTime() {
for (int i = 0; i < 20; i++) {
xrayTestTimes[i] = 0;
}
}
public boolean setDingPattern(String patternString) {
touch();
if (patternString == null || patternString.equals("")) {
dingPatternString = "";
dingPattern = null;
return true;
}
try {
Pattern tempPattern = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE);
dingPatternString = patternString;
dingPattern = tempPattern;
} catch (PatternSyntaxException ex) {
return false;
}
return true;
}
public void setFrozen(boolean frozen) {
this.frozen = frozen;
touch();
}
public void setGeoLocation(String geoLocation) {
if (!this.geoLocation.equals(geoLocation)) {
touch();
this.geoLocation = geoLocation;
}
}
public void setIp(String newIp) {
if (!this.lastKnownIp.equals(newIp)) {
touch();
this.lastKnownIp = newIp;
}
}
public void setName(String newName) {
if (!this.lastKnownName.equals(newName)) {
touch();
this.lastKnownName = newName;
}
}
public void setPreciseGeoLocation(String geoLocation) {
if (!this.preciseGeoLocation.equals(geoLocation)) {
touch();
this.preciseGeoLocation = geoLocation;
}
}
public void setShadowmuted(boolean shadowmuted) {
touch();
this.shadowmuted = shadowmuted;
}
public void setSubtitleLangPair(String subtitleLangPair) {
touch();
this.subtitleLangPair = subtitleLangPair;
}
public void setTimezone(String timeZone) {
this.timeZone = timeZone;
}
public void setUndercover(boolean undercover) {
touch();
this.undercover = undercover;
}
public long testSpamWarnTime() {
long newTime = xrayTestTimes[xrayTestPointer] = System.currentTimeMillis();
xrayTestPointer = (xrayTestPointer + 1) % 20;
return newTime - xrayTestTimes[xrayTestPointer];
}
public long testXrayWarnTime() {
long newTime = xrayTestTimes[xrayTestPointer] = System.currentTimeMillis();
xrayTestPointer = (xrayTestPointer + 1) % 20;
return newTime - xrayTestTimes[xrayTestPointer];
}
public void touch() {
dirty = true;
}
public boolean loadData() {
if (!dataFile.exists()) {
return false;
}
YamlConfiguration yaml = YamlConfiguration.read(dataFile);
frozen = yaml.getBoolean("frozen", false);
geoLocation = yaml.getString("geolocation", "Unknown");
preciseGeoLocation = yaml.getString("preciseGeolocation", "Unknown");
timeZone = yaml.getString("timezone", "Unknown");
lastKnownName = yaml.getString("name", "Unknown");
lastKnownIp = yaml.getString("ip", "Unknown");
shadowmuted = yaml.getBoolean("shadowmuted", false);
undercover = yaml.getBoolean("undercover", false);
noPhantom = yaml.getBoolean("nophantom", false);
if (playerInstance != null) {
lastKnownName = playerInstance.getName();
}
String patternString = yaml.getString("dingPattern", "");
if (!setDingPattern(patternString)) {
dingPatternString = "";
dingPattern = null;
}
String weekString = yaml.getString("weeklyActivity", "");
if (weekString.length() == 24 * 7 * 2) {
char[] weekChars = weekString.toCharArray();
for (int i = 0; i < 24 * 7; i++) {
weeklyMetrics[i] = (int) StringUtil.getBase64Bits(weekChars, 2 * i, 2 * i + 2);
}
}
String yearString = yaml.getString("yearlyActivity", "");
if (yearString.length() == 13 * 3) {
char[] yearChars = yearString.toCharArray();
for (int i = 0; i < 13; i++) {
yearlyMetrics[i] = (int) StringUtil.getBase64Bits(yearChars, 3 * i, 3 * i + 3);
}
}
List<YamlConfiguration> markSectionList = yaml.getSectionList("marks");
for (YamlConfiguration section : markSectionList) {
marks.add(new Mark(section));
}
dirty = false;
return true;
}
protected void saveData() {
if (!dirty) {
return;
}
YamlConfiguration yaml = YamlConfiguration.emptyConfiguration();
yaml.set("dingPattern", dingPatternString);
yaml.set("name", lastKnownName);
yaml.set("ip", lastKnownIp);
yaml.set("geolocation", geoLocation);
yaml.set("preciseGeolocation", preciseGeoLocation);
yaml.set("timezone", timeZone);
yaml.set("frozen", frozen);
yaml.set("shadowmuted", shadowmuted);
yaml.set("undercover", undercover);
yaml.set("nophantom", noPhantom);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 24 * 7; i++) {
sb.append(StringUtil.toBase64(weeklyMetrics[i], 2));
}
yaml.set("weeklyActivity", sb.toString());
sb = new StringBuilder();
for (int i = 0; i < 13; i++) {
sb.append(StringUtil.toBase64(yearlyMetrics[i], 3));
}
yaml.set("yearlyActivity", sb.toString());
List<YamlConfiguration> markSections = new LinkedList<>();
for (Mark mark : marks) {
markSections.add(mark.toYaml());
}
yaml.set("marks", markSections);
try {
dataFile.getParentFile().mkdir();
yaml.save(dataFile);
} catch (IOException e) {
Bukkit.getLogger().log(Level.WARNING, "Unable to save data for {0}! Data was lost.", uuid);
e.printStackTrace();
}
dirty = false;
}
public boolean hasNoPhantom() {
return noPhantom;
}
public void setNoPhantom(boolean noPhantom) {
this.noPhantom = noPhantom;
}
}
|
package system.param;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author: mol
* @Description:
* @Date: create in 11:06 2018/3/14
*/
public class DeviceParam extends PageNo implements Serializable{
@NotNull
private Integer groupId;
@NotNull
private Integer level;
private String deviceName;
private String deviceAddress;
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceAddress() {
return deviceAddress;
}
public void setDeviceAddress(String deviceAddress) {
this.deviceAddress = deviceAddress;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
}
|
package examples.JavaFX;
import clib.javafx.dialogs.ErrorDialogBox;
import clib.javafx.dialogs.ExitCode;
import clib.javafx.dialogs.InfoDialogBox;
import clib.javafx.dialogs.WarningDialogBox;
import javafx.application.Application;
import javafx.stage.Stage;
public class E_Dialogs extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception
{
ErrorDialogBox errorDialogBox = new ErrorDialogBox(primaryStage);
InfoDialogBox infoDialogBox = new InfoDialogBox(primaryStage);
WarningDialogBox warningDialogBox = new WarningDialogBox(primaryStage);
errorDialogBox.setTitle("Hata!");
errorDialogBox.setMessage("Bilinmeyen bir hata meydana geldi!");
errorDialogBox.showAndWait();
if (warningDialogBox.showAndWait().equals(ExitCode.YES))
{
infoDialogBox.setTitle("Uygulama güncellendi!");
infoDialogBox.setMessage("Yenilikler: \n...\n...\n...");
infoDialogBox.show();
}
}
}
|
package com.arkaces.aces_marketplace_api.contract;
import com.arkaces.aces_marketplace_api.account.AccountEntity;
import com.arkaces.aces_marketplace_api.services.ServiceEntity;
import lombok.Data;
import javax.persistence.*;
import java.time.LocalDateTime;
@Data
@Entity
@Table(name = "contracts")
public class ContractEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long pid;
private String id;
private LocalDateTime createdAt;
private String argumentsJson;
private String remoteContractId;
private String status;
@ManyToOne
@JoinColumn(name = "account_pid")
private AccountEntity accountEntity;
@ManyToOne
@JoinColumn(name = "service_pid")
private ServiceEntity serviceEntity;
}
|
package com.hjtech.base.retroft.provide.impl;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.hjtech.base.retroft.provide.InterceptorProvide;
import com.hjtech.base.retroft.provide.OkHttpClientProvide;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
/*
* 项目名: HjtechARouterFrame
* 包名 com.hjtech.base.retroft
* 文件名: OkHttpClientProvide
* 创建者: ZJB
* 创建时间: 2017/10/25 on 17:44
* 描述: TODO
*/
@Route(path = "/net/okhttpclient")
public class OkHttpClientProvideImpl implements OkHttpClientProvide {
@Autowired
InterceptorProvide interceptorProvide;
@Override
public void init(Context context) {
ARouter.getInstance().inject(this);
}
@Override
public OkHttpClient getOkHttpClient() {
return new OkHttpClient.Builder()
.addInterceptor(interceptorProvide.getHttpLoggingInterceptor())
//设置超时
.connectTimeout(15, TimeUnit.SECONDS)
.readTimeout(15, TimeUnit.SECONDS)
.writeTimeout(15, TimeUnit.SECONDS)
//错误重连
.retryOnConnectionFailure(true).build();
}
}
|
package com.example.petergeras.navcontrol.Model;
public class Product implements ListItem {
private String productName;
private String productUrl;
private String productImageURL;
private Double productPrice;
private Integer position;
private String companyName;
public Product(String productName, String productImageURL, String productUrl, Double productPrice) {
this.productName = productName;
this.productPrice = productPrice;
this.productUrl = productUrl;
this.productImageURL = productImageURL;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public Double getProductPrice() {
return productPrice;
}
public void setProductPrice(Double productPrice) {
this.productPrice = productPrice;
}
public String getProductUrl() {
return productUrl;
}
public void setProductUrl(String productUrl) {
this.productUrl = productUrl;
}
public String getProductImageURL() {
return productImageURL;
}
public void setProductImageURL(String productImageURL) {
this.productImageURL = productImageURL;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Override
public String getTitle() {
return productName;
}
@Override
public String getSubtitle() {
return "$" + productPrice;
}
@Override
public String getImageURL() {
return productImageURL;
}
}
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.eclipse.server;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.eclipse.Activator;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.JobID;
import org.apache.hadoop.mapred.JobStatus;
import org.apache.hadoop.mapred.RunningJob;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Display;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.SAXException;
/**
* Representation of a Hadoop location, meaning of the master node (NameNode,
* JobTracker).
*
* <p>
* This class does not create any SSH connection anymore. Tunneling must be
* setup outside of Eclipse for now (using Putty or <tt>ssh -D<port>
* <host></tt>)
*
* <p>
* <em> TODO </em>
* <li> Disable the updater if a location becomes unreachable or fails for
* tool long
* <li> Stop the updater on location's disposal/removal
*/
public class HadoopServer {
/**
* Frequency of location status observations expressed as the delay in ms
* between each observation
*
* TODO Add a preference parameter for this
*/
protected static final long STATUS_OBSERVATION_DELAY = 1500;
/**
*
*/
public class LocationStatusUpdater extends Job {
JobClient client = null;
/**
* Setup the updater
*/
public LocationStatusUpdater() {
super("Map/Reduce location status updater");
this.setSystem(true);
}
/* @inheritDoc */
@Override
protected IStatus run(IProgressMonitor monitor) {
if (client == null) {
try {
client = HadoopServer.this.getJobClient();
} catch (IOException ioe) {
client = null;
return new Status(Status.ERROR, Activator.PLUGIN_ID, 0,
"Cannot connect to the Map/Reduce location: "
+ HadoopServer.this.getLocationName(),
ioe);
}
}
try {
// Set of all known existing Job IDs we want fresh info of
Set<JobID> missingJobIds =
new HashSet<JobID>(runningJobs.keySet());
JobStatus[] jstatus = client.jobsToComplete();
for (JobStatus status : jstatus) {
JobID jobId = status.getJobID();
missingJobIds.remove(jobId);
HadoopJob hJob;
synchronized (HadoopServer.this.runningJobs) {
hJob = runningJobs.get(jobId);
if (hJob == null) {
// Unknown job, create an entry
RunningJob running = client.getJob(jobId);
hJob =
new HadoopJob(HadoopServer.this, jobId, running, status);
newJob(hJob);
}
}
// Update HadoopJob with fresh infos
updateJob(hJob, status);
}
// Ask explicitly for fresh info for these Job IDs
for (JobID jobId : missingJobIds) {
HadoopJob hJob = runningJobs.get(jobId);
if (!hJob.isCompleted())
updateJob(hJob, null);
}
} catch (IOException ioe) {
client = null;
return new Status(Status.ERROR, Activator.PLUGIN_ID, 0,
"Cannot retrieve running Jobs on location: "
+ HadoopServer.this.getLocationName(), ioe);
}
// Schedule the next observation
schedule(STATUS_OBSERVATION_DELAY);
return Status.OK_STATUS;
}
/**
* Stores and make the new job available
*
* @param data
*/
private void newJob(final HadoopJob data) {
runningJobs.put(data.getJobID(), data);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
fireJobAdded(data);
}
});
}
/**
* Updates the status of a job
*
* @param job the job to update
*/
private void updateJob(final HadoopJob job, JobStatus status) {
job.update(status);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
fireJobChanged(job);
}
});
}
}
static Logger log = Logger.getLogger(HadoopServer.class.getName());
/**
* Hadoop configuration of the location. Also contains specific parameters
* for the plug-in. These parameters are prefix with eclipse.plug-in.*
*/
private Configuration conf;
/**
* Jobs listeners
*/
private Set<IJobListener> jobListeners = new HashSet<IJobListener>();
/**
* Jobs running on this location. The keys of this map are the Job IDs.
*/
private transient Map<JobID, HadoopJob> runningJobs =
Collections.synchronizedMap(new TreeMap<JobID, HadoopJob>());
/**
* Status updater for this location
*/
private LocationStatusUpdater statusUpdater;
// state and status - transient
private transient String state = "";
/**
* Creates a new default Hadoop location
*/
public HadoopServer() {
this.conf = new Configuration();
this.addPluginConfigDefaultProperties();
}
/**
* Creates a location from a file
*
* @throws IOException
* @throws SAXException
* @throws ParserConfigurationException
*/
public HadoopServer(File file) throws ParserConfigurationException,
SAXException, IOException {
this.conf = new Configuration();
this.addPluginConfigDefaultProperties();
this.loadFromXML(file);
}
/**
* Create a new Hadoop location by copying an already existing one.
*
* @param source the location to copy
*/
public HadoopServer(HadoopServer existing) {
this();
this.load(existing);
}
public void addJobListener(IJobListener l) {
jobListeners.add(l);
}
public void dispose() {
// TODO close DFS connections?
}
/**
* List all elements that should be present in the Server window (all
* servers and all jobs running on each servers)
*
* @return collection of jobs for this location
*/
public Collection<HadoopJob> getJobs() {
startStatusUpdater();
return this.runningJobs.values();
}
/**
* Remove the given job from the currently running jobs map
*
* @param job the job to remove
*/
public void purgeJob(final HadoopJob job) {
runningJobs.remove(job.getJobID());
Display.getDefault().asyncExec(new Runnable() {
public void run() {
fireJobRemoved(job);
}
});
}
/**
* Returns the {@link Configuration} defining this location.
*
* @return the location configuration
*/
public Configuration getConfiguration() {
return this.conf;
}
/**
* Gets a Hadoop configuration property value
*
* @param prop the configuration property
* @return the property value
*/
public String getConfProp(ConfProp prop) {
return prop.get(conf);
}
/**
* Gets a Hadoop configuration property value
*
* @param propName the property name
* @return the property value
*/
public String getConfProp(String propName) {
return this.conf.get(propName);
}
public String getLocationName() {
return ConfProp.PI_LOCATION_NAME.get(conf);
}
/**
* Returns the master host name of the Hadoop location (the Job tracker)
*
* @return the host name of the Job tracker
*/
public String getMasterHostName() {
return getConfProp(ConfProp.PI_JOB_TRACKER_HOST);
}
public String getState() {
return state;
}
/**
* Overwrite this location with the given existing location
*
* @param existing the existing location
*/
public void load(HadoopServer existing) {
this.conf = new Configuration(existing.conf);
}
/**
* Overwrite this location with settings available in the given XML file.
* The existing configuration is preserved if the XML file is invalid.
*
* @param file the file path of the XML file
* @return validity of the XML file
* @throws ParserConfigurationException
* @throws IOException
* @throws SAXException
*/
public boolean loadFromXML(File file) throws ParserConfigurationException,
SAXException, IOException {
Configuration newConf = new Configuration(this.conf);
DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = builder.parse(file);
Element root = document.getDocumentElement();
if (!"configuration".equals(root.getTagName()))
return false;
NodeList props = root.getChildNodes();
for (int i = 0; i < props.getLength(); i++) {
Node propNode = props.item(i);
if (!(propNode instanceof Element))
continue;
Element prop = (Element) propNode;
if (!"property".equals(prop.getTagName()))
return false;
NodeList fields = prop.getChildNodes();
String attr = null;
String value = null;
for (int j = 0; j < fields.getLength(); j++) {
Node fieldNode = fields.item(j);
if (!(fieldNode instanceof Element))
continue;
Element field = (Element) fieldNode;
if ("name".equals(field.getTagName()))
attr = ((Text) field.getFirstChild()).getData();
if ("value".equals(field.getTagName()) && field.hasChildNodes())
value = ((Text) field.getFirstChild()).getData();
}
if (attr != null && value != null)
newConf.set(attr, value);
}
this.conf = newConf;
return true;
}
/**
* Sets a Hadoop configuration property value
*
* @param prop the property
* @param propvalue the property value
*/
public void setConfProp(ConfProp prop, String propValue) {
prop.set(conf, propValue);
}
/**
* Sets a Hadoop configuration property value
*
* @param propName the property name
* @param propValue the property value
*/
public void setConfProp(String propName, String propValue) {
this.conf.set(propName, propValue);
}
public void setLocationName(String newName) {
ConfProp.PI_LOCATION_NAME.set(conf, newName);
}
/**
* Write this location settings to the given output stream
*
* @param out the output stream
* @throws IOException
*/
public void storeSettingsToFile(File file) throws IOException {
FileOutputStream fos = new FileOutputStream(file);
this.conf.writeXml(fos);
fos.close();
}
/* @inheritDoc */
@Override
public String toString() {
return this.getLocationName();
}
/**
* Fill the configuration with valid default values
*/
private void addPluginConfigDefaultProperties() {
for (ConfProp prop : ConfProp.values()) {
if (conf.get(prop.name) == null)
conf.set(prop.name, prop.defVal);
}
}
/**
* Starts the location status updater
*/
private synchronized void startStatusUpdater() {
if (statusUpdater == null) {
statusUpdater = new LocationStatusUpdater();
statusUpdater.schedule();
}
}
/*
* Rewrite of the connecting and tunneling to the Hadoop location
*/
/**
* Provides access to the default file system of this location.
*
* @return a {@link FileSystem}
*/
public FileSystem getDFS() throws IOException {
return FileSystem.get(this.conf);
}
/**
* Provides access to the Job tracking system of this location
*
* @return a {@link JobClient}
*/
public JobClient getJobClient() throws IOException {
JobConf jconf = new JobConf(this.conf);
return new JobClient(jconf);
}
/*
* Listeners handling
*/
protected void fireJarPublishDone(JarModule jar) {
for (IJobListener listener : jobListeners) {
listener.publishDone(jar);
}
}
protected void fireJarPublishStart(JarModule jar) {
for (IJobListener listener : jobListeners) {
listener.publishStart(jar);
}
}
protected void fireJobAdded(HadoopJob job) {
for (IJobListener listener : jobListeners) {
listener.jobAdded(job);
}
}
protected void fireJobRemoved(HadoopJob job) {
for (IJobListener listener : jobListeners) {
listener.jobRemoved(job);
}
}
protected void fireJobChanged(HadoopJob job) {
for (IJobListener listener : jobListeners) {
listener.jobChanged(job);
}
}
}
|
package model;
// Generated by MyEclipse Persistence Tools
/**
* Usuario generated by MyEclipse Persistence Tools
*/
public class Usuario extends AbstractUsuario implements java.io.Serializable {
// Constructors
/** default constructor */
public Usuario() {
}
/** minimal constructor */
public Usuario(Integer idUsuario, String usuario, String pwd,
String nombre, String apellido) {
super(idUsuario, usuario, pwd, nombre, apellido);
}
/** full constructor */
public Usuario(Integer idUsuario, String usuario, String pwd,
String nombre, String apellido, String email, String telefono,
Integer idPerfil) {
super(idUsuario, usuario, pwd, nombre, apellido, email, telefono,
idPerfil);
}
}
|
package com.tencent.mm.plugin.appbrand.launching;
import com.tencent.mm.ipcinvoker.c;
import com.tencent.mm.plugin.appbrand.appcache.WxaPkgWrappingInfo;
import com.tencent.mm.plugin.appbrand.appcache.base.WxaPkgLoadProgress;
import com.tencent.mm.plugin.appbrand.launching.RuntimeLoadModuleTask.2;
import com.tencent.mm.plugin.appbrand.launching.RuntimeLoadModuleTask.WxaPkgResultProgressPair;
import com.tencent.mm.sdk.platformtools.x;
class RuntimeLoadModuleTask$1 implements c<WxaPkgResultProgressPair> {
final /* synthetic */ RuntimeLoadModuleTask ggM;
public RuntimeLoadModuleTask$1(RuntimeLoadModuleTask runtimeLoadModuleTask) {
this.ggM = runtimeLoadModuleTask;
}
public final /* synthetic */ void at(Object obj) {
WxaPkgResultProgressPair wxaPkgResultProgressPair = (WxaPkgResultProgressPair) obj;
switch (2.ggN[WxaPkgResultProgressPair.a(wxaPkgResultProgressPair).ordinal()]) {
case 1:
WxaPkgWrappingInfo wxaPkgWrappingInfo = wxaPkgResultProgressPair.ggP;
this.ggM.un(wxaPkgWrappingInfo == null ? null : wxaPkgWrappingInfo.ffK);
return;
case 2:
WxaPkgLoadProgress wxaPkgLoadProgress = wxaPkgResultProgressPair.ggQ;
if (wxaPkgLoadProgress != null) {
this.ggM.b(wxaPkgLoadProgress);
return;
} else {
x.e("MicroMsg.AppBrand.RuntimeLoadModuleTask", "hy: non progress info! should not happen");
return;
}
default:
return;
}
}
}
|
package com.lolRiver.river.persistence;
import com.lolRiver.river.models.Elo;
import com.lolRiver.river.persistence.interfaces.EloDao;
import com.lolRiver.river.util.sql.SqlQueryUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository;
import javax.sql.DataSource;
import java.sql.*;
import java.util.Map;
/**
* @author mxia (mxia@lolRiver.com)
* 10/1/13
*/
@Repository
public class JdbcEloDao implements EloDao {
private static final Logger LOGGER = Logger.getLogger(JdbcEloDao.class);
private static String GET_GIVEN_ID_SQL = "SELECT * FROM elo WHERE id = :id";
private static String INSERT_SQL = "INSERT INTO elo (user_id, elo, time) VALUES (?,?,?)";
private static String GET_ELO_MATCHING_ELO_HEAD = "SELECT * " +
"FROM elo " +
"WHERE ";
private static String GET_ELO_MATCHING_ELO_TAIL = " ORDER BY time DESC LIMIT 1";
private NamedParameterJdbcTemplate namedParamJdbcTemplate;
private JdbcTemplate jdbcTemplate;
private EloRowMapper rowMapper = new EloRowMapper();
@Autowired
public void init(final DataSource dataSource) {
namedParamJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
jdbcTemplate = new JdbcTemplate(dataSource);
}
// helper method to handle results with num rows != 1
private Elo queryForElo(final String sql, final Elo ap,
final RowMapper<Elo> rowMapper) {
try {
return namedParamJdbcTemplate.queryForObject(sql, new BeanPropertySqlParameterSource(ap), rowMapper);
} catch (final EmptyResultDataAccessException e) {
// not an error when no rows were found
return null;
}
}
@Override
public Elo getEloFromId(int id) {
final Elo queryObject = new Elo();
queryObject.setId(id);
return queryForElo(GET_GIVEN_ID_SQL, queryObject, rowMapper);
}
@Override
public Elo insertElo(final Elo elo) {
LOGGER.debug("Creating Elo with values: " + elo + " using query: " + INSERT_SQL);
if (elo == null) {
return null;
}
final KeyHolder holder = new GeneratedKeyHolder();
try {
jdbcTemplate.update(new PreparedStatementCreator() {
@Override
public PreparedStatement createPreparedStatement(final Connection connection) throws SQLException {
final PreparedStatement ps = connection.prepareStatement(INSERT_SQL, Statement.RETURN_GENERATED_KEYS);
ps.setInt(1, elo.getUserId());
ps.setString(2, elo.getName().name());
ps.setTimestamp(3, elo.getTime());
return ps;
}
}, holder);
} catch (DuplicateKeyException e) {
// ignore
return null;
}
return getEloFromId(holder.getKey().intValue());
}
@Override
public Elo getLatestEloFromElo(Elo elo, Map<String, String> paramsToMatch) {
if (elo == null || paramsToMatch == null || paramsToMatch.isEmpty()) {
LOGGER.warn("Tried to fetch elo with bad inputs. Elo: " + elo
+ ", paramsToMatch: " + paramsToMatch);
return null;
}
final String queryString = GET_ELO_MATCHING_ELO_HEAD + SqlQueryUtil.conditionalQuery(paramsToMatch) + GET_ELO_MATCHING_ELO_TAIL;
LOGGER.info("Fetching elo: " + elo + " with: " + queryString);
return namedParamJdbcTemplate.queryForObject(queryString, new BeanPropertySqlParameterSource(elo), rowMapper);
}
// Extract Elo results from a JDBC result set
public final class EloRowMapper implements RowMapper<Elo> {
@Override
public Elo mapRow(final ResultSet resultSet, final int i) throws SQLException {
final int id = resultSet.getInt(Elo.ID_STRING);
final int userId = resultSet.getInt(Elo.USER_ID_STRING);
final Timestamp time = resultSet.getTimestamp(Elo.TIME_STRING);
final String eloName = resultSet.getString(Elo.NAME_STRING);
return Elo.fromString(eloName)
.setId(id)
.setUserId(userId)
.setTime(time);
}
}
}
|
package com.yoeki.kalpnay.hrporatal.Plane;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.yoeki.kalpnay.hrporatal.R;
import com.yoeki.kalpnay.hrporatal.Request.TochangeAdapter;
import com.yoeki.kalpnay.hrporatal.Request.TochangeModel;
import java.util.ArrayList;
public class PlanformActivity extends AppCompatActivity implements View.OnClickListener {
TextView tv_wherelocation,tv_location,tv_locationgeneral,tv_employeename;
LinearLayout ly_location,ly_locationgeneral;
String str;
FrameLayout frm_formback;
ImageView img_backform;
Button time_planformsubmit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_planform);
initialize();
img_backform.setOnClickListener(this);
time_planformsubmit.setOnClickListener(this);
tv_wherelocation.setOnClickListener(this);
tv_location.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.tv_wherelocation:
locationdialog();
break;
case R.id.img_backform:
finish();
break;
case R.id.time_planformsubmit:
success();
break;
case R.id.tv_location:
locationformdialog();
break;
}
}
public void initialize(){
tv_wherelocation=findViewById(R.id.tv_wherelocation);
img_backform=findViewById(R.id.img_backform);
time_planformsubmit=findViewById(R.id.time_planformsubmit);
tv_location=findViewById(R.id.tv_location);
tv_locationgeneral=findViewById(R.id.tv_locationgeneral);
ly_locationgeneral=findViewById(R.id.ly_location);
ly_location=findViewById(R.id.ly_locationgeneral);
}
public void locationdialog(){
final RadioGroup radioGroup_locationtype;
TextView tv_leavereqsubmit;
final Dialog dialog = new Dialog(PlanformActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCancelable(true);
dialog.setContentView(R.layout.dialog_wherelocation);
radioGroup_locationtype=dialog.findViewById(R.id.radioGroup_locationtype);
radioGroup_locationtype.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
Button btn=radioGroup_locationtype.findViewById(i);
str=btn.getText().toString();
tv_wherelocation.setText(btn.getText().toString());
if (str.equals("Company Location")){
ly_location.setVisibility(View.GONE);
ly_locationgeneral.setVisibility(View.VISIBLE);
}else if (str.equals("Vendor Location")){
ly_location.setVisibility(View.GONE);
ly_locationgeneral.setVisibility(View.VISIBLE);
}else if (str.equals("General")){
ly_location.setVisibility(View.VISIBLE);
ly_locationgeneral.setVisibility(View.GONE);
}
}
});
tv_leavereqsubmit=dialog.findViewById(R.id.tv_leavereqsubmit);
tv_leavereqsubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
dialog.show();
}
public void success(){
final Dialog dialog = new Dialog(PlanformActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCancelable(true);
dialog.setContentView(R.layout.dialog_successform);
TextView tv_submitformmsg=dialog.findViewById(R.id.tv_submitformmsg);
tv_submitformmsg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
finish();
}
});
dialog.show();
}
public void locationformdialog() {
final ArrayList<TochangeModel> arraylistdep=new ArrayList<>();
TochangeModel data1=new TochangeModel();
data1.setDepartmentname("E-210,Noida,Sec-63");
arraylistdep.add(data1);
TochangeModel data2=new TochangeModel();
data2.setDepartmentname("h-25,Sec-3,Noida");
arraylistdep.add(data2);
TochangeModel data3=new TochangeModel();
data3.setDepartmentname("A-45,Sec-2,Noida");
arraylistdep.add(data3);
TochangeModel data4=new TochangeModel();
data4.setDepartmentname("H-119,Sec-62,Noida");
arraylistdep.add(data4);
TochangeModel data5=new TochangeModel();
data5.setDepartmentname("G-19,Sec-63,Noida");
arraylistdep.add(data5);
TochangeModel data6=new TochangeModel();
data6.setDepartmentname("B-225,New Ashok Nagar,New Delhi");
arraylistdep.add(data6);
TochangeModel data7=new TochangeModel();
data7.setDepartmentname("B-19,Sec-19,Noida");
arraylistdep.add(data7);
final TochangeAdapter adapter = new TochangeAdapter(PlanformActivity.this, arraylistdep);
final Dialog dialog = new Dialog(PlanformActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_location);
ListView listsponser = dialog.findViewById(R.id.li_locationlist);
listsponser.setAdapter(adapter);
listsponser.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
tv_location.setText(arraylistdep.get(i).getDepartmentname());
dialog.dismiss();
}
});
dialog.show();
}
}
|
package Action.Chapter16;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
/**
* Created by apple on 2019/7/28.
*/
public class ReflectDemo02 {
public static void main(String args[]) throws Exception{
Class<?> c = null;
c = Class.forName("Action.Chapter16.SimpleBeanTwo");
Method toM = c.getMethod("toString");
if(toM.isAnnotationPresent(MyDefaultAnnotation.class)){
MyDefaultAnnotation mda = null;
mda = toM.getAnnotation(MyDefaultAnnotation.class);
String key = mda.key();
String value = mda.value();
System.out.println("key="+ key);
System.out.println("value="+ value);
}
}
}
|
package ua.khai.slynko.library.web.command.utils;
import org.apache.log4j.Logger;
import ua.khai.slynko.library.db.entity.CatalogItem;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
public final class CommandUtils {
private CommandUtils() {}
private static final Logger LOG = Logger.getLogger(CommandUtils.class);
public static void setRedirect(HttpServletRequest request) {
request.setAttribute("sendRedirect", true);
}
public static void sortCatalogItemsBy(List<CatalogItem> catalogItems, String criteria) {
if (criteria == null || criteria.equals("title")) {
catalogItems.sort(Comparator.comparing(CatalogItem::getTitle));
} else if (criteria.equals("author")) {
catalogItems.sort(Comparator.comparing(CatalogItem::getAuthor));
} else if (criteria.equals("edition")) {
catalogItems.sort(Comparator.comparing(CatalogItem::getEdition));
} else if (criteria.equals("publicationYear")) {
catalogItems.sort(Comparator.comparing(CatalogItem::getPublicationYear));
}
}
/**
* <p>
* Checks if two dates are on the same day ignoring time.
* </p>
*
* @param date1
* the first date, not altered, not null
* @param date2
* the second date, not altered, not null
* @return true if they represent the same day
* @throws IllegalArgumentException
* if either date is <code>null</code>
*/
public static boolean isSameDay(Date date1, Date date2) {
if (date1 == null || date2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
Calendar cal1 = Calendar.getInstance();
cal1.setTime(date1);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(date2);
return isSameDay(cal1, cal2);
}
/**
* <p>
* Checks if two calendars represent the same day ignoring time.
* </p>
*
* @param cal1
* the first calendar, not altered, not null
* @param cal2
* the second calendar, not altered, not null
* @return true if they represent the same day
* @throws IllegalArgumentException
* if either calendar is <code>null</code>
*/
public static boolean isSameDay(Calendar cal1, Calendar cal2) {
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
return (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR)
&& cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR));
}
/**
* <p>
* Checks if a date is today.
* </p>
*
* @param date
* the date, not altered, not null.
* @return true if the date is today.
* @throws IllegalArgumentException
* if the date is <code>null</code>
*/
public static boolean isToday(String dateString) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
date = sdf.parse(dateString);
} catch (ParseException e) {
LOG.error(e);
}
return isSameDay(date, Calendar.getInstance().getTime());
}
public static Date getDateTo(HttpServletRequest request) {
String dateToStr = request.getParameter("dateTo");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dateTo;
try {
dateTo = sdf.parse(dateToStr);
} catch (ParseException e) {
dateTo = new Date();
}
return dateTo;
}
public static boolean isDateBefore(String date, Date endDate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dateTo = null;
try {
dateTo = sdf.parse(date);
} catch (ParseException e) {
LOG.error(e);
}
return dateTo.compareTo(endDate) < 0;
}
}
|
package com.csye6225.demo;
import io.restassured.RestAssured;
import org.junit.Ignore;
import org.junit.Test;
import java.net.URI;
import java.net.URISyntaxException;
public class RestAssuredDemoApiTest {
@Ignore
@Test
public void testGetHomePage() throws URISyntaxException {
RestAssured.when().get(new URI("http://localhost:8080/")).then().statusCode(200);
}
}
|
package smart.storage;
public class UploadResult {
private final String err;
private final String url;
public UploadResult(String err, String url) {
this.err = err;
this.url = url;
}
public String getErr() {
return err;
}
public String getUrl() {
return url;
}
}
|
package test;
import java.util.ArrayList;
import java.util.Stack;
public class Test_TreeTraver2 {
/**
* 创建结点,包含数据,左右子结点地址
*/
static class Node<E>{
E data;
Node<E> right;
Node<E> left;
//相关数据的添加
public Node(E data , Node<E> right , Node<E> left){
this.left = left;
this.right = right;
this.data = data;
}
//初始化
public Node(E data){
this(data,null,null);
}
}
/**
* 创建树
*/
static class LinkedTree<E>{
//根结点
Node<E> root;
//初始化树
public LinkedTree(E data){
root = new Node<>(data);
}
/**
* 添加结点
* @param data 添加的数据
* @param father 父级结点地址
* @param isLeft 是否为父级结点的左子结点
* @return 添加的结点
*/
public Node<E> add(E data , Node<E> father , boolean isLeft){
if(father == null) throw new RuntimeException("无父级,拒绝添加");
Node<E> theNode = new Node<>(data);
if(isLeft){
father.left = theNode;
}else{
father.right = theNode;
}
return theNode;
}
}
/**
* 先序1
* @param root 树的根结点
* @return 先序遍历序列数组
*/
public static ArrayList<Object> preOrder(Node<Object> root){
//判断以root为根的树是否为空
if(root==null) return null;
//创建暂时存储结点的栈
Stack<Node<Object>> stack = new Stack<>();
//创建先序遍历序列储存的列表
ArrayList<Object> list = new ArrayList<>();
//创建指针,并指向root
Node<Object> p = root;
//循环至栈空
while(p!=null || !stack.isEmpty() ){
/*
* 循环将p结点和左子结点入栈入组,直至p为null
*/
while(p!=null){
stack.add(p);
list.add(p.data);
p = p.left;
}
/*
* 如果p为null,栈为空,表明遍历结束
* 如果栈不为空,弹出栈顶结点,p指针指向该节点的右子节点(有可能为null)
* 继续循环将p的左子节点入栈入组
*/
if(!stack.isEmpty()){
p = stack.pop();
p = p.right;
}
}
//返回后序遍历序列数组
return list;
}
/**
* 先序2
* @param root 树的根结点
* @return 先序遍历序列数组
*/
public static ArrayList<Object> preOrder2(Node<Object> root){
//判断以root为根的树是否为空
if(root==null) return null;
//创建存储结点的栈
Stack<Node<Object>> stack = new Stack<>();
//创建先序遍历序列储存的列表
ArrayList<Object> list = new ArrayList<>();
//创建指针
Node<Object> p;
//将根结点入栈
stack.push(root);
//循环至栈空
while(!stack.isEmpty()){
/*
* 依据先序遍历的特点:p结点→左子节点→右子结点
*/
//p指针指向弹出栈顶的结点
p = stack.pop();
//p结点的数据入组
list.add(p.data);
//如果有右结点,入栈
if( p.right != null) stack.push(p.right);
//如果有左节点,入栈并p指针指向左子节点
if( p.left != null) {
stack.push(p.left);
p=p.left;
}
}
//返回先序遍历序列数组
return list;
}
/**
* 中序
* @param root 树的根结点
* @return 中序遍历序列数组
*/
public static ArrayList<Object> inOrder(Node<Object> root){
//判断以root为根的树是否为空
if(root==null) return null;
//创建存储结点的栈
Stack<Node<Object>> stack = new Stack<>();
//创建中序遍历序列储存的列表
ArrayList<Object> list = new ArrayList<>();
//创建指针,并指向根结点
Node<Object> p = root;
//循环至p指针为null,以及栈为空。
while(p!=null || !stack.isEmpty() ){
//依次将左子树结点入栈,直至为null
while(p!=null){
stack.add(p);
p = p.left;
}
/*
* 如果指针p和栈均为空,则遍历完成
* 如果栈不为空,弹出的栈顶结点,数据入组,p指针指向该节点右子节点
*/
if(!stack.isEmpty()){
p = stack.pop();
list.add(p.data);
p = p.right;
}
}
//返回中序遍历序列数组
return list;
}
/**
* 输出
* @param list 需输出的数组
*/
public static void print(ArrayList<Object> list){
for (int i = 0 ; i<list.size() ; i++) System.out.print(list.get(i)+" ");
System.out.println();
}
/**
* 计算叶子结点、总结点、层数,递归
*/
static class TreeInf{
static int lives_count = 0;
static int count = 0;
private static void count(Node<?> root){
if (root == null) return;
if (root.right == null && root.left == null) lives_count +=1 ;
count(root.left);
count(root.right);
count+=1;
}
static int level = 0;
static int theLevel;
private static void level(Node<?> root){
if (root == null){
return;
}
theLevel += 1 ;
level(root.left);
level(root.right);
if (root.right == null && root.left == null){
if (theLevel>level) level = theLevel;
}
theLevel -= 1 ;
}
private static void print(Node<?> root){
count(root);
level(root);
System.out.println("叶子结点数为:"+lives_count);
System.out.println("结点总数为:"+count);
System.out.println("高度为:"+level);
}
}
@SuppressWarnings("unused")
public static void main(String[] args){
LinkedTree<Object> tree = new LinkedTree<>("A");
Node<Object> A = tree.root;
Node<Object> B = tree.add('B', A, true);
Node<Object> C = tree.add('C', A, false);
Node<Object> D = tree.add('D', B, true);
Node<Object> E = tree.add('E', B, false);
Node<Object> F = tree.add('F', C, false);
Node<Object> G = tree.add('G', D, true);
Node<Object> H = tree.add('H', E, true);
Node<Object> I = tree.add('I', E, false);
Node<Object> J = tree.add('J', I, false);
System.out.println("在以"+tree.root.data+"为根结点的二叉树中:");
System.out.print("先序遍历序列,法一:");
print(preOrder(A));
System.out.print("先序遍历序列,法二:");
print(preOrder2(A));
System.out.print("中序遍历序列 :");
print(inOrder(A));
TreeInf.print(A);
}
}
|
package com.tencent.mm.console;
import android.content.Intent;
import com.tencent.mm.platformtools.af;
import com.tencent.mm.sdk.platformtools.x;
class Shell$8 implements Shell$a {
Shell$8() {
}
public final void n(Intent intent) {
af.exp = intent.getStringExtra("errmsg");
x.w("MicroMsg.Shell", "tiger set tigerIDCErrMsg =%s", new Object[]{af.exp});
}
}
|
package com.brunocalou.guitarstudio;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import java.io.Serializable;
/**
* Created by bruno on 10/02/16.
*/
public class EffectListAdapter extends BaseAdapter {
private EffectList effects;
private LayoutInflater inflater;
private Activity context;
public EffectListAdapter(Activity context, EffectList effects) {
this.effects = effects;
this.context = context;
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public void setEffectList (EffectList effect_list) {
this.effects = effect_list;
}
@Override
public int getCount() {
return effects.size();
}
@Override
public Object getItem(int position) {
return effects.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolderItem view_holder;
if (convertView == null) {
convertView = inflater.inflate(R.layout.effect_list_item, parent, false);
view_holder = new ViewHolderItem();
view_holder.check_box = (CheckBox) convertView.findViewById(R.id.effectCheckBox);
view_holder.img_button = (ImageButton) convertView.findViewById(R.id.effectSettingsButton);
convertView.setTag(view_holder);
} else {
view_holder = (ViewHolderItem) convertView.getTag();
}
final EffectListItem effect_item = effects.get(position);
if (effect_item != null) {
view_holder.check_box.setText(effect_item.name);
view_holder.check_box.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Log.d("Adapter", "CheckBox is checked");
effect_item.getEffect().enable();
} else {
Log.d("Adapter", "CheckBox is not checked");
effect_item.getEffect().disable();
}
}
});
view_holder.check_box.setChecked(effect_item.getEffect().isEnabled());
view_holder.img_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, effect_item.getEffectActivity());
Bundle bundle = new Bundle();
bundle.putSerializable(String.valueOf(R.string.DISTORTION_EFFECT), effect_item.getEffect());
intent.putExtras(bundle);
context.startActivity(intent);
}
});
}
return convertView;
}
class ViewHolderItem {
ImageButton img_button;
CheckBox check_box;
}
}
|
/*
* Copyright (c) 2009-2011 by Jan Stender, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
package org.xtreemfs.osd.storage;
import java.text.DateFormat;
import java.util.Date;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.Map.Entry;
import org.xtreemfs.common.KeyValuePairs;
import org.xtreemfs.common.uuids.ServiceUUID;
import org.xtreemfs.common.xloc.RAID0Impl;
import org.xtreemfs.foundation.LifeCycleThread;
import org.xtreemfs.foundation.TimeSync;
import org.xtreemfs.foundation.logging.Logging;
import org.xtreemfs.foundation.logging.Logging.Category;
import org.xtreemfs.foundation.pbrpc.client.RPCAuthentication;
import org.xtreemfs.foundation.pbrpc.client.RPCResponse;
import org.xtreemfs.foundation.pbrpc.generatedinterfaces.RPC.UserCredentials;
import org.xtreemfs.osd.OSDRequestDispatcher;
import org.xtreemfs.osd.storage.StorageLayout.FileList;
import org.xtreemfs.pbrpc.generatedinterfaces.MRCServiceClient;
import org.xtreemfs.pbrpc.generatedinterfaces.DIR.ServiceSet;
import org.xtreemfs.pbrpc.generatedinterfaces.GlobalTypes.Replica;
import org.xtreemfs.pbrpc.generatedinterfaces.GlobalTypes.StripingPolicy;
import org.xtreemfs.pbrpc.generatedinterfaces.GlobalTypes.StripingPolicyType;
import org.xtreemfs.pbrpc.generatedinterfaces.MRC.getxattrRequest;
import org.xtreemfs.pbrpc.generatedinterfaces.MRC.getxattrResponse;
/**
*
* @author bjko
*/
public class CleanupVersionsThread extends LifeCycleThread {
// PATTERN for the output. Brackets are not allowed to be used at the format
// strings.
public final static String STATUS_FORMAT = "files checked: %8d versions deleted: %8d running since: %s";
public final static String STOPPED_FORMAT = "not running, last check started %s";
private final OSDRequestDispatcher master;
private volatile boolean isRunning;
private volatile boolean quit;
private final StorageLayout layout;
private volatile long filesChecked;
private volatile long versionsRemoved;
private volatile long startTime;
private UserCredentials uc;
final ServiceUUID localUUID;
public CleanupVersionsThread(OSDRequestDispatcher master, StorageLayout layout) {
super("CleanupVThr");
this.master = master;
this.isRunning = false;
this.quit = false;
this.layout = layout;
this.localUUID = master.getConfig().getUUID();
this.startTime = 0L;
this.filesChecked = 0L;
this.versionsRemoved = 0L;
}
public boolean cleanupStart(UserCredentials uc) {
synchronized (this) {
if (isRunning) {
return false;
} else {
this.uc = uc;
isRunning = true;
this.notify();
return true;
}
}
}
public void cleanupStop() {
synchronized (this) {
if (isRunning) {
isRunning = false;
}
}
}
public boolean isRunning() {
synchronized (this) {
return isRunning;
}
}
public String getStatus() {
synchronized (this) {
String d = DateFormat.getDateInstance().format(new Date(startTime));
assert (d != null);
if (isRunning) {
return String.format(STATUS_FORMAT, filesChecked, versionsRemoved, d);
} else {
return String.format(STOPPED_FORMAT, d);
}
}
}
public void shutdown() {
synchronized (this) {
quit = true;
this.notifyAll();
}
}
public void run() {
notifyStarted();
try {
do {
synchronized (this) {
if (!isRunning)
this.wait();
if (quit)
break;
}
FileList l = null;
filesChecked = 0;
startTime = TimeSync.getGlobalTime();
final MRCServiceClient mrcClient = new MRCServiceClient(master.getRPCClient(), null);
// first, determine all snapshot timestamps + volumes for all
// files
// volume -> set of file IDs
Map<Volume, List<String>> perVolume = new Hashtable<Volume, List<String>>();
do {
l = layout.getFileList(l, 1024 * 4);
for (String fileName : l.files.keySet()) {
filesChecked++;
// parse volume and file ID
String[] tmp = fileName.split(":");
String volId = tmp[0];
String fileId = tmp[1];
// create a new volume and add it to the map if
// necessary
Volume vol = new Volume(volId);
List<String> flist = perVolume.get(vol);
// if the volume doesn't exist in the map yet ...
if (flist == null) {
// determine the list of snapshot timestamps for the
// volume
// first, determine the volume name
ServiceSet s = master.getDIRClient().xtreemfs_service_get_by_uuid(
null, RPCAuthentication.authNone, RPCAuthentication.userService, vol.id);
if (s.getServicesCount() == 0) {
Logging.logMessage(Logging.LEVEL_WARN, Category.misc, this,
"could not retrieve volume information for '%s' from DIR", vol.id);
continue;
}
// get the MRC responsible for the volume
String volName = s.getServices(0).getName();
vol.mrc = new ServiceUUID(KeyValuePairs.getValue(s.getServices(0).getData()
.getDataList(), "mrc"));
// get the list of snapshot timestamps for the
// volume
RPCResponse<getxattrResponse> tsResponse = null;
String ts = null;
try {
tsResponse = mrcClient.getxattr(vol.mrc.getAddress(),
RPCAuthentication.authNone, uc, getxattrRequest.newBuilder()
.setVolumeName(volName).setPath("").setName(
"xtreemfs.snapshot_time").build());
ts = tsResponse.get().getValue();
StringTokenizer st = new StringTokenizer(ts);
long[] tsArray = new long[st.countTokens()];
for (int i = 0; i < tsArray.length; i++)
tsArray[i] = Long.parseLong(st.nextToken());
vol.timestamps = tsArray;
// add the volume entry to the map
flist = new LinkedList<String>();
perVolume.put(vol, flist);
} finally {
if (tsResponse != null)
tsResponse.freeBuffers();
}
}
flist.add(fileId);
synchronized (this) {
if (!isRunning)
break;
}
}
synchronized (this) {
if (!isRunning)
break;
}
} while (l.hasMore);
// check each volume
for (Entry<Volume, List<String>> entry : perVolume.entrySet()) {
long[] timestamps = entry.getKey().timestamps;
List<String> files = entry.getValue();
for (String fileId : files) {
fileId = entry.getKey().id + ":" + fileId;
// get the metadata; provide any striping policy
// (doesn't matter here ...)
FileMetadata md = layout.getFileMetadataNoCaching(RAID0Impl.getPolicy(Replica
.newBuilder().setReplicationFlags(0).setStripingPolicy(
StripingPolicy.newBuilder().setType(
StripingPolicyType.STRIPING_POLICY_RAID0).setStripeSize(128)
.setWidth(1).build()).build(), 0), fileId);
// determine the set of versions to delete
Map<Integer, Set<Integer>> versionsToDelete = md.getVersionTable()
.cleanup(timestamps);
// delete the objects
for (Entry<Integer, Set<Integer>> v : versionsToDelete.entrySet())
for (int version : v.getValue()) {
// delete the object version if it is not part
// of the file's current version
if (md.getLatestObjectVersion(v.getKey()) != version)
layout.deleteObject(fileId, md, v.getKey(), version);
}
// save the updated version table
if (versionsToDelete.size() != 0)
md.getVersionTable().save();
synchronized (this) {
if (!isRunning)
break;
}
}
}
synchronized (this) {
if (!isRunning)
break;
}
isRunning = false;
} while (!quit);
} catch (Exception thr) {
Logging.logError(Logging.LEVEL_ERROR, this, thr);
}
notifyStopped();
}
public class Volume {
final String id;
ServiceUUID mrc = null;
long[] timestamps;
/**
* Constructor for Volumes with unknown MRC.
*/
Volume(String volId) {
this.id = volId;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof Volume))
return false;
return id.equals(((Volume) obj).id);
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return this.id.hashCode();
}
}
}
|
/**
* Write a description of class Class here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Class
{
// instance variables - replace the example below with your own
private int x;
public Class()
{
}
public long FindSmallestDivisibleNumber(int low, int high)
{
int sonuc = 1;
while(true)
{
int i;
for(i = low; i <= high; i++)
{
if(sonuc % i != 0)
{
sonuc++;
break;
}
}
if(i == (high + 1))
break;
}
return sonuc;
}
}
|
package com.yixin.kepler.component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import com.yixin.dsc.util.MailMessageUtils;
import com.yixin.kepler.common.RedisClientUtil;
import java.util.concurrent.TimeUnit;
/**
* redis分布式🔒
* @author sukang
* @date 2018-07-04 19:00:13
*/
@Component
public class RedisDistributedLock implements DistributedLock{
private Logger logger = LoggerFactory.getLogger(getClass());
private RedisClientUtil redisClientUtil;
private ApplicationContext ioc;
@Autowired
public RedisDistributedLock(RedisClientUtil redisClientUtil, ApplicationContext applicationContext) {
this.redisClientUtil = redisClientUtil;
this.ioc = applicationContext;
}
@Override
public Boolean lock(String lockKey, TimeUnit timeUnit, long timeout) {
logger.info("键值{}开始添加redis锁",lockKey);
long currentTimeMillis = System.currentTimeMillis();
//获取超时时间的ms
long lockTimeMs = timeUnit.toMillis(timeout);
long setNx;
try {
setNx = redisClientUtil.setnx(lockKey,
String.valueOf(currentTimeMillis + lockTimeMs));
} catch (Exception e) {
logger.error("{}设置锁异常",lockKey,e);
pubEvent(lockKey,e);
return true;
}
if (setNx == 1 ) {
logger.info("键值{}获取redis锁成功",lockKey);
try {
redisClientUtil.expire(lockKey, (int)timeUnit.toSeconds(timeout));
} catch (Exception e) {
logger.error("{}设置超时时间异常,异常信息为",lockKey,e);
}
return true;
}
String lockTime = redisClientUtil.getValueByKey(lockKey);
if (lockTime != null && Long.valueOf(lockTime)
< System.currentTimeMillis() ) {
String oldValue = redisClientUtil.getSet(lockKey,
String.valueOf(currentTimeMillis + lockTimeMs));
//将两次获取的值对比
if (oldValue != null && oldValue.equals(lockTime)) {
return true;
}
}
return false;
}
@Override
public Boolean unLock(String lockKey) {
try {
redisClientUtil.delByKey(lockKey);
logger.info("{}解锁成功",lockKey);
} catch (Exception e) {
logger.error("解锁{}异常,异常原因为",lockKey,e);
pubEvent(lockKey.concat("解锁异常"),e);
}
return true;
}
private void pubEvent(String context,Exception exception){
//发送邮件事件
MailMessageUtils.sendException(exception, context);
}
}
|
package Peli;
public class Pelilauta {
private final int LEVEYS = 8;
private final int KORKEUS = 8;
public Pelilauta() {
}
}
|
package com.train;
public class Ticket {
int tickets;
int roundTripTickets;
public Ticket(int tickets, int roundTripTickets) {
this.tickets = tickets;
this.roundTripTickets = roundTripTickets;
}
public void print(){
System.out.println("Total tickets: " + tickets);
System.out.println("Round-trip: " + roundTripTickets);
System.out.println("Total: " + ((tickets-roundTripTickets)*1000 + roundTripTickets*2000*0.9));
}
}
|
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wso2.charon3.core.config;
/**
* This defines constants for extension schema builder.
*/
public class SCIMConfigConstants {
public static final String ATTRIBUTE_URI = "attributeURI";
public static final String ATTRIBUTE_NAME = "attributeName";
public static final String DATA_TYPE = "type";
public static final String MULTIVALUED = "multiValued";
public static final String DESCRIPTION = "description";
public static final String REQUIRED = "required";
public static final String CASE_EXACT = "caseExact";
public static final String MUTABILITY = "mutability";
public static final String RETURNED = "returned";
public static final String UNIQUENESS = "uniqueness";
public static final String SUB_ATTRIBUTES = "subAttributes";
public static final String CANONICAL_VALUES = "canonicalValues";
public static final String REFERENCE_TYPES = "referenceTypes";
public static final String PATCH = "true";
public static final String BULK = "true";
public static final String SORT = "true";
public static final String ETAG = "true";
public static final String FILTER = "filter";
public static final String CHNAGE_PASSWORD = "true";
public static final String DOCUMENTATION_URL = "http://example.com/help/scim.html";
public static final String MAX_OPERATIONS = "1000";
public static final String MAX_PAYLOAD_SIZE = "1048576";
public static final String MAX_RESULTS = "200";
public static final String AUTHENTICATION_SCHEMES = "authenticationSchemes";
public static final String SCIM_SCHEMA_EXTENSION_CONFIG = "scim2-schema-extension.config";
public static final String ATTRIBUTES = "attributes";
public static final String NAME = "name";
}
|
package hello;
public class UnicodeTest {
public static void main(String[] args) {
System.out.println("안녕하세요, 자바");
}
}
|
package java_code.view;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.pubnub.api.PubNub;
import com.pubnub.api.callbacks.SubscribeCallback;
import com.pubnub.api.models.consumer.PNStatus;
import com.pubnub.api.models.consumer.pubsub.PNMessageResult;
import com.pubnub.api.models.consumer.pubsub.PNPresenceEventResult;
import com.pubnub.api.models.consumer.pubsub.PNSignalResult;
import com.pubnub.api.models.consumer.pubsub.message_actions.PNMessageActionResult;
import com.pubnub.api.models.consumer.pubsub.objects.PNMembershipResult;
import com.pubnub.api.models.consumer.pubsub.objects.PNSpaceResult;
import com.pubnub.api.models.consumer.pubsub.objects.PNUserResult;
import java_code.controller.Controller;
import java_code.controller.ServerConnection;
import java_code.model.Patron;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
public class ManagerView {
Controller controller;
ServerConnection conn;
@FXML
private ListView<String> waitlistView;
@FXML
private Label venueNameLabel;
@FXML
private TextField waitPerPatronField;
@FXML
private Label totalWaitTimeLabel;
@FXML
private TextField newUsernameField;
@FXML
private PasswordField newPasswordField;
@FXML
private PasswordField passwordVerificationField;
@FXML
private Label errorText;
/**
* Initializes the scene.
*/
@FXML
protected void initialize(){
conn = ServerConnection.getInstance();
controller = SeatDApplication.getController();
SeatDApplication.setToDefaultWindowSize();
registerManagerPageDataListener();
conn.getManagerPageData(controller.getVenueID());
waitPerPatronField.setFocusTraversable(false);
errorText.setVisible(false);
}
/**
* Handles all messages that will update the management page dynamically.
*/
public void registerManagerPageDataListener(){
conn.getPubNub().addListener(new SubscribeCallback() {
@Override
public void status(@NotNull PubNub pubnub, @NotNull PNStatus pnStatus) {}
@Override
public void message(@NotNull PubNub pubnub, @NotNull PNMessageResult message) {
String type = message.getMessage().getAsJsonObject().get("type").getAsString();//Message type
if(type.equals("updateAllData"))
updateWaitTime(message);
if(type.equals("updateWaitlist") &&
message.getMessage().getAsJsonObject().get("data").getAsJsonObject().get("venueID").
getAsInt() == controller.getVenueID())
updateWaitlistList(message);
if(type.equals("badWaitPerPatronUpdate") &&
message.getMessage().getAsJsonObject().get("data").getAsJsonObject().get("venueID").
getAsInt() == controller.getVenueID()){
waitPerPatronField.clear();
waitPerPatronField.setFocusTraversable(false);
}
if(!type.equals("managerViewData"))
return;
Platform.runLater(()->{waitlistView.getItems().clear();});
JsonObject data = message.getMessage().getAsJsonObject().get("data").getAsJsonObject();
//Extract data: into (venueName, waitPerPatronValue, waitlistPatrons)
JsonArray waitlistNames = data.get("waitlistNames").getAsJsonArray();
JsonArray waitlistEmails = data.get("waitlistEmails").getAsJsonArray();
Iterator<JsonElement> waitNameIt = waitlistNames.iterator();
Iterator<JsonElement> waitEmailIt = waitlistEmails.iterator();
ArrayList<Patron> waitlistPatrons = new ArrayList<>();
while(waitNameIt.hasNext() && waitEmailIt.hasNext())
waitlistPatrons.add(new Patron(waitNameIt.next().getAsString(), waitEmailIt.next().getAsString()));
ObservableList<String> waitlistViewList = FXCollections.observableArrayList();
if(!waitlistPatrons.isEmpty()){
for(int i = 0; i < waitlistPatrons.size(); i++)
waitlistViewList.add(Integer.toString(i + 1).concat(". ").
concat(waitlistPatrons.get(i).toString()));
controller.setTmpWaitlistOrder(waitlistPatrons);
}else
waitlistViewList.add("Nobody is on the waitlist your venue sucks.");
Platform.runLater(()->{waitlistView.setItems(waitlistViewList);});
controller.setManagerUsername(data.get("username").getAsString());
controller.setManagerPassword(data.get("password").getAsString());
conn.refreshWaitListData();
//Run Extraction
Platform.runLater(()->{
totalWaitTimeLabel.setText(String.valueOf(data.get("waitPerPatron").getAsInt() * waitlistPatrons.size()));
venueNameLabel.setText(data.get("name").getAsString());
waitPerPatronField.setPromptText(data.get("waitPerPatron").getAsString());
newUsernameField.setPromptText(controller.getManagerUsername());
newPasswordField.setPromptText(controller.getManagerPassword());
passwordVerificationField.setPromptText("Rewrite New Password");
});
}
@Override
public void presence(@NotNull PubNub pubnub, @NotNull PNPresenceEventResult pnPresenceEventResult) {}
@Override
public void signal(@NotNull PubNub pubnub, @NotNull PNSignalResult pnSignalResult) {}
@Override
public void user(@NotNull PubNub pubnub, @NotNull PNUserResult pnUserResult) {}
@Override
public void space(@NotNull PubNub pubnub, @NotNull PNSpaceResult pnSpaceResult) {}
@Override
public void membership(@NotNull PubNub pubnub, @NotNull PNMembershipResult pnMembershipResult) {}
@Override
public void messageAction(@NotNull PubNub pubnub, @NotNull PNMessageActionResult pnMessageActionResult) {}
});
}
/**
* Runs when a waitlist is updated, or its wait time.
* @param message
*/
private void updateWaitTime(PNMessageResult message){
JsonArray waitTimes = message.getMessage().getAsJsonObject().get("data").getAsJsonObject().
get("waitTimes").getAsJsonArray();
Iterator<JsonElement> waitTimeIt = waitTimes.iterator();
ArrayList<Integer> waitlistTimes = new ArrayList<>();
while(waitTimeIt.hasNext())
waitlistTimes.add(waitTimeIt.next().getAsInt());
Platform.runLater(()->{totalWaitTimeLabel.setText(Integer.toString(waitlistTimes.get(controller.getVenueID())));});
}
/**
* Runs when a person is added to the waitlist, to update all relevant management pages.
* @param message
*/
private void updateWaitlistList(PNMessageResult message){
Platform.runLater(()->{waitlistView.getItems().clear();});
JsonObject data = message.getMessage().getAsJsonObject().get("data").getAsJsonObject();
JsonArray names = data.get("names").getAsJsonArray();
JsonArray emails = data.get("emails").getAsJsonArray();
Iterator<JsonElement> nameElements = names.iterator();
Iterator<JsonElement> emailElements = emails.iterator();
ArrayList<Patron> patrons = new ArrayList<>();
while(nameElements.hasNext() && emailElements.hasNext())
patrons.add(new Patron(nameElements.next().getAsString(), emailElements.next().getAsString()));
ObservableList<String> waitlistViewList = FXCollections.observableArrayList();
if(!patrons.isEmpty()){
for(int i = 0; i < patrons.size(); i++)
waitlistViewList.add(Integer.toString(i + 1).concat(". ").
concat(patrons.get(i).toString()));
controller.setTmpWaitlistOrder(patrons);
}else
waitlistViewList.add("Nobody is on the waitlist your venue sucks.");
Platform.runLater(()->{
waitlistView.setItems(waitlistViewList);
totalWaitTimeLabel.setText(Integer.toString(data.get("waittime").getAsInt()));
});
}
/**
* Checks if a new wait time per patron was entered, if so, it updates the controller and refreshes the scene.
*/
public void onUpdateWaitPerPatronClicked(){
String entry = waitPerPatronField.getText();
if(!entry.isEmpty() && !entry.equals((waitPerPatronField.getPromptText())) && Integer.valueOf(entry) > 0)
conn.updateWaitPerPatron(controller.getVenueID(), Integer.parseInt(waitPerPatronField.getText()));
waitPerPatronField.clear();
}
public void onDeleteClicked(){
if(!waitlistView.getSelectionModel().isEmpty()){
Patron tmp = getPatronFromStringAr(waitlistView.getSelectionModel().getSelectedItem().split(" | "));
conn.deleteWaitListPatron(controller.getVenueID(), tmp.getName(), tmp.getEmail());
}
}
/**
* Moves the selected patron down one, if possible, in the temporary list.
*/
public void onDownClicked(){
if(waitlistView.getSelectionModel().isEmpty())
return;
Patron selected = getPatronFromStringAr(waitlistView.getSelectionModel().getSelectedItem().split(" | "));
int selectedIndex = waitlistView.getSelectionModel().getSelectedIndex();
if(selectedIndex == -1 || selectedIndex == controller.getTmpWaitlistOrder().size())
return;
Patron tmp = controller.getTmpWaitlistOrder().get(selectedIndex + 1);
controller.getTmpWaitlistOrder().set(selectedIndex + 1, selected);
controller.getTmpWaitlistOrder().set(selectedIndex, tmp);
waitlistView.getItems().clear();
ObservableList<String> waitlistViewList = FXCollections.observableArrayList();
for(int i = 0; i < controller.getTmpWaitlistOrder().size(); i++)
waitlistViewList.add(Integer.toString(i + 1).concat(". ").
concat(controller.getTmpWaitlistOrder().get(i).toString()));
waitlistView.setItems(waitlistViewList);
waitlistView.getSelectionModel().selectIndices(selectedIndex + 1);
}
/**
* Moves the selected patron up one, if possible, in the temporary list.
*/
public void onUpClicked(){
if(waitlistView.getSelectionModel().isEmpty())
return;
Patron selected = getPatronFromStringAr(waitlistView.getSelectionModel().getSelectedItem().split(" | "));
int selectedIndex = waitlistView.getSelectionModel().getSelectedIndex();
if(selectedIndex < 1)
return;
Patron tmp = controller.getTmpWaitlistOrder().get(selectedIndex - 1);
controller.getTmpWaitlistOrder().set(selectedIndex - 1, selected);
controller.getTmpWaitlistOrder().set(selectedIndex, tmp);
waitlistView.getItems().clear();
ObservableList<String> waitlistViewList = FXCollections.observableArrayList();
for(int i = 0; i < controller.getTmpWaitlistOrder().size(); i++)
waitlistViewList.add(Integer.toString(i + 1).concat(". ").
concat(controller.getTmpWaitlistOrder().get(i).toString()));
waitlistView.setItems(waitlistViewList);
waitlistView.getSelectionModel().selectIndices(selectedIndex - 1);
}
/**
* Saves the temporary list to the database.
*/
public void onSavedListClicked(){
conn.updateWaitListFromMove(controller.getVenueID(), controller.getTmpWaitlistOrder());
}
/**
* Updates the manager's username and/or password
*/
public void onSaveChangesClicked(){
//No new info present
if(newUsernameField.getText().isEmpty() && newPasswordField.getText().isEmpty())
return;
//All new info present, passwords match
if(!newUsernameField.getText().isEmpty() && !newPasswordField.getText().isEmpty() &&
newPasswordField.getText().equals(passwordVerificationField.getText())){
conn.updateManagerInfo(controller.getVenueID(), newUsernameField.getText(), newPasswordField.getText());
newUsernameField.clear();
newPasswordField.clear();
passwordVerificationField.clear();
errorText.setVisible(false);
return;
}
//New passwords present and match
if(newUsernameField.getText().isEmpty() && newPasswordField.getText().equals(passwordVerificationField.getText())){
conn.updateManagerInfo(controller.getVenueID(), controller.getManagerUsername(), newPasswordField.getText());
newPasswordField.clear();
passwordVerificationField.clear();
errorText.setVisible(false);
return;
}
//New username present
if(!newUsernameField.getText().isEmpty() && newPasswordField.getText().isEmpty() && passwordVerificationField.getText().isEmpty()){
conn.updateManagerUsername(controller.getVenueID(), newUsernameField.getText());
newUsernameField.clear();
errorText.setVisible(false);
return;
}
errorText.setVisible(true);
}
/**
* Logs the manager out and returns them to the venue scene.
*/
public void onLogoutButtonClicked(){
try {
SeatDApplication.getCoordinator().showVenueListScene();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Used to extract a Patron object from the list representation in the manager page, showing the current waitlist.
* @param str
* @return
*/
private Patron getPatronFromStringAr(String[] str){
String user_name = "";
String email = "";
boolean usernameRetieved = false;
for(int i = 0; i < str.length; i++) {
if (i > 0 && !usernameRetieved && !str[i].equals("|"))
user_name = user_name.concat( " " + str[i]);
if(usernameRetieved)
email = email.concat(" " + str[i]);
if(str[i].equals("|"))
usernameRetieved = true;
}
return new Patron(user_name.trim(), email.trim());
}
}
|
package com.example.responsimobile.model;
import com.google.gson.annotations.SerializedName;
public class ResponseDataHarian{
@SerializedName("status_code")
private int statusCode;
@SerializedName("data")
private DataHarian dataHarian;
public int getStatusCode(){
return statusCode;
}
public DataHarian getDataHarian(){
return dataHarian;
}
}
|
package holidayinventorycore;
import java.util.*;
import java.io.Serializable;
import de.hybris.platform.util.*;
import de.hybris.platform.core.*;
import de.hybris.platform.jalo.JaloBusinessException;
import de.hybris.platform.jalo.type.*;
import de.hybris.platform.persistence.type.*;
import de.hybris.platform.persistence.enumeration.*;
import de.hybris.platform.persistence.property.PersistenceManager;
import de.hybris.platform.persistence.*;
/**
* Generated by hybris Platform.
*/
@SuppressWarnings({"cast","unused","boxing","null", "PMD"})
public class GeneratedTypeInitializer extends AbstractTypeInitializer
{
/**
* Generated by hybris Platform.
*/
public GeneratedTypeInitializer( ManagerEJB manager, Map params )
{
super( manager, params );
}
/**
* Generated by hybris Platform.
*/
@Override
protected void performRemoveObjects( ManagerEJB manager, Map params ) throws JaloBusinessException
{
// no-op by now
}
/**
* Generated by hybris Platform.
*/
@Override
protected final void performCreateTypes( final ManagerEJB manager, Map params ) throws JaloBusinessException
{
// performCreateTypes
createItemType(
"HolidayInventoryRequest",
"AbstractInventoryRequest",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayInventoryRequest.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayInventoryRequest",
false,
null,
false
);
createItemType(
"AbstractHolidayInventoryDetail",
"AbstractInventoryDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.AbstractHolidayInventoryDetail.class,
null,
false,
null,
true
);
createItemType(
"HolidayInventoryDetail",
"AbstractHolidayInventoryDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayInventoryDetail.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayInventoryDetail",
false,
null,
false
);
createItemType(
"PackageInclusionInfo",
"GenericItem",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.PackageInclusionInfo.class,
"de.hybris.platform.persistence.holidayinventorycore_PackageInclusionInfo",
false,
null,
false
);
createItemType(
"HolidayRoomInfo",
"GenericItem",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayRoomInfo.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayRoomInfo",
false,
null,
false
);
createItemType(
"HolidayDetailedRoomInfo",
"HolidayRoomInfo",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayDetailedRoomInfo.class,
null,
false,
null,
false
);
createItemType(
"HolidayRoomLevelInvDetail",
"HolidayInventoryDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayRoomLevelInvDetail.class,
null,
false,
null,
true
);
createItemType(
"HolidayPaxRoomInvDetail",
"HolidayRoomLevelInvDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayPaxRoomInvDetail.class,
null,
false,
null,
false
);
createItemType(
"HolidayAnyRoomInvDetail",
"HolidayRoomLevelInvDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayAnyRoomInvDetail.class,
null,
false,
null,
false
);
createItemType(
"HolidayRoomTypeInvDetail",
"HolidayRoomLevelInvDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.HolidayRoomTypeInvDetail.class,
null,
false,
null,
false
);
createItemType(
"TravelRangeHolidayInvDetails",
"HolidayInventoryDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.TravelRangeHolidayInvDetails.class,
null,
false,
null,
false
);
createItemType(
"SpecificTravelDatesHolidayInvDetails",
"HolidayInventoryDetail",
com.cnk.travelogix.datamodel.holiday.inventory.jalo.SpecificTravelDatesHolidayInvDetails.class,
null,
false,
null,
false
);
createItemType(
"HolidayCutOffAndCharges",
"CutOffsAndCharges",
com.cnk.travelogix.holiday.inventory.core.jalo.HolidayCutOffAndCharges.class,
null,
false,
null,
false
);
createItemType(
"HolidayInvSupplierAdvanceDefinition",
"GenericItem",
com.cnk.travelogix.holiday.inventory.core.jalo.HolidayInvSupplierAdvanceDefinition.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayInvSupplierAdvanceDefinition",
false,
null,
false
);
createItemType(
"HolidayInventoryDefinition",
"AbstractInventoryDefinition",
com.cnk.travelogix.holiday.inventory.core.jalo.HolidayInventoryDefinition.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayInventoryDefinition",
false,
null,
false
);
createItemType(
"HolidayCompanySpecificInventory",
"HolidayInventoryDetail",
com.cnk.travelogix.holiday.inventory.core.jalo.HolidayCompanySpecificInventory.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayCompanySpecificInventory",
false,
null,
false
);
createItemType(
"HolidayPenaltyCharges",
"GenericItem",
com.cnk.travelogix.holiday.inventory.core.jalo.HolidayPenaltyCharges.class,
"de.hybris.platform.persistence.holidayinventorycore_HolidayPenaltyCharges",
false,
null,
false
);
createRelationType(
"HolidayInventoryDetailToHolidayRoomInfo",
null,
true
);
createRelationType(
"HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges",
null,
true
);
createRelationType(
"HolidayInventoryDefinition2HolidayCompanySpecificInventory",
null,
true
);
createRelationType(
"HolidayPenaltyCharges2HolidayCutOffAndCharges",
null,
true
);
createEnumerationType(
"ValidForType",
null
);
createEnumerationType(
"InventoryRequestBy",
null
);
createEnumerationType(
"ThresholdApplicableOn",
null
);
}
/**
* Generated by hybris Platform.
*/
@Override
protected final void performModifyTypes( final ManagerEJB manager, Map params ) throws JaloBusinessException
{
// performModifyTypes
single_createattr_HolidayInventoryRequest_product();
single_createattr_HolidayInventoryRequest_productFlavour();
single_createattr_HolidayInventoryRequest_priceRangeFrom();
single_createattr_HolidayInventoryRequest_priceRangeTo();
single_createattr_HolidayInventoryRequest_inventoryDefnitionCode();
single_createattr_HolidayInventoryRequest_isFlightIncluded();
single_createattr_HolidayInventoryRequest_packageCategory();
single_createattr_AbstractHolidayInventoryDetail_noOfPax();
single_createattr_AbstractHolidayInventoryDetail_anyRooms();
single_createattr_AbstractHolidayInventoryDetail_roomTypeSingle();
single_createattr_AbstractHolidayInventoryDetail_roomTypeDouble();
single_createattr_AbstractHolidayInventoryDetail_roomTypeTriple();
single_createattr_AbstractHolidayInventoryDetail_daysOfWeek();
single_createattr_AbstractHolidayInventoryDetail_time();
single_createattr_AbstractHolidayInventoryDetail_specificDates();
single_createattr_AbstractHolidayInventoryDetail_travelDateRange();
single_createattr_PackageInclusionInfo_serviceBasedDayWiseItineraries();
single_createattr_PackageInclusionInfo_itineraryBasedDayWiseItineraries();
single_createattr_HolidayRoomInfo_city();
single_createattr_HolidayRoomInfo_checkInDate();
single_createattr_HolidayRoomInfo_checkOutDate();
single_createattr_HolidayRoomInfo_accommodation();
single_createattr_HolidayRoomInfo_rating();
single_createattr_HolidayRoomInfo_roomCategory();
single_createattr_HolidayDetailedRoomInfo_noOfNights();
single_createattr_HolidayDetailedRoomInfo_packageInclusion();
single_createattr_HolidayPaxRoomInvDetail_noOfRooms();
single_createattr_HolidayCutOffAndCharges_priceComponent();
single_createattr_HolidayCutOffAndCharges_applicableOn();
single_createattr_HolidayInvSupplierAdvanceDefinition_cutOffForFreeSale();
single_createattr_HolidayInvSupplierAdvanceDefinition_blockOutDates();
single_createattr_HolidayInventoryDefinition_overBookingLimit();
single_createattr_HolidayInventoryDefinition_product();
single_createattr_HolidayInventoryDefinition_flavor();
single_createattr_HolidayInventoryDefinition_packageCategory();
single_createattr_HolidayInventoryDefinition_market();
single_createattr_HolidayInventoryDefinition_requestedBy();
single_createattr_HolidayInventoryDefinition_advanceDefinition();
single_createattr_HolidayCompanySpecificInventory_sbu();
single_createattr_HolidayCompanySpecificInventory_bu();
single_createattr_HolidayCompanySpecificInventory_market();
single_createattr_HolidayCompanySpecificInventory_distributionChannel();
single_createattr_HolidayCompanySpecificInventory_division();
single_createattr_HolidayCompanySpecificInventory_salesOffice();
single_createattr_HolidayCompanySpecificInventory_stopSales();
single_createattr_HolidayCompanySpecificInventory_liabilityOnUtilization();
single_createattr_HolidayPenaltyCharges_validateForType();
single_createattr_HolidayPenaltyCharges_definedBy();
single_createattr_HolidayPenaltyCharges_appliedOn();
single_createattr_HolidayPenaltyCharges_thresholdAppliedOn();
createRelationAttributes(
"HolidayInventoryDetailToHolidayRoomInfo",
false,
"holidayInventoryDetail",
"HolidayInventoryDetail",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
false,
false,
CollectionType.COLLECTION,
"holidayProductRoomInfo",
"HolidayRoomInfo",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
false,
CollectionType.COLLECTION
);
createRelationAttributes(
"HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges",
false,
"HolidayInvSupplierAdvanceDefinition",
"HolidayInvSupplierAdvanceDefinition",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
false,
false,
CollectionType.COLLECTION,
"penaltyCharges",
"HolidayPenaltyCharges",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
false,
CollectionType.COLLECTION
);
createRelationAttributes(
"HolidayInventoryDefinition2HolidayCompanySpecificInventory",
false,
"holidayInventoryDefinition",
"HolidayInventoryDefinition",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
false,
false,
CollectionType.COLLECTION,
"distributedInventories",
"HolidayCompanySpecificInventory",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
false,
CollectionType.COLLECTION
);
createRelationAttributes(
"HolidayPenaltyCharges2HolidayCutOffAndCharges",
false,
"holidayPenaltyCharges",
"HolidayPenaltyCharges",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
false,
false,
CollectionType.COLLECTION,
"charges",
"HolidayCutOffAndCharges",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
false,
CollectionType.COLLECTION
);
}
public void single_createattr_HolidayInventoryRequest_product() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"product",
null,
"HolidayProduct",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryRequest_productFlavour() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"productFlavour",
null,
"HolidayFlavor",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryRequest_priceRangeFrom() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"priceRangeFrom",
null,
"java.math.BigDecimal",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryRequest_priceRangeTo() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"priceRangeTo",
null,
"java.math.BigDecimal",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryRequest_inventoryDefnitionCode() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"inventoryDefnitionCode",
null,
"java.lang.String",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryRequest_isFlightIncluded() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"isFlightIncluded",
null,
"java.lang.Boolean",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryRequest_packageCategory() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryRequest",
"packageCategory",
null,
"PackageCategory",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_noOfPax() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"noOfPax",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_anyRooms() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"anyRooms",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_roomTypeSingle() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"roomTypeSingle",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_roomTypeDouble() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"roomTypeDouble",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_roomTypeTriple() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"roomTypeTriple",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_daysOfWeek() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"daysOfWeek",
null,
"WeekDayCollection",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_time() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"time",
null,
"java.lang.String",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_specificDates() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"specificDates",
null,
"DateCollection",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_AbstractHolidayInventoryDetail_travelDateRange() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"AbstractHolidayInventoryDetail",
"travelDateRange",
null,
"de.hybris.platform.util.StandardDateRange",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_PackageInclusionInfo_serviceBasedDayWiseItineraries() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"PackageInclusionInfo",
"serviceBasedDayWiseItineraries",
null,
"AbstractDayWiseItinerary",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_PackageInclusionInfo_itineraryBasedDayWiseItineraries() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"PackageInclusionInfo",
"itineraryBasedDayWiseItineraries",
null,
"DayWiseItinerary",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayRoomInfo_city() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayRoomInfo",
"city",
null,
"City",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayRoomInfo_checkInDate() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayRoomInfo",
"checkInDate",
null,
"java.util.Date",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayRoomInfo_checkOutDate() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayRoomInfo",
"checkOutDate",
null,
"java.util.Date",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayRoomInfo_accommodation() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayRoomInfo",
"accommodation",
null,
"Accommodation",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayRoomInfo_rating() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayRoomInfo",
"rating",
null,
"Rating",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayRoomInfo_roomCategory() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayRoomInfo",
"roomCategory",
null,
"RoomCategory",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayDetailedRoomInfo_noOfNights() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayDetailedRoomInfo",
"noOfNights",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayDetailedRoomInfo_packageInclusion() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayDetailedRoomInfo",
"packageInclusion",
null,
"PackageInclusionInfo",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayPaxRoomInvDetail_noOfRooms() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayPaxRoomInvDetail",
"noOfRooms",
null,
"java.lang.Integer",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCutOffAndCharges_priceComponent() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCutOffAndCharges",
"priceComponent",
null,
"NonAirPriceComponentType",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCutOffAndCharges_applicableOn() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCutOffAndCharges",
"applicableOn",
null,
"ThresholdApplicableOn",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInvSupplierAdvanceDefinition_cutOffForFreeSale() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInvSupplierAdvanceDefinition",
"cutOffForFreeSale",
null,
"CutOffForFreeSale",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInvSupplierAdvanceDefinition_blockOutDates() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInvSupplierAdvanceDefinition",
"blockOutDates",
null,
"StandardDateRangeSet",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_overBookingLimit() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"overBookingLimit",
null,
"java.lang.Long",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_product() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"product",
null,
"HolidayProduct",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_flavor() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"flavor",
null,
"HolidayFlavor",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_packageCategory() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"packageCategory",
null,
"PackageCategory",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_market() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"market",
null,
"Market",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_requestedBy() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"requestedBy",
null,
"InventoryRequestBy",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayInventoryDefinition_advanceDefinition() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayInventoryDefinition",
"advanceDefinition",
null,
"HolidayInvSupplierAdvanceDefinition",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_sbu() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"sbu",
null,
"StrategicBusinessUnit",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_bu() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"bu",
null,
"BusinessUnit",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_market() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"market",
null,
"Market",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_distributionChannel() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"distributionChannel",
null,
"DistributionChannel",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_division() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"division",
null,
"Division",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_salesOffice() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"salesOffice",
null,
"SalesOffice",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_stopSales() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"stopSales",
null,
"java.Lang.Boolean",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayCompanySpecificInventory_liabilityOnUtilization() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayCompanySpecificInventory",
"liabilityOnUtilization",
null,
"java.Lang.Double",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayPenaltyCharges_validateForType() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayPenaltyCharges",
"validateForType",
null,
"ValidForType",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayPenaltyCharges_definedBy() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayPenaltyCharges",
"definedBy",
null,
"DefinedBy",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayPenaltyCharges_appliedOn() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayPenaltyCharges",
"appliedOn",
null,
"AppliedOn",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
public void single_createattr_HolidayPenaltyCharges_thresholdAppliedOn() throws JaloBusinessException
{
Map sqlColumnDefinitions = null;
createPropertyAttribute(
"HolidayPenaltyCharges",
"thresholdAppliedOn",
null,
"ThresholdApplicableOn",
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
null,
sqlColumnDefinitions
);
}
/**
* Generated by hybris Platform.
*/
@Override
protected final void performCreateObjects( final ManagerEJB manager, Map params ) throws JaloBusinessException
{
// performCreateObjects
createEnumerationValues(
"ValidForType",
false,
Arrays.asList( new String[] {
"ALL_TOUR_DATES",
"SPECIFIC_TOUR_DATES"
} )
);
createEnumerationValues(
"InventoryRequestBy",
false,
Arrays.asList( new String[] {
"PAX",
"ROOMS"
} )
);
createEnumerationValues(
"ThresholdApplicableOn",
false,
Arrays.asList( new String[] {
"TOUR_DATE",
"TOTAL_UTILIZATION"
} )
);
single_setRelAttributeProperties_HolidayInventoryDetailToHolidayRoomInfo_source();
single_setRelAttributeProperties_HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges_source();
single_setRelAttributeProperties_HolidayInventoryDefinition2HolidayCompanySpecificInventory_source();
single_setRelAttributeProperties_HolidayPenaltyCharges2HolidayCutOffAndCharges_source();
single_setRelAttributeProperties_HolidayInventoryDetailToHolidayRoomInfo_target();
single_setRelAttributeProperties_HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges_target();
single_setRelAttributeProperties_HolidayInventoryDefinition2HolidayCompanySpecificInventory_target();
single_setRelAttributeProperties_HolidayPenaltyCharges2HolidayCutOffAndCharges_target();
connectRelation(
"HolidayInventoryDetailToHolidayRoomInfo",
false,
"holidayInventoryDetail",
"HolidayInventoryDetail",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
"holidayProductRoomInfo",
"HolidayRoomInfo",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
true
);
connectRelation(
"HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges",
false,
"HolidayInvSupplierAdvanceDefinition",
"HolidayInvSupplierAdvanceDefinition",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
"penaltyCharges",
"HolidayPenaltyCharges",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
true
);
connectRelation(
"HolidayInventoryDefinition2HolidayCompanySpecificInventory",
false,
"holidayInventoryDefinition",
"HolidayInventoryDefinition",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
"distributedInventories",
"HolidayCompanySpecificInventory",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
true
);
connectRelation(
"HolidayPenaltyCharges2HolidayCutOffAndCharges",
false,
"holidayPenaltyCharges",
"HolidayPenaltyCharges",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
"charges",
"HolidayCutOffAndCharges",
true,
de.hybris.platform.jalo.type.AttributeDescriptor.READ_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.WRITE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.OPTIONAL_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.REMOVE_FLAG|de.hybris.platform.jalo.type.AttributeDescriptor.SEARCH_FLAG,
true,
true
);
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayInventoryRequest",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayInventoryRequest_product();
single_setAttributeProperties_HolidayInventoryRequest_productFlavour();
single_setAttributeProperties_HolidayInventoryRequest_priceRangeFrom();
single_setAttributeProperties_HolidayInventoryRequest_priceRangeTo();
single_setAttributeProperties_HolidayInventoryRequest_inventoryDefnitionCode();
single_setAttributeProperties_HolidayInventoryRequest_isFlightIncluded();
single_setAttributeProperties_HolidayInventoryRequest_packageCategory();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"AbstractHolidayInventoryDetail",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_AbstractHolidayInventoryDetail_noOfPax();
single_setAttributeProperties_AbstractHolidayInventoryDetail_anyRooms();
single_setAttributeProperties_AbstractHolidayInventoryDetail_roomTypeSingle();
single_setAttributeProperties_AbstractHolidayInventoryDetail_roomTypeDouble();
single_setAttributeProperties_AbstractHolidayInventoryDetail_roomTypeTriple();
single_setAttributeProperties_AbstractHolidayInventoryDetail_daysOfWeek();
single_setAttributeProperties_AbstractHolidayInventoryDetail_time();
single_setAttributeProperties_AbstractHolidayInventoryDetail_specificDates();
single_setAttributeProperties_AbstractHolidayInventoryDetail_travelDateRange();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayInventoryDetail",
false,
true,
true,
null,
customPropsMap
);
}
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"PackageInclusionInfo",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_PackageInclusionInfo_serviceBasedDayWiseItineraries();
single_setAttributeProperties_PackageInclusionInfo_itineraryBasedDayWiseItineraries();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayRoomInfo",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayRoomInfo_city();
single_setAttributeProperties_HolidayRoomInfo_checkInDate();
single_setAttributeProperties_HolidayRoomInfo_checkOutDate();
single_setAttributeProperties_HolidayRoomInfo_accommodation();
single_setAttributeProperties_HolidayRoomInfo_rating();
single_setAttributeProperties_HolidayRoomInfo_roomCategory();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayDetailedRoomInfo",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayDetailedRoomInfo_noOfNights();
single_setAttributeProperties_HolidayDetailedRoomInfo_packageInclusion();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayRoomLevelInvDetail",
false,
true,
true,
null,
customPropsMap
);
}
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayPaxRoomInvDetail",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayPaxRoomInvDetail_noOfRooms();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayAnyRoomInvDetail",
false,
true,
true,
null,
customPropsMap
);
}
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayRoomTypeInvDetail",
false,
true,
true,
null,
customPropsMap
);
}
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"TravelRangeHolidayInvDetails",
false,
true,
true,
null,
customPropsMap
);
}
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"SpecificTravelDatesHolidayInvDetails",
false,
true,
true,
null,
customPropsMap
);
}
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayCutOffAndCharges",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayCutOffAndCharges_priceComponent();
single_setAttributeProperties_HolidayCutOffAndCharges_applicableOn();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayInvSupplierAdvanceDefinition",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayInvSupplierAdvanceDefinition_cutOffForFreeSale();
single_setAttributeProperties_HolidayInvSupplierAdvanceDefinition_blockOutDates();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayInventoryDefinition",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayInventoryDefinition_overBookingLimit();
single_setAttributeProperties_HolidayInventoryDefinition_product();
single_setAttributeProperties_HolidayInventoryDefinition_flavor();
single_setAttributeProperties_HolidayInventoryDefinition_packageCategory();
single_setAttributeProperties_HolidayInventoryDefinition_market();
single_setAttributeProperties_HolidayInventoryDefinition_requestedBy();
single_setAttributeProperties_HolidayInventoryDefinition_advanceDefinition();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayCompanySpecificInventory",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayCompanySpecificInventory_sbu();
single_setAttributeProperties_HolidayCompanySpecificInventory_bu();
single_setAttributeProperties_HolidayCompanySpecificInventory_market();
single_setAttributeProperties_HolidayCompanySpecificInventory_distributionChannel();
single_setAttributeProperties_HolidayCompanySpecificInventory_division();
single_setAttributeProperties_HolidayCompanySpecificInventory_salesOffice();
single_setAttributeProperties_HolidayCompanySpecificInventory_stopSales();
single_setAttributeProperties_HolidayCompanySpecificInventory_liabilityOnUtilization();
{
Map customPropsMap = new HashMap();
setItemTypeProperties(
"HolidayPenaltyCharges",
false,
true,
true,
null,
customPropsMap
);
}
single_setAttributeProperties_HolidayPenaltyCharges_validateForType();
single_setAttributeProperties_HolidayPenaltyCharges_definedBy();
single_setAttributeProperties_HolidayPenaltyCharges_appliedOn();
single_setAttributeProperties_HolidayPenaltyCharges_thresholdAppliedOn();
setDefaultProperties(
"ValidForType",
true,
true,
null
);
setDefaultProperties(
"InventoryRequestBy",
true,
true,
null
);
setDefaultProperties(
"ThresholdApplicableOn",
true,
true,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_product() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"product",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_productFlavour() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"productFlavour",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_priceRangeFrom() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"priceRangeFrom",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_priceRangeTo() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"priceRangeTo",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_inventoryDefnitionCode() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"inventoryDefnitionCode",
true,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_isFlightIncluded() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"isFlightIncluded",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryRequest_packageCategory() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryRequest",
"packageCategory",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_noOfPax() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"noOfPax",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_anyRooms() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"anyRooms",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_roomTypeSingle() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"roomTypeSingle",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_roomTypeDouble() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"roomTypeDouble",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_roomTypeTriple() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"roomTypeTriple",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_daysOfWeek() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"daysOfWeek",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_time() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"time",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_specificDates() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"specificDates",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_AbstractHolidayInventoryDetail_travelDateRange() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"AbstractHolidayInventoryDetail",
"travelDateRange",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_PackageInclusionInfo_serviceBasedDayWiseItineraries() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"PackageInclusionInfo",
"serviceBasedDayWiseItineraries",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_PackageInclusionInfo_itineraryBasedDayWiseItineraries() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"PackageInclusionInfo",
"itineraryBasedDayWiseItineraries",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayRoomInfo_city() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"city",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayRoomInfo_checkInDate() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"checkInDate",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayRoomInfo_checkOutDate() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"checkOutDate",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayRoomInfo_accommodation() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"accommodation",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayRoomInfo_rating() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"rating",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayRoomInfo_roomCategory() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"roomCategory",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayDetailedRoomInfo_noOfNights() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayDetailedRoomInfo",
"noOfNights",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayDetailedRoomInfo_packageInclusion() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayDetailedRoomInfo",
"packageInclusion",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayPaxRoomInvDetail_noOfRooms() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPaxRoomInvDetail",
"noOfRooms",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCutOffAndCharges_priceComponent() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCutOffAndCharges",
"priceComponent",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCutOffAndCharges_applicableOn() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCutOffAndCharges",
"applicableOn",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInvSupplierAdvanceDefinition_cutOffForFreeSale() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInvSupplierAdvanceDefinition",
"cutOffForFreeSale",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInvSupplierAdvanceDefinition_blockOutDates() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInvSupplierAdvanceDefinition",
"blockOutDates",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_overBookingLimit() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"overBookingLimit",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_product() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"product",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_flavor() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"flavor",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_packageCategory() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"packageCategory",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_market() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"market",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_requestedBy() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"requestedBy",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayInventoryDefinition_advanceDefinition() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"advanceDefinition",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_sbu() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"sbu",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_bu() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"bu",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_market() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"market",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_distributionChannel() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"distributionChannel",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_division() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"division",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_salesOffice() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"salesOffice",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_stopSales() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"stopSales",
false,
java.lang.Boolean.FALSE,
"java.lang.Boolean.FALSE",
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayCompanySpecificInventory_liabilityOnUtilization() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"liabilityOnUtilization",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayPenaltyCharges_validateForType() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPenaltyCharges",
"validateForType",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayPenaltyCharges_definedBy() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPenaltyCharges",
"definedBy",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayPenaltyCharges_appliedOn() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPenaltyCharges",
"appliedOn",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setAttributeProperties_HolidayPenaltyCharges_thresholdAppliedOn() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPenaltyCharges",
"thresholdAppliedOn",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayInventoryDetailToHolidayRoomInfo_source() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayRoomInfo",
"holidayInventoryDetail",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayInventoryDetailToHolidayRoomInfo_target() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDetail",
"holidayProductRoomInfo",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges_source() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPenaltyCharges",
"HolidayInvSupplierAdvanceDefinition",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayInvSupplierAdvanceDefinition2HolidayPenaltyCharges_target() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInvSupplierAdvanceDefinition",
"penaltyCharges",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayInventoryDefinition2HolidayCompanySpecificInventory_source() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCompanySpecificInventory",
"holidayInventoryDefinition",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayInventoryDefinition2HolidayCompanySpecificInventory_target() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayInventoryDefinition",
"distributedInventories",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayPenaltyCharges2HolidayCutOffAndCharges_source() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayCutOffAndCharges",
"holidayPenaltyCharges",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
public void single_setRelAttributeProperties_HolidayPenaltyCharges2HolidayCutOffAndCharges_target() throws JaloBusinessException
{
Map customPropsMap = new HashMap();
setAttributeProperties(
"HolidayPenaltyCharges",
"charges",
false,
null,
null,
null,
true,
true,
null,
customPropsMap,
null
);
}
}
|
package com.tech.thrithvam.tiquesinnowner;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
public class ChatList extends AppCompatActivity {
DatabaseHandler db=new DatabaseHandler(ChatList.this);
Long lastMsgTime=0L;
ListView chatHeadsList;
TextView no_items;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat_list);
no_items=(TextView)findViewById(R.id.loadingText);
chatHeadsList = (ListView) findViewById(R.id.chatHeadListView);
if(db.GetUserDetail("UserID")==null){
Toast.makeText(ChatList.this,R.string.please_login,Toast.LENGTH_LONG).show();
Intent intentUser = new Intent(ChatList.this, Login.class);
startActivity(intentUser);
finish();
overridePendingTransition(R.anim.slide_entry1,R.anim.slide_entry2);
}
loadChatHeads();
}
public void loadChatHeads()
{
ArrayList<String[]> chatHeadData=db.GetChatHeads();
if(chatHeadData.size()==0){
chatHeadsList.setVisibility(View.GONE);
no_items.setVisibility(View.VISIBLE);
}
else {
chatHeadsList.setVisibility(View.VISIBLE);
no_items.setVisibility(View.GONE);
if(Long.parseLong(chatHeadData.get(0)[2])>lastMsgTime) {
lastMsgTime=Long.parseLong(chatHeadData.get(0)[2]);
CustomAdapter adapter = new CustomAdapter(ChatList.this, chatHeadData, "chatHeads");
chatHeadsList.setAdapter(adapter);
}
}
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
loadChatHeads();
}
},1000);
}
//---------------Menu creation---------------------------------------------
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.logout:
new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert)//.setTitle(R.string.exit)
.setMessage(R.string.logout_q)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
db.UserLogout();
Intent goHome = new Intent(ChatList.this, Login.class);
goHome.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
goHome.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(goHome);
finish();
overridePendingTransition(R.anim.slide_exit1,R.anim.slide_exit2);
}
}).setNegativeButton(R.string.no, null).show();
default:
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed() {
finish();
overridePendingTransition(R.anim.slide_exit1,R.anim.slide_exit2);
}
}
|
package Flowers; /**
* Created by Yasya on 04.10.16.
*/
import java.util.ArrayList;
import java.util.Iterator;
public class Bouquet extends Item {
public ArrayList<Flower> arrOfF = new ArrayList<Flower>();
public Bouquet() {
arrOfF = new ArrayList<Flower>();
};
public Bouquet(ArrayList<Flower> arr) {
arrOfF = (ArrayList<Flower>)arr.clone();
//System.arraycopy(arr, 0, arrOfF, 0, size);
}
public double getPrice() {
double price = 0;
for (Flower f : this.arrOfF) {
price += f.getPrice();
}
return price;
}
public boolean isFresh() {
boolean isF = true;
for (Flower f : this.arrOfF) {
isF = isF && f.getSpec().getFreshness();
}
return isF;
}
public double getLength() {
double len = 0;
for (Flower f : this.arrOfF) {
len = Double.max(len, f.getSpec().getLen());
}
return len;
}
public Flower findFlowerOfLen(int fromL, int toL) {
for ( Flower f : this.arrOfF){
if(f.getSpec().getLen() <= toL && f.getSpec().getLen() >= fromL) {
return f;
}
}
return null;
}
public String toString() {
String info = "Flowers` info:\n";
for(Flower f : arrOfF) {
info = info + f.toString();
}
info += "Flowers.Bouquet`s price: " + Double.toString(this.getPrice()) + " Length: "
+ Double.toString(this.getLength()) + " Freshness: " + Boolean.toString(this.isFresh()) + "\n";
return info;
}
public void addFlowers(Flower...flowers) {
for (Flower f : flowers) {
arrOfF.add(f);
}
}
/*public void sortByPrice(){
for (int i = 0; i< arrOfF.size() - 1; ++i) {
Flowers.Flower f1 = arrOfF.get(0);
for (Flowers.Flower f2 : arrOfF.subList(1,arrOfF.size() - arrOfF.indexOf(f1))) {
if (f1.getPrice() > f2.getPrice()) {
arrOfF.add(arrOfF.indexOf(f1),f2);
arrOfF.remove(f1);
f2 =
}
}
}*/
public Flower[] searchFlower(FlowerSpec searchSpec) {
ArrayList<Flower> matchingFlowers= new ArrayList<Flower>();
for (Iterator i = arrOfF.iterator(); i.hasNext(); ) {
Flower f = (Flower)i.next();
if (f.getSpec().matches(searchSpec))
matchingFlowers.add(f);
}
Flower[] retmF = new Flower[matchingFlowers.size()];
int i = 0;
for (Flower f : matchingFlowers) {
retmF[i] = f;
i++;
}
return retmF;
}
public double price() {
return this.getPrice();
}
}
|
package com.tencent.matrix.a.b;
import android.app.AlarmManager.OnAlarmListener;
import android.app.PendingIntent;
import android.os.Build.VERSION;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
public class b {
private static boolean bpC;
private static com.tencent.matrix.a.c.b.b bpD = new com.tencent.matrix.a.c.b.b() {
public final void b(Method method, Object[] objArr) {
com.tencent.matrix.d.b.v("Matrix.AlarmManagerServiceHooker", "onServiceMethodInvoke: method name %s", method.getName());
b.a(method, objArr);
}
};
private static com.tencent.matrix.a.c.b bpE = new com.tencent.matrix.a.c.b("alarm", "android.app.IAlarmManager", bpD);
private static List<c> bpF = new ArrayList();
private static Class bpG;
private static Field bpH;
private static final class a {
OnAlarmListener bpq;
PendingIntent bpy;
private a() {
}
/* synthetic */ a(byte b) {
this();
}
}
private static final class b {
static a d(Object[] objArr) {
if (objArr.length != 2) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createCancelArgs2 args length invalid : %d", Integer.valueOf(objArr.length));
return null;
}
a aVar = new a();
if (objArr[0] == null || (objArr[0] instanceof PendingIntent)) {
aVar.bpy = (PendingIntent) objArr[0];
if (b.bpG == null || b.bpH == null) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs sListenerWrapperCls sListenerField null", new Object[0]);
return null;
} else if (objArr[1] == null || b.bpG.isInstance(objArr[1])) {
try {
if (objArr[1] != null) {
aVar.bpq = (OnAlarmListener) b.bpH.get(objArr[1]);
}
return aVar;
} catch (IllegalAccessException e) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 init exp:%s", e.getLocalizedMessage());
return null;
}
} else {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 not ListenerWrapper, %s", objArr[1]);
return null;
}
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createCancelArgs2 args idx 0 not PendingIntent, %s", objArr[0]);
return null;
}
}
public interface c {
void a(int i, long j, long j2, long j3, int i2, PendingIntent pendingIntent, OnAlarmListener onAlarmListener);
void a(PendingIntent pendingIntent, OnAlarmListener onAlarmListener);
}
private static final class d {
long bpI;
long bpn;
long bpo;
OnAlarmListener bpq;
PendingIntent bpy;
int flags;
int type;
private d() {
}
/* synthetic */ d(byte b) {
this();
}
}
private static final class e {
static d e(Object[] objArr) {
if (objArr.length != 11) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args length invalid : %d", Integer.valueOf(objArr.length));
return null;
}
d dVar = new d();
if (objArr[1] instanceof Integer) {
dVar.type = ((Integer) objArr[1]).intValue();
if (objArr[2] instanceof Long) {
dVar.bpn = ((Long) objArr[2]).longValue();
if (objArr[3] instanceof Long) {
dVar.bpI = ((Long) objArr[3]).longValue();
if (objArr[4] instanceof Long) {
dVar.bpo = ((Long) objArr[4]).longValue();
if (objArr[5] instanceof Integer) {
dVar.flags = ((Integer) objArr[5]).intValue();
if (objArr[6] == null || (objArr[6] instanceof PendingIntent)) {
dVar.bpy = (PendingIntent) objArr[6];
if (b.bpG == null || b.bpH == null) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs sListenerWrapperCls sListenerField null", new Object[0]);
return null;
}
if (VERSION.SDK_INT >= 24) {
if (objArr[7] == null || b.bpG.isInstance(objArr[7])) {
try {
if (objArr[7] != null) {
dVar.bpq = (OnAlarmListener) b.bpH.get(objArr[7]);
}
} catch (IllegalAccessException e) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 7 init exp:%s", e.getLocalizedMessage());
return null;
}
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 7 not ListenerWrapper, %s", objArr[7]);
return null;
}
return dVar;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 6 not PendingIntent, %s", objArr[6]);
return null;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 5 not Integer, %s", objArr[5]);
return null;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 4 not Long, %s", objArr[4]);
return null;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 3 not Long, %s", objArr[3]);
return null;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 2 not Long, %s", objArr[2]);
return null;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 not Integer, %s", objArr[1]);
return null;
}
}
static /* synthetic */ void a(Method method, Object[] objArr) {
a aVar = null;
int i = (byte) 0;
if (method.getName().equals("set") || method.getName().equals("setRepeating") || method.getName().equals("setInexactRepeating")) {
d dVar;
if (objArr != null) {
com.tencent.matrix.d.b.i("Matrix.AlarmManagerServiceHooker", "createSetArgs apiLevel:%d, codeName:%s, versionRelease:%s", Integer.valueOf(VERSION.SDK_INT), VERSION.CODENAME, Integer.valueOf(VERSION.SDK_INT));
com.tencent.matrix.d.b.i("Matrix.AlarmManagerServiceHooker", "createSetArgsAccordingToArgsLength: length:%s", Integer.valueOf(objArr.length));
d dVar2;
switch (objArr.length) {
case 3:
if (objArr.length == 3) {
dVar2 = new d();
if (!(objArr[0] instanceof Integer)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 0 not Integer, %s", objArr[0]);
dVar = null;
break;
}
dVar2.type = ((Integer) objArr[0]).intValue();
if (!(objArr[1] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 not Long, %s", objArr[1]);
dVar = null;
break;
}
dVar2.bpn = ((Long) objArr[1]).longValue();
if (objArr[2] != null && !(objArr[2] instanceof PendingIntent)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 2 not PendingIntent, %s", objArr[2]);
dVar = null;
break;
}
dVar2.bpy = (PendingIntent) objArr[2];
dVar = dVar2;
break;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args length invalid : %d", Integer.valueOf(objArr.length));
dVar = null;
break;
break;
case 4:
if (objArr.length == 4) {
dVar2 = new d();
if (!(objArr[0] instanceof Integer)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 0 not Integer, %s", objArr[0]);
dVar = null;
break;
}
dVar2.type = ((Integer) objArr[0]).intValue();
if (!(objArr[1] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 not Long, %s", objArr[1]);
dVar = null;
break;
}
dVar2.bpn = ((Long) objArr[1]).longValue();
if (!(objArr[2] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 2 not Long, %s", objArr[2]);
dVar = null;
break;
}
dVar2.bpo = ((Long) objArr[2]).longValue();
if (objArr[3] != null && !(objArr[3] instanceof PendingIntent)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 3 not PendingIntent, %s", objArr[3]);
dVar = null;
break;
}
dVar2.bpy = (PendingIntent) objArr[3];
dVar = dVar2;
break;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args length invalid : %d", Integer.valueOf(objArr.length));
dVar = null;
break;
break;
case 6:
case 7:
if (objArr.length != 7 && objArr.length != 6) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args length invalid : %d", Integer.valueOf(objArr.length));
dVar = null;
break;
}
dVar2 = new d();
if (!(objArr[0] instanceof Integer)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 0 not Integer, %s", objArr[0]);
dVar = null;
break;
}
dVar2.type = ((Integer) objArr[0]).intValue();
if (!(objArr[1] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 not Long, %s", objArr[1]);
dVar = null;
break;
}
dVar2.bpn = ((Long) objArr[1]).longValue();
if (!(objArr[2] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 2 not Long, %s", objArr[2]);
dVar = null;
break;
}
dVar2.bpI = ((Long) objArr[2]).longValue();
if (!(objArr[3] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 3 not Long, %s", objArr[3]);
dVar = null;
break;
}
dVar2.bpo = ((Long) objArr[3]).longValue();
if (objArr[4] != null && !(objArr[4] instanceof PendingIntent)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 4 not PendingIntent, %s", objArr[4]);
dVar = null;
break;
}
dVar2.bpy = (PendingIntent) objArr[4];
dVar = dVar2;
break;
break;
case 8:
if (objArr.length == 8) {
dVar2 = new d();
if (!(objArr[0] instanceof Integer)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 0 not Integer, %s", objArr[0]);
dVar = null;
break;
}
dVar2.type = ((Integer) objArr[0]).intValue();
if (!(objArr[1] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 1 not Long, %s", objArr[1]);
dVar = null;
break;
}
dVar2.bpn = ((Long) objArr[1]).longValue();
if (!(objArr[2] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 2 not Long, %s", objArr[2]);
dVar = null;
break;
}
dVar2.bpI = ((Long) objArr[2]).longValue();
if (!(objArr[3] instanceof Long)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 3 not Long, %s", objArr[3]);
dVar = null;
break;
}
dVar2.bpo = ((Long) objArr[3]).longValue();
if (!(objArr[4] instanceof Integer)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 4 not Integer, %s", objArr[4]);
dVar = null;
break;
}
dVar2.flags = ((Integer) objArr[4]).intValue();
if (objArr[5] != null && !(objArr[5] instanceof PendingIntent)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args idx 5 not PendingIntent, %s", objArr[5]);
dVar = null;
break;
}
dVar2.bpy = (PendingIntent) objArr[5];
dVar = dVar2;
break;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args length invalid : %d", Integer.valueOf(objArr.length));
dVar = null;
break;
break;
default:
dVar = e.e(objArr);
break;
}
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createSetArgs args null", new Object[0]);
dVar = null;
if (dVar == null) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "dispatchSet setArgs null", new Object[0]);
return;
}
synchronized (b.class) {
while (true) {
byte b;
byte b2 = b;
if (b2 < bpF.size()) {
((c) bpF.get(b2)).a(dVar.type, dVar.bpn, dVar.bpI, dVar.bpo, dVar.flags, dVar.bpy, dVar.bpq);
b = b2 + 1;
}
}
}
} else if (method.getName().equals("remove")) {
if (objArr != null) {
com.tencent.matrix.d.b.i("Matrix.AlarmManagerServiceHooker", "createCancelArgs apiLevel:%d, codeName:%s, versionRelease:%s", Integer.valueOf(VERSION.SDK_INT), VERSION.CODENAME, Integer.valueOf(VERSION.SDK_INT));
com.tencent.matrix.d.b.i("Matrix.AlarmManagerServiceHooker", "createCancelArgsAccordingToArgsLength: length:%s", Integer.valueOf(objArr.length));
switch (objArr.length) {
case 1:
if (objArr.length == 1) {
a aVar2 = new a();
if (objArr[0] != null && !(objArr[0] instanceof PendingIntent)) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createCancelArgs1 args idx 0 not PendingIntent, %s", objArr[0]);
break;
}
aVar2.bpy = (PendingIntent) objArr[0];
aVar = aVar2;
break;
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createCancelArgs1 args length invalid : %d", Integer.valueOf(objArr.length));
break;
break;
default:
aVar = b.d(objArr);
break;
}
}
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "createCancelArgs args null", new Object[0]);
if (aVar == null) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "dispatchCancel cancelArgs null", new Object[0]);
return;
}
synchronized (b.class) {
while (i < bpF.size()) {
((c) bpF.get(i)).a(aVar.bpy, aVar.bpq);
i++;
}
}
}
}
static {
try {
Class cls = Class.forName("android.app.AlarmManager$ListenerWrapper");
bpG = cls;
Field declaredField = cls.getDeclaredField("mListener");
bpH = declaredField;
declaredField.setAccessible(true);
} catch (ClassNotFoundException e) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "static init exp:%s", e);
} catch (NoSuchFieldException e2) {
com.tencent.matrix.d.b.w("Matrix.AlarmManagerServiceHooker", "static init exp:%s", e2);
}
}
public static synchronized void a(c cVar) {
synchronized (b.class) {
if (cVar != null) {
if (!bpF.contains(cVar)) {
bpF.add(cVar);
if (!(bpC || bpF.isEmpty())) {
com.tencent.matrix.d.b.i("Matrix.AlarmManagerServiceHooker", "checkHook hookRet:%b", Boolean.valueOf(bpE.doHook()));
bpC = true;
}
}
}
}
}
public static synchronized void b(c cVar) {
synchronized (b.class) {
if (cVar != null) {
bpF.remove(cVar);
if (bpC && bpF.isEmpty()) {
com.tencent.matrix.d.b.i("Matrix.AlarmManagerServiceHooker", "checkUnHook unHookRet:%b", Boolean.valueOf(bpE.doUnHook()));
bpC = false;
}
}
}
}
}
|
package com.xiaodao.admin.client;
import com.github.pagehelper.PageInfo;
import com.xiaodao.feign.config.MultipartSupportConfig;
import com.xiaodao.core.result.RespDataVO;
import com.xiaodao.core.result.RespVO;
import com.xiaodao.core.result.RespVOBuilder;
import com.xiaodao.admin.entity.SysUserOnline;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@FeignClient(value = "system-service", path = "/sysUserOnline", fallbackFactory = SysUserOnlineClientFallback.class, configuration = MultipartSupportConfig.class)
public interface SysUserOnlineClient {
/**
* 新增
*
* @param sysUserOnline
* @return
*/
@PostMapping("/insert")
RespVO insert(@RequestBody SysUserOnline sysUserOnline);
/**
* 带有空值判断的新增
*
* @param sysUserOnline
* @return
*/
@PostMapping("/insertSelective")
RespVO insertSelective(@RequestBody SysUserOnline sysUserOnline);
/**
* 批量新增
*
* @param list
* @return
*/
@PostMapping("/batchInsert")
RespVO batchInsert(@RequestBody List<SysUserOnline> list);
/**
* 带有空值判断的新增
*
* @param list
* @return
*/
@PostMapping("/batchInsertSelective")
RespVO batchInsertSelective(@RequestBody List<SysUserOnline> list);
/**
* 根据主键更新
*
* @param sysUserOnline
* @return
*/
@PutMapping("/updateByPrimaryKey")
RespVO updateByPrimaryKey(@RequestBody SysUserOnline sysUserOnline);
/**
* 根据空值判断的主键更新
*
* @param sysUserOnline
* @return
*/
@PutMapping("/updateSelectiveByPrimaryKey")
RespVO updateSelectiveByPrimaryKey(@RequestBody SysUserOnline sysUserOnline);
/**
* 批量更新
*
* @param list
* @return
*/
@PutMapping("/batchUpdate")
RespVO batchUpdate(@RequestBody List<SysUserOnline> list);
/**
* 带有空值判断的批量更新
*
* @param list
* @return
*/
@PutMapping("/batchUpdateSelective")
RespVO batchUpdateSelective(@RequestBody List<SysUserOnline> list);
/**
* 更新插入
*
* @param sysUserOnline
* @return
*/
@PostMapping("/upsert")
RespVO upsert(@RequestBody SysUserOnline sysUserOnline);
/**
* 带有空值判断的更新插入
*
* @param sysUserOnline
* @return
*/
@PostMapping("/upsertSelective")
RespVO upsertSelective(@RequestBody SysUserOnline sysUserOnline);
/**
* 批量更新插入
*
* @param list
* @return
*/
@PostMapping("/batchUpsert")
RespVO batchUpsert(@RequestBody List<SysUserOnline> list);
/**
* 带有空值判断的批量更新插入
*
* @param list
* @return
*/
@PostMapping("/batchUpsertSelective")
RespVO batchUpsertSelective(@RequestBody List<SysUserOnline> list);
/**
* 通过主键删除
*
* @param sessionid
* @return
*/
@DeleteMapping("/{sessionid}")
RespVO deleteByPrimaryKey(@PathVariable(value = "sessionid") String sessionid);
/**
* 通过主键批量删除
*
* @param list
* @return
*/
@DeleteMapping("/deleteBatchByPrimaryKeys")
RespVO deleteBatchByPrimaryKeys(@RequestBody List<Long> list);
/**
* 条件删除
*
* @param sysUserOnline
* @return
*/
@DeleteMapping("/delete")
RespVO delete(@RequestBody SysUserOnline sysUserOnline);
/**
* 通过主键查询
*
* @param sessionid
* @return
*/
@GetMapping("/{sessionid}")
RespVO<SysUserOnline> queryByPrimaryKey(@PathVariable(value = "sessionid") String sessionid);
/**
* 通过主键批量查询
*
* @param list
* @return
*/
@PostMapping("/queryBatchPrimaryKeys")
RespVO<RespDataVO<SysUserOnline>> queryBatchPrimaryKeys(@RequestBody List<Long> list);
/**
* 条件查询一个
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryOne")
RespVO<SysUserOnline> queryOne(@RequestBody SysUserOnline sysUserOnline);
/**
* 条件查询
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryByCondition")
RespVO<RespDataVO<SysUserOnline>> queryByCondition(@RequestBody SysUserOnline sysUserOnline);
/**
* 条件分页查询
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryPageByCondition")
RespVO<PageInfo<SysUserOnline>> queryPageByCondition(@RequestBody SysUserOnline sysUserOnline);
/**
* 模糊查询
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryFuzzy")
RespVO<RespDataVO<SysUserOnline>> queryFuzzy(@RequestBody SysUserOnline sysUserOnline);
/**
* 模糊分页查询
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryPageFuzzy")
RespVO<PageInfo<SysUserOnline>> queryPageFuzzy(@RequestBody SysUserOnline sysUserOnline);
/**
* 模糊条件查询
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryByLikeCondition")
RespVO<RespDataVO<SysUserOnline>> queryByLikeCondition(@RequestBody SysUserOnline sysUserOnline);
/**
* 模糊分页条件查询
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryPageByLikeCondition")
RespVO<PageInfo<SysUserOnline>> queryPageByLikeCondition(@RequestBody SysUserOnline sysUserOnline);
/**
* 条件查询数量
*
* @param sysUserOnline
* @return
*/
@PostMapping("/queryCount")
RespVO<Long> queryCount(@RequestBody SysUserOnline sysUserOnline);
/**
* 分组统计
*
* @param sysUserOnline
* @return
*/
@PostMapping("/statisticsGroup")
RespVO<RespDataVO<Map<String, Object>>> statisticsGroup(@RequestBody SysUserOnline sysUserOnline);
/**
* 日统计
*
* @param sysUserOnline
* @return
*/
@PostMapping("/statisticsGroupByDay")
RespVO<RespDataVO<Map<String, Object>>> statisticsGroupByDay(@RequestBody SysUserOnline sysUserOnline);
/**
* 月统计
*
* @param sysUserOnline
* @return
*/
@PostMapping("/statisticsGroupByMonth")
RespVO<RespDataVO<Map<String, Object>>> statisticsGroupByMonth(@RequestBody SysUserOnline sysUserOnline);
/**
* 年统计
*
* @param sysUserOnline
* @return
*/
@PostMapping("/statisticsGroupByYear")
RespVO<RespDataVO<Map<String, Object>>> statisticsGroupByYear(@RequestBody SysUserOnline sysUserOnline);
}
class SysUserOnlineClientFallback implements SysUserOnlineClient {
@Override
public RespVO insert(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO insertSelective(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO batchInsert(List<SysUserOnline> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO batchInsertSelective(List<SysUserOnline> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO updateByPrimaryKey(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO updateSelectiveByPrimaryKey(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO batchUpdate(List<SysUserOnline> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO batchUpdateSelective(List<SysUserOnline> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO upsert(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO upsertSelective(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO batchUpsert(List<SysUserOnline> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO batchUpsertSelective(List<SysUserOnline> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO deleteByPrimaryKey(String sessionid) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO deleteBatchByPrimaryKeys(List<Long> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO delete(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<SysUserOnline> queryByPrimaryKey(String sessionid) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<SysUserOnline>> queryBatchPrimaryKeys(List<Long> list) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<SysUserOnline> queryOne(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<SysUserOnline>> queryByCondition(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<PageInfo<SysUserOnline>> queryPageByCondition(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<SysUserOnline>> queryFuzzy(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<PageInfo<SysUserOnline>> queryPageFuzzy(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<SysUserOnline>> queryByLikeCondition(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<PageInfo<SysUserOnline>> queryPageByLikeCondition(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<Long> queryCount(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<Map<String, Object>>> statisticsGroup(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<Map<String, Object>>> statisticsGroupByDay(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<Map<String, Object>>> statisticsGroupByMonth(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
@Override
public RespVO<RespDataVO<Map<String, Object>>> statisticsGroupByYear(SysUserOnline sysUserOnline) {
return RespVOBuilder.failure("system-service服务不可用");
}
}
|
package com.tencent.mm.protocal.c;
import com.tencent.mm.bk.a;
import java.util.LinkedList;
public final class pr extends a {
public String huX;
public String huY;
public String lMY;
public String rnv;
public String rnw;
public long roL;
public String roM;
public String roN;
public akz rtT;
public String title;
public String url;
protected final int a(int i, Object... objArr) {
int h;
if (i == 0) {
f.a.a.c.a aVar = (f.a.a.c.a) objArr[0];
if (this.title != null) {
aVar.g(1, this.title);
}
if (this.huX != null) {
aVar.g(2, this.huX);
}
if (this.huY != null) {
aVar.g(3, this.huY);
}
if (this.url != null) {
aVar.g(4, this.url);
}
aVar.T(5, this.roL);
if (this.roM != null) {
aVar.g(6, this.roM);
}
if (this.roN != null) {
aVar.g(7, this.roN);
}
if (this.lMY != null) {
aVar.g(8, this.lMY);
}
if (this.rtT != null) {
aVar.fV(9, this.rtT.boi());
this.rtT.a(aVar);
}
if (this.rnv != null) {
aVar.g(10, this.rnv);
}
if (this.rnw == null) {
return 0;
}
aVar.g(11, this.rnw);
return 0;
} else if (i == 1) {
if (this.title != null) {
h = f.a.a.b.b.a.h(1, this.title) + 0;
} else {
h = 0;
}
if (this.huX != null) {
h += f.a.a.b.b.a.h(2, this.huX);
}
if (this.huY != null) {
h += f.a.a.b.b.a.h(3, this.huY);
}
if (this.url != null) {
h += f.a.a.b.b.a.h(4, this.url);
}
h += f.a.a.a.S(5, this.roL);
if (this.roM != null) {
h += f.a.a.b.b.a.h(6, this.roM);
}
if (this.roN != null) {
h += f.a.a.b.b.a.h(7, this.roN);
}
if (this.lMY != null) {
h += f.a.a.b.b.a.h(8, this.lMY);
}
if (this.rtT != null) {
h += f.a.a.a.fS(9, this.rtT.boi());
}
if (this.rnv != null) {
h += f.a.a.b.b.a.h(10, this.rnv);
}
if (this.rnw != null) {
h += f.a.a.b.b.a.h(11, this.rnw);
}
return h;
} else if (i == 2) {
f.a.a.a.a aVar2 = new f.a.a.a.a((byte[]) objArr[0], unknownTagHandler);
for (h = a.a(aVar2); h > 0; h = a.a(aVar2)) {
if (!super.a(aVar2, this, h)) {
aVar2.cJS();
}
}
return 0;
} else if (i != 3) {
return -1;
} else {
f.a.a.a.a aVar3 = (f.a.a.a.a) objArr[0];
pr prVar = (pr) objArr[1];
int intValue = ((Integer) objArr[2]).intValue();
switch (intValue) {
case 1:
prVar.title = aVar3.vHC.readString();
return 0;
case 2:
prVar.huX = aVar3.vHC.readString();
return 0;
case 3:
prVar.huY = aVar3.vHC.readString();
return 0;
case 4:
prVar.url = aVar3.vHC.readString();
return 0;
case 5:
prVar.roL = aVar3.vHC.rZ();
return 0;
case 6:
prVar.roM = aVar3.vHC.readString();
return 0;
case 7:
prVar.roN = aVar3.vHC.readString();
return 0;
case 8:
prVar.lMY = aVar3.vHC.readString();
return 0;
case 9:
LinkedList IC = aVar3.IC(intValue);
int size = IC.size();
for (intValue = 0; intValue < size; intValue++) {
byte[] bArr = (byte[]) IC.get(intValue);
akz akz = new akz();
f.a.a.a.a aVar4 = new f.a.a.a.a(bArr, unknownTagHandler);
for (boolean z = true; z; z = akz.a(aVar4, akz, a.a(aVar4))) {
}
prVar.rtT = akz;
}
return 0;
case 10:
prVar.rnv = aVar3.vHC.readString();
return 0;
case 11:
prVar.rnw = aVar3.vHC.readString();
return 0;
default:
return -1;
}
}
}
}
|
package com.kakaopay.payments.api.service;
import com.kakaopay.payments.api.domain.entity.PaymentInfo;
import com.kakaopay.payments.api.domain.repository.PaymentInfoRepository;
import com.kakaopay.payments.api.dto.AmountInfo;
import com.kakaopay.payments.api.dto.CardInfo;
import com.kakaopay.payments.api.dto.RequestDto;
import com.kakaopay.payments.api.dto.ResponseDto;
import com.kakaopay.payments.api.exception.ErrorCode;
import com.kakaopay.payments.api.exception.InvalidDataException;
import com.kakaopay.payments.api.security.AES256Cipher;
import com.kakaopay.payments.api.util.Constants;
import com.kakaopay.payments.api.util.DataConvertor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Slf4j
@Service
public class PaymentServiceImpl implements PaymentService{
@Autowired
PaymentInfoRepository paymentInfoRepository;
private static String secretKey = "12345678901234567890123456789012"; // TODO : DataBase 조회 후 derivation
@Override
public ResponseDto processPayment(RequestDto requestDto) throws Exception{
if(!validationVAT(requestDto.getAmountInfo())) // 부가가치세 검증
throw new InvalidDataException(ErrorCode.INVALID_VAT_VALUE);
PaymentInfo paymentInfo = PaymentInfo.builder()
.payType(requestDto.getPayType())
.installment(requestDto.getAmountInfo().getInstallment())
.amount(requestDto.getAmountInfo().getAmount())
.vat(requestDto.getAmountInfo().getVat())
.build();
synchronized (requestDto.getCardInfo().getCardNumber().intern()) // 동시성 - 같은 카드번호 기준
{
savePaymentInfo(requestDto, paymentInfo); // 결제정보 저장
}
return ResponseDto.builder()
.manageId(paymentInfo.getManageId())
.payStatement(paymentInfo.getPayStatement())
.build();
}
@Override
public ResponseDto processCancel(RequestDto requestDto) throws Exception{
AmountInfo amountInfo = requestDto.getAmountInfo();
amountInfo.setInstallment(0); // 취소거래시 할부 =: 0
Optional<PaymentInfo> opPaymentInfo = paymentInfoRepository.findById(requestDto.getManageId());
if(!opPaymentInfo.isPresent()) // manageId 존재하는지 검증
throw new InvalidDataException(ErrorCode.NOT_FOUND_ORIGIN_MANAGE_ID);
PaymentInfo paymentInfo = opPaymentInfo.get();
requestDto.setCardInfo(extractCardInfo(paymentInfo.getPayStatement())); // string 명세서에서 cardInfo 추출
PaymentInfo cancelPaymentInfo = null;
synchronized (requestDto.getManageId().intern()) // 동시성 - 결제 한 건이 기준
{
if(!validationCancelVAT(paymentInfo, amountInfo)) // 부가가치세 검증
throw new InvalidDataException(ErrorCode.INVALID_VAT_VALUE);
if(!validationCancelData(paymentInfo, amountInfo)) // 원 거래 금액 및 부가세와 취소 금액의 및 부가세와의 검증
throw new InvalidDataException(ErrorCode.INVALID_CANCEL_AMOUNT_DATA);
cancelPaymentInfo = PaymentInfo.builder()
.payType(requestDto.getPayType())
.installment(requestDto.getAmountInfo().getInstallment())
.amount(requestDto.getAmountInfo().getAmount())
.vat(requestDto.getAmountInfo().getVat())
.originManageId(requestDto.getManageId())
.build();
savePaymentInfo(requestDto, cancelPaymentInfo); // 취소정보 저장
reduceOriginPaymentAmount(paymentInfo, cancelPaymentInfo); // 원 결제 정보를 취소금액만큼 차감
paymentInfoRepository.save(paymentInfo); // 결제 금액정보 다시 저장
}
return ResponseDto.builder()
.manageId(cancelPaymentInfo.getManageId())
.payStatement(cancelPaymentInfo.getPayStatement())
.build();
}
@Override
public ResponseDto processReadPayment(String manageId) throws Exception{
Optional<PaymentInfo> opPaymentInfo = paymentInfoRepository.findById(manageId);
if(!opPaymentInfo.isPresent()) // manageId 존재하는지 검증
throw new InvalidDataException(ErrorCode.NOT_FOUND_ORIGIN_MANAGE_ID);
PaymentInfo paymentInfo = opPaymentInfo.get();
CardInfo cardInfo = extractCardInfo(paymentInfo.getPayStatement()); // 원거래로부터 카드정보 추출
maskingCardInfo(cardInfo); // 카드정보 마스킹
AmountInfo amountInfo = AmountInfo.builder()
.amount(paymentInfo.getAmount())
.vat(paymentInfo.getVat())
.build();
Map<String, Object> optionalMap = new HashMap<String, Object>(); // 응답값에 옵션 정보 추가 (할부)
optionalMap.put("installment", amountInfo.getInstallment());
return ResponseDto.builder()
.manageId(paymentInfo.getManageId())
.cardInfo(cardInfo)
.payType(paymentInfo.getPayType())
.amountInfo(amountInfo)
.optionalData(optionalMap)
.build();
}
@Override
public List<PaymentInfo> processReadPaymentList() throws Exception {
return paymentInfoRepository.findAll();
}
/**
* 결제 및 취소 정보 저장
* @param requestDto
* @param paymentInfo
* @throws Exception
*/
private void savePaymentInfo(RequestDto requestDto, PaymentInfo paymentInfo) throws Exception{
synchronized (this){
paymentInfoRepository.save(paymentInfo); // 결제 or 취소 정보 저장
}
requestDto.setManageId(paymentInfo.getManageId());
paymentInfo.setPayStatement(generatePayStatement(requestDto, secretKey)); // string 명세 생성
paymentInfoRepository.save(paymentInfo); // string 명세 저장
}
/**
* 원 결제정보에서 취소금액 및 부가가치세만큼 차감
* @param paymentInfo 원 결제정보
* @param cancelPaymentInfo 차감하고자 하는 금액 및 부가가치세 정보
*/
private void reduceOriginPaymentAmount(PaymentInfo paymentInfo, PaymentInfo cancelPaymentInfo){
int amount = paymentInfo.getAmount();
int vat = paymentInfo.getVat();
paymentInfo.setAmount(amount - cancelPaymentInfo.getAmount());
paymentInfo.setVat(vat - cancelPaymentInfo.getVat());
}
/**
* 부가가치세 계산 및 검증
* @param amountInfo 금액과 부가가치세 정보
*/
private boolean validationVAT(AmountInfo amountInfo) {
if(amountInfo.getVat() == null)
amountInfo.setVat(DataConvertor.calVAT(amountInfo.getAmount()));
if(amountInfo.getVat() > amountInfo.getAmount())
return false; // 부가가치세는 결제금액보다 클수 없습니다.
return true;
}
/**
* 취소 시 VAT 계산 및 검증
* @param paymentInfo 원 결제 정보
* @param cancelAmountInfo 취소 금액정보
* @return
*/
private boolean validationCancelVAT(PaymentInfo paymentInfo, AmountInfo cancelAmountInfo) {
if(cancelAmountInfo.getVat() == null){
if(paymentInfo.getAmount() == cancelAmountInfo.getAmount()) // 원 결제금액과 취소금액이 같다면 원 결제의 남은 부가가치세를 사용
cancelAmountInfo.setVat(paymentInfo.getVat());
else
cancelAmountInfo.setVat(DataConvertor.calVAT(cancelAmountInfo.getAmount()));
}
if(cancelAmountInfo.getVat() > cancelAmountInfo.getAmount())
return false; // 부가가치세는 결제금액보다 클수 없습니다.
return true;
}
/**
* 취소 결제를 하기전 데이터 검증
* @param paymentInfo 원 결제 정보
* @param cancelAmountInfo 취소 결제 정보
* @return
*/
private boolean validationCancelData(PaymentInfo paymentInfo, AmountInfo cancelAmountInfo){
if(paymentInfo.getAmount() < cancelAmountInfo.getAmount()) // 원거래 금액보다 취소 금액이 큰 값인지 검증
return false;
if(paymentInfo.getVat() < cancelAmountInfo.getVat() ) // 원거래 부가가치세보다 취소 부가가치세가 큰 값인지 검증
return false;
if((paymentInfo.getAmount() == cancelAmountInfo.getAmount()) // 원거래 금액이 0원이 될 때 부가가치세는 차감된 후는 0이어야 함.
&& (paymentInfo.getVat() != cancelAmountInfo.getVat()))
return false;
return true;
}
/**
* 결제 string 데이터 명세 생성
* @param requestDto 결제 string 데이터 명세를 생성하기 위한 필요 데이터
* @param secretKey 카드정보를 암호화하기 위한 secret key
* @return
*/
public String generatePayStatement(RequestDto requestDto, String secretKey) throws Exception{
String concatCardInfo = DataConvertor.concatCardInfo(requestDto.getCardInfo()); // 카드정보 문자열 합치기
String encData = AES256Cipher.encryptCardInfo(concatCardInfo, secretKey); // 카드정보 암호화
// 공통헤더부문
String payType = DataConvertor.formatPayStr(requestDto.getPayType(), Constants.PayStatementSize.PAY_TYPE, Constants.DATA_TYPE_STRING);
String manageId = DataConvertor.formatPayStr(requestDto.getManageId(), Constants.PayStatementSize.MANAGE_ID, Constants.DATA_TYPE_STRING);
String cardNum = DataConvertor.formatPayStr(requestDto.getCardInfo().getCardNumber(), Constants.PayStatementSize.CARD_NUMBER, Constants.DATA_TYPE_NUM_LEFT);
// 데이터부문
String installment = DataConvertor.formatPayStr(String.valueOf(requestDto.getAmountInfo().getInstallment()), Constants.PayStatementSize.INSTALLMENT, Constants.DATA_TYPE_NUM_ZERO);
String expDate = DataConvertor.formatPayStr(requestDto.getCardInfo().getExpirationDate(), Constants.PayStatementSize.EXP_DATE, Constants.DATA_TYPE_NUM_LEFT);
String cvc = DataConvertor.formatPayStr(requestDto.getCardInfo().getCvc(), Constants.PayStatementSize.CVC, Constants.DATA_TYPE_NUM_LEFT);
String amount = DataConvertor.formatPayStr(String.valueOf(requestDto.getAmountInfo().getAmount()), Constants.PayStatementSize.AMOUNT, Constants.DATA_TYPE_NUM);
String vat = DataConvertor.formatPayStr(String.valueOf(requestDto.getAmountInfo().getVat().intValue()), Constants.PayStatementSize.VAT, Constants.DATA_TYPE_NUM_ZERO);
String originManageId = DataConvertor.formatPayStr("", Constants.PayStatementSize.ORIGIN_MNG_ID, Constants.DATA_TYPE_STRING);
String encCardInfo = DataConvertor.formatPayStr(encData, Constants.PayStatementSize.ENC_CARD_INFO, Constants.DATA_TYPE_STRING);
String reserved = DataConvertor.formatPayStr("", Constants.PayStatementSize.RESERVED, Constants.DATA_TYPE_STRING);
// 데이터 명세 생성
StringBuilder sb = new StringBuilder();
sb.append(payType).append(manageId).append(cardNum).append(installment).append(expDate).append(cvc)
.append(amount).append(vat).append(originManageId).append(encCardInfo).append(reserved);
String concatStr = sb.toString();
return DataConvertor.formatPayStr(String.valueOf(concatStr.length()), Constants.PayStatementSize.DATA_SIZE, Constants.DATA_TYPE_NUM) + concatStr;
}
/**
* string 명세에서 CardInfo 객체로 추출
* @param payStatement string 명세
* @return CardInfo 객체
*/
private CardInfo extractCardInfo(String payStatement) throws Exception{
int encOffset = Constants.PayStatementSize.TOT_SIZE - Constants.PayStatementSize.ENC_CARD_INFO - Constants.PayStatementSize.RESERVED; // 암호화된 카드정보 위치
String encCardInfo = payStatement.substring(encOffset, Constants.PayStatementSize.ENC_CARD_INFO); // 암호화된 정보 추출
int indexBlank = encCardInfo.indexOf(' ');
encCardInfo = encCardInfo.substring(0, indexBlank); // 암호화된 카드 string 값만 추출
log.debug("encCardInfo = " + encCardInfo);
String decData = AES256Cipher.decryptCardInfo(encCardInfo, secretKey); // 복호화
log.debug("decData = " + decData);
return DataConvertor.objectCardInfo(decData); // 카드정보 객체 변환
}
/**
* 카드번호 마스킹
* @param cardInfo
*/
private void maskingCardInfo(CardInfo cardInfo) {
String cardNumber = cardInfo.getCardNumber();
StringBuffer sb = new StringBuffer(cardNumber.substring(0, 6));
int midSize = cardNumber.length() - 9;
while(midSize > 0) {
sb.append('*');
midSize--;
}
sb.append(cardNumber.substring(cardNumber.length() - 3, cardNumber.length()));
cardInfo.setCardNumber(sb.toString());
}
}
|
package tools;
public class LinkedElement<Data> {
Data data;
LinkedElement<Data> rest;
public LinkedElement(Data data, LinkedElement rest){
this.data=data;
this.rest=rest;
}
public Data getData(){
return data;
}
}
|
package ua.nure.makieiev.brainfuck.strategy.impl;
import ua.nure.makieiev.brainfuck.command.Command;
import ua.nure.makieiev.brainfuck.strategy.SymbolStrategy;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;
/**
* This class is responsible for adding new list to stack if we have new loop.
*/
public class StartLoopSymbolStrategy implements SymbolStrategy {
/**
* This method adds new list to stack
*
* @param commandStack is stack with command list
*/
@Override
public void execute(Stack<List<Command>> commandStack) {
commandStack.push(new LinkedList<>());
}
}
|
import org.openqa.selenium.By;
import org.openqa.selenium.winium.DesktopOptions;
import org.openqa.selenium.winium.WiniumDriver;
import org.openqa.selenium.winium.WiniumDriverService;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.io.File;
import static org.testng.Assert.assertEquals;
public class ExamleWinium {
private WiniumDriver driver;
WiniumDriverService service;
DesktopOptions options = new DesktopOptions();
//For tracking buttons use VisualUIAVerifyNative from Win10 SDK
@BeforeTest
void preparation() throws Exception {
File winiumExe = new File("C:\\selenium-java-3.8.1\\winium\\Winium.Desktop.Driver.exe");
service = new WiniumDriverService.Builder().usingDriverExecutable(winiumExe)
.usingPort(9999)
.withVerbose(true)
.withSilent(false)
.buildDesktopService();
service.start();
}
@Test(priority = 1)
void verify_Create_New_Document() {
// 1) Open Notepad app
options.setApplicationPath("C:\\Windows\\SysWOW64\\notepad.exe");
driver = new WiniumDriver(service, options);
// 2) Click "File"
driver.findElement(By.name("File")).click();
// 3) Select "New"
driver.findElement(By.name("New")).click();
// 4) Check the window title
try {
assertEquals("Untitled - Notepad", driver.findElement(By.className("Notepad")).getAttribute("Name"));
// 5) Check the text field
assertEquals("", driver.findElement(By.className("Edit")).getText());
} catch (Exception e) {
e.printStackTrace();
}
}
@AfterTest
void afterTest(){
driver.quit();
}
}
|
package br.com.servlet;
import java.io.BufferedReader;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import br.com.DAO.LivroDAO;
public class ServletDelete extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().append("Served at: ").append(request.getContextPath());
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuilder sb = new StringBuilder();
BufferedReader br = request.getReader();
String str = null;
while ((str = br.readLine()) != null) {
sb.append(str);
}
JSONObject jObj = new JSONObject(sb.toString());
int id = jObj.getInt("id");
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");
LivroDAO livDAO = new LivroDAO();
try{
livDAO.deleteOne(id);
}catch (Exception e){
e.printStackTrace();
}
}
}
|
package com.jlgproject.activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.jlgproject.MainActivity;
import com.jlgproject.R;
import com.jlgproject.base.BaseActivity;
import com.jlgproject.util.ActivityCollector;
public class PaySuccess extends BaseActivity implements View.OnClickListener{
private TextView mTv_Title_pay;
private ImageView mIv_Title_left_pay,mIv_title_right;
private LinearLayout mLl_ivParent_pay;
@Override
public int loadWindowLayout() {
return R.layout.activity_pay_success;
}
@Override
public void initViews() {
super.initViews();
//动态设置标题
mTv_Title_pay = (TextView) findViewById(R.id.tv_title_name);
mTv_Title_pay.setText(getResources().getText(R.string.toPayS));
mIv_Title_left_pay = (ImageView) findViewById(R.id.iv_title_left);
mIv_Title_left_pay.setVisibility(View.VISIBLE);
mLl_ivParent_pay = (LinearLayout) findViewById(R.id.ll_ivParent_title);
mLl_ivParent_pay.setOnClickListener(this);
mIv_title_right= (ImageView) findViewById(R.id.iv_title_right);
mIv_title_right.setImageResource(R.mipmap.return_home);
mIv_title_right.setVisibility(View.VISIBLE);
mIv_title_right.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v==mLl_ivParent_pay){
finish();
}else if(v==mIv_title_right){
ActivityCollector.startA(PaySuccess.this, MainActivity.class,"currMenu",0);
}
}
}
|
package chapter5;
import java.time.LocalDate;
import java.util.Objects;
public class Employee2 {
private String name;
private double salary;
private LocalDate hireDay;
public Employee2(String n, double s, int year, int month, int day) {
this.name = n;
this.salary = s;
this.hireDay = LocalDate.of(year, month, day);
}
public String getName() {
return name;
}
public double getSalary() {
return this.salary;
}
public LocalDate getHireDay() {
return this.hireDay;
}
public void raiseSalary(double byPercent) {
double raise = this.salary * byPercent / 100;
this.salary += raise;
}
public boolean equals(Object otherObject) {
if(this == otherObject) return true;
if (otherObject == null) return false;
if (getClass() != otherObject.getClass()) return false;
Employee2 other = (Employee2) otherObject;
return Objects.equals(name, other.getName()) && salary == other.getSalary() &&
Objects.equals(hireDay, other.getHireDay());
}
public int hashCode() {
return Objects.hash(name, salary, hireDay);
}
public String toString() {
return getClass().getName() + "[name=" + name + ",salary=" + salary + ",hireDay=" + hireDay + "]";
}
}
|
import java.util.Scanner;
public class Sample {
static String removeVowel(String s) {
StringBuffer res=new StringBuffer("");
int n=s.length();
for(int i=0;i<n;i++) {
if(!isVowel(s.charAt(i))){
res.append(s.charAt(i));
}
}
return new String(res);
}
static boolean isVowel(char c) {
return c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='A'||c=='E'||c=='I'||c=='O'
||c=='U';
}
static boolean containsVowel(String s) {
for(int i=0;i<s.length();i++) {
if(isVowel(s.charAt(i)))
return true;
}
return false;
}
static String removeWordswithVowel(String s) {
String[]arr=s.split(" ");
String res="";
for(int i=0;i<arr.length;i++) {
if(!containsVowel(arr[i]))
res+=arr[i]+" ";
}
return res;
}
static void palindromicSubstrings(String s) {
int n=s.length();
for(int i=0;i<n;i++) {
for(int j=i+1;j<=n;j++) {
String sub=s.substring(i,j);
if(isPalindrome(sub))
System.out.print(sub+",");
}
}
}
static boolean isPalindrome(String s) {
int i=0,j=s.length()-1;
while(i<j) {
if(s.charAt(i)!=s.charAt(j))
return false;
i++;j--;
}
return true;
}
public static void main(String[]args)throws Exception {
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
palindromicSubstrings(s);
}
}
|
package esir.dom11.nsoc.context.presence;
import esir.dom11.nsoc.context.calendar.Calendar;
import esir.dom11.nsoc.context.calendar.CalendarEvent;
import org.kevoree.annotation.*;
import org.kevoree.framework.AbstractComponentType;
import org.kevoree.framework.MessagePort;
import java.util.Date;
import java.util.LinkedList;
@Requires({
@RequiredPort(name = "fakecalendar", type = PortType.MESSAGE)
})
@Library(name = "NSOC_2011::Context")
@ComponentType
public class FakeCalendar extends AbstractComponentType {
@Start
public void start() {
update();
}
@Stop
public void stop() {
}
@Update
public void update() {
sendCalendar(generateCalendar());
}
public Calendar generateCalendar() {
long currentTime = new Date().getTime();
LinkedList<CalendarEvent> events = new LinkedList<CalendarEvent>();
events.add(
new CalendarEvent(
new Date(currentTime + 5000),
new Date(currentTime + 15000)
)
);
events.add(
new CalendarEvent(
new Date(currentTime + 35000),
new Date(currentTime + 40000)
)
);
Calendar calendar = new Calendar();
calendar.getEvents().addAll(events);
return calendar;
}
public void sendCalendar(Calendar calendar) {
System.out.println("Context::FakeCalendar : sendCalendar");
if (this.isPortBinded("fakeCalendar")) {
this.getPortByName("fakeCalendar", MessagePort.class).process(calendar);
}
}
}
|
package com.shiku.mianshi.controller;
import java.util.List;
import javax.annotation.Resource;
import org.bson.types.ObjectId;
import org.mongodb.morphia.Datastore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mongodb.BasicDBObject;
import cn.xyz.commons.constants.MsgType;
import cn.xyz.commons.support.Callback;
import cn.xyz.commons.support.jedis.JedisTemplate;
import cn.xyz.commons.support.mongo.MongoOperator;
import cn.xyz.commons.utils.DES;
import cn.xyz.commons.utils.StringUtil;
import cn.xyz.commons.utils.ThreadUtil;
import cn.xyz.commons.vo.JSONMessage;
import cn.xyz.mianshi.service.FriendsManager;
import cn.xyz.mianshi.service.impl.RoomManagerImplForIM;
import cn.xyz.mianshi.service.impl.UserManagerImpl;
import cn.xyz.mianshi.utils.KSessionUtil;
import cn.xyz.mianshi.vo.Friends;
import cn.xyz.mianshi.vo.MsgNotice;
import cn.xyz.mianshi.vo.User;
import cn.xyz.mianshi.vo.Room.Member;
import cn.xyz.service.ApnsPushService;
import cn.xyz.service.JPushService;
import lombok.extern.slf4j.Slf4j;
@RestController
@Slf4j
/**
*
* <p>Title: ExtController</p>
* <p>Description:此类曾用于离线消息推送,现已弃用 </p>
* @author xiaobai
* @date 2018年7月26日
*/
public class ExtController {
@Value("${iOS.AppStore.VoIP.enabled:false}")
private Boolean iOSVoIPEnabled;
@Resource(name = "dsForTigase")
private Datastore dsForTigase;
@Resource(name = "dsForRW")
protected Datastore dsForRW;
@Resource(name="dsForRoom")
protected Datastore dsForRoom;
@Resource(name = "jedisTemplate")
protected JedisTemplate jedisTemplate;
@Autowired
private FriendsManager friendsManager;
@Autowired
private UserManagerImpl userManager;
@Autowired
private RoomManagerImplForIM roomManager;
@Autowired
private JPushService jpushService;
@RequestMapping(value = "/notify")
public JSONMessage notify(@RequestParam(defaultValue="1") int type,@RequestParam int from, @RequestParam(defaultValue="0") int to,
@RequestParam(defaultValue="") String roomJid,
@RequestParam String body,
@RequestParam(defaultValue="0") long ts) {
try {
MsgNotice notice=parseMsgNotice(from, to,2==type?1:0,roomJid, body);
if(null==notice){
log.info("text 为null 不需要推送。。。。");
return null;
}
notice.setTime(ts);
ThreadUtil.executeInThread(new Callback() {
@Override
public void execute(Object obj) {
if(1==type){
log.info("====日 志====pushOne"+to+"-----------");
pushOne(to, notice,0);
}
else {
log.info("====日 志====pushGroup"+to+"-----------");
pushGroup(to, notice);
}
}
});
return JSONMessage.success();
} catch (Exception e) {
log.error("=====错 误 日 志=====消息解析失败,body:" +body);
e.printStackTrace();
}
return JSONMessage.failure("推送失败");
}
//推送给一个用户
private JSONMessage pushOne(int to,MsgNotice notice,int isGroup){
try {
//判断用户是否开启消息免打扰
User user=dsForRW.createQuery(User.class).filter("_id", to).get();
if(user.getOfflineNoPushMsg()==1){
return null;
}
//判断用户是否对好友设置了消息免打扰
Friends friends=dsForRW.createQuery(Friends.class).field("userId").equal(to).field("toUserId").equal(notice.getFrom()).get();
if(friends!=null&&friends.getOfflineNoPushMsg()==1){
return null;
}
//判断用户是否对房间设置了消息免打扰
Member member=(Member) dsForRoom.createQuery(Member.class).field("roomId").equal(roomManager.getRoomId(notice.getRoomJid())).get();
if(member!=null&&member.getOfflineNoPushMsg()==1){
return null;
}
String key1 = String.format("user:%s:channelId", to);
String key2 = String.format("user:%s:deviceId", to);
String channelId = jedisTemplate.get(key1);
String deviceId = jedisTemplate.get(key2);
if (null == deviceId)
return JSONMessage.failure("deviceId is Null");
// channeId没有设置对应的userId或者对应的userId等于消息接收方
if("2".equals(deviceId)){
if (iOSVoIPEnabled && !StringUtil.isEmpty(KSessionUtil.getAPNSToken(to))) {
//苹果APP上架时需禁用此功能VoIP(即CallKit)
if(notice.getType()==100||notice.getType()==110||notice.getType()==115||notice.getType()==120){
//apns 推送
ApnsPushService.getInstance().pushMsgToUser(notice,notice.getFileName());
return JSONMessage.success();
}
} else {
log.info("iOS VoIP is disabled, it's nice to AppStore!");
}
try {
if(StringUtil.isEmpty(channelId)){
System.out.println("离线推送:未发现匹配的与用户匹配的推送通道Id");
return JSONMessage.failure("channelId is Null");
}
jpushService.send(channelId, "收到一条新消息");
} catch (NumberFormatException e) {
jedisTemplate.del(key2);
}
return JSONMessage.success();
}else {
return JSONMessage.success();
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
//推送给群组
private void pushGroup(int to,MsgNotice notice){
if(notice.getType()==1&&!StringUtil.isEmpty(notice.getObjectId())&&!StringUtil.isEmpty(notice.getRoomJid())){
if(notice.getObjectId().equals(notice.getRoomJid())){
ObjectId roomId = roomManager.getRoomId(notice.getRoomJid());
List groupUserList = roomManager.getMermerListIdByRedis(roomId);
BasicDBObject query=new BasicDBObject("onlinestate", 0).append("_id", new BasicDBObject(MongoOperator.IN, groupUserList));
List<Integer> userList = userManager.distinct("_id",query);
if(!userList.isEmpty()){
for (Integer userId : userList) {
notice.setTo(userId);
notice.setToName(userManager.getNickName(userId));
pushOne(userId, notice,1);
}
}
}else{
String[] objectIdlist=notice.getObjectId().split(" ");
for(int i=0;i<objectIdlist.length;i++){
notice.setTo(Integer.parseInt(objectIdlist[i]));
notice.setToName(userManager.getNickName(Integer.parseInt(objectIdlist[i])));
pushOne(Integer.parseInt(objectIdlist[i]), notice,1);
}
}
}else{
ObjectId roomId = roomManager.getRoomId(notice.getRoomJid());
List groupUserList = roomManager.getMermerListIdByRedis(roomId);
//groupUserList.remove(notice.getFrom());
BasicDBObject query=new BasicDBObject("onlinestate", 0).append("_id", new BasicDBObject(MongoOperator.IN, groupUserList));
List<Integer> userList = userManager.distinct("_id",query);
if(!userList.isEmpty()){
for (Integer userId : userList) {
if(userId==notice.getFrom())
continue ;
notice.setTo(userId);
notice.setToName(userManager.getNickName(userId));
pushOne(userId, notice,1);
}
}
}
}
/**
*
* <p>Title: parseMsgNotice</p>
* <p>Description: 将传过来的参数进行封装,</p>
* @param from
* @param to
* @param isGroup
* @param jid
* @param body
* @return
*/
private MsgNotice parseMsgNotice(int from,int to,int isGroup,String jid,String body){
MsgNotice notice=new MsgNotice();
int messageType = 0;
String text =null;
try {
if(body.contains("http://api.map.baidu.com/staticimage")){
messageType=MsgType.TYPE_LOCATION;
notice.setName(userManager.getNickName(from));
notice.setFrom(from);
if(1==isGroup){
notice.setTitle(roomManager.getRoomName(jid));
notice.setRoomJid(jid);
notice.setGroupName("("+notice.getTitle()+")");
text=notice.getName()+notice.getGroupName()+":[位置]";
notice.setIsGroup(1);
}else{
notice.setTo(to);
notice.setTitle(notice.getName());
text=notice.getName()+":[位置]";
}
}else{
JSONObject jsonObj = JSON
.parseObject(body);
messageType = jsonObj.getIntValue("type");
notice.setFrom(jsonObj.getIntValue("fromUserId"));
notice.setTo(to);
notice.setName(jsonObj.getString("fromUserName"));
notice.setToName(jsonObj.getString("toUserName"));
notice.setFileName(jsonObj.getString("fileName"));
notice.setIsGroup(isGroup);
notice.setTitle(notice.getName());
if(!StringUtil.isEmpty(jsonObj.getString("objectId")))
notice.setObjectId(jsonObj.getString("objectId"));
if(!StringUtil.isEmpty(jid)){
notice.setRoomJid(jid);
notice.setTitle(roomManager.getRoomName(jid));
notice.setGroupName("("+notice.getTitle()+")");
}else if(!StringUtil.isEmpty(jsonObj.getString("objectId"))){
if(roomManager.getRoomName(jsonObj.getString("objectId"))!=null)
notice.setTitle(roomManager.getRoomName(jsonObj.getString("objectId")));
notice.setGroupName("("+notice.getTitle()+")");
}
if(1==jsonObj.getIntValue("isEncrypt")){
text=DES.decryptDES(jsonObj.getString("content"), "12345678");
}else
text=jsonObj.getString("content");
text=parseText(messageType,isGroup, notice, text);
}
if(null==text)
return null;
} catch (Exception e) {
e.printStackTrace();
}
notice.setType(messageType);
notice.setText(text);
if(StringUtil.isEmpty(notice.getToName()))
notice.setToName(userManager.getNickName(to));
return notice;
}
/**
*
* <p>Title: parseText</p>
* <p>Description: 用于messageType来组装推送的消息体</p>
* @param messageType
* @param isGroup
* @param notice
* @param content
* @return
*/
private String parseText(int messageType,int isGroup, MsgNotice notice,String content) {
String text=null;
try {
switch (messageType) {
case MsgType.TYPE_TEXT:
case MsgType.TYPE_FEEDBACK:
text =content;
if (StringUtils.hasText(text)) {
if (text.length() > 20)
text = text.substring(0, 20) + "...";
}
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+text;
if(!StringUtil.isEmpty(notice.getObjectId())&&!StringUtil.isEmpty(notice.getRoomJid())){
text="[有人@我]"+notice.getName()+notice.getGroupName()+":"+content;
if(notice.getObjectId().equals(notice.getRoomJid())){
text="[有全体消息]"+notice.getName()+notice.getGroupName()+":"+content;
}
}
break;
case MsgType.TYPE_IMAGE:
case MsgType.TYPE_GIF:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[图片]";
break;
case MsgType.TYPE_VOICE:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[语音]";
break;
case MsgType.TYPE_LOCATION:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[位置]";
break;
case MsgType.TYPE_VIDEO:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[视频]";
break;
case MsgType.TYPE_CARD:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[名片]";
break;
case MsgType.TYPE_FILE:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[文件]";
break;
case MsgType.TYPE_RED:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[红包]";
break;
case MsgType.TYPE_83:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+"领取了红包";
break;
case MsgType.TYPE_IMAGE_TEXT:
case MsgType.TYPE_IMAGE_TEXT_MANY:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+":"+"[图文]";
break;
case MsgType.TYPE_BACK:
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+"撤回了一条消息";
break;
case MsgType.TYPE_MUCFILE_ADD:
notice.setIsGroup(1);
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+"上传了群文件";
break;
case MsgType.TYPE_MUCFILE_DEL:
notice.setIsGroup(1);
text=notice.getName()+(1==isGroup?notice.getGroupName():"")+"删除了文件";
break;
case MsgType.TYPE_SAYHELLO:
text=notice.getName()+":请求加为好友";
break;
case MsgType.TYPE_DELALL:
text=notice.getName()+":删除好友你";
break;
case MsgType.TYPE_PASS:
text=notice.getName()+":同意加好友";
break;
case MsgType.TYPE_CHANGE_NICK_NAME:
notice.setIsGroup(1);
text=notice.getName()+(notice.getGroupName())+"修改群昵称为"+content;
break;
case MsgType.TYPE_CHANGE_ROOM_NAME:
notice.setIsGroup(1);
text=notice.getName()+(notice.getGroupName())+"修改群名为"+content;
break;
case MsgType.TYPE_DELETE_MEMBER:
notice.setIsGroup(1);
if(notice.getFrom()==notice.getTo())
text=notice.getToName()+(notice.getGroupName())+"退出群组";
else {
text=notice.getToName()+(notice.getGroupName())+"被踢出群组";
}
break;
case MsgType.TYPE_NEW_NOTICE:
notice.setIsGroup(1);
text=notice.getName()+(notice.getGroupName())+"修改了群公告"+content;
break;
case MsgType.TYPE_GAG:
notice.setIsGroup(1);
long ts=Long.parseLong(content);
//long time=DateUtil.currentTimeSeconds();
if(0<ts)
text=notice.getToName()+(notice.getGroupName())+"被禁言";
else text=notice.getToName()+(notice.getGroupName())+"被取消禁言";
break;
case MsgType.NEW_MEMBER:
notice.setIsGroup(1);
text=notice.getToName()+(notice.getGroupName())+"加入群组";
break;
case MsgType.TYPE_SEND_MANAGER:
notice.setIsGroup(1);
if(1==Integer.parseInt(content))
text=notice.getToName()+(notice.getGroupName())+"被设置管理员";
else
text=notice.getToName()+(notice.getGroupName())+"被取消管理员";
break;
case MsgType.TYPE_INPUT:
case MsgType.TYPE_COMMENT:
case MsgType.TYPE_CHANGE_SHOW_READ:
return null;
default:
if(StringUtil.isEmpty(content))
return null;
else
text=content;
break;
}
} catch (Exception e) {
log.error("=====错 误 日 志=====:" + "推送消息格式化失败,消息体:"+notice+"内容"+content);
e.printStackTrace();
}
return text;
}
}
|
package net.sourceforge.vrapper.vim;
import net.sourceforge.vrapper.keymap.KeyStroke;
import net.sourceforge.vrapper.keymap.SpecialKey;
/**
* Wrapper class for {@link KeyStroke} which provides an additional
* recursive property.
*
* @author Matthias Radig
*/
public class RemappedKeyStroke implements KeyStroke {
private final KeyStroke delegate;
private final boolean recursive;
public RemappedKeyStroke(KeyStroke delegate, boolean recursive) {
super();
this.delegate = delegate;
this.recursive = recursive;
}
public char getCharacter() {
return delegate.getCharacter();
}
public SpecialKey getSpecialKey() {
return delegate.getSpecialKey();
}
public boolean withShiftKey() {
return delegate.withShiftKey();
}
public boolean isRecursive() {
return recursive;
}
@Override
public String toString() {
String key = getSpecialKey() == null ? Character.toString(getCharacter()) : getSpecialKey().toString();
return "RemappedKeyStroke(" + key + ")";
}
@Override
public boolean equals(Object obj) {
return delegate.equals(obj);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public boolean isVirtual() {
return true;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.