blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
9aa7a3ef360866b91f544266980dc7eb2c90b0e4
947c4bbf5dbdeea1be2bd6633d8fc1f37c60f6ba
/Pz-s/D/D123.java
d083783f52eb922e0ba0464055b3f19a340d10e4
[]
no_license
k-takase36/skill_judgment
b056e51cc7edae999383cc60fdbcc7a233d12701
fe1cae79e58a2cc165381603de87d6aa305681b7
refs/heads/master
2023-09-02T01:43:52.209828
2021-10-13T09:51:50
2021-10-13T09:51:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
497
java
package D; import java.util.Scanner; public class D123 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // Scannerクラスのインスタンスを作成、引数で標準入力System.inを指定 int x = sc.nextInt(); //nextInt()メソッドで数値として取得 sc.nextLine(); //nextLine()メソッドで改行 //結果を出力 if (x < 10000) { System.out.println(x + 10000); } else { System.out.println(x); } } }
185d6a9ad89db8035cf6b584d8a64741cffcc6b8
bd13a356d6db0784dad6231360f9c53009011cc5
/src/main/java/net/laflash/msscbrewery/web/controller/BeerController.java
e8c7b6e197b64a61960ea811dce9c4221f1d7e49
[]
no_license
JLaFlash/mssc-brewery
1bcfc8b109b4bb7ba25d226a28abb36992ba2ded
193330eb30f98bcdc88b838df2d7aeab26c6271c
refs/heads/master
2020-12-05T16:48:28.190770
2020-01-09T02:01:24
2020-01-09T02:01:24
232,177,348
0
0
null
null
null
null
UTF-8
Java
false
false
1,748
java
package net.laflash.msscbrewery.web.controller; import net.laflash.msscbrewery.services.BeerService; import net.laflash.msscbrewery.web.model.BeerDto; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.UUID; @RequestMapping("api/v1/beer") @RestController public class BeerController { private final BeerService beerService; public BeerController(BeerService beerService) { this.beerService = beerService; } @GetMapping("/{beerId}") public ResponseEntity<BeerDto> getBeer(@PathVariable(name = "beerId" ) UUID beerId){ return new ResponseEntity<>(beerService.getBeerById(beerId), HttpStatus.OK); } @PostMapping("/") public ResponseEntity<BeerDto> handlePost(@Valid @RequestBody() BeerDto beerDto){ BeerDto newbeerDto = beerService.saveNewBeer(beerDto); HttpHeaders headers = new HttpHeaders(); headers.add("Location", "api/v1/beer/" + newbeerDto.getId().toString()); return new ResponseEntity(headers, HttpStatus.CREATED); } @PutMapping("/{beerId}") public ResponseEntity handleUpdate(@PathVariable(name = "beerId") UUID id, @Valid @RequestBody() BeerDto beerDto){ beerService.updateBeer(id, beerDto); return new ResponseEntity(HttpStatus.NO_CONTENT); } @DeleteMapping("/{beerId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void daleteBeer(@PathVariable(name = "beerId") UUID id){ beerService.daleteById(id); } }
7565032549825814ba36cbea6ebbc367b1a571d4
a0eb97fa249bd9390c28404d7c3fe857677cde7b
/EDC/localux/Formule.java
2fd9c373822aa7b36ac3f03c1505fc9f3ac69c4f
[]
no_license
LevezoErell/EDC_Localux
0705ac51fe1c4d067dc2c203177f6b7f56b2cca8
2cc4739a754edfe2bb109e904c6d5f898b23a65e
refs/heads/master
2021-04-21T06:28:34.429788
2020-03-24T16:28:49
2020-03-24T16:28:49
249,757,177
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
package localux; abstract class Formule { /** * Variables */ public int id; public String libelle; /** * Constructeur vide */ public Formule() { } /** * Constructeur * * @param unId * @param unLibelle */ public Formule(int unId, String unLibelle) { this.id = unId; this.libelle = unLibelle; } /** * Mutateurs et accesseurs * @return id */ public int getId() { return id; } public void setId(int id) { this.id = id; } public String getLibelle() { return libelle; } public void setLibelle(String libelle) { this.libelle = libelle; } }
9d705d1075e664f8cd86c2e6f7a7c1b282378eb4
54049f14d790bdc6532bece8b59cce9a8410dfff
/beast-mcmc-srp/src/dr/app/beagle/evomodel/treelikelihood/AbstractTreeLikelihood.java
a09e35b7a2a4314389adec238dc53c71e72291c5
[]
no_license
RodrigoLab/snowgoose
82674a6e4e38cb3e453dc24fc721f653c67e13b3
c780adc2c219f65bd571f664eeff112b1be592b7
refs/heads/develop
2021-01-17T07:01:18.844096
2016-10-27T20:41:02
2016-10-27T20:41:02
16,417,069
0
0
null
2016-10-27T20:41:02
2014-01-31T18:51:21
Java
UTF-8
Java
false
false
8,871
java
/* * AbstractTreeLikelihood.java * * Copyright (c) 2002-2013 Alexei Drummond, Andrew Rambaut and Marc Suchard * * This file is part of BEAST. * See the NOTICE file distributed with this work for additional * information regarding copyright ownership and licensing. * * BEAST is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * BEAST is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with BEAST; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ package dr.app.beagle.evomodel.treelikelihood; import dr.evolution.alignment.PatternList; import dr.evolution.datatype.DataType; import dr.evolution.tree.NodeRef; import dr.evomodel.tree.TreeModel; import dr.inference.model.*; import dr.xml.Reportable; /** * AbstractTreeLikelihood - a base class for likelihood calculators of sites on a tree. * * @author Andrew Rambaut * @author Marc Suchard * @version $Id: AbstractTreeLikelihood.java,v 1.16 2005/06/07 16:27:39 alexei Exp $ */ public abstract class AbstractTreeLikelihood extends AbstractModelLikelihood implements Reportable { protected static final boolean COUNT_TOTAL_OPERATIONS = false; public AbstractTreeLikelihood(String name, PatternList patternList, TreeModel treeModel) { super(name); this.patternList = patternList; this.dataType = patternList.getDataType(); patternCount = patternList.getPatternCount(); stateCount = dataType.getStateCount(); patternWeights = patternList.getPatternWeights(); this.treeModel = treeModel; addModel(treeModel); nodeCount = treeModel.getNodeCount(); updateNode = new boolean[nodeCount]; for (int i = 0; i < nodeCount; i++) { updateNode[i] = true; } likelihoodKnown = false; } /** * Set update flag for a node and its children */ protected void updateNode(NodeRef node) { updateNode[node.getNumber()] = true; likelihoodKnown = false; } /** * Set update flag for a node and its direct children */ protected void updateNodeAndChildren(NodeRef node) { updateNode[node.getNumber()] = true; for (int i = 0; i < treeModel.getChildCount(node); i++) { NodeRef child = treeModel.getChild(node, i); updateNode[child.getNumber()] = true; } likelihoodKnown = false; } /** * Set update flag for a node and all its descendents */ protected void updateNodeAndDescendents(NodeRef node) { updateNode[node.getNumber()] = true; for (int i = 0; i < treeModel.getChildCount(node); i++) { NodeRef child = treeModel.getChild(node, i); updateNodeAndDescendents(child); } likelihoodKnown = false; } /** * Set update flag for all nodes */ protected void updateAllNodes() { for (int i = 0; i < nodeCount; i++) { updateNode[i] = true; } likelihoodKnown = false; } /** * Set update flag for a pattern */ protected void updatePattern(int i) { if (updatePattern != null) { updatePattern[i] = true; } likelihoodKnown = false; } /** * Set update flag for all patterns */ protected void updateAllPatterns() { if (updatePattern != null) { for (int i = 0; i < patternCount; i++) { updatePattern[i] = true; } } likelihoodKnown = false; } public final double[] getPatternWeights() { return patternWeights; } // ************************************************************** // VariableListener IMPLEMENTATION // ************************************************************** protected void handleVariableChangedEvent(Variable variable, int index, Parameter.ChangeType type) { // do nothing } // ************************************************************** // Model IMPLEMENTATION // ************************************************************** protected void handleModelChangedEvent(Model model, Object object, int index) { if (COUNT_TOTAL_OPERATIONS) totalModelChangedCount++; likelihoodKnown = false; } /** * Stores the additional state other than model components */ protected void storeState() { storedLikelihoodKnown = likelihoodKnown; storedLogLikelihood = logLikelihood; } /** * Restore the additional stored state */ protected void restoreState() { likelihoodKnown = storedLikelihoodKnown; logLikelihood = storedLogLikelihood; } protected void acceptState() { } // nothing to do // ************************************************************** // Likelihood IMPLEMENTATION // ************************************************************** public final Model getModel() { return this; } public final double getLogLikelihood() { if (COUNT_TOTAL_OPERATIONS) totalGetLogLikelihoodCount++; if (CompoundLikelihood.DEBUG_PARALLEL_EVALUATION) { System.err.println((likelihoodKnown ? "lazy" : "evaluate")); } if (!likelihoodKnown) { if (COUNT_TOTAL_OPERATIONS) totalCalculateLikelihoodCount++; logLikelihood = calculateLogLikelihood(); likelihoodKnown = true; } return logLikelihood; } /** * Forces a complete recalculation of the likelihood next time getLikelihood is called */ public void makeDirty() { if (COUNT_TOTAL_OPERATIONS) totalMakeDirtyCount++; likelihoodKnown = false; updateAllNodes(); updateAllPatterns(); } protected abstract double calculateLogLikelihood(); public String getReport() { if (hasInitialized) { String rtnValue = getClass().getName() + "(" + getLogLikelihood() + ")"; if (COUNT_TOTAL_OPERATIONS) rtnValue += " total operations = " + totalOperationCount + " matrix updates = " + totalMatrixUpdateCount + " model changes = " + totalModelChangedCount + " make dirties = " + totalMakeDirtyCount + " calculate likelihoods = " + totalCalculateLikelihoodCount + " get likelihoods = " + totalGetLogLikelihoodCount + " all rate updates = " + totalRateUpdateAllCount + " partial rate updates = " + totalRateUpdateSingleCount; return rtnValue; } else { return getClass().getName() + "(uninitialized)"; } } // ************************************************************** // INSTANCE VARIABLES // ************************************************************** /** * the tree */ protected TreeModel treeModel = null; /** * the patternList */ protected PatternList patternList = null; protected DataType dataType = null; /** * the pattern weights */ protected double[] patternWeights; /** * the number of patterns */ protected int patternCount; /** * the number of states in the data */ protected int stateCount; /** * the number of nodes in the tree */ protected int nodeCount; /** * Flags to specify which patterns are to be updated */ protected boolean[] updatePattern = null; /** * Flags to specify which nodes are to be updated */ protected boolean[] updateNode; private double logLikelihood; private double storedLogLikelihood; protected boolean likelihoodKnown = false; private boolean storedLikelihoodKnown = false; protected boolean hasInitialized = false; protected int totalOperationCount = 0; protected int totalMatrixUpdateCount = 0; protected int totalGetLogLikelihoodCount = 0; protected int totalModelChangedCount = 0; protected int totalMakeDirtyCount = 0; protected int totalCalculateLikelihoodCount = 0; protected int totalRateUpdateAllCount = 0; protected int totalRateUpdateSingleCount = 0; }
4b1da4d01fe060e9a1392a94d105be86f76759a5
b8654a4a4459a43861dc87b21e7985f2f5b6f27a
/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java
4c5b0e0c9dec902353405d1d180bba80f2024f92
[ "MIT" ]
permissive
bitdinar/bitdinarwallet
e68b6ed3c1a63a9bd2b6a6d736a685361885dd59
ba2b1a376316904ffd0b4622e7c743dcf5200a33
refs/heads/master
2021-01-24T04:36:23.013028
2018-02-26T09:25:20
2018-02-26T09:25:20
122,740,925
0
0
null
null
null
null
UTF-8
Java
false
false
20,829
java
package com.breadwallet.tools.manager; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.util.Log; import com.breadwallet.tools.util.BRConstants; import org.json.JSONArray; import java.util.ArrayList; import java.util.Currency; import java.util.List; import java.util.Locale; import java.util.UUID; import static com.breadwallet.tools.util.BRConstants.GEO_PERMISSIONS_REQUESTED; import static com.breadwallet.tools.util.BRConstants.receive; /** * BreadWallet * <p> * Created by Mihail Gutan <[email protected]> on 6/13/16. * Copyright (c) 2016 breadwallet LLC * <p> * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * <p> * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * <p> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ public class BRSharedPrefs { public static final String TAG = BRSharedPrefs.class.getName(); public static List<OnIsoChangedListener> isoChangedListeners = new ArrayList<>(); public interface OnIsoChangedListener { void onIsoChanged(String iso); } public static void addIsoChangedListener(OnIsoChangedListener listener) { if (isoChangedListeners == null) { isoChangedListeners = new ArrayList<>(); } if (!isoChangedListeners.contains(listener)) isoChangedListeners.add(listener); } public static void removeListener(OnIsoChangedListener listener) { if (isoChangedListeners == null) { isoChangedListeners = new ArrayList<>(); } isoChangedListeners.remove(listener); } public static String getIso(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); String defIso; try { defIso = "TND";// Currency.getInstance(Locale.getDefault()).getCurrencyCode(); } catch (IllegalArgumentException e) { e.printStackTrace(); defIso = "TND";// Currency.getInstance(Locale.US).getCurrencyCode(); } return settingsToGet.getString(BRConstants.CURRENT_CURRENCY, defIso); } public static void putIso(Context context, String code) { SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putString(BRConstants.CURRENT_CURRENCY, code.equalsIgnoreCase(Locale.getDefault().getISO3Language()) ? null : code); editor.apply(); for (OnIsoChangedListener listener : isoChangedListeners) { if (listener != null) listener.onIsoChanged(code); } } public static boolean getPhraseWroteDown(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean(BRConstants.PHRASE_WRITTEN, false); } public static void putPhraseWroteDown(Context context, boolean check) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(BRConstants.PHRASE_WRITTEN, check); editor.apply(); } public static boolean getGreetingsShown(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean("greetingsShown", false); } public static void putGreetingsShown(Context context, boolean shown) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean("greetingsShown", shown); editor.apply(); } public static int getCurrencyListPosition(Context context) { SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); return settings.getInt(BRConstants.POSITION, 0); } public static void putCurrencyListPosition(Context context, int lastItemsPosition) { SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putInt(BRConstants.POSITION, lastItemsPosition); editor.apply(); } public static String getReceiveAddress(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString(BRConstants.RECEIVE_ADDRESS, ""); } public static void putReceiveAddress(Context ctx, String tmpAddr) { SharedPreferences.Editor editor = ctx.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE).edit(); editor.putString(BRConstants.RECEIVE_ADDRESS, tmpAddr); editor.apply(); } public static String getWalletName(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString(BRConstants.WALLET_NAME, "My Bread"); } public static void putWalletName(Context ctx, String name) { SharedPreferences.Editor editor = ctx.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE).edit(); editor.putString(BRConstants.WALLET_NAME, name); editor.apply(); } public static String getFirstAddress(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString(BRConstants.FIRST_ADDRESS, ""); } public static void putFirstAddress(Context context, String firstAddress) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString(BRConstants.FIRST_ADDRESS, firstAddress); editor.apply(); } public static long getFeePerKb(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getLong(BRConstants.FEE_KB_PREFS, 0); } public static void putFeePerKb(Context context, long fee) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong(BRConstants.FEE_KB_PREFS, fee); editor.apply(); } public static long getEconomyFeePerKb(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getLong(BRConstants.ECONOMY_FEE_KB_PREFS, 0); } public static void putEconomyFeePerKb(Context context, long fee) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong(BRConstants.ECONOMY_FEE_KB_PREFS, fee); editor.apply(); } public static long getCatchedBalance(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getLong("balance", 0); } public static void putCatchedBalance(Context context, long fee) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong("balance", fee); editor.apply(); } public static long getSecureTime(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getLong(BRConstants.SECURE_TIME_PREFS, System.currentTimeMillis() / 1000); } //secure time from the server public static void putSecureTime(Context activity, long date) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong(BRConstants.SECURE_TIME_PREFS, date); editor.apply(); } public static long getLastSyncTime(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getLong("lastSyncTime", 0); } public static void putLastSyncTime(Context activity, long time) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong("lastSyncTime", time); editor.apply(); } public static long getFeeTime(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getLong("feeTime", 0); } public static void putFeeTime(Context activity, long feeTime) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong("feeTime", feeTime); editor.apply(); } public static List<Integer> getBitIdNonces(Context activity, String key) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); String result = prefs.getString(key, null); List<Integer> list = new ArrayList<>(); try { JSONArray arr = new JSONArray(result); for (int i = 0; i < arr.length(); i++) { int a = arr.getInt(i); Log.d("found a nonce: ", a + ""); list.add(a); } } catch (Exception e) { e.printStackTrace(); } return list; } public static void putBitIdNonces(Context activity, List<Integer> nonces, String key) { JSONArray arr = new JSONArray(); arr.put(nonces); SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString(key, arr.toString()); editor.apply(); } public static boolean getAllowSpend(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean(BRConstants.ALLOW_SPEND, true); } public static void putAllowSpend(Context activity, boolean allow) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(BRConstants.ALLOW_SPEND, allow); editor.apply(); } //if the user prefers all in bitcoin units, not other currencies public static boolean getPreferredBTC(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean("priceSetToBitcoin", true); } //if the user prefers all in bitcoin units, not other currencies public static void putPreferredBTC(Context activity, boolean b) { Log.e(TAG, "putPreferredBTC: " + b); SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean("priceSetToBitcoin", b); editor.apply(); } //if the user prefers all in bitcoin units, not other currencies public static boolean getUseFingerprint(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean("useFingerprint", false); } //if the user prefers all in bitcoin units, not other currencies public static void putUseFingerprint(Context activity, boolean use) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean("useFingerprint", use); editor.apply(); } public static boolean getFeatureEnabled(Context activity, String feature) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean(feature, false); } public static void putFeatureEnabled(Context activity, boolean enabled, String feature) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(feature, enabled); editor.apply(); } public static boolean getGeoPermissionsRequested(Context activity) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getBoolean(GEO_PERMISSIONS_REQUESTED, false); } public static void putGeoPermissionsRequested(Context activity, boolean requested) { SharedPreferences prefs = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(GEO_PERMISSIONS_REQUESTED, requested); editor.apply(); } public static int getStartHeight(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); return settingsToGet.getInt(BRConstants.START_HEIGHT, 0); } public static void putStartHeight(Context context, int startHeight) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putInt(BRConstants.START_HEIGHT, startHeight); editor.apply(); } public static int getLastBlockHeight(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); return settingsToGet.getInt(BRConstants.LAST_BLOCK_HEIGHT, 0); } public static void putLastBlockHeight(Context context, int lastHeight) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putInt(BRConstants.LAST_BLOCK_HEIGHT, lastHeight); editor.apply(); } public static boolean getScanRecommended(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); return settingsToGet.getBoolean("scanRecommended", false); } public static void putScanRecommended(Context context, boolean recommended) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putBoolean("scanRecommended", recommended); editor.apply(); } public static int getCurrencyUnit(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); return settingsToGet.getInt(BRConstants.CURRENT_UNIT, BRConstants.CURRENT_UNIT_BITCOINS); } public static void putCurrencyUnit(Context context, int unit) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putInt(BRConstants.CURRENT_UNIT, unit); editor.apply(); } public static String getDeviceId(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); String deviceId = settingsToGet.getString(BRConstants.USER_ID, ""); if (deviceId.isEmpty()) setDeviceId(context, UUID.randomUUID().toString()); return (settingsToGet.getString(BRConstants.USER_ID, "")); } private static void setDeviceId(Context context, String uuid) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putString(BRConstants.USER_ID, uuid); editor.apply(); } public static void clearAllPrefs(Context activity) { SharedPreferences.Editor editor = activity.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE).edit(); editor.clear(); editor.apply(); } public static boolean getShowNotification(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return settingsToGet.getBoolean("showNotification", false); } public static void putShowNotification(Context context, boolean show) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putBoolean("showNotification", show); editor.apply(); } public static boolean getShareData(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return settingsToGet.getBoolean("shareData", false); } public static void putShareData(Context context, boolean show) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putBoolean("shareData", show); editor.apply(); } public static boolean getShareDataDismissed(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return settingsToGet.getBoolean("shareDataDismissed", false); } public static void putShareDataDismissed(Context context, boolean dismissed) { if (context == null) return; SharedPreferences settings = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putBoolean("shareDataDismissed", dismissed); editor.apply(); } public static String getBCHTxId(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString("bchTxId", ""); } public static void putBCHTxId(Context context, String txId) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString("bchTxId", txId); editor.apply(); } public static String getTrustNode(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString("trustNode", ""); } public static void putTrustNode(Context context, String trustNode) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString("trustNode", trustNode); editor.apply(); } }
daf2b350b08a5b0536e0bb8c12b52e90b6a4f87f
30876e27edec62989a8274c19c24810251da99f2
/src/java/beans/AntivirusController.java
cfbd35be37663466aee6cf4eeaddc57a60ed52c5
[]
no_license
sarracent/records-manager
52d4f22ec2e1c1cdf9ee6d7dd98dbfe7ba9273df
88ebc3b1c9c0bd528e7a692ff0ed32057c4e583a
refs/heads/master
2020-04-02T11:19:39.315423
2018-10-23T10:28:01
2018-10-23T10:28:01
154,382,131
0
0
null
null
null
null
UTF-8
Java
false
false
5,522
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package beans; import beans.util.JsfUtil; import beans.util.JsfUtil.PersistAction; import static beans.util.JsfUtil.addErrorMessage; import java.io.Serializable; import java.util.List; import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; import javax.ejb.EJB; import javax.ejb.EJBException; import javax.inject.Named; import javax.enterprise.context.SessionScoped; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.FacesConverter; @Named("antivirusController") @SessionScoped public class AntivirusController implements Serializable { @EJB private beans.AntivirusFacade ejbFacade; private List<Antivirus> items = null; private Antivirus selected; public AntivirusController() { } public Antivirus getSelected() { return selected; } public void setSelected(Antivirus selected) { this.selected = selected; } protected void setEmbeddableKeys() { } protected void initializeEmbeddableKey() { } private AntivirusFacade getFacade() { return ejbFacade; } public Antivirus prepareCreate() { selected = new Antivirus(); initializeEmbeddableKey(); return selected; } public void create() { persist(PersistAction.CREATE, ResourceBundle.getBundle("/Bundle").getString("AntivirusCreated")); if (!JsfUtil.isValidationFailed()) { items = null; // Invalidate list of items to trigger re-query. } } public void update() { persist(PersistAction.UPDATE, ResourceBundle.getBundle("/Bundle").getString("AntivirusUpdated")); } public void destroy() { persist(PersistAction.DELETE, ResourceBundle.getBundle("/Bundle").getString("AntivirusDeleted")); if (!JsfUtil.isValidationFailed()) { selected = null; // Remove selection items = null; // Invalidate list of items to trigger re-query. } } public List<Antivirus> getItems() { if (items == null) { items = getFacade().findAll(); } return items; } private void persist(PersistAction persistAction, String successMessage) { if (selected != null) { setEmbeddableKeys(); try { if (persistAction != PersistAction.DELETE) { getFacade().edit(selected); } else { getFacade().remove(selected); } JsfUtil.addSuccessMessage(successMessage); } catch (EJBException ex) { String msg = ""; Throwable cause = ex.getCause(); if (cause != null) { msg = cause.getLocalizedMessage(); } if (msg.length() > 0) { addErrorMessage("El Antivirus ya existe, introduzca uno nuevo"); } else { JsfUtil.addErrorMessage(ex, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); } } catch (Exception ex) { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, ex); JsfUtil.addErrorMessage(ex, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); } } } public Antivirus getAntivirus(java.lang.Integer id) { return getFacade().find(id); } public List<Antivirus> getItemsAvailableSelectMany() { return getFacade().findAll(); } public List<Antivirus> getItemsAvailableSelectOne() { return getFacade().findAll(); } @FacesConverter(forClass = Antivirus.class) public static class AntivirusControllerConverter implements Converter { @Override public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { if (value == null || value.length() == 0) { return null; } AntivirusController controller = (AntivirusController) facesContext.getApplication().getELResolver(). getValue(facesContext.getELContext(), null, "antivirusController"); return controller.getAntivirus(getKey(value)); } java.lang.Integer getKey(String value) { java.lang.Integer key; key = Integer.valueOf(value); return key; } String getStringKey(java.lang.Integer value) { StringBuilder sb = new StringBuilder(); sb.append(value); return sb.toString(); } @Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null) { return null; } if (object instanceof Antivirus) { Antivirus o = (Antivirus) object; return getStringKey(o.getId()); } else { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "object {0} is of type {1}; expected type: {2}", new Object[]{object, object.getClass().getName(), Antivirus.class.getName()}); return null; } } } }
c4dd28b315647f9908999d162947bc3e954de631
97faab88539c707483d7de5aaedbf7e1a551889e
/src/com/leetcode/ValidAnagram.java
f42fadcf2db0e58736254b23441e9bec9739ecfc
[]
no_license
syedirfan33/ProblemSolving
83cf047c1f08ed089553401e61561e7e560e4712
07f0e565f3f6d39d10d3464f2aafe5b6de6bc3e5
refs/heads/master
2023-08-15T12:53:53.922113
2021-09-25T04:04:26
2021-09-25T04:04:26
261,063,747
1
1
null
null
null
null
UTF-8
Java
false
false
598
java
package com.leetcode; import java.util.HashMap; import java.util.Map; public class ValidAnagram { // To solve the follow up, can use hashtable instead of char array public boolean isAnagram(String s, String t) { if (s.length() != t.length()) return false; Map<Character, Integer> map = new HashMap<>(); for (char c : s.toCharArray()) map.put(c, map.getOrDefault(c, 0) + 1); for (char c : t.toCharArray()) { if (!map.containsKey(c) || map.get(c) == 0) return false; map.put(c, map.get(c) - 1); } return true; } }
74391eb8d4dbd024f3423c5486c3dbbee9c72208
2fda0a2f1f5f5d4e7d72ff15a73a4d3e1e93abeb
/proFL-plugin-2.0.3/org/pitest/reloc/antlr/common/preprocessor/Tool.java
d287d588ed84e60ed0185a11e2a8becce7f2a70f
[ "MIT" ]
permissive
ycj123/Research-Project
d1a939d99d62dc4b02d9a8b7ecbf66210cceb345
08296e0075ba0c13204944b1bc1a96a7b8d2f023
refs/heads/main
2023-05-29T11:02:41.099975
2021-06-08T13:33:26
2021-06-08T13:33:26
374,899,147
0
0
null
null
null
null
UTF-8
Java
false
false
4,984
java
// // Decompiled by Procyon v0.5.36 // package org.pitest.reloc.antlr.common.preprocessor; import java.io.File; import java.util.Enumeration; import java.io.IOException; import java.io.FileNotFoundException; import org.pitest.reloc.antlr.common.collections.impl.Vector; public class Tool { protected Hierarchy theHierarchy; protected String grammarFileName; protected String[] args; protected int nargs; protected Vector grammars; protected org.pitest.reloc.antlr.common.Tool antlrTool; public Tool(final org.pitest.reloc.antlr.common.Tool antlrTool, final String[] array) { this.antlrTool = antlrTool; this.processArguments(array); } public static void main(final String[] array) { final Tool tool = new Tool(new org.pitest.reloc.antlr.common.Tool(), array); tool.preprocess(); final String[] preprocessedArgList = tool.preprocessedArgList(); for (int i = 0; i < preprocessedArgList.length; ++i) { System.out.print(" " + preprocessedArgList[i]); } System.out.println(); } public boolean preprocess() { if (this.grammarFileName == null) { this.antlrTool.toolError("no grammar file specified"); return false; } if (this.grammars != null) { this.theHierarchy = new Hierarchy(this.antlrTool); final Enumeration elements = this.grammars.elements(); while (elements.hasMoreElements()) { final String str = elements.nextElement(); try { this.theHierarchy.readGrammarFile(str); continue; } catch (FileNotFoundException ex) { this.antlrTool.toolError("file " + str + " not found"); return false; } break; } } if (!this.theHierarchy.verifyThatHierarchyIsComplete()) { return false; } this.theHierarchy.expandGrammarsInFile(this.grammarFileName); final GrammarFile file = this.theHierarchy.getFile(this.grammarFileName); final String nameForExpandedGrammarFile = file.nameForExpandedGrammarFile(this.grammarFileName); if (nameForExpandedGrammarFile.equals(this.grammarFileName)) { this.args[this.nargs++] = this.grammarFileName; } else { try { file.generateExpandedFile(); this.args[this.nargs++] = this.antlrTool.getOutputDirectory() + System.getProperty("file.separator") + nameForExpandedGrammarFile; } catch (IOException ex2) { this.antlrTool.toolError("cannot write expanded grammar file " + nameForExpandedGrammarFile); return false; } } return true; } public String[] preprocessedArgList() { final String[] args = new String[this.nargs]; System.arraycopy(this.args, 0, args, 0, this.nargs); return this.args = args; } private void processArguments(final String[] array) { this.nargs = 0; this.args = new String[array.length]; for (int i = 0; i < array.length; ++i) { if (array[i].length() == 0) { this.antlrTool.warning("Zero length argument ignoring..."); } else if (array[i].equals("-glib")) { if (File.separator.equals("\\") && array[i].indexOf(47) != -1) { this.antlrTool.warning("-glib cannot deal with '/' on a PC: use '\\'; ignoring..."); } else { final org.pitest.reloc.antlr.common.Tool antlrTool = this.antlrTool; this.grammars = org.pitest.reloc.antlr.common.Tool.parseSeparatedList(array[i + 1], ';'); ++i; } } else if (array[i].equals("-o")) { this.args[this.nargs++] = array[i]; if (i + 1 >= array.length) { this.antlrTool.error("missing output directory with -o option; ignoring"); } else { ++i; this.args[this.nargs++] = array[i]; this.antlrTool.setOutputDirectory(array[i]); } } else if (array[i].charAt(0) == '-') { this.args[this.nargs++] = array[i]; } else { this.grammarFileName = array[i]; if (this.grammars == null) { this.grammars = new Vector(10); } this.grammars.appendElement(this.grammarFileName); if (i + 1 < array.length) { this.antlrTool.warning("grammar file must be last; ignoring other arguments..."); break; } } } } }
4e1e279ae65f8fdea69741471828c50e37b3c175
96448b53a15b5172483151dc7cf926e3f39363c2
/ledger/nuls-ledger/src/main/java/io/nuls/ledger/rpc/cmd/ValidatorCmd.java
b199f03044f6bc78a36783352c89be01d62519c0
[ "MIT" ]
permissive
wangko27/nuls_2.0
352f2d34143a48bec9fbd33bac5951fefda86c0f
09e95498909c01b85c07b604553eb6ed3577964f
refs/heads/develop
2020-04-04T22:19:23.261370
2018-12-14T08:24:33
2018-12-14T08:24:33
156,319,589
2
1
MIT
2018-12-14T03:02:19
2018-11-06T03:19:54
Java
UTF-8
Java
false
false
2,567
java
/*- * ⁣⁣ * MIT License * ⁣⁣ * Copyright (C) 2017 - 2018 nuls.io * ⁣⁣ * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * ⁣⁣ */ package io.nuls.ledger.rpc.cmd; import io.nuls.ledger.validator.CoinDataValidator; import io.nuls.rpc.cmd.BaseCmd; import io.nuls.rpc.model.CmdAnnotation; import io.nuls.rpc.model.message.Response; import io.nuls.tools.core.annotation.Autowired; import io.nuls.tools.core.annotation.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.math.BigInteger; import java.util.Map; /** * Created by wangkun23 on 2018/11/22. */ @Component public class ValidatorCmd extends BaseCmd { final Logger logger = LoggerFactory.getLogger(getClass()); @Autowired CoinDataValidator coinDataValidator; /** * validate coin data * * @param params * @return */ @CmdAnnotation(cmd = "lg_validateCoinData", version = 1.0, scope = "private", minEvent = 0, minPeriod = 0, description = "test getHeight 1.0") public Response validateCoinData(Map params) { //TODO.. 验证参数个数和格式 String address = (String) params.get("address"); Integer chainId = (Integer) params.get("chainId"); Integer assetId = (Integer) params.get("assetId"); BigInteger amount = (BigInteger) params.get("amount"); String nonce = (String) params.get("nonce"); Boolean result = coinDataValidator.validate(address, chainId, assetId, amount, nonce); return success(result); } }
45edeae0512d5fe6e58d35df3a2aae727387c4a3
3cc849f555953147e8051f623b8552ac17854399
/src/com/rds/bacera/mapper/RdsBaceraCTDnaMapper.java
2472762a4d6656881917d7815c7cdfcec24d957a
[]
no_license
clownlin22/judicial-web
c8444b17f16ec9a567d43786efce6ff8ce0c967b
6350aa62353187dc1ee5dac5b1f6322e5c2982c8
refs/heads/master
2020-05-07T22:23:21.426381
2019-04-12T06:07:00
2019-04-12T06:07:00
180,913,232
0
0
null
null
null
null
UTF-8
Java
false
false
276
java
package com.rds.bacera.mapper; import java.util.Map; import org.springframework.stereotype.Component; @Component("RdsBaceraCTDnaMapper") public interface RdsBaceraCTDnaMapper extends RdsBaceraBaseMapper { @SuppressWarnings("rawtypes") public int queryNumExit(Map map); }
86ff7a389f8618d822587f88096fd344eea488bf
48395b3679c84571f61c3bf53b6bce0ed3fc66e7
/homework3/calculator/CalculatorWithMemoryDecorator.java
10a728df081b11df1ef32614e6088ed5a9ebd02a
[]
no_license
MarZinchenko/HomeWorks
0f53b264d1f6a7ca0ff7a055900d3802401e0b65
eb87405d6cce54aae70efa35e30b61b0bafc5614
refs/heads/master
2023-02-07T20:40:35.080596
2021-01-03T22:02:48
2021-01-03T22:02:48
321,421,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,300
java
//8 package homework2.arrays.homework3.calculator; public class CalculatorWithMemoryDecorator implements ICalculator { private double memory; private double lastValue; ICalculator calculator; public CalculatorWithMemoryDecorator(ICalculator calculator){ this.calculator = calculator; } public ICalculator getCalculator(){ return this.calculator; } public void bringToMemory(double a){ this.memory = a; } public double getFromMemory(){ this.lastValue = this.memory; this.memory = 0; return lastValue ; } public double getLastValue(){ return this.lastValue; } public double div(double a, double b){ return this.calculator.div(a, b); } public double mult(double a, double b){ return this.calculator.mult(a, b); } public double plus(double a, double b){ return this.calculator.plus(a, b); } public double minus(double a, double b){ return this.calculator.minus(a, b); } public double pow(double a, int b){ return this.calculator.pow(a, b); } public double abs(double a){ return this.calculator.abs(a); } public double sqrt(double a){ return this.calculator.sqrt(a); } }
4c0582f18e1692767c794e2092675116ea4ddc2c
aa90cb116edbf586cb769797c49f4c46a0a0caed
/src/main/java/org/squiddev/plethora/api/module/AbstractModuleHandler.java
8c5902255ee3057a7b5ec7a93bbf8afd10872a2d
[ "MIT" ]
permissive
SquidDev-CC/plethora
c1cda54f9fc9ca163def4c4e78ddb69392e9f545
3c9b41561a3dcc45d08a9167f6e471638cf2e170
refs/heads/minecraft-1.12
2021-08-29T09:44:58.781157
2021-08-06T18:24:26
2021-08-06T18:24:26
61,070,151
64
56
MIT
2021-08-22T13:27:36
2016-06-13T21:14:19
Java
UTF-8
Java
false
false
588
java
package org.squiddev.plethora.api.module; import org.squiddev.plethora.api.method.IContextBuilder; import javax.annotation.Nonnull; /** * Some default implementations for {@link IModuleHandler} methods. * * It is recommended that all implementations extend this class: it allows additional methods * to be added to the module handler without introducing abstract method errors occurring. */ public abstract class AbstractModuleHandler implements IModuleHandler { @Override public void getAdditionalContext(@Nonnull IModuleAccess access, @Nonnull IContextBuilder builder) { } }
22cf368b9ed580a4fd1ac6c5814f4d491f711fde
1bd95dfc6d0cf71259569c1b520f1526fd273661
/src/main/java/com/sg/assignment/common/exception/InvalidUserException.java
0fecbd7704db6d15c30b0c4fd03e070e98a11960
[]
no_license
sg-object/sg-board
01849498188bfc5c9b138c59684514a4f519d3ec
ff45320241dbb504674c4b9a8834c164aa0d49af
refs/heads/master
2022-11-22T15:26:59.689176
2020-07-22T08:09:08
2020-07-22T08:09:08
280,802,009
0
0
null
2020-07-22T08:09:09
2020-07-19T05:55:38
Java
UTF-8
Java
false
false
291
java
package com.sg.assignment.common.exception; public class InvalidUserException extends AbstractException { private static final long serialVersionUID = -7537204630780202406L; @Override public String getErrorCode() { // TODO Auto-generated method stub return INVALID_USER_CODE; } }
bb018bf114d8acc60a0a750575566dd605fe03f8
db75c2977498151e949971627c5b6b111e7f6f69
/GuideProject/step/v28_04/src/main/java/com/eomcs/lms/handler/LessonDeleteCommand.java
81cac28fa26d2affc459554e46e50cbea8575274
[]
no_license
yh0921k/GuideProject
5bd7eb1882d07281ccafafb30bdfe5775bcd80ab
b8bba0025acc6086926e810b31ee2dc14efd207c
refs/heads/master
2020-11-26T03:12:27.536475
2020-04-20T09:06:27
2020-04-21T00:51:53
228,948,427
0
1
null
null
null
null
UTF-8
Java
false
false
855
java
package com.eomcs.lms.handler; import java.util.List; import com.eomcs.lms.domain.Lesson; import com.eomcs.util.Prompt; public class LessonDeleteCommand implements Command { List<Lesson> lessonList; Prompt prompt; public LessonDeleteCommand(Prompt prompt, List<Lesson> list) { this.prompt = prompt; this.lessonList = list; } @Override public void execute() { int index = indexOfLesson(prompt.inputInt("번호? ")); if (index == -1) { System.out.println("해당 번호의 수업이 없습니다."); return; } this.lessonList.remove(index); System.out.println("수업을 삭제했습니다."); } private int indexOfLesson(int no) { for (int i = 0; i < this.lessonList.size(); i++) { if (this.lessonList.get(i).getNo() == no) { return i; } } return -1; } }
58c2a0c19b689b03345177390c0096958b67e028
ca021ff2fb3d5abdaf7f65fbaab776e869ccd7a5
/src/fundationStructure/NextGreaterElement2.java
2c19bc4f077160d8b26fd8c6885ba5fe2a18a4be
[]
no_license
teddywang1992/leetcode
56ab4c072c9f0f2db31a0721294b1619a12856cd
7d676f2e67a1a2ba073a5c11fc5f17e8c6b77e69
refs/heads/master
2021-01-22T18:07:23.152614
2018-11-24T22:46:09
2018-11-24T22:46:09
100,737,117
0
0
null
null
null
null
UTF-8
Java
false
false
839
java
package fundationStructure; //take care of the corner case that two digit are same //so we need to store each time. so we can't use hashmap to do that. import java.util.Arrays; import java.util.Stack; public class NextGreaterElement2 { public int[] nextGreaterElements(int[] nums) { if (nums == null || nums.length == 0) { return new int[]{}; } int[] result = new int[nums.length]; Stack<Integer> stack = new Stack<>(); int n = nums.length; Arrays.fill(result, -1); for (int i = 1; i < 2 * n; i++) { if (i < n + 1) { stack.push(i - 1); } while(!stack.isEmpty() && nums[(i % n)] > nums[stack.peek()]) { result[stack.pop()] = nums[i % n]; } } return result; } }
62f14ad51f9f3f626323cb128e0000ee412ea6ba
676e021e420959a22f8eb326068576f93efe1f41
/src/main/java/com/diogorolins/battleShip/config/security/SecurityConfig.java
1159432c58f902c69be9e18155154be12e5a083b
[]
no_license
diogorolins/battleship-backend-old
d72c748d2566068463a63ddb3d3158b2daa13b44
f35ae039dfbd36e0efcaea3afaf5ff9583192161
refs/heads/master
2023-04-15T23:20:59.203086
2020-08-07T14:06:39
2020-08-07T14:06:39
278,490,519
0
0
null
2021-04-26T20:28:02
2020-07-09T23:13:33
Java
UTF-8
Java
false
false
3,488
java
package com.diogorolins.battleShip.config.security; import java.util.Arrays; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; @EnableWebSecurity @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Autowired private Environment env; @Autowired private AuthConfig authConfig; @Autowired private TokenService tokenService; private static final String[] PUBLIC_MATCHERS_POST = { "/players", "/auth" }; private static final String[] PUBLIC_MATCHERS_GET = { "/ships" }; private static final String[] PUBLIC_MATCHERS = { "/h2-console/**" }; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(authConfig).passwordEncoder(bCryptPasswordEncoder()); } @Override protected void configure(HttpSecurity http) throws Exception { if(Arrays.asList(env.getActiveProfiles()).contains("dev")) { http.headers().frameOptions().disable(); } http.cors().and().csrf().disable(); http.authorizeRequests() .antMatchers(HttpMethod.POST,PUBLIC_MATCHERS_POST).permitAll() .antMatchers(HttpMethod.POST,PUBLIC_MATCHERS_GET).permitAll() .antMatchers(PUBLIC_MATCHERS).permitAll() .anyRequest().authenticated(); http.addFilter(new JWTAuthenticationFilter(authenticationManager(), tokenService)); http.addFilter(new JWTAuthorizationFilter(authenticationManager(), tokenService, authConfig)); http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); } @Override public void configure(WebSecurity web) throws Exception { } @Override @Bean protected AuthenticationManager authenticationManager() throws Exception { return super.authenticationManager(); } @Bean public BCryptPasswordEncoder bCryptPasswordEncoder() { return new BCryptPasswordEncoder(); } @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration config = new CorsConfiguration().applyPermitDefaultValues(); config.setAllowedMethods(Arrays.asList("POST", "GET", "PUT", "DELETE", "OPTIONS", "PATCH")); final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", config); return source; } }
[ "=" ]
=
036a36071ce71a699e7894d2a3844da452c14373
c064a1024ee3ead27c629016a4b278005ab68583
/Ticket.java
6bbfe0069795804748c59aada9fbcf224496c6af
[]
no_license
rgupta47/Ticketing-System
efb1426505280e8e2f9e1d81f08bd42eba357750
6f5c5f790712c935ed7de2160f465125fc37ff07
refs/heads/master
2021-09-12T15:29:17.731700
2018-04-18T02:46:32
2018-04-18T02:46:32
114,855,170
0
0
null
null
null
null
UTF-8
Java
false
false
2,664
java
public class Ticket { private static int autoTicketID = 0; protected String ticketID; protected String customerRepID; protected String dateCreated; protected String customerServiceRepID; protected boolean isResolved; protected int departmentID; protected CustomerInformation customerInformationObject; protected ServiceInformation serviceInformationObject; protected Transcript transcriptObject; public Ticket(){ ticketID = "TK" + String.valueOf(autoTicketID++); customerRepID = ""; dateCreated = ""; customerServiceRepID = ""; isResolved = false; departmentID = -1; customerInformationObject = new CustomerInformation(); serviceInformationObject = new ServiceInformation(); transcriptObject = new Transcript(); } } class CustomerInformation { private static int autoIncrementCustomerId = 0; private String customerID; private String customerName; private int customerPhoneNumber; private String customerAddress; public CustomerInformation(){ autoIncrementCustomerId++; customerID = String.valueOf(autoIncrementCustomerId); customerName = ""; customerPhoneNumber = -1; customerAddress = ""; } public String getCustomerID() { return customerID; } public void setCustomerID(String customerID) { this.customerID = customerID; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } public int getCustomerPhoneNumber() { return customerPhoneNumber; } public void setCustomerPhoneNumber(int customerPhoneNumber) { this.customerPhoneNumber = customerPhoneNumber; } public String getCustomerAddress() { return customerAddress; } public void setCustomerAddress(String customerAddress) { this.customerAddress = customerAddress; } } class ServiceInformation { private String serviceID; private String serviceStartDate; private String serviceEndDate; public ServiceInformation(){ serviceID = ""; serviceStartDate = ""; serviceEndDate = ""; } public String getServiceID() { return serviceID; } public void setServiceID(String serviceID) { this.serviceID = serviceID; } public String getServiceStartDate() { return serviceStartDate; } public void setServiceStartDate(String serviceStartDate) { this.serviceStartDate = serviceStartDate; } public String getServiceEndDate() { return serviceEndDate; } public void setServiceEndDate(String serviceEndDate) { this.serviceEndDate = serviceEndDate; } }
894e1379e74e3eeed314cb8e999c626491a8a928
3000f3e038b7257ee418837ff079b65e3185bf9a
/assignment2/Calculator/src/testcase/CalculatorTest.java
32064796ee551b4c4aa9eb6555224199833edacd
[]
no_license
tvidyadhari/epam
065dfaf3fa2c386c102b9ee2ecc5f8c5f638e69b
4f0156462b088eb790e4d44bd61aa135406f2f8a
refs/heads/master
2020-05-03T10:04:11.305053
2019-06-29T08:46:01
2019-06-29T08:46:01
178,570,491
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package testcase; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import logic.Calculator; class CalculatorTest { @Test void testAdd() { assertEquals(0, Calculator.add(-1, 1)); assertEquals(55, Calculator.add(45, 10)); assertEquals(10, Calculator.add(5, 5)); } @Test void testMultiply() { assertEquals(15, Calculator.multiply(3, 5)); assertEquals(0, Calculator.multiply(3, 0)); assertEquals(-15, Calculator.multiply(3, -5)); } @Test void testDivide() { assertEquals(0, Calculator.divide(0, 1)); assertEquals(5, Calculator.divide(25, 5)); assertEquals(2, Calculator.divide(25, 11)); assertThrows(ArithmeticException.class, () -> { Calculator.divide(1, 0); }); } }
c791b8ac513afd1706cfd5e80557d67efb59d646
252fce0244897d2b387d5be3d84deec78e7c524f
/LiteratureManage/src/com/teamghz/action/PanelAction.java
7a368e7cd8e9f57fa15d6c2ebdcc45407d5cc14d
[]
no_license
gaohuangzhang/LiteratureReadingNotes
9f23f096415bb390959a3f8f577713495f11d50b
bfc64b9bce5ad893b49638c8b8af2be85a02ec6d
refs/heads/master
2021-01-19T04:38:43.345007
2016-12-14T10:49:43
2016-12-14T10:49:43
69,084,988
4
8
null
2016-12-13T13:38:59
2016-09-24T06:32:23
Java
UTF-8
Java
false
false
565
java
package com.teamghz.action; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.struts2.ServletActionContext; import com.teamghz.configure.*; import com.teamghz.connecter.*; public class PanelAction { public String signOut() { ServletRequest request = ServletActionContext.getRequest(); HttpServletRequest req = (HttpServletRequest) request; HttpSession session = req.getSession(); session.invalidate(); System.out.println("SignOut"); return "SUCCESS"; } }
87a70ff726f943a561541a01b3eff5d88e4d29bd
0916b7b92eb92627b023e776d5a5119f4b16d827
/hciDesktop/src/mainPackage/Main.java
3fbfd4ee016dc2301f3a5ca75fe7064c58a5cd79
[]
no_license
ddome/tphci2009c2
130e3c538171b6600828d4e7bd7818f744e44ef4
136fdb36faebe692beb64bb64ab1286a8c1d0ccb
refs/heads/master
2021-01-10T11:55:04.463576
2009-11-24T03:48:29
2009-11-24T03:48:29
53,597,276
0
0
null
null
null
null
UTF-8
Java
false
false
5,086
java
package mainPackage; import java.awt.event.ActionListener; import java.util.Locale; import org.jdesktop.application.*; import javax.swing.*; import utils.LanguageSession; import utils.Session; import servicesHandler.LogoutHandler; public class Main extends SingleFrameApplication{ static JMenuBar mbar= new JMenuBar(); static JMenu searchD = new JMenu(); static JMenu userD = new JMenu(); static JMenuItem menuItemLanguaje= new JMenuItem(); static JMenuItem login = new JMenuItem(); static JMenuItem register = new JMenuItem(); static JMenuItem password = new JMenuItem(); static JMenuItem account = new JMenuItem(); static JMenuItem logout = new JMenuItem(); static JMenuItem search = new JMenuItem(); static String confirmExitTitle; static String confirmExitMsg; static JFrame main; public static JFrame myFrame; @SuppressWarnings("deprecation") protected void startup() { myFrame = getMainFrame(); myFrame.setName("mainFrame"); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(Password.class); confirmExitTitle=resourceMap.getString("confirmExitTitle.text"); confirmExitMsg=resourceMap.getString("confirmExitMsg.text"); new Session(); searchD.setName("searchMenu"); userD.setName("userMenu"); login.setName("loginDialog"); password.setName("passwordDialog"); account.setName("accountDialog"); register.setName("registerDialog"); logout.setName("logoutAction"); search.setName("searchDialog"); login.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JFrame mainFrame = getMainFrame(); mainFrame.setEnabled(false); Login login = new Login(); login.setLocationRelativeTo(mainFrame); login.setVisible(true); login.setResizable(false); }; }); search.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JFrame mainFrame = getMainFrame(); Search login = new Search(); login.setLocationRelativeTo(mainFrame); login.setVisible(true); login.setResizable(false); }; }); register.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JFrame mainFrame = getMainFrame(); mainFrame.setEnabled(false); Register register = new Register(); register.setLocationRelativeTo(mainFrame); register.setVisible(true); register.setResizable(false); }; }); password.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JFrame mainFrame = getMainFrame(); mainFrame.setEnabled(false); Password password = new Password(); password.setLocationRelativeTo(mainFrame); password.setVisible(true); password.setResizable(false); }; }); account.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JFrame mainFrame = getMainFrame(); mainFrame.setEnabled(false); UpdateAccount account = new UpdateAccount(); account.setLocationRelativeTo(mainFrame); account.setVisible(true); account.setResizable(false); }; }); logout.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { int option = JOptionPane.showConfirmDialog(null,confirmExitMsg,confirmExitTitle, JOptionPane.YES_NO_OPTION); if(JOptionPane.NO_OPTION==option){ return; } new LogoutHandler(Session.getSession().username,Session.getSession().token); toggleLoginOff(); Session.getSession().CloseSession(); }; }); userD.add(register); userD.add(login); searchD.add(search); userD.add(password).hide(); userD.add(account).hide(); userD.add(logout).hide(); mbar.add(searchD); mbar.add(userD); main = getMainFrame(); getMainFrame().setJMenuBar(mbar); getMainFrame().add((new JScrollPane()).add(new TabbedPanel())); show(getMainFrame()); } public static void main(String[] args) { new LenguajeSelector(null); if(LanguageSession.getActualLangugeName().compareToIgnoreCase("English")==0){ Locale.setDefault(new Locale("en","US")); } else{ Locale.setDefault(new Locale("es","AR")); } launch(Main.class, args); } @SuppressWarnings("deprecation") public static void toggleLoginOn(){ userD.getMenuComponent(1).hide(); userD.getMenuComponent(0).hide(); userD.getMenuComponent(2).show(); userD.getMenuComponent(3).show(); userD.getMenuComponent(4).show(); } @SuppressWarnings("deprecation") public static void toggleLoginOff(){ userD.getMenuComponent(1).show(); userD.getMenuComponent(0).show(); userD.getMenuComponent(2).hide(); userD.getMenuComponent(3).hide(); userD.getMenuComponent(4).hide(); } }
[ "bombax@77f57708-cd88-11de-8d2e-8bf2cb4fc7ae" ]
bombax@77f57708-cd88-11de-8d2e-8bf2cb4fc7ae
bb1a3f30cfea7c6c8307beb8af77f93e52b2c9a7
400fa6f7950fcbc93f230559d649a7bfc50975fe
/src/com/jagex/SocketProvider.java
42f55b12118c12f608833126f10bc25d6198bd76
[]
no_license
Rune-Status/Major--Renamed-839
bd242a9b230c104a4021ec679e527fe752c27c4f
0e9039aa22f7ecd0ebcf2473a4acb5e91f6c8f76
refs/heads/master
2021-07-15T08:58:15.963040
2017-10-22T20:14:35
2017-10-22T20:14:35
107,897,914
1
0
null
null
null
null
UTF-8
Java
false
false
2,670
java
package com.jagex; import java.io.IOException; import java.net.Socket; public abstract class SocketProvider { public static String toUrlSafe(CharSequence sequence) { int length = sequence.length(); StringBuilder builder = new StringBuilder(length); for (int index = 0; index < length; index++) { char character = sequence.charAt(index); if (character >= 'a' && character <= 'z' || character >= 'A' && character <= 'Z' || character >= '0' && character <= '9' || character == '.' || character == '-' || character == '*' || character == '_') { builder.append(character); } else if (character == ' ') { builder.append('+'); } else { int b = Class483.charToByte(character); builder.append('%'); int packed = b >> 4 & 0xf; if (packed >= 10) { builder.append((char) (packed + 55)); } else { builder.append((char) (packed + 48)); } packed = b & 0xf; if (packed >= 10) { builder.append((char) (55 + packed)); } else { builder.append((char) (packed + 48)); } } } return builder.toString(); } public static void method13763() { if (Class31.loginStep * -1087837371 == 108) { Class31.loginStep = -781018025; } } static void method13762(int plane, int localX, int localZ, int group, int i_7_, int type, Class540 class540) { Class480_Sub12 class480_sub12 = null; for (Class480_Sub12 class480_sub12_10_ = (Class480_Sub12) Class480_Sub12.aClass644_10067.head(); null != class480_sub12_10_; class480_sub12_10_ = (Class480_Sub12) Class480_Sub12.aClass644_10067 .next()) { if (plane == class480_sub12_10_.plane * -618261599 && localX == 1155137153 * class480_sub12_10_.localX && localZ == 51547319 * class480_sub12_10_.localZ && group == -677397461 * class480_sub12_10_.group) { class480_sub12 = class480_sub12_10_; break; } } if (class480_sub12 == null) { class480_sub12 = new Class480_Sub12(); class480_sub12.plane = plane * 1586008161; class480_sub12.group = -1555094909 * group; class480_sub12.localX = localX * -1064812159; class480_sub12.localZ = localZ * 1342836999; Class480_Sub12.aClass644_10067.pushBack(class480_sub12); } class480_sub12.id = i_7_ * 340568737; class480_sub12.type = -1339454739 * type; class480_sub12.aClass540_10066 = class540; class480_sub12.aBool10069 = true; class480_sub12.aBool10063 = false; } int port; String host; SocketProvider() { } public abstract Socket provide() throws IOException; Socket direct() throws IOException { return new Socket(host, 147585685 * port); } }
85c4616b0ad7558dd95ce3ac8fa996c8f5c7f5fa
6e77bd058376fd0013cd647c1f5b0addae9cc114
/src/com/edu/realestate/yelp/YelpBusiness.java
60adf5ec47896704518f9b45606006bce6e2cd9a
[]
no_license
pgtissot/immo
c4dbe381bafe8c6ce456c4897a599401ceb310e6
eed433f5e936e7b025cac010054854162dc9510f
refs/heads/master
2022-06-27T11:24:37.051017
2019-08-30T16:38:06
2019-08-30T16:38:06
198,404,493
0
0
null
2022-05-25T06:59:43
2019-07-23T10:06:10
Java
UTF-8
Java
false
false
1,221
java
package com.edu.realestate.yelp; public class YelpBusiness extends YelpElement { private String image_url; private String categories; private double rating; private double distance; public YelpBusiness(String name, String url, String image_url, String categories, double rating, double distance, String address) { super(name, url, address); this.image_url = image_url; this.categories = categories; this.rating = rating; this.distance = distance; } public String getImage_url() { return image_url; } public void setImage_url(String image_url) { this.image_url = image_url; } public String getCategories() { return categories; } public void setCategories(String categories) { this.categories = categories; } public double getRating() { return rating; } public void setRating(double rating) { this.rating = rating; } public double getDistance() { return distance; } public void setDistance(double distance) { this.distance = distance; } @Override public String toString() { return "YelpBusiness [" + super.toString() + ", image_url=" + image_url + ", categories=" + categories + ", rating=" + rating + ", distance=" + distance + "]"; } }
cf360a318d5983e8ac98ad7480be7cacef411690
32e67f8c6e6cd1c2c18178f15d350f9050141f42
/com.appunta.sample.MainActivity/src/com/appunta/android/ui/EyeView.java
644731538245f15758d77e3c9e6c086d0156ad83
[]
no_license
liqy/appunta
c8c0460c98cf3584b6d8b9ad09a97b83062b916a
85e41e075bd8f188ebe36e5cd231908723a60cc9
refs/heads/master
2021-01-25T08:43:08.096363
2012-09-20T00:51:27
2012-09-20T00:51:27
5,880,026
5
3
null
null
null
null
WINDOWS-1250
Java
false
false
3,914
java
/* Copyright Sergi Martínez (@sergiandreplace) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.appunta.android.ui; import android.content.Context; import android.graphics.Canvas; import android.util.AttributeSet; import com.appunta.android.math3d.Math3dUtil; import com.appunta.android.math3d.Trig1; import com.appunta.android.math3d.Trig3; import com.appunta.android.math3d.Vector1; import com.appunta.android.math3d.Vector2; import com.appunta.android.math3d.Vector3; import com.appunta.android.point.Point; public class EyeView extends AppuntaView { private static final int SCREEN_DEPTH = 1; private Vector3 camRot=new Vector3(); private Trig3 camTrig=new Trig3(); private Vector3 camPos=new Vector3(); private Vector3 pointPos=new Vector3(); private Vector3 relativePos=new Vector3(); private Vector3 relativeRotPos=new Vector3(); private Vector3 screenRatio=new Vector3(); private Vector2 screenPos=new Vector2(); private Vector2 screenSize=new Vector2(); private Vector1 screenRot=new Vector1(); private Trig1 screenRotTrig=new Trig1(); private boolean drawn; public EyeView(Context context) { super(context); init(); } public EyeView(Context context, AttributeSet attrs) { super(context, attrs); init(); } EyeView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { screenRatio.z=SCREEN_DEPTH; } @Override protected void preRender(Canvas canvas) { // For the moment we stablish a square as ratio. Size is arithmetic mean of width and height screenRatio.y=(getWidth()+getHeight())/2; screenRatio.x=(getWidth()+getHeight())/2; // Get the current size of the window screenSize.y=getHeight(); screenSize.x=getWidth(); //Obtain the current camera rotation and related calculations based on phone orientation and rotation Math3dUtil.getCamRotation(getOrientation(), getPhoneRotation(), camRot, camTrig, screenRot, screenRotTrig); //Transform current camera location into a position object; Math3dUtil.convertLocationToPosition(getLocation(), camPos); } @Override protected void calculatePointCoordinates(Point point) { //Transform point Location into a Position object Math3dUtil.convertLocationToPosition(point.getLocation(), pointPos); //Calculate relative position to the camera. Transforms angles of latitude and longitude into meters of distance. Math3dUtil.getRelativeTranslationInMeters(pointPos, camPos, relativePos); //Rotates the point around the camera in order to stablish the camera rotation to <0,0,0> Math3dUtil.getRelativeRotation(relativePos, camTrig, relativeRotPos); //Converts a 3d position into a 2d position on screen drawn=Math3dUtil.convert3dTo2d(relativeRotPos, screenSize, screenRatio, screenRotTrig, screenPos); //If drawn is false, the point is behind us, so no need to paint if (drawn) { point.setX((float) screenPos.x); point.setY((float) screenPos.y); } point.setDrawn(drawn); } @Override protected void postRender(Canvas canvas) { // TODO Auto-generated method stub } }
0ca8e18107070e26cc22f84d4681d65e0e2b3206
eb0174136bfb94fcd53f990ead3a4f94d4f6bc3d
/spring-boot-controller/src/main/java/com/li/controller/view/HelloController.java
1dcbbce74bd724ef74191d2ff0d89a3bc228c8dc
[]
no_license
jianyli/spring-boot
9022720d3dc51076a3e53681712556aea930a2c0
097afd875b490c5bd36fe4a44aa1df0ac1dbcfea
refs/heads/master
2022-06-22T19:48:26.699408
2021-01-25T04:46:20
2021-01-25T04:46:20
228,300,446
0
0
null
2022-06-17T03:30:33
2019-12-16T04:10:26
Java
UTF-8
Java
false
false
1,303
java
package com.li.controller.view; import com.google.common.collect.Lists; import com.li.domain.Student; import com.li.domain.UserFriend; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import java.util.Date; import java.util.List; /** * @Author ljy * @Date 2021/1/24 13:28 * @description */ @Controller //@RequestMapping( "view") public class HelloController { @RequestMapping(value = "/") public String index(ModelMap map) { List<Student> students = Lists.newArrayList(); Student s1 = new Student(); Student s2 = new Student(); Student s3 = new Student(); s1.setName("li1"); s2.setName("li2"); s3.setName("li3"); s1.setSex("男"); s2.setSex("男"); s3.setSex("男"); students.add(s1); students.add(s2); students.add(s3); map.put("message"," test message"); map.put("username","李建有"); map.put("username1","甘密"); map.put("flag","yes"); map.put("students", students); map.put("date", new Date()); map.put("books",Lists.newArrayList("sd","fed","fsde")); map.put("age",34); return "index"; } }
474b73a719623d984d3cc3f7a145e6210fd4959c
70aa8a1a5fc9ecc683b8526fedfcf20fcc2d77a5
/src/main/java/pl/edu/agh/cs/kraksim/main/ConsoleSimulationVisualizer.java
88337cb26619e0a6692ab23ff83ce0af455ff0b2
[]
no_license
Pysiokot/kraksim
cd837453b80bf1625da331e60385a6e3a7f1bcf3
398082b6ab6d43114bd331e73a6f0925c45202ea
refs/heads/master
2022-12-20T04:21:19.862986
2020-09-29T16:32:30
2020-09-29T16:32:30
237,761,884
0
1
null
null
null
null
UTF-8
Java
false
false
1,438
java
package pl.edu.agh.cs.kraksim.main; import pl.edu.agh.cs.kraksim.core.City; import pl.edu.agh.cs.kraksim.main.gui.SimulationVisualizer; import pl.edu.agh.cs.kraksim.ministat.CityMiniStatExt; import pl.edu.agh.cs.kraksim.ministat.MiniStatEView; import java.io.PrintWriter; class ConsoleSimulationVisualizer implements SimulationVisualizer { private final CityMiniStatExt stat; private final PrintWriter writer = new PrintWriter(System.out); public ConsoleSimulationVisualizer(final City city, final MiniStatEView statView) { stat = statView.ext(city); // System.out.println( "\n\n Starting Krasim Simulation " ); // System.out.println( "------------------------------------" ); // System.out.println( "Akademia Gorniczo Hutnicza 2005-2007\n\n" ); } public void startLearningPhase(final int phaseNum) { writer.printf("LEARNING PHASE: %d\n", phaseNum + 1); } public void startTestingPhase() { writer.printf("TESTING PHASE\n"); } public void endPhase() { writer.printf("\n"); } public void end(long elapsed) { writer.printf("Simulation time:" + (elapsed / 1000.0) + "\nTHE END\n"); writer.close(); } public void update(final int turn) { // if ( turn % 100 == 0 ) { writer.printf("\rturn: %6d %6d %6d %6.2f %6.2f", turn, stat.getTravelCount(), stat.getCarCount(), stat.getAvgVelocity(), stat.getTravelLength() / 1000); // } } }
eadf9c9510c468aacb68af4d9eeee25824bb3bd3
b9fe2ede738c62d5b0896942c14db096eee62191
/DBase.java
eb55facf6789d7ed34248feb5575a32662cbdb3b
[]
no_license
turmantas/Book
98c7872b4aa9ed2f328f2f990a27c11b78620486
eab8716d25331dca331ce9431f54b14c7c447a0a
refs/heads/master
2020-12-13T13:49:36.104470
2017-06-28T04:39:02
2017-06-28T04:39:02
95,574,566
0
0
null
null
null
null
UTF-8
Java
false
false
729
java
import java.sql.*; public class DBase { String DRIVER = "com.mysql.jdbc.Driver"; String URL = "jdbc:mysql://localhost:3306/"; String DB = "Book"; String USERNAME = "root"; String PASSWORD = "qwerty"; private static DBase instance = null; public static DBase getInstance() { if (instance == null) { instance = new DBase(); } return instance; } private Connection connection = null; public Connection getConnection () { return connection; } private DBase (){ try { Class.forName(DRIVER); connection = DriverManager.getConnection(URL+DB,USERNAME,PASSWORD); System.out.println("Connected"); } catch (Exception e) {System.out.println("Connection problems--> " + e.getMessage());} } }
91c85a4a39f883b61ffb6a2fa172d88fee151cc3
9684339b5fb6913b21c0f00d21c8b4d202c848f5
/Jarvis/app/src/main/java/edu/depaul/csc595/jarvis/detection/gcm/JarvisInstanceIdListenerService.java
42f4939a9fc63929d49f3bdf811bb2557e864950
[]
no_license
csc595g1/hrpd
bd40aae9e6a2986817c03dc87d3c438ae945d603
a45453ce2b79c4955cfce2064848ddfaa1e10662
refs/heads/master
2021-01-10T13:20:06.059057
2016-04-05T00:26:32
2016-04-05T00:26:32
49,824,129
1
14
null
2016-04-05T00:26:32
2016-01-17T15:57:56
Java
UTF-8
Java
false
false
545
java
package edu.depaul.csc595.jarvis.detection.gcm; import android.content.Intent; import com.google.android.gms.iid.InstanceIDListenerService; /** * JarvisInstanceIdListenerService.java * Jarvis */ public class JarvisInstanceIdListenerService extends InstanceIDListenerService { @Override public void onTokenRefresh() { // Fetch updated InstanceID token and notify our app's server of any changes (if applicable). Intent intent = new Intent(this, TokenUpdateIntentService.class); startService(intent); } }
626e3664c9668ea5e785ba5ba7c5acd23593da1a
0b588f7110f5b026cc6eb3af98f68f5b7174f5d1
/src/main/java/datastructures/minpriorityqueue/FibonacciHeap/FibonacciHeap.java
51b3d5114d8508dfbdd528d2a7b47d9d7a8c0377
[ "MIT" ]
permissive
nikhilc1527/Algorithms
e391b934d46d0c9a06aad0754ab109e938480364
9b756811186f3ad9fb5c1fff9705fee329c4baa8
refs/heads/master
2022-11-18T03:19:25.486026
2020-07-14T07:07:49
2020-07-14T07:07:49
265,966,641
0
0
null
2020-05-21T22:43:15
2020-05-21T22:43:14
null
UTF-8
Java
false
false
4,341
java
package datastructures.minpriorityqueue.FibonacciHeap; import java.util.HashMap; import java.util.HashSet; import java.util.Objects; public class FibonacciHeap { private final HashMap<Integer, Node> references; private Node min; public FibonacciHeap() { references = new HashMap<>(); } public static void main(String[] args) { FibonacciHeap h = new FibonacciHeap(); for (int i = 0; i < 10; i++) { h.insert(i); } h.delete(5); while (!h.isEmpty()) { System.out.println(h.extractMin()); } System.out.println(h); } public void insert(int val) { Node newNode = new Node(val); references.put(val, newNode); if (min == null) { min = newNode; min.left = min; min.right = min; } else { min.insert(newNode); if (newNode.val < min.val) { min = newNode; } } } public int extractMin() { int toReturn = min.val; references.remove(toReturn); if (min.left == min && min.child == null) { min = null; } else { min.safeUnlink(); min = min.left; consolidate(); } return toReturn; } public void delete(int val) { Node nodeForm = references.get(val); nodeForm.val = Integer.MIN_VALUE; min = nodeForm; extractMin(); } public boolean isEmpty() { return min == null; } private void consolidate() { Node[] degrees = new Node[45]; Node dummy = min; HashSet<Node> visited = new HashSet<>(); do { if (visited.contains(dummy)) { break; } if (dummy.val < min.val) { min = dummy; } while (degrees[dummy.degree] != null) { Node other = degrees[dummy.degree]; if (other.val < dummy.val) { Node temp = other; other = dummy; dummy = temp; } dummy.link(other); degrees[dummy.degree - 1] = null; } degrees[dummy.degree] = dummy; visited.add(dummy); dummy = dummy.right; } while (dummy != min); } @Override public String toString() { StringBuilder sb = new StringBuilder(); if (min != null) { Node dummy = min; do { sb.append(dummy.val).append(" "); dummy = dummy.right; } while (dummy != min); } return sb.toString(); } private static class Node { public int val; public Node left, right, child; public int degree; public boolean mark; public Node(int _val) { val = _val; } public void insert(Node other) { if (left == this) { left = other; right = other; left.right = this; left.left = this; } else { Node temp = left; left = other; left.right = this; left.left = temp; temp.right = left; } } public void unlink() { left.right = right; right.left = left; } public void safeUnlink() { saveChildren(); unlink(); } public void link(Node other) { other.unlink(); if (child == null) { child = new Node(other.val); child.left = child; child.right = child; } else { child.insert(other); } other.mark = false; degree++; } public void saveChildren() { if (child != null) { Node dummy = child; do { Node tempNext = dummy.right; insert(dummy); dummy = tempNext; } while (dummy != child); child = null; } } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node node = (Node) o; return val == node.val && degree == node.degree && mark == node.mark && Objects.equals(left, node.left) && Objects.equals(right, node.right) && Objects.equals(child, node.child); } @Override public int hashCode() { return Objects.hash(val); } @Override public String toString() { return val + ""; } } }
63fe04d8e55c87105c453e082bd20a587d070228
2a6ddb2cb7152486ea72092995657db84a7b45b2
/src/main/java/org/support/generator/CustomAbstractXmlElementGenerator.java
f5d9a4fff9041a40bb4de40b552436bcf2de3b28
[]
no_license
sustzq/hello-world
7b07987341dff70db9bfa252354ac37196fc7597
88a3d6fda1d7c1001383d2f7ecd5b3565853889c
refs/heads/main
2023-04-08T15:42:10.088937
2021-04-18T13:09:20
2021-04-18T13:09:20
354,770,817
0
0
null
2021-04-05T08:50:27
2021-04-05T08:40:03
null
UTF-8
Java
false
false
3,785
java
package org.support.generator; import org.mybatis.generator.api.IntrospectedColumn; import org.mybatis.generator.api.dom.xml.Attribute; import org.mybatis.generator.api.dom.xml.TextElement; import org.mybatis.generator.api.dom.xml.XmlElement; import org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities; import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator; public class CustomAbstractXmlElementGenerator extends AbstractXmlElementGenerator { @Override public void addElements(XmlElement parentElement) { // 增加base_query XmlElement sql = new XmlElement("sql"); sql.addAttribute(new Attribute("id", "base_query")); //在这里添加where条件 XmlElement selectTrimElement = new XmlElement("trim"); //设置trim标签 selectTrimElement.addAttribute(new Attribute("prefix", "WHERE")); selectTrimElement.addAttribute(new Attribute("prefixOverrides", "AND | OR")); //添加where和and StringBuilder sb = new StringBuilder(); for(IntrospectedColumn introspectedColumn : introspectedTable.getAllColumns()) { XmlElement selectNotNullElement = new XmlElement("if"); //$NON-NLS-1$ sb.setLength(0); sb.append("null != "); sb.append(introspectedColumn.getJavaProperty()); selectNotNullElement.addAttribute(new Attribute("test", sb.toString())); sb.setLength(0); // 添加and sb.append(" and "); // 添加别名t sb.append("t."); sb.append(MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn)); // 添加等号 sb.append(" = "); sb.append(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn)); selectNotNullElement.addElement(new TextElement(sb.toString())); selectTrimElement.addElement(selectNotNullElement); } sql.addElement(selectTrimElement); parentElement.addElement(sql); // 公用select sb.setLength(0); sb.append("select "); sb.append("t.* "); sb.append("from "); sb.append(introspectedTable.getFullyQualifiedTableNameAtRuntime()); sb.append(" t"); TextElement selectText = new TextElement(sb.toString()); // 公用include XmlElement include = new XmlElement("include"); include.addAttribute(new Attribute("refid", "base_query")); // 增加find XmlElement find = new XmlElement("select"); find.addAttribute(new Attribute("id", "find")); find.addAttribute(new Attribute("resultMap", "BaseResultMap")); find.addAttribute(new Attribute("parameterType", introspectedTable.getBaseRecordType())); find.addElement(selectText); find.addElement(include); parentElement.addElement(find); // 增加list XmlElement list = new XmlElement("select"); list.addAttribute(new Attribute("id", "list")); list.addAttribute(new Attribute("resultMap", "BaseResultMap")); list.addAttribute(new Attribute("parameterType", introspectedTable.getBaseRecordType())); list.addElement(selectText); list.addElement(include); parentElement.addElement(list); // 增加pageList XmlElement pageList = new XmlElement("select"); pageList.addAttribute(new Attribute("id", "pageList")); pageList.addAttribute(new Attribute("resultMap", "BaseResultMap")); pageList.addAttribute(new Attribute("parameterType", introspectedTable.getBaseRecordType())); pageList.addElement(selectText); pageList.addElement(include); parentElement.addElement(pageList); } }
68fa64afed6976aea6d0065649b9dc1deb625060
501d3bc27325bc74f4197a5f7f4139fbcac7b5cb
/exercici Git/src/Pujar.java
6dd4a92cb21e929abeaa6ed34a245ae7fd5f1424
[]
no_license
toRRRz/repo1
5ef1709d0c6a64babd5e974e205556666bb6cf17
a5d89098fd6a7551573fe5f8344177377ba20e85
refs/heads/master
2021-01-19T16:12:39.517597
2017-04-14T10:50:36
2017-04-14T10:50:36
88,256,001
0
0
null
2017-04-14T10:53:59
2017-04-14T09:52:37
Java
UTF-8
Java
false
false
29
java
public class Pujar { }
045f785c1a08f0fe95a177688df430e3644e4d15
ec5d445e19c69c196097d266efb4a6a83b3588ca
/graph/src/main/java/graph/DFSAdjMatrix.java
bd0ee472a9dd500f4835bd93d98d76ec38e7a91e
[]
no_license
managerwhocodes/Data-Structures-Algorithms
b1061f7069bb7638ffabd84e7a5eb21f92515b68
ee83f935d30308f6c3b73ac31af1f4f4afdbe0fd
refs/heads/master
2021-08-29T05:06:39.322419
2021-08-17T20:27:51
2021-08-17T20:27:51
250,962,888
0
0
null
2021-08-17T20:27:52
2020-03-29T05:45:11
Java
UTF-8
Java
false
false
2,303
java
package graph; import java.util.ArrayList; import java.util.Stack; public class DFSAdjMatrix{ private ArrayList<GraphNode> nodeList = new ArrayList<GraphNode>(); private int [][] adjMatrix; private DFSAdjMatrix(ArrayList<GraphNode> nodeList){ this.nodeList = nodeList; this.adjMatrix = new int[nodeList.size()][nodeList.size()]; } private void bfs(GraphNode node){ Stack<GraphNode> stack = new Stack<GraphNode>(); stack.add(node); while(!stack.isEmpty()){ GraphNode presentNode = stack.pop(); presentNode.setVisited(true); System.out.print(presentNode.getName()+" "); presentNode.setNeighbours(getNeighbors(presentNode)); for(GraphNode neighbour : presentNode.getNeighbours()) { if(!neighbour.isVisited()) { stack.push(neighbour); neighbour.setVisited(true); } } } } private void addUndirectedEdge(int i, int j){ adjMatrix[i][j] = 1; adjMatrix[j][i] = 1; } private ArrayList<GraphNode> getNeighbors(GraphNode node) { ArrayList<GraphNode> neighbors = new ArrayList<GraphNode>(); int nodeIndex = node.getIndex(); for(int i=0; i<adjMatrix.length;i++) { if(adjMatrix[nodeIndex][i]==1) { neighbors.add(nodeList.get(i)); } } return neighbors; } public static void main(String args[]){ ArrayList<GraphNode> nodeList = new ArrayList<GraphNode>(); for(int i=0;i<10;i++){ nodeList.add(new GraphNode("V"+i,i)); } DFSAdjMatrix graph = new DFSAdjMatrix(nodeList); graph.addUndirectedEdge(0,1); graph.addUndirectedEdge(0,3); graph.addUndirectedEdge(1,2); graph.addUndirectedEdge(1,4); graph.addUndirectedEdge(2,5); graph.addUndirectedEdge(2,9); graph.addUndirectedEdge(3,6); graph.addUndirectedEdge(4,7); graph.addUndirectedEdge(5,8); graph.addUndirectedEdge(6,7); graph.addUndirectedEdge(7,8); graph.addUndirectedEdge(8,9); System.out.println("Printing BFS from source: "+nodeList.get(0).getName()); graph.bfs(nodeList.get(0)); } }
4bd54a9899ed1aa1e1fd7d641b19afc31780ac53
339259c9aa2e39d042f4c5668ecf2a85fd52f42e
/src/test/java/NewTest.java
6c4ecfbefb7918a37d1e1dd48a03660563f55583
[]
no_license
nb2628/Selenium
b60158305c17b26675957796f47b997be80af2a0
c00b0e2fe54f0da6a3c02b37894d898d696f527c
refs/heads/master
2020-03-17T20:23:39.818150
2018-05-18T07:01:41
2018-05-18T07:01:41
133,907,239
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
import org.testng.annotations.Test; import org.testng.annotations.DataProvider; public class NewTest { @Test(dataProvider ="LoginData") public void f(Integer n, String s) { System.out.println("username is"+n); System.out.println("password is"+s); System.out.println(n+" "+s); } @DataProvider(name="LoginData") public String [][] dp(){ return new String [][] { new String[] {"user1","pass1"}, new String[] {"user2","pass2"} }; } }
3c392387bf401b95189e6c0b7e1c5e5ffd0975a6
a86ab8748ca3ea091de240d3950b221ca622c74e
/src/main/java/hello/Controller/User_Controller.java
3495638517c80d58d6759266a5f70c60279b48a2
[]
no_license
sandyema/AlarmProject
b261066ef6388508cc8568ae660eb89da1796eaf
7d254ad221a63c6032ea7e77a0333582714a8d4f
refs/heads/master
2023-07-30T11:08:36.215916
2021-09-19T21:38:08
2021-09-19T21:38:08
404,603,946
0
0
null
null
null
null
UTF-8
Java
false
false
18,719
java
package hello.Controller; import hello.Domain.Alarm; import hello.Domain.Alarm_User; import hello.Domain.UserAlarm; import hello.Repository.AlarmUser_Repository; import hello.Repository.Alarm_Repository; import hello.Repository.User_Repository; import net.minidev.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import java.math.RoundingMode; import java.text.DecimalFormat; import java.io.*; import java.net.*; import java.util.*; import javax.mail.*; import javax.mail.Authenticator; import javax.mail.PasswordAuthentication; import javax.mail.internet.*; import javax.activation.*; import javax.mail.Session; import javax.mail.Transport; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; @Controller @RequestMapping("/StockAlarms") public class User_Controller { @Autowired private User_Repository user_repository; @Autowired private Alarm_Repository alarm_repository; @Autowired private AlarmUser_Repository alarmUser_repository; private static DecimalFormat df2 = new DecimalFormat("#.##"); @Scheduled(fixedRate = 50000) public void scheduleFixedTask(){ String alarmName,destinationEmail=""; Double price=0.0; for (UserAlarm userAlarm : alarmUser_repository.findAll()) { for (Alarm_User user : user_repository.findAll()) { for (Alarm alarm : alarm_repository.findAll()) { if (userAlarm.getId_alarm().equals(alarm.getId()) && userAlarm.getId_user().equals(user.getId()) && alarm.getActive().equals(1)) { try { alarmName=alarm.getAlarm_name(); price=getPriceStock(alarmName); if((alarm.getOver_price().equals(1) && alarm.getActive().equals(1)&& df2.format(price).equals(df2.format(alarm.getInitial_price()*(1+alarm.getWanted_percent()/100)))) || (alarm.getLess_price().equals(1) && alarm.getActive().equals(1)&& df2.format(price).equals(df2.format(alarm.getInitial_price()*(1-alarm.getWanted_percent()/100))))) { destinationEmail=user.getEmail(); String htmlCode = "<h1> CONGRATULATION </h1> <br/> <h2><b>Your stock "+alarmName+" have the price "+ price +" now "+"</b></h2>"; sendMail(destinationEmail,htmlCode); alarm.setActive(0); } } catch (Exception e) { e.printStackTrace(); } } } } } } @RequestMapping(value = "/login", method = RequestMethod.POST) public @ResponseBody JSONObject login(@RequestBody JSONObject user) { //System.out.println("Try to login for :" + user.getAsString("email") + " : " + user.getAsString("pass")); HashMap<String, String> response = new HashMap<String, String>(); String user_email = user.getAsString("email"); String user_pass = user.getAsString("pass"); System.out.println(user_email + user_pass + "\n"); System.out.println(user_pass + "\n"); Alarm_User user_found = user_repository.findByEmailAndPass(user_email, user_pass); if (user_found != null) { response.put("response", "true"); //response.put("token", TokenManager.generateToken(username)); System.out.println("Succes to login for " + user_email + " : " + user_pass); } else { response.put("response", "false"); // System.out.println("Failed to login for " + user_email + " : " + user_pass); } return new JSONObject(response); } @RequestMapping(value = "/register", method = RequestMethod.POST) public @ResponseBody JSONObject addStudent(@RequestBody JSONObject user) { System.out.println("Try to add user :" + user.getAsString("first_name") + " : " + user.getAsString("last_name") + " : " + user.getAsString("email") + " : " + user.getAsString("pass")); HashMap<String, String> response = new HashMap<String, String>(); String user_firstname = user.getAsString("first_name"); String user_lastname = user.getAsString("last_name"); String user_email = user.getAsString("email"); String user_pass = user.getAsString("pass"); Alarm_User user_registed = user_repository.save(new Alarm_User(user_firstname, user_lastname, user_email, user_pass)); if (user_registed != null) { response.put("response", "true"); response.put("id_user", String.valueOf(user_registed.getId())); System.out.println("Succes to add for " + user_firstname + user_lastname + " : " + user_pass); } else { response.put("response", "false"); System.out.println("Error to add for " + user_firstname + user_lastname + " : " + user_pass); } return new JSONObject(response); } @RequestMapping(value = "/resetPass", method = RequestMethod.POST) public @ResponseBody JSONObject resetPass(@RequestBody JSONObject user) { System.out.println("Try to modify for :" + user.getAsString("user_email")); HashMap<String, String> response = new HashMap<String, String>(); String user_email = user.getAsString("user_email"); String new_pass = user.getAsString("new_pass"); System.out.println(user_email + "\n"); System.out.println("____PASS___"+new_pass); String htmlCode = "<h1> NEW PASSWORD </h1> <br/> <h2><b>Your password is now "+new_pass+"</b></h2>"; try { user_repository.resetPass(user_email, new_pass); response.put("response", "true"); sendMail(user_email,htmlCode); }catch (Exception ex){ System.out.println(ex); } return new JSONObject(response); } @RequestMapping(value = "/findID", method = RequestMethod.POST) public @ResponseBody JSONObject findID(@RequestBody JSONObject user) { System.out.println("Try to find id for :" + user.getAsString("email") + " : " + user.getAsString("pass")); HashMap<String, Integer> response = new HashMap<String, Integer>(); String user_email = user.getAsString("email"); String user_pass = user.getAsString("pass"); System.out.println(user_email + user_pass + "\n"); System.out.println(user_pass + "\n"); Alarm_User user_found = user_repository.findByEmailAndPass(user_email, user_pass); System.out.println(user_found.getEmail()); System.out.println(user_found.getPass()); System.out.println(user_found.getFirst_name()); System.out.println(user_found.toString()); if (user_found != null) { response.put("response", user_found.getId()); //response.put("token", TokenManager.generateToken(username)); System.out.println("Succes to find id for " + user_email + " : " + user_pass + " : " + user_found.getId()); } else { response.put("response", -1); System.out.println("Failed to find id for " + user_email + " : " + user_pass); } return new JSONObject(response); } @ResponseBody @RequestMapping(value = "/getAllAlarms", method = RequestMethod.GET) public ResponseEntity<JSONObject> getAllAlarms() { List<Alarm> list = alarm_repository.findAll(); JSONObject object = new JSONObject(); object.put("Alarms", list); return new ResponseEntity<JSONObject>(object, HttpStatus.OK); } private Double getPriceStock(String stockName) throws IOException{ String price="not found"; Double priceInDouble=0.0; URL url=new URL("https://www.google.com/finance/quote/"+stockName+":NYSE?ei=ga4QWNiFOobBe4LShnAF"); URLConnection urlConnection=url.openConnection(); InputStreamReader inStream=new InputStreamReader(urlConnection.getInputStream()); BufferedReader bufferedReader=new BufferedReader(inStream); String line=bufferedReader.readLine(); while(line!=null) { if(line.contains("[\""+stockName+"\",")){ int target=line.indexOf(("[\""+stockName+"\",")); int deci=line.indexOf(".",target); int start=deci; while(line.charAt(start)!='\"'){ start--; } price= line.substring(start+3,deci+3); } line=bufferedReader.readLine(); } priceInDouble=Double.valueOf(price); return priceInDouble; } @ResponseBody @RequestMapping(value = "/getAllAlarms/{id_user}", method = RequestMethod.GET) public ResponseEntity<JSONObject> getAlarms(@PathVariable Integer id_user) { List<Alarm> alarmsList = new ArrayList<>(); JSONObject object = new JSONObject(); Double price=0.0; for (UserAlarm userAlarm : alarmUser_repository.findAll()) { for (Alarm_User user : user_repository.findAll()) { for (Alarm alarm : alarm_repository.findAll()) { if (userAlarm.getId_user().equals(id_user) && userAlarm.getId_alarm().equals(alarm.getId()) && userAlarm.getId_user().equals(user.getId())) { try { price=getPriceStock(alarm.getAlarm_name()); alarm.setCurrent_price(price); alarmsList.add(alarm); if(alarm.getOver_price().equals(1) && df2.format(alarm.getCurrent_price()).equals(df2.format(alarm.getInitial_price()*(1+alarm.getWanted_percent()/100)))) { alarm.setActive(0); } if(alarm.getLess_price().equals(1) && df2.format(alarm.getCurrent_price()).equals(df2.format(alarm.getInitial_price()*(1-alarm.getWanted_percent()/100)))) { alarm.setActive(0); } } catch (IOException e) { e.printStackTrace(); } } } } } object.put("Alarms", alarmsList); return new ResponseEntity<JSONObject>(object, HttpStatus.OK); } // @RequestMapping(value = "/addAlarm", method = RequestMethod.POST) // public @ResponseBody // JSONObject addAlarm(@RequestBody JSONObject alarm) { // System.out.println("Try to add alarm :" + " : " + alarm.getAsString("alarm_name")+ " : " + alarm.getAsString("initial_price")+ " : " + alarm.getAsString("wanted_percent")); // HashMap<String, String> response = new HashMap<String, String>(); // // String alarm_name = alarm.getAsString("alarm_name"); // Double initial_price=(Double) alarm.getAsNumber("initial_price") ; // Double wanted_percent=(Double)alarm.getAsNumber("wanted_percent"); // Integer over_price= Integer.valueOf(alarm.getAsString("over_price")); // Integer less_price= Integer.valueOf(alarm.getAsString("less_price")); // // Alarm alarm_added = alarm_repository.save(new Alarm(alarm_name,initial_price,wanted_percent,over_price,less_price)); // // if (alarm_added != null) { // response.put("response", "true"); // System.out.println("Succes to add for " + alarm_name ); // } else { // response.put("response", "false"); // System.out.println("Error to add for " + alarm_name); // } // // return new JSONObject(response); // } @ResponseBody @RequestMapping(value = "/editAlarm", method = RequestMethod.POST) public ResponseEntity<JSONObject> editAlarm(@RequestBody JSONObject alarm) { System.out.println("Try to edit alarm :" + " : " + alarm.getAsString("alarm_name")+ " : " + alarm.getAsString("wanted_percent")); JSONObject response = new JSONObject(); Integer id= Integer.valueOf(alarm.getAsString("id")); String alarm_name = alarm.getAsString("alarm_name"); Double wanted_percent=Double.valueOf(alarm.getAsString("wanted_percent")); Integer over_price= Integer.valueOf(alarm.getAsString("over_price")); Integer less_price= Integer.valueOf(alarm.getAsString("less_price")); try { alarm_repository.update(alarm_name,wanted_percent,over_price,less_price,id); response.put("response", "true"); } catch (Exception e){ response.put("response", "false"); }; return new ResponseEntity<JSONObject>(response, HttpStatus.OK); } @ResponseBody @RequestMapping(value = "/deleteAlarm", method = RequestMethod.POST) public JSONObject deleteAlarm(@RequestBody JSONObject alarm) { System.out.println("Try to delete alarm :" + alarm.getAsString("id_alarm")+ alarm.getAsString("id_user")); Integer id_alarm=Integer.valueOf(alarm.getAsString("id_alarm")); Integer id_user=Integer.valueOf(alarm.getAsString("id_user")); Boolean deleted = false; HashMap<String, String> response = new HashMap<String, String>(); ArrayList<UserAlarm> useralarms = (ArrayList<UserAlarm>) alarmUser_repository.findAll(); ArrayList<Alarm> alarms = (ArrayList<Alarm>) alarm_repository.findAll(); ArrayList<Alarm_User> users = (ArrayList<Alarm_User>) user_repository.findAll(); for (UserAlarm a : useralarms) { System.out.println(useralarms); if (a.getId_user().equals(id_user) ) { for (Alarm aa : alarms) { System.out.println(alarms.toString()); if (aa.getId().equals(a.getId_alarm()) && aa.getId().equals(id_alarm)) { for (Alarm_User u : users) { System.out.println(users); if (u.getId().equals(a.getId_user())) { alarmUser_repository.delete(a); deleted = true; break; } } } } } } if (deleted) { response.put("response", "true"); System.out.println("Succes to delete for " + alarm.getAsString("id_alarm")+ alarm.getAsString("id_user")); } else { response.put("response", "false"); System.out.println("Error to delete for " + alarm.getAsString("id_alarm")+ alarm.getAsString("id_user")); } return new JSONObject(response); } @RequestMapping(value = "/addAlarm", method = RequestMethod.POST) public @ResponseBody JSONObject addAlarm(@RequestBody JSONObject alarm) throws IOException { System.out.println("Try to add alarm :" + alarm.getAsString("idUser") + " : " + alarm.getAsString("alarmName")); HashMap<String, String> response = new HashMap<String, String>(); String alarmName = alarm.getAsString("alarmName"); Double wantedPercente = Double.valueOf(alarm.getAsString("wantedPercente")); Integer idUser = Integer.valueOf(alarm.getAsString("idUser")); Integer over = Integer.valueOf(alarm.getAsString("over")); Integer less = Integer.valueOf(alarm.getAsString("less")); Double initial_price=getPriceStock(alarmName); Alarm alarm_added = alarm_repository.save(new Alarm(alarmName,initial_price,initial_price,wantedPercente,over,less,1)); if (alarm_added != null) { alarmUser_repository.save(new UserAlarm(alarm_added.getId(),idUser)); response.put("response", "true"); System.out.println("Succes to add for " + alarm.getAsString("idUser") + " : " + alarm.getAsString("alarmName")); } else { response.put("response", "false"); System.out.println("Error to add for " + alarm.getAsString("idUser") + " : " + alarm.getAsString("alarmName")); } return new JSONObject(response); } public static void sendMail(String recepient,String htmlCode) throws Exception { System.out.println("Preparing to send email"); Properties properties = new Properties(); //Enable authentication properties.put("mail.smtp.auth", "true"); //Set TLS encryption enabled properties.put("mail.smtp.starttls.enable", "true"); //Set SMTP host properties.put("mail.smtp.host", "smtp.gmail.com"); //Set smtp port properties.put("mail.smtp.port", "587"); properties.put("mail.smtp.ssl.trust", "smtp.gmail.com"); //Your gmail address String myAccountEmail = "[email protected]"; //Your gmail password String password = "*****"; //Create a session with account credentials Session session = Session.getInstance(properties, new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(myAccountEmail, password); } }); //Prepare email message Message message = prepareMessage(session, myAccountEmail, recepient,htmlCode); //Send mail Transport.send(message); System.out.println("Message sent successfully"); } private static Message prepareMessage(Session session, String myAccountEmail, String recepient,String htmlCode) { try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress(myAccountEmail)); message.setRecipient(Message.RecipientType.TO, new InternetAddress(recepient)); message.setSubject("Alarms stock"); message.setContent(htmlCode, "text/html"); return message; } catch (Exception ex) { System.out.println(ex); } return null; } }
39ffddc854dd151ff80c1e8d12360238b15add08
739dfb48691757f013ec0f3e272c046b746bbd7e
/jcommon/src/main/java/com/cmp/common/id/UUID.java
904e786d78b7a37a9bdeb3cdb6057d1bbb91e03b
[]
no_license
kangdawei/javadev-ideas
57b84b6c4745bf4191d9c371ed24f4503a733b39
a14df4a410a773fd9504ceb45303c77fae50ddb6
refs/heads/master
2021-01-13T03:00:50.035757
2016-12-19T12:13:36
2016-12-19T12:13:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,650
java
package com.cmp.common.id; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.TimeUnit; /** * ID生成策略:64位ID (42(毫秒)+5(机器ID)+5(业务编码)+12(重复累加)) 每秒26W ID * * @author HongjianZ */ public class UUID { private static long twepoch = 1288834974657L; // 机器标识位数 private static long workerIdBits = 5L; // 数据中心标识位数 private static long datacenterIdBits = 5L; // 毫秒内自增位 private static long sequenceBits = 12L; // 机器ID偏左移12位 private static long workerIdShift = sequenceBits; // 数据中心ID左移17位 private static long datacenterIdShift = sequenceBits + workerIdBits; // 时间毫秒左移22位 private static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; private static long sequenceMask = -1L ^ (-1L << sequenceBits); private static long lastTimestamp = -1L; private long sequence = 0L; private long workerId; private long datacenterId; public long getWorkerId() { return workerId; } public void setWorkerId(long workerId) { this.workerId = workerId; } public long getDatacenterId() { return datacenterId; } public void setDatacenterId(long datacenterId) { this.datacenterId = datacenterId; } public synchronized long nextID() { long timestamp = timeGen(); if (timestamp < lastTimestamp) { try { throw new Exception("Clock moved backwards. Refusing to generate id for " + (lastTimestamp - timestamp) + " milliseconds"); } catch (Exception e) { e.printStackTrace(); } } if (lastTimestamp == timestamp) { // 当前毫秒内,则+1 sequence = (sequence + 1) & sequenceMask; if (sequence == 0) { // 当前毫秒内计数满了,则等待下一秒 timestamp = tilNextMillis(lastTimestamp); } } else { sequence = 0; } lastTimestamp = timestamp; // ID偏移组合生成最终的ID return ((timestamp - twepoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence; } private long tilNextMillis(final long lastTimestamp) { long timestamp = this.timeGen(); while (timestamp <= lastTimestamp) { timestamp = this.timeGen(); } return timestamp; } private long timeGen() { return System.currentTimeMillis(); } // TEST public static void main(String[] args) { // 机器ID和数据中心ID UUID w = new UUID(); w.setWorkerId(2); w.setDatacenterId(2); final CyclicBarrier cdl = new CyclicBarrier(100); for (int i = 0; i < 1000; i++) { System.out.println(i + 1); new Thread(new Runnable() { @Override public void run() { try { cdl.await(); } catch (InterruptedException e) { e.printStackTrace(); } catch (BrokenBarrierException e) { e.printStackTrace(); } System.out.println(w.nextID()); } }).start(); } try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); } } }
[ "yanliangliang123" ]
yanliangliang123
94eee313f5bcfbeac01a5b3cdae4d3f9f7510bbf
1873c209131857089a75d56e68b403c70473edca
/src/main/java/com/wjp/designmode/create/prototype/ProtoType.java
60b28f7f4e6b9f5272f27f8e3fef2c62d742482b
[]
no_license
weijupeng/msb
6fdedff01fdb4b2537661da67f6ad17302e46a4f
18fc126ec5636969547cda1043f60d469dd31f84
refs/heads/master
2022-06-26T21:15:37.195557
2020-06-11T01:37:52
2020-06-11T01:37:52
254,317,946
0
0
null
2022-06-17T03:14:30
2020-04-09T08:44:59
Java
UTF-8
Java
false
false
306
java
package com.wjp.designmode.create.prototype; /** * @author wjp * @date 2020/6/9 14:46 */ public class ProtoType implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { ProtoType protoType = (ProtoType) super.clone(); return protoType; } }
496e4f7ad94e17d5fc17521120f543fad2961ce1
5f53b055f9c48767ffb692a4f36579ec3f4ec132
/src/main/java/SeleniumSessions/TotalImages.java
40abee53ba68a1c7efb55560c6ad43c5c53349a5
[]
no_license
kavimunigati/Oct2020kavitha
50bfd372f2366224fd721db8a16b0d034a0cb3dc
cd26517cf8020b648f6e7a606791b3e3b4acf879
refs/heads/master
2023-02-23T12:21:21.599342
2021-01-27T21:50:27
2021-01-27T21:50:27
333,565,221
0
0
null
null
null
null
UTF-8
Java
false
false
1,724
java
package SeleniumSessions; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import io.github.bonigarcia.wdm.WebDriverManager; public class TotalImages { static WebDriver driver; public static void main(String[] args) { // print total no. of images on the page //print the url of each image WebDriverManager.chromedriver().setup(); driver =new ChromeDriver(); driver.get("https://www.amazon.com/"); List<WebElement> imagelist = driver.findElements(By.tagName("img"));// img is the tag for image in html System.out.println(imagelist.size());// printing the no. of images on the list // for printing the list of images we are using for each loop /** for(int i=0; i<imagelist.size(); i++) { String image = imagelist.get(i).getText(); System.out.println(image); }*/ // or we can use the foreach loop /**syntax for each loop * for (Object e :list); * System.out.println(e); * object = WebElement * e = reference for webElement * list = image list , in which we have to search }*/ for(WebElement e : imagelist) { String srcUrl = e.getAttribute("src"); System.out.println(srcUrl); } /** for (WebElement e: imagelist) //e.getAttribute("src");// .getAttribute returns String so initiating String with srcUrl as reference. String srcUrl = e.getAttribute("src");//src is the property in html for image link. System.out.println(srcUrl);// stcurl is the reference for the String */ } }
dc49d77a723299fbc10e01733009359fe91267fb
4ba49c89d7d64dc40c8a722cc708a55501e22dcf
/SCP/src/main/java/zdoctor/scp/items/ItemBlockDeco.java
88c32e6bcc1c70b2f6eab05b5f62bb80fd891bac
[]
no_license
Z-Doctor/SCP
effcd44fd3557e6184958478f350d1aacec005f5
611ed19bbc80b9bfced8912dc277dd41d4cc97be
refs/heads/master
2021-01-19T12:55:17.073258
2017-08-30T22:52:27
2017-08-30T22:52:27
100,817,041
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package zdoctor.scp.items; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class ItemBlockDeco extends ItemBlock { static final String[] subBlocks = { "ctile", "ctileg", "floortile", "wallbottom", "wallmiddle", "walltop", "1162wall", "1162walla", "concrete", "pdfloor", "pdwallbottom", "pdwallmiddle", "pdwalltop", "red", "vent" }; public ItemBlockDeco(Block dogshit) { super(dogshit); setHasSubtypes(true); } public String getUnlocalizedName(ItemStack itemstack) { int i = itemstack.getMetadata(); if ((i < 0) || (i >= subBlocks.length)) { i = 0; } return super.getUnlocalizedName() + "." + subBlocks[i]; } public int getMetadata(int meta) { return meta; } }
51a313067399483d9d0aaeddd087f367b79c0fc2
171ab1d2148b70c27bf8b25cf8a51a510643f18b
/pro-seata/server/src/main/java/io/seata/server/store/DbcpDataSourceGenerator.java
494cccdfcc7972eae371d905aab4b9cc925c6222
[ "Apache-2.0" ]
permissive
lptnyy/spring-cloud-project
aa71cf0de4ceacbc21bcac2a8b00dc33ab04f309
4b7370ea3967814b6356c988ef57ef8023493e84
refs/heads/master
2022-11-22T06:45:23.828617
2020-05-10T17:50:04
2020-05-10T17:50:04
147,296,922
5
3
Apache-2.0
2022-11-16T09:22:40
2018-09-04T06:15:01
Java
UTF-8
Java
false
false
2,008
java
/* * Copyright 1999-2019 Seata.io Group. * * 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 io.seata.server.store; import javax.sql.DataSource; import io.seata.common.loader.LoadLevel; import io.seata.core.store.db.AbstractDataSourceGenerator; import org.apache.commons.dbcp2.BasicDataSource; /** * The type Dbcp data source generator. * * @author zhangsen * @author ggndnn */ @LoadLevel(name = "dbcp") public class DbcpDataSourceGenerator extends AbstractDataSourceGenerator { @Override public DataSource generateDataSource() { BasicDataSource ds = new BasicDataSource(); ds.setDriverClassName(getDriverClassName()); // DriverClassLoader works if upgrade commons-dbcp to at least 1.3.1. // https://issues.apache.org/jira/browse/DBCP-333 ds.setDriverClassLoader(getDriverClassLoader()); ds.setUrl(getUrl()); ds.setUsername(getUser()); ds.setPassword(getPassword()); ds.setInitialSize(getMinConn()); ds.setMaxTotal(getMaxConn()); ds.setMinIdle(getMinConn()); ds.setMaxIdle(getMinConn()); ds.setMaxWaitMillis(getMaxWait()); ds.setTimeBetweenEvictionRunsMillis(120000); ds.setNumTestsPerEvictionRun(1); ds.setTestWhileIdle(true); ds.setValidationQuery(getValidationQuery(getDBType())); ds.setConnectionProperties("useUnicode=yes;characterEncoding=utf8;socketTimeout=5000;connectTimeout=500"); return ds; } }
[ "wangyang19" ]
wangyang19
27c8ee2416c528c3cc96ce17d904b06505dd6282
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/24/24_fc0a5b87f58b138fc889e0a01bc2fb36b7fcba09/EventServiceImpl/24_fc0a5b87f58b138fc889e0a01bc2fb36b7fcba09_EventServiceImpl_s.java
e16246f1ec23c8b1768dc008fae7803e5fa3bbf9
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
31,117
java
/* * Copyright (c) 2008-2013, Hazelcast, Inc. 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 com.hazelcast.spi.impl; import com.hazelcast.core.HazelcastException; import com.hazelcast.instance.MemberImpl; import com.hazelcast.instance.Node; import com.hazelcast.logging.ILogger; import com.hazelcast.nio.Address; import com.hazelcast.nio.ObjectDataInput; import com.hazelcast.nio.ObjectDataOutput; import com.hazelcast.nio.Packet; import com.hazelcast.nio.serialization.Data; import com.hazelcast.nio.serialization.DataSerializable; import com.hazelcast.nio.serialization.IdentifiedDataSerializable; import com.hazelcast.spi.*; import com.hazelcast.spi.annotation.PrivateApi; import com.hazelcast.util.Clock; import com.hazelcast.util.ConcurrencyUtil; import com.hazelcast.util.ConstructorFunction; import com.hazelcast.util.executor.StripedExecutor; import com.hazelcast.util.executor.StripedRunnable; import java.io.IOException; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; /** * @author mdogan 12/14/12 */ public class EventServiceImpl implements EventService, PostJoinAwareService { private static final EventRegistration[] EMPTY_REGISTRATIONS = new EventRegistration[0]; private final ILogger logger; private final NodeEngineImpl nodeEngine; private final ConcurrentMap<String, EventServiceSegment> segments; private final StripedExecutor eventExecutor; EventServiceImpl(NodeEngineImpl nodeEngine) { this.nodeEngine = nodeEngine; logger = nodeEngine.getLogger(EventService.class.getName()); final Node node = nodeEngine.getNode(); int eventThreadCount = node.getGroupProperties().EVENT_THREAD_COUNT.getInteger(); eventExecutor = new StripedExecutor(nodeEngine.executionService.getCachedExecutor(), eventThreadCount); segments = new ConcurrentHashMap<String, EventServiceSegment>(); } public EventRegistration registerLocalListener(String serviceName, String topic, Object listener) { return registerListenerInternal(serviceName, topic, new EmptyFilter(), listener, true); } public EventRegistration registerLocalListener(String serviceName, String topic, EventFilter filter, Object listener) { return registerListenerInternal(serviceName, topic, filter, listener, true); } public EventRegistration registerListener(String serviceName, String topic, Object listener) { return registerListenerInternal(serviceName, topic, new EmptyFilter(), listener, false); } public EventRegistration registerListener(String serviceName, String topic, EventFilter filter, Object listener) { return registerListenerInternal(serviceName, topic, filter, listener, false); } private EventRegistration registerListenerInternal(String serviceName, String topic, EventFilter filter, Object listener, boolean localOnly) { if (listener == null) { throw new IllegalArgumentException("Listener required!"); } if (filter == null) { throw new IllegalArgumentException("EventFilter required!"); } EventServiceSegment segment = getSegment(serviceName, true); Registration reg = new Registration(UUID.randomUUID().toString(), serviceName, topic, filter, nodeEngine.getThisAddress(), listener, localOnly); if (segment.addRegistration(topic, reg)) { if (!localOnly) { invokeRegistrationOnOtherNodes(serviceName, reg); } return reg; } else { return null; } } private boolean handleRegistration(Registration reg) { EventServiceSegment segment = getSegment(reg.serviceName, true); return segment.addRegistration(reg.topic, reg); } public boolean deregisterListener(String serviceName, String topic, Object id) { final EventServiceSegment segment = getSegment(serviceName, false); if (segment != null) { final Registration reg = segment.removeRegistration(topic, String.valueOf(id)); if (reg != null && !reg.isLocalOnly()) { invokeDeregistrationOnOtherNodes(serviceName, topic, String.valueOf(id)); } return reg != null; } return false; } public void deregisterAllListeners(String serviceName, String topic) { final EventServiceSegment segment = getSegment(serviceName, false); if (segment != null) { segment.removeRegistrations(topic); } } private void deregisterSubscriber(String serviceName, String topic, String id) { final EventServiceSegment segment = getSegment(serviceName, false); if (segment != null) { segment.removeRegistration(topic, id); } } private void invokeRegistrationOnOtherNodes(String serviceName, Registration reg) { Collection<MemberImpl> members = nodeEngine.getClusterService().getMemberList(); Collection<Future> calls = new ArrayList<Future>(members.size()); for (MemberImpl member : members) { if (!member.localMember()) { Invocation inv = nodeEngine.getOperationService().createInvocationBuilder(serviceName, new RegistrationOperation(reg), member.getAddress()).build(); calls.add(inv.invoke()); } } for (Future f : calls) { try { f.get(5, TimeUnit.SECONDS); } catch (InterruptedException ignored) { } catch (TimeoutException ignored) { } catch (ExecutionException e) { throw new HazelcastException(e); } } } private void invokeDeregistrationOnOtherNodes(String serviceName, String topic, String id) { Collection<MemberImpl> members = nodeEngine.getClusterService().getMemberList(); Collection<Future> calls = new ArrayList<Future>(members.size()); for (MemberImpl member : members) { if (!member.localMember()) { Invocation inv = nodeEngine.getOperationService().createInvocationBuilder(serviceName, new DeregistrationOperation(topic, id), member.getAddress()).build(); calls.add(inv.invoke()); } } for (Future f : calls) { try { f.get(5, TimeUnit.SECONDS); } catch (InterruptedException ignored) { } catch (TimeoutException ignored) { } catch (ExecutionException e) { throw new HazelcastException(e); } } } public EventRegistration[] getRegistrationsAsArray(String serviceName, String topic) { final EventServiceSegment segment = getSegment(serviceName, false); if (segment != null) { final Collection<Registration> registrations = segment.getRegistrations(topic, false); return registrations != null && !registrations.isEmpty() ? registrations.toArray(new Registration[registrations.size()]) : EMPTY_REGISTRATIONS; } return EMPTY_REGISTRATIONS; } public Collection<EventRegistration> getRegistrations(String serviceName, String topic) { final EventServiceSegment segment = getSegment(serviceName, false); if (segment != null) { final Collection<Registration> registrations = segment.getRegistrations(topic, false); return registrations != null && !registrations.isEmpty() ? Collections.<EventRegistration>unmodifiableCollection(registrations) : Collections.<EventRegistration>emptySet(); } return Collections.emptySet(); } public void publishEvent(String serviceName, EventRegistration registration, Object event, int orderKey) { if (!(registration instanceof Registration)) { throw new IllegalArgumentException(); } final Registration reg = (Registration) registration; if (reg.isLocal()) { executeLocal(serviceName, event, reg, orderKey); } else { final Address subscriber = registration.getSubscriber(); sendEventPacket(subscriber, new EventPacket(registration.getId(), serviceName, event), orderKey); } } public void publishEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey) { final Iterator<EventRegistration> iter = registrations.iterator(); Data eventData = null; while (iter.hasNext()) { EventRegistration registration = iter.next(); if (!(registration instanceof Registration)) { throw new IllegalArgumentException(); } final Registration reg = (Registration) registration; if (reg.isLocal()) { executeLocal(serviceName, event, reg, orderKey); } else { if (eventData == null) { eventData = nodeEngine.toData(event); } final Address subscriber = registration.getSubscriber(); sendEventPacket(subscriber, new EventPacket(registration.getId(), serviceName, eventData), orderKey); } } } private void executeLocal(String serviceName, Object event, Registration reg, int orderKey) { if (nodeEngine.isActive()) { try { eventExecutor.execute(new LocalEventDispatcher(serviceName, event, reg.listener, orderKey)); } catch (RejectedExecutionException e) { logger.log(Level.WARNING, e.toString()); } } } private void sendEventPacket(Address subscriber, EventPacket eventPacket, int orderKey) { final String serviceName = eventPacket.serviceName; final EventServiceSegment segment = getSegment(serviceName, true); boolean sync = segment.incrementPublish() % 100000 == 0; if (sync) { Invocation inv = nodeEngine.getOperationService().createInvocationBuilder(serviceName, new SendEventOperation(eventPacket, orderKey), subscriber).setTryCount(50).build(); try { inv.invoke().get(3, TimeUnit.SECONDS); } catch (Exception ignored) { } } else { final Packet packet = new Packet(nodeEngine.toData(eventPacket), orderKey, nodeEngine.getSerializationContext()); packet.setHeader(Packet.HEADER_EVENT); nodeEngine.send(packet, subscriber); } } private EventServiceSegment getSegment(String service, boolean forceCreate) { EventServiceSegment segment = segments.get(service); if (segment == null && forceCreate) { return ConcurrencyUtil.getOrPutIfAbsent(segments, service, new ConstructorFunction<String, EventServiceSegment>() { public EventServiceSegment createNew(String key) { return new EventServiceSegment(key); } }); } return segment; } @PrivateApi void executeEvent(Runnable eventRunnable) { if (nodeEngine.isActive()) { try { eventExecutor.execute(eventRunnable); } catch (RejectedExecutionException e) { logger.log(Level.WARNING, e.toString()); } } } @PrivateApi void handleEvent(Packet packet) { try { eventExecutor.execute(new RemoteEventPacketProcessor(packet)); } catch (RejectedExecutionException e) { logger.log(Level.WARNING, e.toString()); } } public PostJoinRegistrationOperation getPostJoinOperation() { final Collection<Registration> registrations = new LinkedList<Registration>(); for (EventServiceSegment segment : segments.values()) { for (Registration reg : segment.registrationIdMap.values()) { if (!reg.isLocalOnly()) { registrations.add(reg); } } } return registrations.isEmpty() ? null : new PostJoinRegistrationOperation(registrations); } void shutdown() { logger.log(Level.FINEST, "Stopping event executor..."); eventExecutor.shutdown(); for (EventServiceSegment segment : segments.values()) { segment.clear(); } segments.clear(); } void onMemberLeft(MemberImpl member) { final Address address = member.getAddress(); for (EventServiceSegment segment : segments.values()) { segment.onMemberLeft(address); } } private static class EventServiceSegment { final String serviceName; final ConcurrentMap<String, Collection<Registration>> registrations = new ConcurrentHashMap<String, Collection<Registration>>(); final ConcurrentMap<String, Registration> registrationIdMap = new ConcurrentHashMap<String, Registration>(); final AtomicInteger totalPublishes = new AtomicInteger(); EventServiceSegment(String serviceName) { this.serviceName = serviceName; } private Collection<Registration> getRegistrations(String topic, boolean forceCreate) { Collection<Registration> listenerList = registrations.get(topic); if (listenerList == null && forceCreate) { return ConcurrencyUtil.getOrPutIfAbsent(registrations, topic, new ConstructorFunction<String, Collection<Registration>>() { public Collection<Registration> createNew(String key) { return Collections.newSetFromMap(new ConcurrentHashMap<Registration, Boolean>()); } }); } return listenerList; } private boolean addRegistration(String topic, Registration registration) { final Collection<Registration> registrations = getRegistrations(topic, true); if (registrations.add(registration)) { registrationIdMap.put(registration.id, registration); return true; } return false; } private Registration removeRegistration(String topic, String id) { final Registration registration = registrationIdMap.remove(id); if (registration != null) { final Collection<Registration> all = registrations.get(topic); if (all != null) { all.remove(registration); } } return registration; } void removeRegistrations(String topic) { final Collection<Registration> all = registrations.remove(topic); if (all != null) { for (Registration reg : all) { registrationIdMap.remove(reg.getId()); } } } void clear() { registrations.clear(); registrationIdMap.clear(); } void onMemberLeft(Address address) { for (Collection<Registration> all : registrations.values()) { Iterator<Registration> iter = all.iterator(); while (iter.hasNext()) { Registration reg = iter.next(); if (address.equals(reg.getSubscriber())) { iter.remove(); registrationIdMap.remove(reg.id); } } } } int incrementPublish() { return totalPublishes.incrementAndGet(); } } private class EventPacketProcessor implements StripedRunnable { private EventPacket eventPacket; int orderKey; private EventPacketProcessor() { } public EventPacketProcessor(EventPacket packet, int orderKey) { this.eventPacket = packet; this.orderKey = orderKey; } public void run() { process(eventPacket); } void process(EventPacket eventPacket) { Object eventObject = eventPacket.event; if (eventObject instanceof Data) { eventObject = nodeEngine.toObject(eventObject); } final String serviceName = eventPacket.serviceName; EventPublishingService<Object, Object> service = nodeEngine.getService(serviceName); if (service == null) { logger.log(Level.WARNING, "There is no service named: " + serviceName); return; } EventServiceSegment segment = getSegment(serviceName, false); if (segment == null) { logger.log(Level.WARNING, "No service registration found for " + serviceName); return; } Registration registration = segment.registrationIdMap.get(eventPacket.id); if (registration == null) { logger.log(Level.WARNING, "No registration found for " + serviceName + " / " + eventPacket.id); return; } if (!registration.isLocal()) { logger.log(Level.WARNING, "Invalid target for " + registration); return; } dispatchEvent(service, eventObject, registration.listener); } public int getKey() { return orderKey; } } private class RemoteEventPacketProcessor extends EventPacketProcessor implements StripedRunnable { private Packet packet; public RemoteEventPacketProcessor(Packet packet) { this.packet = packet; this.orderKey = packet.getPartitionId(); } public void run() { Data data = packet.getData(); EventPacket eventPacket = (EventPacket) nodeEngine.toObject(data); process(eventPacket); } } private class LocalEventDispatcher implements StripedRunnable { final String serviceName; final Object event; final Object listener; final int orderKey; private LocalEventDispatcher(String serviceName, Object event, Object listener, int orderKey) { this.serviceName = serviceName; this.event = event; this.listener = listener; this.orderKey = orderKey; } public final void run() { final EventPublishingService<Object, Object> service = nodeEngine.getService(serviceName); if (service != null) { dispatchEvent(service, event, listener); } else { if (nodeEngine.isActive()) { throw new IllegalArgumentException("Service[" + serviceName + "] could not be found!"); } } } public int getKey() { return orderKey; } } private void dispatchEvent(EventPublishingService<Object, Object> service, Object event, Object listener) { final long start = Clock.currentTimeMillis(); service.dispatchEvent(event, listener); final long end = Clock.currentTimeMillis(); if ((end - start) > 100) { logger.log(Level.WARNING, "Caution: Off-load event processing to your own thread-pool, don't use event thread! Listener: " + listener); } } public static class Registration implements EventRegistration { private String id; private String serviceName; private String topic; private EventFilter filter; private Address subscriber; private transient boolean localOnly; private transient Object listener; public Registration() { } public Registration(String id, String serviceName, String topic, EventFilter filter, Address subscriber, Object listener, boolean localOnly) { this.filter = filter; this.id = id; this.listener = listener; this.serviceName = serviceName; this.topic = topic; this.subscriber = subscriber; this.localOnly = localOnly; } public EventFilter getFilter() { return filter; } public String getId() { return id; } public Address getSubscriber() { return subscriber; } public boolean isLocalOnly() { return localOnly; } private boolean isLocal() { return listener != null; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Registration that = (Registration) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false; if (topic != null ? !topic.equals(that.topic) : that.topic != null) return false; if (filter != null ? !filter.equals(that.filter) : that.filter != null) return false; if (subscriber != null ? !subscriber.equals(that.subscriber) : that.subscriber != null) return false; return true; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0); result = 31 * result + (topic != null ? topic.hashCode() : 0); result = 31 * result + (filter != null ? filter.hashCode() : 0); result = 31 * result + (subscriber != null ? subscriber.hashCode() : 0); return result; } public void writeData(ObjectDataOutput out) throws IOException { out.writeUTF(id); out.writeUTF(serviceName); out.writeUTF(topic); subscriber.writeData(out); out.writeObject(filter); } public void readData(ObjectDataInput in) throws IOException { id = in.readUTF(); serviceName = in.readUTF(); topic = in.readUTF(); subscriber = new Address(); subscriber.readData(in); filter = in.readObject(); } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("Registration"); sb.append("{filter=").append(filter); sb.append(", id='").append(id).append('\''); sb.append(", serviceName='").append(serviceName).append('\''); sb.append(", subscriber=").append(subscriber); sb.append(", listener=").append(listener); sb.append('}'); return sb.toString(); } } public final static class EventPacket implements IdentifiedDataSerializable { private String id; private String serviceName; private Object event; public EventPacket() { } EventPacket(String id, String serviceName, Object event) { this.event = event; this.id = id; this.serviceName = serviceName; } public void writeData(ObjectDataOutput out) throws IOException { out.writeUTF(id); out.writeUTF(serviceName); out.writeObject(event); } public void readData(ObjectDataInput in) throws IOException { id = in.readUTF(); serviceName = in.readUTF(); event = in.readObject(); } public int getFactoryId() { return SpiDataSerializerHook.F_ID; } public int getId() { return SpiDataSerializerHook.EVENT_PACKET; } } public static final class EmptyFilter implements EventFilter, DataSerializable { public boolean eval(Object arg) { return true; } public void writeData(ObjectDataOutput out) throws IOException { } public void readData(ObjectDataInput in) throws IOException { } @Override public boolean equals(Object obj) { return obj instanceof EmptyFilter; } @Override public int hashCode() { return 0; } } public static class SendEventOperation extends AbstractOperation { private EventPacket eventPacket; private int orderKey; public SendEventOperation() { } public SendEventOperation(EventPacket eventPacket, int orderKey) { this.eventPacket = eventPacket; this.orderKey = orderKey; } public void run() throws Exception { EventServiceImpl eventService = (EventServiceImpl) getNodeEngine().getEventService(); eventService.executeEvent(eventService.new EventPacketProcessor(eventPacket, orderKey)); } public boolean returnsResponse() { return true; } protected void writeInternal(ObjectDataOutput out) throws IOException { super.writeInternal(out); eventPacket.writeData(out); out.writeInt(orderKey); } protected void readInternal(ObjectDataInput in) throws IOException { super.readInternal(in); eventPacket = new EventPacket(); eventPacket.readData(in); orderKey = in.readInt(); } } public static class RegistrationOperation extends AbstractOperation { private Registration registration; private transient boolean response = false; public RegistrationOperation() { } private RegistrationOperation(Registration registration) { this.registration = registration; } public void run() throws Exception { EventServiceImpl eventService = (EventServiceImpl) getNodeEngine().getEventService(); response = eventService.handleRegistration(registration); } @Override public Object getResponse() { return response; } @Override public boolean returnsResponse() { return true; } @Override protected void writeInternal(ObjectDataOutput out) throws IOException { registration.writeData(out); } @Override protected void readInternal(ObjectDataInput in) throws IOException { registration = new Registration(); registration.readData(in); } } public static class DeregistrationOperation extends AbstractOperation { private String topic; private String id; DeregistrationOperation() { } private DeregistrationOperation(String topic, String id) { this.topic = topic; this.id = id; } public void run() throws Exception { EventServiceImpl eventService = (EventServiceImpl) getNodeEngine().getEventService(); eventService.deregisterSubscriber(getServiceName(), topic, id); } @Override public Object getResponse() { return true; } @Override public boolean returnsResponse() { return true; } @Override protected void writeInternal(ObjectDataOutput out) throws IOException { out.writeUTF(topic); out.writeUTF(id); } @Override protected void readInternal(ObjectDataInput in) throws IOException { topic = in.readUTF(); id = in.readUTF(); } } public static class PostJoinRegistrationOperation extends AbstractOperation { private Collection<Registration> registrations; public PostJoinRegistrationOperation() { } public PostJoinRegistrationOperation(Collection<Registration> registrations) { this.registrations = registrations; } @Override public void run() throws Exception { if (registrations != null && registrations.size() > 0) { NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); EventServiceImpl eventService = nodeEngine.eventService; for (Registration reg : registrations) { eventService.handleRegistration(reg); } } } @Override public boolean returnsResponse() { return false; } @Override protected void writeInternal(ObjectDataOutput out) throws IOException { super.writeInternal(out); int len = registrations != null ? registrations.size() : 0; out.writeInt(len); if (len > 0) { for (Registration reg : registrations) { reg.writeData(out); } } } @Override protected void readInternal(ObjectDataInput in) throws IOException { super.readInternal(in); int len = in.readInt(); if (len > 0) { registrations = new ArrayList<Registration>(len); for (int i = 0; i < len; i++) { Registration reg = new Registration(); registrations.add(reg); reg.readData(in); } } } } }
41f0589a1e50d2a1b7b9be69354fb54f66df92a6
91924d70f45fc77b5763cf213018deaa1287e772
/iski-ejb/src/main/java/tn/esprit/blizzard/services/interfaces/OrganizerRequestServiceRemote.java
bf3b701346faa9bf7cd18f56da7645f53d597c65
[]
no_license
Bairem/iSKi
1cdac5577f0c4011d47cee01609c5aba6bada13b
d49e96a9c9f59b7ecd09846ba9cf8cac7cd43f58
refs/heads/master
2021-07-25T02:02:16.991790
2017-10-29T23:47:12
2017-10-29T23:47:12
108,161,910
0
0
null
null
null
null
UTF-8
Java
false
false
538
java
package tn.esprit.blizzard.services.interfaces; import java.util.List; import javax.ejb.Remote; import tn.esprit.blizzard.iski.entities.OrganizerRequest; @Remote public interface OrganizerRequestServiceRemote { public OrganizerRequest add(OrganizerRequest u); public OrganizerRequest update(OrganizerRequest u); public void remove(Integer id); public List<OrganizerRequest> findAll(); public OrganizerRequest findById(Integer id); public List<OrganizerRequest> findPendingRequests(String status); }
e048ef3204d6b21c921d71c07d112a2f879ab0df
982f6c3a3c006d2b03f4f53c695461455bee64e9
/src/main/java/com/alipay/api/domain/LiabilityQuoteInfo.java
fbbd6e51520477917b5f8c25f849a2709bebae79
[ "Apache-2.0" ]
permissive
zhaomain/Alipay-Sdk
80ffc0505fe81cc7dd8869d2bf9a894b823db150
552f68a2e7c10f9ffb33cd8e0036b0643c7c2bb3
refs/heads/master
2022-11-15T03:31:47.418847
2020-07-09T12:18:59
2020-07-09T12:18:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,048
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 责任报价信息 * * @author auto create * @since 1.0, 2020-06-28 19:21:16 */ public class LiabilityQuoteInfo extends AlipayObject { private static final long serialVersionUID = 5861218518931987841L; /** * 保司返回的起保时间,格式yyyy-MM-dd HH:mm:ss */ @ApiField("effect_end_time") private String effectEndTime; /** * 保司返回的起保时间,格式yyyy-MM-dd HH:mm:ss */ @ApiField("effect_start_time") private String effectStartTime; /** * 不计免赔保费,单位分 */ @ApiField("iop_premium") private String iopPremium; /** * 责任编码 */ @ApiField("liability_no") private String liabilityNo; /** * 责任保费,单位分 */ @ApiField("liability_premium") private String liabilityPremium; /** * 责任保额,单位分 */ @ApiField("sum_insured") private String sumInsured; public String getEffectEndTime() { return this.effectEndTime; } public void setEffectEndTime(String effectEndTime) { this.effectEndTime = effectEndTime; } public String getEffectStartTime() { return this.effectStartTime; } public void setEffectStartTime(String effectStartTime) { this.effectStartTime = effectStartTime; } public String getIopPremium() { return this.iopPremium; } public void setIopPremium(String iopPremium) { this.iopPremium = iopPremium; } public String getLiabilityNo() { return this.liabilityNo; } public void setLiabilityNo(String liabilityNo) { this.liabilityNo = liabilityNo; } public String getLiabilityPremium() { return this.liabilityPremium; } public void setLiabilityPremium(String liabilityPremium) { this.liabilityPremium = liabilityPremium; } public String getSumInsured() { return this.sumInsured; } public void setSumInsured(String sumInsured) { this.sumInsured = sumInsured; } }
4ac8aea2bd8d9ea8c264e00578c6e4c852d2bbe3
c6a164d2defb875c13e822a4b0b8080677b8fe12
/app/src/main/java/com/example/tp1login/request/ApiClient.java
b94676698681125944aebf056189dc7a8290f68f
[]
no_license
Nahuel-Scerca/TP1_Login_SP
602de83b822f7916247111fb26975d6ae09b8dd3
94749965e859759c1b44d7bad7cf0fc5cc253351
refs/heads/master
2022-12-31T13:31:15.406020
2020-10-21T16:59:44
2020-10-21T16:59:44
306,157,432
0
0
null
null
null
null
UTF-8
Java
false
false
1,931
java
package com.example.tp1login.request; import android.content.Context; import android.content.SharedPreferences; import com.example.tp1login.model.Usuario; public class ApiClient { private static SharedPreferences sp; private static SharedPreferences conectar(Context context){ if(sp==null){ sp= context.getSharedPreferences("datos",0); } return sp; } public static void guardar(Context context , Usuario usuario){ SharedPreferences sp= conectar(context); SharedPreferences.Editor editor= sp.edit(); editor.putLong("dni",usuario.getDni()); editor.putString("apellido",usuario.getApellido()); editor.putString("nombre",usuario.getNombre()); editor.putString("mail",usuario.getMail()); editor.putString("password",usuario.getPassword()); editor.commit(); } public static Usuario leer(Context context){ SharedPreferences sp= conectar(context); Long dni = sp.getLong("dni",-1); String apellido = sp.getString("apellido","-1"); String nombre = sp.getString("nombre","-1"); String mail = sp.getString("mail","-1"); String password = sp.getString("password","-1"); Usuario usuario = new Usuario(dni,apellido,nombre,mail,password); return usuario; } public static Usuario login(Context context, String email, String password){ Usuario usuario = null; SharedPreferences sp= conectar(context); Long dni = sp.getLong("dni",-1); String apellido = sp.getString("apellido","-1"); String nombre = sp.getString("nombre","-1"); String mail = sp.getString("mail","-1"); String pass = sp.getString("password","-1"); if(email.equals(mail) && password.equals(pass)){ usuario = new Usuario(dni,apellido,nombre,mail,pass); } return usuario; } }
21447fbec170d97fcd66e7103423313720ad0842
78f790c822f797088a27f73f23502bcd4e518256
/src/test/java/nfm/subway/cli/CLITestMainTest.java
f96699098042aabc9fafccea6d9a1db4a2bceb88
[]
no_license
XiaoqingWang/esper-sensor
acdd663effbae2061f0e20b1404f0e9725c04dc4
85d91a2da9a361b431f29747559fe9bd336bd324
refs/heads/master
2020-12-25T21:00:40.178289
2014-01-26T12:10:35
2014-01-26T12:10:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package nfm.subway.cli; import org.junit.Test; import static org.junit.Assert.*; public class CLITestMainTest { @Test public void 시분초새시간이모두높을때() { String newDate = "20140115130118"; String oldDate = "20140115130103"; int waitTime = CLITestMain.getDelayTime(newDate, oldDate); assertEquals(15, waitTime); } @Test public void 초가새시간이느릴때() { String newDate = "20140115130103"; String oldDate = "20140115130050"; int waitTime = CLITestMain.getDelayTime(newDate, oldDate); assertEquals(13, waitTime); } @Test public void 초분새시간이모두느릴때() { String newDate = "20140115150002"; String oldDate = "20140115145950"; int waitTime = CLITestMain.getDelayTime(newDate, oldDate); assertEquals(12, waitTime); } }
84882145fa00fe0ab4bf01cd614f74b90e84ff34
5cc01dec9ec1c6dde262d56d42c40dd8acfe2010
/PTSCMC/src/java/com/venus/mc/contract/order/SearchMaterialAction.java
a9286a76b1b2376fdc7537ddbdb1481c836409be
[]
no_license
phuongtu1983/mc
6defa0c94a02e2ff5ce9886ee87a219396d54ac0
0966390950a911e9fdb75484701bdede381a3042
refs/heads/master
2020-03-11T11:50:15.387384
2018-04-18T00:42:25
2018-04-18T00:42:25
129,980,464
0
0
null
null
null
null
UTF-8
Java
false
false
1,445
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.venus.mc.contract.order; import com.venus.core.util.StringUtil; import com.venus.core.util.LogUtil; import com.venus.mc.bean.SearchFormBean; import com.venus.mc.core.SpineAction; import com.venus.mc.dao.MaterialDAO; import com.venus.mc.util.Constants; import java.util.ArrayList; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; /** * * @author Mai vinh loc */ public class SearchMaterialAction extends SpineAction { @Override public boolean doAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { SearchFormBean formBean = (SearchFormBean) form; int fieldid = formBean.getSearchid(); String strFieldvalue = formBean.getSearchvalue(); ArrayList materialList = null; try { MaterialDAO materialDAO = new MaterialDAO(); materialList = materialDAO.searchMaterial(fieldid, StringUtil.encodeHTML(strFieldvalue)); } catch (Exception ex) { LogUtil.error("FAILED:Material:search-" + ex.getMessage()); ex.printStackTrace(); } request.setAttribute(Constants.MATERIAL_LIST, materialList); return true; } }
44b6329ddd0f52e1839b926999ce5b888e8c4c96
a367d647b70e0c772cc63a666498f66969e68e03
/src/Programers/numberHide.java
3edb8464fedb835f010c3c1a7064db0d650e276d
[]
no_license
lwjace/yamuAlgorithm
0149e043d4cd0d28ae61dfbc2cc44dd62c34d8ff
91c17b294adedb35c394217c77c029c221ca9228
refs/heads/master
2023-01-24T06:53:50.452639
2020-12-09T11:52:36
2020-12-09T11:52:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
package Programers; public class numberHide { public static void main(String[] args) { System.out.println(solution("01090550119")); } public static String solution(String phone_number) { String answer = ""; int length= phone_number.length(); for (int i=0; i<=length-4; i++){ answer+="*"; } String end= phone_number.substring(length-4); answer+=end; return answer; } }
4b252a68c58f7fcf821ae9c52ad0aea1c8740d1b
57138c9e3873081f5a75f907589d36e39ad2dd62
/application/sshapp/src/main/java/org/ssh/app/example/entity/Disc_1.java
d63c8b8bd2e5539a51baed43643e2b9c6b516b23
[ "Apache-2.0" ]
permissive
parth2691/sshapp
f329b5bdacac37c72fa226772aa4efdd74bdaf81
20a573490663f00eb0981c9f758e2281fe13f105
refs/heads/master
2021-01-22T01:18:27.824518
2012-06-02T12:05:26
2012-06-02T12:05:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,504
java
package org.ssh.app.example.entity; import java.io.Serializable; import javax.persistence.DiscriminatorColumn; import javax.persistence.DiscriminatorType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.TableGenerator; @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "DISC_TYPE", discriminatorType = DiscriminatorType.STRING) public class Disc_1 implements Serializable { private static final long serialVersionUID = 4096693525922121897L; private Long id; private String name; private Integer price; @Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "Id_Generator") @TableGenerator(name = "Id_Generator", table = "ID_GENERATOR", pkColumnName = "GEN_NAME", valueColumnName = "GEN_VAL", pkColumnValue = "Disc_1", initialValue = 1, allocationSize = 1) public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } }
2874db4ffe8964255c3815dfb16fc0d2be74435c
a83e543bcb8869b9e32947ef1c7c378d09a4a607
/VideoGenTransformer/src/main/java/fr/istic/videogen/tps/TP3.java
f91edd893858a07fdf0784b6fdca20d83522188d
[]
no_license
triggersch/videogen
cc7145fdc25cc0624a394a93e1482d4d93c8063f
8ba7fac805338bae9a1ec4353c2ed2f9afd38a82
refs/heads/master
2020-04-24T15:18:54.065587
2019-02-22T12:19:03
2019-02-22T12:19:03
171,009,790
0
0
null
null
null
null
UTF-8
Java
false
false
6,449
java
package fr.istic.videogen.tps; import static org.junit.Assert.*; import java.util.List; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.junit.Test; import fr.istic.videoGen.AlternativesMedia; import fr.istic.videoGen.ImageDescription; import fr.istic.videoGen.MandatoryMedia; import fr.istic.videoGen.Media; import fr.istic.videoGen.MediaDescription; import fr.istic.videoGen.OptionalMedia; import fr.istic.videoGen.VideoDescription; import fr.istic.videoGen.VideoGeneratorModel; import fr.istic.videogen.fileutils.FilesUtils; public class TP3 { private FilesUtils fileservice = new FilesUtils(); public String[] addOptionnalVideo( String[] entries ) { String[] result = new String[entries.length * 2]; int index = 0; for(String s:entries) { result[index] = s + ",TRUE"; result[index+1] = s + ",FALSE"; index += 2; } return result; } public String[] addMandatoryVideo( String[] entries ) { String[] result = new String[entries.length]; int index = 0; for(String s:entries) { if (s == null) s=""; result[index] = s + ",TRUE"; index ++; } return result; } public String[] addAlternativesVideo( String[] entries , int nbChoice) { String[] result = new String[entries.length * nbChoice]; int index = 0; int i=0; for(String s:entries) { int nb = nbChoice; while(nb > 0) { String line = ""; for(i=0;i<nbChoice;i++) { if (i == nb-1) line += ",TRUE"; else line += ",FALSE"; } result[index] = s + line; index++; nb--; } } return result; } public Long getFileSize(String filename) { File f = fileservice.loadingFile2(filename); Long value = 0L; if (f.exists()) value = f.length(); return value; } @Test public void generateCSV() throws Exception { String listeId = ""; String[] listeCycle = new String[1]; Map<String,String> listLocation = new LinkedHashMap<String,String>(); File dslfile = fileservice.loadingFile2("dsl/exampletp.videogen"); VideoGeneratorModel videoGen = new VideoGenHelper().loadVideoGenerator(URI.createURI(dslfile.getPath())); assertNotNull(videoGen); for (Media media : videoGen.getMedias()) { if (media instanceof MandatoryMedia){ MandatoryMedia mandatory = (MandatoryMedia)media; MediaDescription mediadescription = mandatory.getDescription(); if(mediadescription instanceof ImageDescription) { ImageDescription imagedescription = (ImageDescription)mediadescription; System.out.println("Mandatory image : " + imagedescription.getImageid()); listeId += "," + imagedescription.getImageid(); listeCycle = addMandatoryVideo( listeCycle ); listLocation.put( imagedescription.getImageid(),imagedescription.getLocation()); }else if(mediadescription instanceof VideoDescription) { VideoDescription video = (VideoDescription)mediadescription; System.out.println("Mandatory video : " + video.getVideoid()); listeId += "," + video.getVideoid(); listeCycle = addMandatoryVideo( listeCycle ); listLocation.put( video.getVideoid(),video.getLocation()); } }else if (media instanceof OptionalMedia){ OptionalMedia option = (OptionalMedia)media; MediaDescription mediadescrip = option.getDescription(); if(mediadescrip instanceof ImageDescription) { ImageDescription imgdescrip = (ImageDescription)mediadescrip; System.out.println("Optional image : " + imgdescrip.getImageid()); listeId += "," + imgdescrip.getLocation(); listeCycle = addOptionnalVideo( listeCycle ); listLocation.put( imgdescrip.getImageid(),imgdescrip.getLocation()); }else if(mediadescrip instanceof VideoDescription) { VideoDescription videodescription = (VideoDescription)mediadescrip; System.out.println("Optional video : " +videodescription.getVideoid()); listeId += "," + videodescription.getVideoid(); listeCycle = addOptionnalVideo( listeCycle ); listLocation.put( videodescription.getVideoid(),videodescription.getLocation()); } }else if (media instanceof AlternativesMedia){ AlternativesMedia alternative = (AlternativesMedia)media; EList<MediaDescription> liste = alternative.getMedias(); for( MediaDescription md : liste ) { if(md instanceof ImageDescription) { ImageDescription img = (ImageDescription)md; System.out.println("Alternatives image : " + img.getImageid()); listeId += "," + img.getImageid(); listLocation.put( img.getImageid(),img.getLocation()); }else if(md instanceof VideoDescription) { VideoDescription video = (VideoDescription)md; System.out.println("Alternatives video : " +video.getVideoid()); listeId += "," + video.getVideoid(); listLocation.put( video.getVideoid(),video.getLocation()); } } listeCycle = addAlternativesVideo( listeCycle , liste.size()); } } File file = fileservice.loadingFile2("csv/csv-file.csv"); BufferedWriter bw = new BufferedWriter(new FileWriter(file)); bw.write(listeId + ",size,realsize \n"); int index = 1; String output = "ouputvideo/output.mp4"; for (String line : listeCycle) { Long cumulSize = 0L; Long realSize = 0L; Long gifSize = 0L; int indexColonne = -1; List<String> concatLocation = new ArrayList<String>(); // liste de media à concatener List<String> medias = new ArrayList<String>(); for (String str : line.split(",")) { if (str.equals("TRUE")) { //size Object[] keys = listLocation.keySet().toArray(); String location = listLocation.get( keys[indexColonne] ); concatLocation.add(location); cumulSize += getFileSize(location); //realsize medias.add(location); } indexColonne++; } VideoTools.concatenerMedia(concatLocation, output); realSize = getFileSize(output); bw.write(index + line + "," + cumulSize +","+ realSize +","+ gifSize +"\n"); index++; } bw.close(); BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { System.out.println(line); } br.close(); } }
78225a69b9e3a0173fc4cffd049b61b2bfab269a
e9375c7cb7f672a59b927d1f6e2dcc50da7994bf
/src/com/company/thread/lock/ThreadAA.java
4ea3f0412f8a55015cab989b74fe5cc588552eae
[]
no_license
zxj16152/JavaTest
eea553f57e4d40616b641246463e67a9adf3120b
3ed20cc08d61bdbf20e9aafbdc1ec9fbf0e112e4
refs/heads/master
2020-07-19T19:22:36.426860
2019-09-05T07:22:46
2019-09-05T07:22:46
206,500,603
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package com.company.thread.lock; import com.company.thread.condition.MyService; /** * @Description TODO * @Author zhouxinjian * @Date 2019-07-16 15:11 **/ public class ThreadAA extends Thread { private MyService myService; public ThreadAA(MyService myService) { this.myService=myService; } @Override public void run() { // myService.methodA(); } }
0f19cb7e4fe5e58a243ef82caf5f3882aac4539c
25e90779bf473aeb04b6987474fd2b3c0394e98b
/cityGML/src/main/java/it/sinergis/jaxb/EndUseUnitPropertyType.java
71e62a25e7953f06c877c86ffb2848c9deecc571
[]
no_license
SunshineProject/BuildingEfficiencyPre-certificationService
9d36123eb2294e441c1f95decf5e1df05426bc36
82a5688ac37f914fa10916845468649c402e949f
refs/heads/master
2021-01-10T14:08:58.797049
2016-02-17T10:37:43
2016-02-17T10:37:43
51,445,327
0
0
null
null
null
null
UTF-8
Java
false
false
7,177
java
package it.sinergis.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import org.w3._1999.xlink.ActuateType; import org.w3._1999.xlink.ShowType; import org.w3._1999.xlink.TypeType; /** * <p>Java class for EndUseUnitPropertyType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="EndUseUnitPropertyType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence minOccurs="0"> * &lt;element ref="{http://www.sig3d.org/citygml/2.0/energy/0.5.0}EndUseUnit"/> * &lt;/sequence> * &lt;attGroup ref="{http://www.opengis.net/gml}AssociationAttributeGroup"/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EndUseUnitPropertyType", propOrder = { "endUseUnit" }) public class EndUseUnitPropertyType { @XmlElement(name = "EndUseUnit") protected EndUseUnitType endUseUnit; @XmlAttribute(name = "remoteSchema", namespace = "http://www.opengis.net/gml") @XmlSchemaType(name = "anyURI") protected String remoteSchema; @XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink") protected TypeType type; @XmlAttribute(name = "href", namespace = "http://www.w3.org/1999/xlink") protected String href; @XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink") protected String role; @XmlAttribute(name = "arcrole", namespace = "http://www.w3.org/1999/xlink") protected String arcrole; @XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink") protected String title; @XmlAttribute(name = "show", namespace = "http://www.w3.org/1999/xlink") protected ShowType show; @XmlAttribute(name = "actuate", namespace = "http://www.w3.org/1999/xlink") protected ActuateType actuate; /** * Gets the value of the endUseUnit property. * * @return * possible object is * {@link EndUseUnitType } * */ public EndUseUnitType getEndUseUnit() { return endUseUnit; } /** * Sets the value of the endUseUnit property. * * @param value * allowed object is * {@link EndUseUnitType } * */ public void setEndUseUnit(EndUseUnitType value) { this.endUseUnit = value; } public boolean isSetEndUseUnit() { return (this.endUseUnit!= null); } /** * Gets the value of the remoteSchema property. * * @return * possible object is * {@link String } * */ public String getRemoteSchema() { return remoteSchema; } /** * Sets the value of the remoteSchema property. * * @param value * allowed object is * {@link String } * */ public void setRemoteSchema(String value) { this.remoteSchema = value; } public boolean isSetRemoteSchema() { return (this.remoteSchema!= null); } /** * Gets the value of the type property. * * @return * possible object is * {@link TypeType } * */ public TypeType getType() { if (type == null) { return TypeType.SIMPLE; } else { return type; } } /** * Sets the value of the type property. * * @param value * allowed object is * {@link TypeType } * */ public void setType(TypeType value) { this.type = value; } public boolean isSetType() { return (this.type!= null); } /** * Gets the value of the href property. * * @return * possible object is * {@link String } * */ public String getHref() { return href; } /** * Sets the value of the href property. * * @param value * allowed object is * {@link String } * */ public void setHref(String value) { this.href = value; } public boolean isSetHref() { return (this.href!= null); } /** * Gets the value of the role property. * * @return * possible object is * {@link String } * */ public String getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link String } * */ public void setRole(String value) { this.role = value; } public boolean isSetRole() { return (this.role!= null); } /** * Gets the value of the arcrole property. * * @return * possible object is * {@link String } * */ public String getArcrole() { return arcrole; } /** * Sets the value of the arcrole property. * * @param value * allowed object is * {@link String } * */ public void setArcrole(String value) { this.arcrole = value; } public boolean isSetArcrole() { return (this.arcrole!= null); } /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle(String value) { this.title = value; } public boolean isSetTitle() { return (this.title!= null); } /** * Gets the value of the show property. * * @return * possible object is * {@link ShowType } * */ public ShowType getShow() { return show; } /** * Sets the value of the show property. * * @param value * allowed object is * {@link ShowType } * */ public void setShow(ShowType value) { this.show = value; } public boolean isSetShow() { return (this.show!= null); } /** * Gets the value of the actuate property. * * @return * possible object is * {@link ActuateType } * */ public ActuateType getActuate() { return actuate; } /** * Sets the value of the actuate property. * * @param value * allowed object is * {@link ActuateType } * */ public void setActuate(ActuateType value) { this.actuate = value; } public boolean isSetActuate() { return (this.actuate!= null); } }
bae218fae1873f3113863a871361181e5bd22e19
b10fbc421c0501d0d2ec99060a620bc3e49fa4c9
/app/src/main/java/net/lzzy/practicesonline/activities/models/Question.java
f2b46f5b2cf9fb876c9cbfe6dc1ddcf976201241
[]
no_license
hezhengqiao/PracticesOnline
795cfccb285c67aae6f2dc84d38c5b7f56764d76
8fbb31791f429074a8ca6973fe4fef748e1742a4
refs/heads/master
2020-05-07T08:37:18.378226
2019-05-22T03:47:50
2019-05-22T03:47:50
180,338,289
0
0
null
2019-04-09T10:00:51
2019-04-09T10:00:50
null
UTF-8
Java
false
false
3,042
java
package net.lzzy.practicesonline.activities.models; import net.lzzy.practicesonline.activities.constants.ApiConstants; import net.lzzy.practicesonline.activities.models.view.QuestionType; import net.lzzy.practicesonline.activities.network.QuestionService; import net.lzzy.sqllib.Ignored; import net.lzzy.sqllib.Jsonable; import net.lzzy.sqllib.Sqlitable; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; import java.util.UUID; /** * * @author lzzy_gxy * @date 2019/4/16 * Description: */ public class Question extends BaseEntity implements Sqlitable, Jsonable { @Ignored public static final String COL_PRACTICE_ID="practiceId"; private String content; @Ignored private QuestionType type; private int dbType; private String analysis; private UUID practiceId; private int number; @Ignored private List<Option> options; public Question(){ options= new ArrayList<>(); } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public QuestionType getType() { return type; } public int getDbType() { return dbType; } public void setDbType(int dbType) { this.dbType = dbType; type=QuestionType.getInstance(dbType); } public String getAnalysis() { return analysis; } public void setAnalysis(String analysis) { this.analysis = analysis; } public UUID getPracticeId() { return practiceId; } public void setPracticeId(UUID practiceId) { this.practiceId = practiceId; } public List<Option> getOptions() { return options; } public void setOptions(List<Option> options) { this.options.clear(); this.options.addAll(options); } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } @Override public boolean needUpdate() { return false; } @Override public JSONObject toJson() throws JSONException { return null; } @Override public void fromJson(JSONObject json) throws JSONException { analysis=json.getString(ApiConstants.JSON_QUESTION_ANALYSIS); content=json.getString(ApiConstants.JSON_QUESTION_CONTENT); setDbType(json.getInt(ApiConstants.JSON_QUESTION_TYPE)); String strOption= json.getString(ApiConstants.JSON_QUESTION_OPTIONS); String strAnswers=json.getString(ApiConstants.JSON_QUESTION_ANSWER); try { List<Option> options= QuestionService.getOptionsFromJson(strOption,strAnswers); for (Option option:options){ option.setQuestionId(id); } setOptions(options); }catch (IllegalAccessException|InstantiationException e){ e.printStackTrace(); } number=json.getInt("Number"); } }
6a91cbe4f1f6f84d1418eb88c9ba14f9cf575a84
e5f262b89b272ef7c24edb74d165c9b8ec8f20e4
/Douwei Solutions/ABCPath.java
bfc864b9d9b236c6bc78a9f74d9f4fe7d77363b6
[]
no_license
magicalsoup/Competitive-Programming-Solutions-Library
289b9b891589cb773da0295274246b18e1334fd7
edcc6928e74c82edd8546aefb118bacc15efe10e
refs/heads/master
2023-01-13T19:52:30.773734
2022-12-27T21:13:30
2022-12-27T21:13:30
134,091,852
37
18
null
2018-05-20T14:34:53
2018-05-19T19:26:33
Java
UTF-8
Java
false
false
2,012
java
package Douwei; import java.util.*; public class ABCPath{ public static char[][] grid; public static int H; public static int W; public static int dfs(int x, int y, char curchar){ if(x<0||y<0||x>=W||y>=H){ return 0; } if(curchar!=grid[x][y]){ return 0; } curchar+=1; int a = Math.max(dfs(x, y+1, curchar), dfs(x, y-1, curchar)); int b = Math.max(dfs(x+1, y+1, curchar), dfs(x+1, y-1, curchar)); int c = Math.max(dfs(x-1, y+1, curchar), dfs(x-1, y-1, curchar)); int d = Math.max(dfs(x+1, y, curchar), dfs(x-1, y, curchar)); return(1+Math.max(Math.max(a, b), Math.max(c, d))); } public static void main(String[] args){ Scanner sc = new Scanner(System.in); int casenum=0; while(true){ casenum=casenum+1; H = sc.nextInt(); W = sc.nextInt(); Queue<Integer> xq = new LinkedList<Integer>(); Queue<Integer> yq = new LinkedList<Integer>(); //ESCAPE if(H==0||W==0){ break; } //INPUT and Gridding sc.nextLine(); grid = new char[W][H]; for(int i=0; i<H; i++){ String temp = sc.nextLine(); for(int j=0; j<W; j++){ if(temp.charAt(j)=='A'){ xq.add(j); yq.add(i); } grid[j][i]=temp.charAt(j); } } int curmax=-1; while(!xq.isEmpty()){ int curx = xq.poll(); int cury = yq.poll(); curmax=Math.max(curmax, dfs(curx, cury, 'A')); } System.out.println("Case_"+casenum+":_"+curmax); } } }
aabf7c188ae0d3acc0fe328d8e49804353d263c5
50ff614e0a9bd6145711523cb039f879eb032c84
/src/builder/recursiveGeneric/Person.java
51083d78c0e6ce2e8c9f42a72bb5516b5ce2aa85
[]
no_license
JAlayon/java-design-patterns
9e9c5039661bdd149a38f41722020ae4cf384bc0
31a23ddf4f2418af4d98599aa011b8bed07b8260
refs/heads/master
2023-06-09T15:14:47.006052
2021-06-23T02:54:50
2021-06-23T02:54:50
361,209,918
0
0
null
2021-06-23T02:19:59
2021-04-24T16:21:20
Java
UTF-8
Java
false
false
1,263
java
package builder.recursiveGeneric; public class Person { public String name; public String position; @Override public String toString() { return "Person{" + "name='" + name + '\'' + ", position='" + position + '\'' + '}'; } } class PersonBuilder<SELF extends PersonBuilder<SELF>>{ protected Person person = new Person(); public SELF withName(String name){ this.person.name = name; return self(); } protected SELF self(){ return (SELF)this; } public Person build(){ return person; } } class EmployeeBuilder extends PersonBuilder<EmployeeBuilder>{ public EmployeeBuilder withPosition(String position){ this.person.position = position; return self(); } @Override protected EmployeeBuilder self() { return this; } } class Demmo{ public static void main(String[] args) { final EmployeeBuilder personBuilder = new EmployeeBuilder(); final Person person = personBuilder .withName("Jair") .withPosition("Software Engineer") .build(); System.out.println(person.toString()); } }
1db15a70bd66a70d09aa364bf6d64a8b2104f5fb
ca11d94c9a94878001666385bf78c90af06f5b55
/tests/WorkmanTests.java
1c2b5085f7fe779a137fab75721af80b088ab842
[ "MIT" ]
permissive
Jinnoma/employees
998a8527e8cb71a8865a23a783b559e0e89ff882
891379c5af31b9c68699052af93bc019f73752cb
refs/heads/master
2023-01-14T15:03:19.858307
2020-11-28T08:25:56
2020-11-28T08:25:56
315,539,226
0
0
null
null
null
null
UTF-8
Java
false
false
866
java
import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; public class WorkmanTests { private Workman workman; @Before public void setup() { Address workerAddress = new Address("Augusta", 12, 13, "Gdynia"); workman = new Workman("Przemek", "Guzek", 30, 3, 100, workerAddress); } @Test public void getWorkmanCorporationValue() { /* value = experience * strength / age */ float corporationValue; corporationValue = workman.getCorporationValue(); assertEquals(10, corporationValue, 2); } @Test(expected = IllegalArgumentException.class) public void setTooHighStrength() { workman.setStrength(101); } @Test(expected = IllegalArgumentException.class) public void setTooLowStrength() { workman.setStrength(-1); } }
a5059570e876b9fd3077f1d615d870863b9f30b5
29d84d8908f5877655b0fc95703880362cde3d40
/app/src/main/java/com/example/preferences/ConfirmActivity.java
984320d186df98ed90ed8cee3e9b697d1f615737
[]
no_license
Dudi111/preference
fd0ff2a8bff22a00ec749697873d9a056a6351ac
318375144b5f8fc4f110c996bff90b85d7e480de
refs/heads/main
2023-06-14T03:00:27.339007
2021-07-06T17:26:43
2021-07-06T17:26:43
383,548,360
0
0
null
null
null
null
UTF-8
Java
false
false
1,821
java
package com.example.preferences; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class ConfirmActivity extends AppCompatActivity { private TextView view1, view2, view3, view4,view5; private Button mbtnconfirm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_confirm); initview(); settext(); mbtnconfirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Context context=getApplication(); new AlertDialog.Builder(context) .setTitle("Delete entry") .setMessage("Are you sure you want to delete this entry?") .show(); } }); } private void initview(){ view1=findViewById(R.id.tvfinal1); view2=findViewById(R.id.tvfinal2); view3=findViewById(R.id.tvfinal3); view4=findViewById(R.id.tvfinal4); view5=findViewById(R.id.tvfinal5); mbtnconfirm=findViewById(R.id.btnconfirm); } private void settext(){ view1.setText(SharedPreference.readString(getApplicationContext(),"name")); view2.setText(SharedPreference.readString(getApplicationContext(),"last")); view3.setText(SharedPreference.readString(getApplicationContext(),"email")); view4.setText(SharedPreference.readString(getApplicationContext(),"seat")); view5.setText(SharedPreference.readString(getApplicationContext(),"date")); } }
1bec1e563be1cf579a1dfe734013d838152c4987
0a99e10a1cb80fc263a9446c5a54ff3a17161f17
/va2/src/main/modes/menu/EstateRoomMenuMode.java
939b262696c6d3b7ddddd629d7f543d0ca498428
[]
no_license
VectorShadow/VA2
46c61d4f309a6badde71879c33a8082a58b56594
3f13c417e01a035eaf8ef0454ab00612c856e4df
refs/heads/master
2021-07-09T01:34:00.354124
2021-04-22T17:17:07
2021-04-22T17:17:07
242,174,598
1
0
null
2021-04-14T14:38:37
2020-02-21T15:48:03
Java
UTF-8
Java
false
false
2,844
java
package main.modes.menu; import io.in.InputCommandList; import io.out.GUIManager; import main.Session; import main.modes.menu.estate.*; import main.modes.menu.estate.armory.ArmoryMenuMode; import main.modes.menu.estate.library.LibraryMenuMode; import world.lore.LockLeaf; import world.lore.LoreDefinitions; import world.terrain.TerrainDefinitions; import world.terrain.TerrainTemplate; public abstract class EstateRoomMenuMode extends MenuMode { abstract protected void setEstateMenu(); @Override public InputCommandList getInput() { return null; } @Override public void to() { setEstateMenu(); GUIManager gm = Session.getGuiManager(); gm.changeChannelToFullscreenText(); out(); } @Override public void from() { //todo - nothing } public static EstateRoomMenuMode interpretTerrain(TerrainTemplate tt) { if (tt.equals(TerrainDefinitions.LIBRARY_PORTAL)) { EstateRoomMenuMode targetMode = new LibraryMenuMode(); if (((LockLeaf)LoreDefinitions.getLockTree().get( LoreDefinitions.THEME_GENERAL, LoreDefinitions.GENERAL_ESTATE_MESSAGE )).isLocked()) { Session.unlockLore(LoreDefinitions.THEME_GENERAL, LoreDefinitions.GENERAL_ESTATE_MESSAGE, targetMode); LoreDefinitions.silentUnlock(LoreDefinitions.THEME_GENERAL, LoreDefinitions.GENERAL_HISTORY); LoreDefinitions.silentUnlock(LoreDefinitions.THEME_GENERAL, LoreDefinitions.GENERAL_MYTHS); return null; } else return targetMode; } else if (tt.equals(TerrainDefinitions.HALL_OF_ARMS_PORTAL)) return new HallOfArmsMenuMode(); else if (tt.equals(TerrainDefinitions.ARCHERY_RANGE_PORTAL)) return new ArcheryRangeMenuMode(); else if (tt.equals(TerrainDefinitions.LABORATORY_PORTAL)) return new LaboratoryMenuMode(); else if (tt.equals(TerrainDefinitions.TROPHY_HALL_PORTAL)) return new TrophyHallMenuMode(); else if (tt.equals(TerrainDefinitions.MAUSOLEUM_PORTAL)) return new MausoleumMenuMode(); else if (tt.equals(TerrainDefinitions.FORGE_PORTAL)) return new ForgeMenuMode(); else if (tt.equals(TerrainDefinitions.WORKSHOP_PORTAL)) return new WorkshopMenuMode(); else if (tt.equals(TerrainDefinitions.WAREHOUSE_PORTAL)) return new WarehouseMenuMode(); else if (tt.equals(TerrainDefinitions.ARMORY_PORTAL)) return new ArmoryMenuMode(); else if (tt.equals(TerrainDefinitions.RITUAL_CHAMBER_PORTAL)) return new RitualChamberMenuMode(); else return null; //unsupported terrain need not generate a menu } }
7b4c6759059a79f9cd1f1737e0835da4729d7c86
ec870a6d5735bbbc373864ccb1b9c2f9405db1b8
/mobile-sensors-max-sum/src/main/java/boundedMaxSum/treeformation/ghs/messages/GHSRejectMessage.java
9af50b4e6fb98fac33053918a384438030468162
[]
no_license
figo005/code_submittion
ab5f6e75144fae2f4c897bbb30beb0e4ade93b72
2c0c2a66a275ba67b79f0461402e5adb26a83c2e
refs/heads/master
2016-09-05T12:17:12.829340
2015-04-12T14:06:14
2015-04-12T14:06:14
33,808,990
0
1
null
null
null
null
UTF-8
Java
false
false
426
java
package boundedMaxSum.treeformation.ghs.messages; import boundedMaxSum.treeformation.ghs.GHSAgent; import boundedMaxSum.treeformation.ghs.GHSEdge; import boundedMaxSum.treeformation.ghs.GHSMessage; public class GHSRejectMessage extends GHSMessage { public GHSRejectMessage(GHSEdge edge, GHSAgent sender) { super(edge, sender, GHSMessageType.REJECT); } @Override public String toString() { return "Reject"; } }
491a732341eaf11bcd38b9a2a166fa60a5baeedc
0ed4f87f109c878b62b6282114315e41c823ed4f
/src/View/Main.java
8a4280910c71c05e522b76cfa3c3714829a25bb8
[]
no_license
Vivien-lb/GLI-Camembert
76d50a9ce9260e48448ecf824786fd9675d8bacf
4d9f70e9f0c661dc80bb523c06bba6d1099178fd
refs/heads/master
2021-01-11T19:43:15.456795
2016-09-25T20:23:17
2016-09-25T20:23:17
69,188,928
0
0
null
null
null
null
UTF-8
Java
false
false
1,481
java
package View; import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import Controller.Controller; import Controller.IController; import Model.Adapter; import Model.IModel; import Model.Item; import Model.Model; import Model.TableCamembert; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Item item1 = new Item("Loyer", "Un toit, c'est fort utile", 400.0); Item item2 = new Item("Sorties", "Les petits plaisirs du mois", 50.0); Item item3 = new Item("Miam miam", "Pizza, pâtes, pizza.", 100.0); Item item4 = new Item("Café", "Le café du matin, celui de 10h, celui de 16h", 15.0); Model model = new Model(); model.addItem(item1); model.addItem(item2); model.addItem(item3); model.addItem(item4); IModel adapter = new Adapter(model); IController ic = new Controller(); ic.setModel(adapter); TableCamembert tablecamembert = new TableCamembert(adapter, ic); Vue vue = new Vue(adapter, ic); ic.setVue(vue); JFrame jframe = new JFrame(); JTable jtable = new JTable(tablecamembert); JScrollPane jscrollpane = new JScrollPane(jtable); JPanel paneltable = new JPanel(); paneltable.add(jscrollpane); jframe.setSize(new Dimension (900, 900)); jframe.getContentPane().add(vue); jframe.add(paneltable,BorderLayout.EAST); jframe.setVisible(true); } }
09ae39f7298537a5742dda9f1ed48d9bc1e1721f
f0fd23d6b87c599354f665fe28d061d2c0c1c157
/ms_users/src/main/java/groupeg/msusers/modele/enumerations/Situation.java
bf5554b977a2b88cae1ec3ea5b81f432f2e1596d
[]
no_license
kagboton/groupeG
91532619e76a32768ddc3407c522e75d13445121
5818eea061c6ea234887e59c80e6ba8969dee4b0
refs/heads/master
2022-04-07T15:52:48.674253
2020-01-27T18:04:29
2020-01-27T18:04:29
236,556,824
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package groupeg.msusers.modele.enumerations; public enum Situation { CELIBATAIRE("Célibataire"), COUPLE("En couple"), INCONNU("Inconnu"); private String value; Situation(String value) { this.value = value; } public String value(){ return value; } }
f9bfa20d0265f61a0d41abaaad7931857b82c3d6
7190a72145528284ff90624def20c30611c2c712
/src/com/company/DataTypeBool.java
ee7cffa4f821fcc13e1ed41f948c856cc3c15897
[]
no_license
madluk-me/Te
27cdf6fe34c773b22139e0d389fd50a7fc515426
e4a0008216a1aa320725fcbdf6e5c3da8934e3ce
refs/heads/master
2020-12-26T07:38:41.476809
2020-05-23T08:46:02
2020-05-23T08:46:02
237,435,744
0
0
null
null
null
null
UTF-8
Java
false
false
1,282
java
package com.company; import java.sql.SQLOutput; public class DataTypeBool { public static void main(String[] args) { boolean varBoolTrue = true; boolean varBoolFalse = false; System.out.println(varBoolFalse); System.out.println(varBoolTrue); //<>== System.out.println("------------------------------------------"); System.out.println(1>4); System.out.println(1<4); System.out.println(1==4); System.out.println(4==4); System.out.println('A'=='A'); System.out.println('A'=='a'); System.out.println(true ==false); System.out.println("------------------"); int number1 = 688; int number2 = 33; boolean checkLessThan = number1 < number2; boolean checkGreaterThan = number1 > number2; boolean checkEqualsThan = number1 == number2; System.out.println("Is number "+ number1+ " less than "+number2); System.out.println("It is "+checkLessThan); System.out.println("Is number "+ number1+ " greater than "+number2); System.out.println("It is "+checkGreaterThan); System.out.println("Is number "+ number1+ " equal "+number2); System.out.println("It is "+checkEqualsThan); } }
b8a8692231b58d255076f563d17e6aa96241b7fd
e8f80594324eb42c7c135537c37237d74cd2ae1b
/src/main/java/com/marin/job/listing/persistence/model/User.java
2ff2e2ac4b1b257133b40b5d573d06457fec21fd
[]
no_license
MarinKacaj/JobListing
1f8693ded1236dc13b4530ce2606130e7774fc15
3adf00008a39e145f2471589a3c1a096bc1915af
refs/heads/master
2020-04-13T08:08:29.654829
2018-12-27T13:11:23
2018-12-27T13:11:23
163,073,419
0
0
null
null
null
null
UTF-8
Java
false
false
2,117
java
package com.marin.job.listing.persistence.model; import javax.persistence.*; import java.util.Set; @Entity @Table(name = "user") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "user_id") private int id; @Column(name = "email") // @ValidEmail(message = "*Please provide an email") // @NotEmpty(message = "*Please provide an email") private String email; @Column(name = "password") // @Length(min = 5, message = "*Your password must have at least 5 characters") // @NotEmpty(message = "*Please provide your password") // @Transient private String password; @Column(name = "name") // @NotEmpty(message = "*Please provide your name") private String name; @Column(name = "last_name") // @NotEmpty(message = "*Please provide your last name") private String lastName; // @Column(name = "active") private int active; @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id")) private Set<Role> roles; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int getActive() { return active; } public void setActive(int active) { this.active = active; } public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } }
4f7562ab1b6a38fbd0aeff50f047aca23d6adaed
1a0fefb7eada7f554fc437ca20617a4599e0150b
/src/me/libraryaddict/gearwars/abilities/Hatcher.java
0aab6d34484a2ccb1c4d24b61ff5318c5fb49e0d
[]
no_license
libraryaddict-old/GearWars
ea2a888bcefd4a8f3813211aa6d1266ab86a3176
7faf405c04e9748e7a497de81eb8a7186358df77
refs/heads/master
2021-07-18T05:48:06.801041
2017-10-25T01:24:57
2017-10-25T01:24:57
107,872,467
0
2
null
null
null
null
UTF-8
Java
false
false
8,411
java
package me.libraryaddict.gearwars.abilities; import me.libraryaddict.gearwars.GearApi; import me.libraryaddict.gearwars.events.PlayerKilledEvent; import me.libraryaddict.gearwars.misc.Disableable; import me.libraryaddict.gearwars.types.AbilityListener; import me.libraryaddict.gearwars.types.Gamer; import net.minecraft.server.v1_7_R4.MobSpawnerAbstract; import net.minecraft.server.v1_7_R4.NBTTagCompound; import net.minecraft.server.v1_7_R4.TileEntityMobSpawner; import net.minecraft.server.v1_7_R4.TileEntityMobSpawnerData; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.CreatureSpawner; import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import java.util.*; public class Hatcher extends AbilityListener implements Disableable { private HashMap<Block, ArrayList<Entity>> spawnedMobs = new HashMap<Block, ArrayList<Entity>>(); private HashMap<Player, ArrayList<Block>> spawners = new HashMap<Player, ArrayList<Block>>(); public void giveSpawner(Player player) { if (player.isOnline() && player.getAllowFlight() == false) { HashMap<Integer, ItemStack> drops = player.getInventory().addItem(new ItemStack(52)); for (Map.Entry<Integer, ItemStack> entry : drops.entrySet()) { player.getWorld().dropItemNaturally(player.getLocation(), entry.getValue()); } } } private boolean isSpawner(Block block) { for (ArrayList<Block> blocks : spawners.values()) { if (blocks.contains(block)) { return true; } } return false; } @EventHandler public void onExplode(EntityExplodeEvent event) { List<Block> blockListCopy = new ArrayList<Block>(); for (Block block : blockListCopy) { if (isSpawner(block)) { removeSpawner(block, true); } } } @EventHandler public void onInteract(PlayerInteractEvent event) { ItemStack item = event.getPlayer().getItemInHand(); if (item != null && item.getType() == Material.MONSTER_EGG && hasAbility(event.getPlayer()) && event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (event.getClickedBlock().getType() == Material.MOB_SPAWNER) { event.setCancelled(true); Player p = event.getPlayer(); if (spawners.containsKey(p) && spawners.get(p).contains(event.getClickedBlock())) { CreatureSpawner spawner = (CreatureSpawner) event.getClickedBlock().getState(); EntityType entity = EntityType.fromId(item.getData().getData()); spawner.setSpawnedType(entity); spawner.update(); p.sendMessage(ChatColor.RED + "You are now spawning " + entity.name()); if (item.getAmount() > 1) { item.setAmount(item.getAmount() - 1); } else { p.getInventory().setItemInHand(new ItemStack(Material.AIR)); } } else { p.sendMessage(ChatColor.RED + "This is not your mob spawner!"); } } } } @EventHandler public void onPlace(BlockPlaceEvent event) { Block b = event.getBlock(); if (b.getType() == Material.MOB_SPAWNER) { if (hasAbility(event.getPlayer())) { if (!spawners.containsKey(event.getPlayer())) { spawners.put(event.getPlayer(), new ArrayList<Block>()); } spawners.get(event.getPlayer()).add(b); MobSpawnerAbstract spawner = ((TileEntityMobSpawner) ((CraftWorld) b.getWorld()).getHandle().getTileEntity( b.getX(), b.getY(), b.getZ())).getSpawner(); NBTTagCompound nbt = new NBTTagCompound(); nbt.setString("CustomName", event.getPlayer().getName()); TileEntityMobSpawnerData data = new TileEntityMobSpawnerData(spawner, nbt, EntityType.PIG.getName()); spawner.a(data); } } } @EventHandler public void onPlayerDeath(PlayerKilledEvent event) { if (event.getKillerGamer() != null) { if (hasAbility(event.getKillerGamer())) { EntityType[] mobs = new EntityType[] { EntityType.SKELETON, EntityType.CREEPER, EntityType.ZOMBIE, EntityType.BLAZE, EntityType.CAVE_SPIDER, EntityType.PIG_ZOMBIE, EntityType.SILVERFISH }; event.getKilled() .getPlayer() .getWorld() .dropItemNaturally(event.getKilled().getPlayer().getLocation(), new ItemStack(Material.MONSTER_EGG, 1, mobs[new Random().nextInt(mobs.length)].getTypeId())); } } else if (hasAbility(event.getKilled()) && spawners.containsKey(event.getKilled().getPlayer())) { List<Block> blocks = spawners.get(event.getKilled().getPlayer()); while (!blocks.isEmpty()) { removeSpawner(blocks.get(0), false); } } } @EventHandler public void onSpawn(CreatureSpawnEvent event) { if (event.getSpawnReason() == SpawnReason.SPAWNER) { if (event.getEntity().getCustomName() != null) { event.getEntity().setMetadata("DontTarget", new FixedMetadataValue(GearApi.getMainPlugin(), event.getEntity().getCustomName())); event.getEntity().setCustomName(null); } } } @EventHandler public void onSpawnerSmash(BlockBreakEvent event) { if (event.getBlock().getType() == Material.MOB_SPAWNER) { for (Player p : spawners.keySet()) { if (spawners.get(p).contains(event.getBlock())) { removeSpawner(event.getBlock(), false); event.getPlayer().sendMessage(ChatColor.BLUE + "You destroyed " + p.getName() + "'s spawner!"); p.sendMessage(ChatColor.BLUE + event.getPlayer().getName() + " destroyed your monster spawner!"); } } } } @EventHandler public void onTarget(EntityTargetEvent event) { if (event.getEntity().hasMetadata("DontTarget") && event.getTarget() instanceof Player) { if (event.getEntity().getMetadata("DontTarget").get(0).asString().equals(((Player) event.getTarget()).getName())) { event.setCancelled(true); } } } @Override public void registerListener() { for (Gamer gamer : getGamers()) { gamer.getPlayer().getInventory().addItem(new ItemStack(Material.MOB_SPAWNER)); } } private void removeSpawner(Block block, boolean message) { Iterator<Player> itel = spawners.keySet().iterator(); while (itel.hasNext()) { Player p = itel.next(); if (spawners.get(p).contains(block)) { if (message) { p.sendMessage(ChatColor.RED + "Spawner has been broken!"); } spawners.get(p).remove(block); if (spawners.get(p).isEmpty()) { itel.remove(); } if (spawnedMobs.containsKey(block)) { for (Entity entity : spawnedMobs.get(block)) { entity.remove(); } spawnedMobs.remove(block); } block.setType(Material.AIR); break; } } } @Override public void unregisterListener() { } }
20c43861b0689f89b4d0ee8520fab0bfd307424b
febf1c79191bf596aa19661dc91888fa2dc6d316
/src/com/uniovi/sdi/ServletSaludo.java
6a363f25c03413e4ca8d0665a5c3759f0568732b
[]
no_license
alvarogarinf/sdi1920-1006-lab-jee
ee5c1c70e27b5ac61330727aa89809ee08fde927
12e54491706a021720bc0b969c472e77a0f0c4a2
refs/heads/master
2020-12-27T06:40:41.061318
2020-02-03T18:13:44
2020-02-03T18:13:44
237,798,707
0
0
null
null
null
null
UTF-8
Java
false
false
1,615
java
package com.uniovi.sdi; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.PrintWriter; import java.util.HashMap; import java.util.Map; /** * Servlet implementation class ServletSaludo */ @WebServlet("/ServletSaludo") public class ServletSaludo extends HttpServlet { private static final long serialVersionUID = 1L; int contador = 0; public ServletSaludo() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<HTML>"); out.println("<HEAD><TITLE>Hola Mundo!</TITLE></HEAD>"); out.println("<BODY>"); String nombre = (String) request.getParameter("nombre"); if (nombre != null) { out.println("Hola " + nombre + "<br>"); } try { Thread.sleep(15000); } catch (InterruptedException e) { } out.println("ID del hilo:" + Thread.currentThread().getId() + "<br>"); contador++; out.println("Visitas:" + contador + "<br>"); out.println("</BODY></HTML>"); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
16da8daeb6e6876fcc6c758754faa784e2f0edfe
7c3507a565443800d3ba459f860e1df0820c7973
/day03-ControlFlow/src/comtrol/ifstmt/CalcBMI.java
2f54b5d5c0498b458449d76dfd96a5a4dabfb740
[]
no_license
kangyuhwan/02_java
d91b1fad22c6475694c7a3eecc6eb99d12c2a0ff
d0615728ec0b5bcd55ec4ef1cfebb33e2b25622f
refs/heads/master
2022-01-26T03:06:58.895604
2019-08-06T01:33:36
2019-08-06T01:33:36
195,142,867
0
0
null
null
null
null
UTF-8
Java
false
false
840
java
package comtrol.ifstmt; /* * */ import java.util.Scanner; public class CalcBMI { // 선언 double weight; double height; String bmi; Scanner scan; // 초기화 bmi = weight/(height*height); scan = new Scanner(System.in); // prompt System.out.printf("키 몸무게 입력 "); weight = scan.nextDouble(); height = scan.nextDouble(); sysout if (bmi > 40) { bmi = "병적인 비만"; } else if (bmi >= 27.5 && bmi < 40 ) { bmi = "비만"; } else if (bmi >= 23 && bmi < 27.5 ) { bmi = "과체중"; } else if (bmi >= 18.5 && bmi < 23 ) { bmi = "정상"; } else if (bmi >= 15 && bmi < 18.5 ) { bmi = "저체중"; } else { bmi = "병적인 저체중"; } System.out.printf("키 : %d 몸무게 : %d bmi : %s입니다.", weight, height, bmi); } }
8118f19e53aa5a1e92b0e5386e9e6724c3157c48
7c18608823ce7616436eadef0a83cfbd64943502
/hazelcast-code-samples/hazelcast-integration/mongodb/src/main/java/com/hazelcast/loader/ReadWriteThroughCache.java
0d59e0df4cc788f829b76107b0257578ae401e29
[]
no_license
djkevincr/JCache-Samples
a7cd6118464997b00d77f6c9de89a2ef20e9089c
1504dc9956d7660d6a191e1a1fd95eed63b4dab2
refs/heads/master
2021-01-01T05:42:55.461979
2016-05-24T15:06:12
2016-05-24T15:06:12
59,575,941
3
1
null
null
null
null
UTF-8
Java
false
false
1,881
java
/* * * Copyright (c) 2008-2015, Hazelcast, Inc. 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 com.hazelcast.loader; import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.IMap; import java.io.FileNotFoundException; /** * Starter application for read-through / write-through example with Hazelcast and MongoDB. * * Connection details should be interred in `hazelcast.xml` under MapStore config for IMap * Properties includes: connection url, database and collection names * * @author Viktor Gamov on 11/2/15. * Twitter: @gamussa */ public class ReadWriteThroughCache { public static void main(String[] args) throws FileNotFoundException { HazelcastInstance instance = Hazelcast.newHazelcastInstance(); IMap<String, Supplement> supplements = instance.getMap("supplements"); System.out.println(supplements.size()); supplements.set("1", new Supplement("bcaa", 10)); supplements.set("2", new Supplement("protein", 100)); supplements.set("3", new Supplement("glucosamine", 200)); System.out.println(supplements.size()); supplements.evictAll(); System.out.println(supplements.size()); supplements.loadAll(true); System.out.println(supplements.size()); } }
a7747186b1080e7fcb45d914832c1ec7d43dd4a4
b69bc3aa46bda206a9de9520d9e0811b365e7d4d
/the state of wakanda 2/Main.java
bdf848faaaebf371b952ed2a7bd25f2193f8b833
[]
no_license
tanishq-agarwal/2d-arrays
7fa96db2bf18ff190dd632aa0349c3b6efbdae45
743f8c1392920d584c8d835920111371d60d6bcf
refs/heads/main
2023-04-05T14:16:53.756080
2021-04-13T10:00:47
2021-04-13T10:00:47
356,487,449
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { // write your code here Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int arr[][]=new int[n][n]; for(int i=0;i<arr.length;i++){ for(int j=0;j<arr[0].length;j++){ arr[i][j]=sc.nextInt(); } } for(int g=0;g<arr.length;g++){ for(int i=0,j=g;j<arr.length; i++,j++){ System.out.println(arr[i][j]); } } } }
73a5a3bce0979ca50b9544fffb0c8bc81d0ce8ef
ad5531058fb389f3fd4d42690485565398272ec2
/src/main/java/com/example/JPA_Test/Dates.java
e771862b301a3945dc21152a60e83c12d81dfef4
[]
no_license
Dilo229/TP_JPA
eb380bdf0de4aedef7d4c2b07ca13d179c821ae7
0d08762546de799f9b91a35ea02c602301eaf00b
refs/heads/master
2023-04-02T01:36:42.905368
2021-03-31T16:25:00
2021-03-31T16:25:00
353,400,934
0
0
null
null
null
null
UTF-8
Java
false
false
54
java
package com.example.JPA_Test; public class Dates { }
7a852aad63018b7a4208014ce9af884db16b9a52
a8ed2f68a5b57bbb0efaa287186a9a0921b2cb70
/src/br/feevale/example/BigUFOEnemyShip.java
0fa0f44e421b463958d2428ee83d54d7e395d534
[]
no_license
ricardomachadosb/Factory-Pattern
67fafd3e9692ae97566ca0024721069137a89cc2
660658fe8802bbdb8abea667033148e3ac363c59
refs/heads/master
2021-01-01T08:54:58.435219
2015-10-03T14:05:58
2015-10-03T14:05:58
42,407,396
1
0
null
null
null
null
UTF-8
Java
false
false
229
java
package br.feevale.example; /** * @author Ricardo Machado * */ public class BigUFOEnemyShip extends UFOEnemyShip { /** * */ public BigUFOEnemyShip(){ setName("Big UFO Enemy Ship"); setDamage(40.0); } }
e83be7b7243cbbc536b0a3f3c0a0575280422482
5786b8c28f069ae9b9b7f850edf4d4c1b5cf976c
/languages/CSharp/source_gen/CSharp/behavior/Class_member_declarations_BehaviorDescriptor.java
af404bfc54173402fc6d98a2152ece35187f7dd3
[ "Apache-2.0" ]
permissive
vaclav/MPS_CSharp
681ea277dae2e7503cd0f2d21cb3bb7084f6dffc
deea11bfe3711dd241d9ca3f007b810d574bae76
refs/heads/master
2021-01-13T14:36:41.949662
2019-12-03T15:26:21
2019-12-03T15:26:21
72,849,927
19
5
null
null
null
null
UTF-8
Java
false
false
378
java
package CSharp.behavior; /*Generated by MPS */ /** * Will be removed after 3.4 * Need to support compilation of the legacy behavior descriptors before the language is rebuilt * This class is not involved in the actual method invocation */ @Deprecated public class Class_member_declarations_BehaviorDescriptor { public String getConceptFqName() { return null; } }
1645b701a5367920949f8cd4949b9e1b0ff0eda2
36d818cbeda9fe07c3097e136beeaad33ab33cd9
/src/Design_Pattern/Structural_Pattern/Adapter/Adapter.java
b5a19ad87cf47745e9829856d6d18c835aabd85e
[]
no_license
XQLong/java_workplace
61a5cca83bc3da942779ececd1b871832d058d41
f8fd8a04c9a01f57a61efbd1e026fe6d83edd9b3
refs/heads/master
2020-03-28T19:23:16.464728
2019-10-22T02:35:37
2019-10-22T02:35:37
148,970,832
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
package Design_Pattern.Structural_Pattern.Adapter; /** * @Author: xql * @Date: Created in 10:48 2019/7/12 * 适配器模式中的适配器类(类适配器模式) */ public class Adapter extends Adaptee implements Target{ @Override public void sampleOperation2() { } }
6fe9489e08bdb1df49f56ab7f54e671f9fb224cf
317dbe484ec3ea1acf6d4041224c6e284ec8ffa3
/src/test/java/com/example/SpringDataJpaAuditingFailApplicationTests.java
8368c8c2b284dd814591f033798516f87fbe5d54
[]
no_license
mihn/spring-data-jpa-auditing-fail
9e4dc582d72e153f2cf2709e1d54368cfe6ea253
9c246941eab0d87e78236e8e264e484b7c73662b
refs/heads/master
2021-01-11T04:06:22.828892
2016-10-18T13:01:00
2016-10-18T13:15:06
71,248,686
0
0
null
null
null
null
UTF-8
Java
false
false
1,058
java
package com.example; import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) @SpringBootTest public class SpringDataJpaAuditingFailApplicationTests { private static final Logger LOGGER = LoggerFactory.getLogger(SpringDataJpaAuditingFailApplicationTests.class); @Autowired TestEntityRepository testEntityRepository; @Test //fails on 1.4.1, works on 1.4.0 public void checkIfAuditingWorks() { //given: TestEntity newEntity = new TestEntity("test"); //when: TestEntity savedEntity = testEntityRepository.save(newEntity); //then: assertThat(savedEntity.getCreatedDate()).isNotNull(); assertThat(savedEntity.getModifiedDate()).isNotNull(); } }
7ea2310cdc5c38d68cdc9ecbc1edaf4f2dd89357
587a128c4020c5b756971759f61a0bd785ad82b2
/TypeFileSelection.java
f359421c519d89623d0a4593600cf3344d2a3985
[]
no_license
emiminoiu/ParsingApp
a831c92eb1275d411b3fa5ffcf86fa5fcf8a0453
d3f03b4c3c0388cbb31ef2e1befaa30b9c4b4acc
refs/heads/master
2020-03-23T22:11:26.166216
2018-07-24T13:02:42
2018-07-24T13:02:42
142,159,221
0
0
null
null
null
null
UTF-8
Java
false
false
2,592
java
package proelite; import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JButton; import java.awt.Color; import java.awt.Font; import javax.swing.JLabel; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.ImageIcon; import javax.swing.SwingConstants; public class TypeFileSelection extends JFrame { public static MenuPage mpage; private JPanel contentPane; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { TypeFileSelection frame = new TypeFileSelection(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public TypeFileSelection() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 464, 323); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JButton btnNewButton_1 = new JButton("StudentRecordsApp"); btnNewButton_1.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent x) { try { Main m = new Main(); m.setVisible(true); TypeFileSelection.this.setVisible(false); }catch (Exception e) { e.printStackTrace(); }} }); btnNewButton_1.setIcon(null); btnNewButton_1.setFont(new Font("Tahoma", Font.ITALIC, 20)); btnNewButton_1.setForeground(Color.BLUE); btnNewButton_1.setBounds(0, 0, 228, 267); contentPane.add(btnNewButton_1); JButton btnNewButton_2 = new JButton("ParsingApp"); btnNewButton_2.setFont(new Font("Tahoma", Font.ITALIC, 25)); btnNewButton_2.setForeground(Color.RED); btnNewButton_2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { MenuPage mpage = new MenuPage(); mpage.setVisible(true); TypeFileSelection.this.setVisible(false); } }); btnNewButton_2.setBounds(220, 0, 222, 267); contentPane.add(btnNewButton_2); ImageIcon image = new ImageIcon("C:\\Users\\Minoiu Emi\\Pictures\\3091347-computer-programing-source-code-on-blue-electronics-background.jpg\""); JButton btnNewButton = new JButton(); btnNewButton.setIcon(image); } }
8bc1938d0217a444a336e4475c197c4a7a4a4217
c5673697bfcfe2dd1a0bb37de8ef8168e3cd2a12
/gmall-order-service/src/main/java/com/atguigu/gmallmy0311/order/mapper/OrderInfoMapper.java
c380e85bf6a400ae759d26d24a6319f1005fc438
[]
no_license
clf322/gmallmy0311
00c281f3b10939ad11e92e90808cd24bcc219238
3b99599d8a1a823b7260b51af226ce822e8a0d6e
refs/heads/master
2022-10-04T05:38:33.337624
2022-08-05T09:38:26
2022-08-05T09:38:26
202,660,127
0
0
null
2022-09-01T23:57:33
2019-08-16T04:48:48
CSS
UTF-8
Java
false
false
199
java
package com.atguigu.gmallmy0311.order.mapper; import com.atguigu.gmallmy0311.bean.OrderInfo; import tk.mybatis.mapper.common.Mapper; public interface OrderInfoMapper extends Mapper<OrderInfo> { }
eff5dbe8f24bfb04020351f9c9041c8fa350368d
76359c348d2a8200fb7b4e2c505758a02d411b54
/src/Pokemon.java
5670716b789681eb0200a283990b2d8651aa0e33
[]
no_license
sameerd4/Pokemon
19c37bd5c08f9e1ae2b42cd08f2fc8a5673c3728
29f5be22ee84c873aa098458048016761814dcf9
refs/heads/master
2020-03-09T07:49:12.000046
2018-09-20T18:57:53
2018-09-20T18:57:53
128,673,529
0
0
null
null
null
null
UTF-8
Java
false
false
1,214
java
public class Pokemon { private String name; private Type type; private Move[] moves; private Stats stats; // constructor public Pokemon(String name, Type type, Move[] moves, Stats stats) { this.name = name; this.type = type; this.moves = moves; this.stats = stats; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Type getType() { return type; } public void setType(Type type) { this.type = type; } public Move[] getMoves() { return moves; } public void setMoves(Move[] moves) { this.moves = moves; } public Stats getStats() { return stats; } public void setStats(Stats stats) { this.stats = stats; } public void attack(Pokemon other) { } public String toString() { return "Name: " + name + "\nType: " + type.getType() + "\n\n" + stats .toString() + "\n\nMoves:" + "\n" + moves[0].getMove() + "\n" + moves[1].getMove() + "\n" + moves[2].getMove() + "\n" + moves[3] .getMove(); } }
eb3f365671b700015f3cb5a7696f1756a3a71e1b
c85cc129a635ab5ac5a469c3dcb398af4cb97db8
/src/main/java/com/magicalsolutions/fastcourier/Config/DBConfig.java
bc1ae4ee2aa256c3debe3fc6e1889d80ccec3150
[]
no_license
VictorAtPL/FastCourier-Rest
0e86a73bc0b1f9aec34a171c48573baa96b5b66c
2a63851450cfa0e483846a70f0ad783122fb4a08
refs/heads/master
2021-09-03T04:33:38.083770
2017-12-19T19:47:17
2017-12-19T19:47:17
111,995,140
0
0
null
2018-01-05T13:39:25
2017-11-25T10:28:20
Java
UTF-8
Java
false
false
3,174
java
package com.magicalsolutions.fastcourier.Config; import org.apache.commons.dbcp2.BasicDataSource; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.orm.hibernate5.HibernateTemplate; import org.springframework.orm.hibernate5.HibernateTransactionManager; import org.springframework.orm.hibernate5.LocalSessionFactoryBean; import org.springframework.transaction.annotation.EnableTransactionManagement; import javax.sql.DataSource; import java.io.IOException; import java.util.Properties; @Configuration @EnableTransactionManagement @PropertySource("classpath:database.properties") public class DBConfig { @Autowired private Environment env; @Bean public HibernateTemplate hibernateTemplate() { return new HibernateTemplate(sessionFactory()); } @Bean public SessionFactory sessionFactory() { LocalSessionFactoryBean lsfb = new LocalSessionFactoryBean(); lsfb.setDataSource(getDataSource()); lsfb.setPackagesToScan("com.magicalsolutions.fastcourier.Entity"); lsfb.setHibernateProperties(hibernateProperties()); try { lsfb.afterPropertiesSet(); } catch (IOException e) { e.printStackTrace(); } return lsfb.getObject(); } @Bean public DataSource getDataSource() { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(env.getProperty("database.driverClassName")); dataSource.setUrl(env.getProperty("database.url")); dataSource.setUsername(env.getProperty("database.username")); dataSource.setPassword(env.getProperty("database.password")); return dataSource; } @Bean public HibernateTransactionManager transactionManager() { return new HibernateTransactionManager(sessionFactory()); } private Properties hibernateProperties() { Properties properties = new Properties(); properties.put("hibernate.dialect", env.getProperty("hibernate.dialect")); properties.put("hibernate.id.new_generator_mappings", env.getProperty("hibernate.id.new_generator_mappings")); properties.put("hibernate.show_sql", env.getProperty("hibernate.show_sql")); properties.put("hibernate.format_sql", env.getProperty("hibernate.format_sql")); properties.put("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); properties.put("hibernate.hbm2ddl.import_files", env.getProperty("hibernate.hbm2ddl.import_files")); properties.put("hibernate.connection.CharSet", env.getProperty("hibernate.connection.CharSet")); properties.put("hibernate.connection.characterEncoding", env.getProperty("hibernate.connection.characterEncoding")); properties.put("hibernate.connection.useUnicode", env.getProperty("hibernate.connection.useUnicode")); return properties; } }
5f3c4a70ca43004b48cd4c88864e7dfff9ae43ca
195e95b85d09d48d10ff32313410ab04b3d20b0b
/lib_common/src/main/java/com/kjq/common/utils/network/DHIRData.java
1546c2c7015f06d39a250707602cf145586872b7
[]
no_license
kangjianqun/Exclusive
16858366e6fb203dd9a8fe8fb5149765b75a0255
a96d72bb35e9db321dd7bc7b1b41b7fa4e429073
refs/heads/master
2022-06-07T09:25:41.284200
2020-04-29T05:13:25
2020-04-29T05:13:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,886
java
package com.kjq.common.utils.network; import com.kjq.common.utils.annotation.KeyValue; import org.json.JSONArray; public class DHIRData { @KeyValue(majorKey = "ir_hostAddress") public String BindHostAddress ; @KeyValue(majorKey = "ir_rFAddress") public String RFAddress ; @KeyValue(majorKey = "ir_order") private String mS_order; @KeyValue(majorKey = "ir_len") private int mI_len; @KeyValue(majorKey = "irOrder") private JSONArray mZJAL_int_data; public DHIRData(String s_order, int i_len, JSONArray JALint_data){ setS_order(s_order); setI_len(i_len); setZJAL_int_data(JALint_data); } public DHIRData(String bindHostAddress, String RFAddress, String s_order, int i_len, JSONArray ZJAL_int_data) { BindHostAddress = bindHostAddress; this.RFAddress = RFAddress; mS_order = s_order; mI_len = i_len; mZJAL_int_data = ZJAL_int_data; } private DHIRData(){ } public static DHIRData getNullInstance(){ return new DHIRData(); } public String getBindHostAddress() { return BindHostAddress; } public void setBindHostAddress(String bindHostAddress) { BindHostAddress = bindHostAddress; } public String getRFAddress() { return RFAddress; } public void setRFAddress(String RFAddress) { this.RFAddress = RFAddress; } public String getS_order() { return mS_order; } public void setS_order(String s_order) { mS_order = s_order; } public int getI_len() { return mI_len; } public void setI_len(int i_len) { mI_len = i_len; } public JSONArray getZJAL_int_data() { return mZJAL_int_data; } public void setZJAL_int_data(JSONArray ZJAL_int_data) { mZJAL_int_data = ZJAL_int_data; } }
fb6454919b69f4c77ff0e403e58640adc630e98b
bbae0a3e2713c9406d88f86423d7e142226b4d39
/commons-httpclient-3.1-rc1/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart/ContentTypeFilePart.java
c7ef044f9bd70de2b074e88d7a79fa850b9516f3
[ "Apache-2.0" ]
permissive
rgosdin/rrg
eedfe42f657f4a9ed5043eae59f7d868b84fbbdc
618f2b0d81c2e93f863be1f9016b6f901f5bdd45
refs/heads/master
2021-07-14T11:58:26.270243
2019-10-29T09:06:14
2019-10-29T09:06:14
209,430,827
0
0
null
null
null
null
UTF-8
Java
false
false
4,628
java
/* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart/ContentTypeFilePart.java,v 1.2 2004/02/22 18:08:45 olegk Exp $ * $Revision: 480424 $ * $Date: 2006-11-29 05:56:49 +0000 (Wed, 29 Nov 2006) $ * * ==================================================================== * * 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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.commons.httpclient.contrib.methods.multipart; import java.io.File; import java.io.FileNotFoundException; import org.apache.commons.httpclient.methods.multipart.FilePart; import org.apache.commons.httpclient.methods.multipart.PartSource; /** A simple extension to {@link FilePart} that automatically determines the content type * of the file. * * @author <a href="mailto:[email protected]">Adrian Sutton</a> * @version $Revision $ * * DISCLAIMER: HttpClient developers DO NOT actively support this component. * The component is provided as a reference material, which may be inappropriate * to be used without additional customization. */ public class ContentTypeFilePart extends FilePart { /** * ContentTypeFilePart constructor. * * @param name the name of the part * @param partSource the source for this part * @param charset the charset encoding for this part. */ public ContentTypeFilePart(String name, PartSource partSource, String charset) { super(name, partSource, ContentType.get(partSource.getFileName()), charset); } /** * ContentTypeFilePart constructor. * * @param name the name of the part * @param partSource the source for this part */ public ContentTypeFilePart(String name, PartSource partSource) { this(name, partSource, null); } /** * ContentTypeFilePart constructor. * * @param name the name of the part * @param file the file to post * @throws FileNotFoundException if the file does not exist */ public ContentTypeFilePart(String name, File file) throws FileNotFoundException { this(name, file, null); } /** * ContentTypeFilePart constructor. * * @param name the name of the part * @param file the file to post * @param charset the charset encoding for the file * @throws FileNotFoundException */ public ContentTypeFilePart(String name, File file, String charset) throws FileNotFoundException { super(name, file, ContentType.get(file), charset); } /** * ContentTypeFilePart constructor. * * @param name the name of the part * @param fileName the file name * @param file the file to post * @throws FileNotFoundException if the file does not exist */ public ContentTypeFilePart(String name, String fileName, File file) throws FileNotFoundException { super(name, fileName, file, ContentType.get(fileName), null); } /** * ContentTypeFilePart constructor. * * @param name the name of the part * @param fileName the file name * @param file the file to post * @param charset the charset encoding for the file * @throws FileNotFoundException if the file does not exist */ public ContentTypeFilePart(String name, String fileName, File file, String charset) throws FileNotFoundException { super(name, fileName, file, ContentType.get(file), charset); } }
0603c6c42d80e494e3ecc905af174921e920451d
3822efd9117b0c107f59add27bd843439898d481
/src/main/java/com/gmail/mosoft521/jcpcmf/ch10/p160LinkedBlockingDeque/test/pop_2.java
53ae00c785dfe47838bc5e8d7c3fde202c6fff75
[]
no_license
mosoft521/JCPCMF
27e06778982703ec272db8e4188a2ff38ee74682
5d3493a08049c0771961eb6619f3bf556658d567
refs/heads/master
2020-06-15T14:17:57.028105
2017-08-23T01:03:33
2017-08-23T01:03:33
75,286,460
1
0
null
null
null
null
UTF-8
Java
false
false
1,039
java
package com.gmail.mosoft521.jcpcmf.ch10.p160LinkedBlockingDeque.test; import java.util.concurrent.LinkedBlockingDeque; public class pop_2 { public static void main(String[] args) { LinkedBlockingDeque deque = new LinkedBlockingDeque(3); System.out.println(deque.pop()); } } /* Exception in thread "main" java.util.NoSuchElementException at java.util.concurrent.LinkedBlockingDeque.removeFirst(LinkedBlockingDeque.java:453) at java.util.concurrent.LinkedBlockingDeque.pop(LinkedBlockingDeque.java:777) at com.gmail.mosoft521.jcpcmf.ch10.p160LinkedBlockingDeque.test.pop_2.main(pop_2.java:9) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Process finished with exit code 1 */
3b1143f32f079e03483c8b47488e3a007ae05d41
e977c424543422f49a25695665eb85bfc0700784
/benchmark/icse15/776365/buggy-version/incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
b3e9027175801fd8d72569eca351352fe6e2bdd1
[]
no_license
amir9979/pattern-detector-experiment
17fcb8934cef379fb96002450d11fac62e002dd3
db67691e536e1550245e76d7d1c8dced181df496
refs/heads/master
2022-02-18T10:24:32.235975
2019-09-13T15:42:55
2019-09-13T15:42:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
398,738
java
/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package org.apache.cassandra.service; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; import java.util.Collections; import org.apache.log4j.Logger; import org.apache.thrift.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.protocol.*; public class Cassandra { public interface Iface { public List<column_t> get_slice(String tablename, String key, String columnFamily_column, int start, int count) throws InvalidRequestException, NotFoundException, TException; public List<column_t> get_slice_by_name_range(String tablename, String key, String columnFamily, String start, String end, int count) throws InvalidRequestException, NotFoundException, TException; public List<column_t> get_slice_by_names(String tablename, String key, String columnFamily, List<String> columnNames) throws InvalidRequestException, NotFoundException, TException; public column_t get_column(String tablename, String key, String columnFamily_column) throws InvalidRequestException, NotFoundException, TException; public int get_column_count(String tablename, String key, String columnFamily_column) throws InvalidRequestException, TException; public void insert(String tablename, String key, String columnFamily_column, byte[] cellData, long timestamp, boolean block) throws InvalidRequestException, UnavailableException, TException; public void batch_insert(batch_mutation_t batchMutation, boolean block) throws InvalidRequestException, UnavailableException, TException; public void remove(String tablename, String key, String columnFamily_column, long timestamp, boolean block) throws InvalidRequestException, UnavailableException, TException; public List<column_t> get_columns_since(String tablename, String key, String columnFamily_column, long timeStamp) throws InvalidRequestException, NotFoundException, TException; public List<superColumn_t> get_slice_super(String tablename, String key, String columnFamily_superColumnName, int start, int count) throws InvalidRequestException, TException; public List<superColumn_t> get_slice_super_by_names(String tablename, String key, String columnFamily, List<String> superColumnNames) throws InvalidRequestException, TException; public superColumn_t get_superColumn(String tablename, String key, String columnFamily) throws InvalidRequestException, NotFoundException, TException; public void batch_insert_superColumn(batch_mutation_super_t batchMutationSuper, boolean block) throws InvalidRequestException, UnavailableException, TException; public void touch(String key, boolean fData) throws TException; public List<String> get_key_range(String tablename, String startWith, String stopAt, int maxResults) throws InvalidRequestException, TException; public String getStringProperty(String propertyName) throws TException; public List<String> getStringListProperty(String propertyName) throws TException; public String describeTable(String tableName) throws TException; public CqlResult_t executeQuery(String query) throws TException; } public static class Client implements Iface { public Client(TProtocol prot) { this(prot, prot); } public Client(TProtocol iprot, TProtocol oprot) { iprot_ = iprot; oprot_ = oprot; } protected TProtocol iprot_; protected TProtocol oprot_; protected int seqid_; public TProtocol getInputProtocol() { return this.iprot_; } public TProtocol getOutputProtocol() { return this.oprot_; } public List<column_t> get_slice(String tablename, String key, String columnFamily_column, int start, int count) throws InvalidRequestException, NotFoundException, TException { send_get_slice(tablename, key, columnFamily_column, start, count); return recv_get_slice(); } public void send_get_slice(String tablename, String key, String columnFamily_column, int start, int count) throws TException { oprot_.writeMessageBegin(new TMessage("get_slice", TMessageType.CALL, seqid_)); get_slice_args args = new get_slice_args(); args.tablename = tablename; args.key = key; args.columnFamily_column = columnFamily_column; args.start = start; args.count = count; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<column_t> recv_get_slice() throws InvalidRequestException, NotFoundException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_slice_result result = new get_slice_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } if (result.nfe != null) { throw result.nfe; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_slice failed: unknown result"); } public List<column_t> get_slice_by_name_range(String tablename, String key, String columnFamily, String start, String end, int count) throws InvalidRequestException, NotFoundException, TException { send_get_slice_by_name_range(tablename, key, columnFamily, start, end, count); return recv_get_slice_by_name_range(); } public void send_get_slice_by_name_range(String tablename, String key, String columnFamily, String start, String end, int count) throws TException { oprot_.writeMessageBegin(new TMessage("get_slice_by_name_range", TMessageType.CALL, seqid_)); get_slice_by_name_range_args args = new get_slice_by_name_range_args(); args.tablename = tablename; args.key = key; args.columnFamily = columnFamily; args.start = start; args.end = end; args.count = count; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<column_t> recv_get_slice_by_name_range() throws InvalidRequestException, NotFoundException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_slice_by_name_range_result result = new get_slice_by_name_range_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } if (result.nfe != null) { throw result.nfe; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_slice_by_name_range failed: unknown result"); } public List<column_t> get_slice_by_names(String tablename, String key, String columnFamily, List<String> columnNames) throws InvalidRequestException, NotFoundException, TException { send_get_slice_by_names(tablename, key, columnFamily, columnNames); return recv_get_slice_by_names(); } public void send_get_slice_by_names(String tablename, String key, String columnFamily, List<String> columnNames) throws TException { oprot_.writeMessageBegin(new TMessage("get_slice_by_names", TMessageType.CALL, seqid_)); get_slice_by_names_args args = new get_slice_by_names_args(); args.tablename = tablename; args.key = key; args.columnFamily = columnFamily; args.columnNames = columnNames; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<column_t> recv_get_slice_by_names() throws InvalidRequestException, NotFoundException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_slice_by_names_result result = new get_slice_by_names_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } if (result.nfe != null) { throw result.nfe; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_slice_by_names failed: unknown result"); } public column_t get_column(String tablename, String key, String columnFamily_column) throws InvalidRequestException, NotFoundException, TException { send_get_column(tablename, key, columnFamily_column); return recv_get_column(); } public void send_get_column(String tablename, String key, String columnFamily_column) throws TException { oprot_.writeMessageBegin(new TMessage("get_column", TMessageType.CALL, seqid_)); get_column_args args = new get_column_args(); args.tablename = tablename; args.key = key; args.columnFamily_column = columnFamily_column; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public column_t recv_get_column() throws InvalidRequestException, NotFoundException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_column_result result = new get_column_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } if (result.nfe != null) { throw result.nfe; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_column failed: unknown result"); } public int get_column_count(String tablename, String key, String columnFamily_column) throws InvalidRequestException, TException { send_get_column_count(tablename, key, columnFamily_column); return recv_get_column_count(); } public void send_get_column_count(String tablename, String key, String columnFamily_column) throws TException { oprot_.writeMessageBegin(new TMessage("get_column_count", TMessageType.CALL, seqid_)); get_column_count_args args = new get_column_count_args(); args.tablename = tablename; args.key = key; args.columnFamily_column = columnFamily_column; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public int recv_get_column_count() throws InvalidRequestException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_column_count_result result = new get_column_count_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_column_count failed: unknown result"); } public void insert(String tablename, String key, String columnFamily_column, byte[] cellData, long timestamp, boolean block) throws InvalidRequestException, UnavailableException, TException { send_insert(tablename, key, columnFamily_column, cellData, timestamp, block); recv_insert(); } public void send_insert(String tablename, String key, String columnFamily_column, byte[] cellData, long timestamp, boolean block) throws TException { oprot_.writeMessageBegin(new TMessage("insert", TMessageType.CALL, seqid_)); insert_args args = new insert_args(); args.tablename = tablename; args.key = key; args.columnFamily_column = columnFamily_column; args.cellData = cellData; args.timestamp = timestamp; args.block = block; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_insert() throws InvalidRequestException, UnavailableException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } insert_result result = new insert_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ire != null) { throw result.ire; } if (result.ue != null) { throw result.ue; } return; } public void batch_insert(batch_mutation_t batchMutation, boolean block) throws InvalidRequestException, UnavailableException, TException { send_batch_insert(batchMutation, block); recv_batch_insert(); } public void send_batch_insert(batch_mutation_t batchMutation, boolean block) throws TException { oprot_.writeMessageBegin(new TMessage("batch_insert", TMessageType.CALL, seqid_)); batch_insert_args args = new batch_insert_args(); args.batchMutation = batchMutation; args.block = block; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_batch_insert() throws InvalidRequestException, UnavailableException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } batch_insert_result result = new batch_insert_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ire != null) { throw result.ire; } if (result.ue != null) { throw result.ue; } return; } public void remove(String tablename, String key, String columnFamily_column, long timestamp, boolean block) throws InvalidRequestException, UnavailableException, TException { send_remove(tablename, key, columnFamily_column, timestamp, block); recv_remove(); } public void send_remove(String tablename, String key, String columnFamily_column, long timestamp, boolean block) throws TException { oprot_.writeMessageBegin(new TMessage("remove", TMessageType.CALL, seqid_)); remove_args args = new remove_args(); args.tablename = tablename; args.key = key; args.columnFamily_column = columnFamily_column; args.timestamp = timestamp; args.block = block; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_remove() throws InvalidRequestException, UnavailableException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } remove_result result = new remove_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ire != null) { throw result.ire; } if (result.ue != null) { throw result.ue; } return; } public List<column_t> get_columns_since(String tablename, String key, String columnFamily_column, long timeStamp) throws InvalidRequestException, NotFoundException, TException { send_get_columns_since(tablename, key, columnFamily_column, timeStamp); return recv_get_columns_since(); } public void send_get_columns_since(String tablename, String key, String columnFamily_column, long timeStamp) throws TException { oprot_.writeMessageBegin(new TMessage("get_columns_since", TMessageType.CALL, seqid_)); get_columns_since_args args = new get_columns_since_args(); args.tablename = tablename; args.key = key; args.columnFamily_column = columnFamily_column; args.timeStamp = timeStamp; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<column_t> recv_get_columns_since() throws InvalidRequestException, NotFoundException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_columns_since_result result = new get_columns_since_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } if (result.nfe != null) { throw result.nfe; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_columns_since failed: unknown result"); } public List<superColumn_t> get_slice_super(String tablename, String key, String columnFamily_superColumnName, int start, int count) throws InvalidRequestException, TException { send_get_slice_super(tablename, key, columnFamily_superColumnName, start, count); return recv_get_slice_super(); } public void send_get_slice_super(String tablename, String key, String columnFamily_superColumnName, int start, int count) throws TException { oprot_.writeMessageBegin(new TMessage("get_slice_super", TMessageType.CALL, seqid_)); get_slice_super_args args = new get_slice_super_args(); args.tablename = tablename; args.key = key; args.columnFamily_superColumnName = columnFamily_superColumnName; args.start = start; args.count = count; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<superColumn_t> recv_get_slice_super() throws InvalidRequestException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_slice_super_result result = new get_slice_super_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_slice_super failed: unknown result"); } public List<superColumn_t> get_slice_super_by_names(String tablename, String key, String columnFamily, List<String> superColumnNames) throws InvalidRequestException, TException { send_get_slice_super_by_names(tablename, key, columnFamily, superColumnNames); return recv_get_slice_super_by_names(); } public void send_get_slice_super_by_names(String tablename, String key, String columnFamily, List<String> superColumnNames) throws TException { oprot_.writeMessageBegin(new TMessage("get_slice_super_by_names", TMessageType.CALL, seqid_)); get_slice_super_by_names_args args = new get_slice_super_by_names_args(); args.tablename = tablename; args.key = key; args.columnFamily = columnFamily; args.superColumnNames = superColumnNames; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<superColumn_t> recv_get_slice_super_by_names() throws InvalidRequestException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_slice_super_by_names_result result = new get_slice_super_by_names_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_slice_super_by_names failed: unknown result"); } public superColumn_t get_superColumn(String tablename, String key, String columnFamily) throws InvalidRequestException, NotFoundException, TException { send_get_superColumn(tablename, key, columnFamily); return recv_get_superColumn(); } public void send_get_superColumn(String tablename, String key, String columnFamily) throws TException { oprot_.writeMessageBegin(new TMessage("get_superColumn", TMessageType.CALL, seqid_)); get_superColumn_args args = new get_superColumn_args(); args.tablename = tablename; args.key = key; args.columnFamily = columnFamily; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public superColumn_t recv_get_superColumn() throws InvalidRequestException, NotFoundException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_superColumn_result result = new get_superColumn_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } if (result.nfe != null) { throw result.nfe; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_superColumn failed: unknown result"); } public void batch_insert_superColumn(batch_mutation_super_t batchMutationSuper, boolean block) throws InvalidRequestException, UnavailableException, TException { send_batch_insert_superColumn(batchMutationSuper, block); recv_batch_insert_superColumn(); } public void send_batch_insert_superColumn(batch_mutation_super_t batchMutationSuper, boolean block) throws TException { oprot_.writeMessageBegin(new TMessage("batch_insert_superColumn", TMessageType.CALL, seqid_)); batch_insert_superColumn_args args = new batch_insert_superColumn_args(); args.batchMutationSuper = batchMutationSuper; args.block = block; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_batch_insert_superColumn() throws InvalidRequestException, UnavailableException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } batch_insert_superColumn_result result = new batch_insert_superColumn_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ire != null) { throw result.ire; } if (result.ue != null) { throw result.ue; } return; } public void touch(String key, boolean fData) throws TException { send_touch(key, fData); } public void send_touch(String key, boolean fData) throws TException { oprot_.writeMessageBegin(new TMessage("touch", TMessageType.CALL, seqid_)); touch_args args = new touch_args(); args.key = key; args.fData = fData; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<String> get_key_range(String tablename, String startWith, String stopAt, int maxResults) throws InvalidRequestException, TException { send_get_key_range(tablename, startWith, stopAt, maxResults); return recv_get_key_range(); } public void send_get_key_range(String tablename, String startWith, String stopAt, int maxResults) throws TException { oprot_.writeMessageBegin(new TMessage("get_key_range", TMessageType.CALL, seqid_)); get_key_range_args args = new get_key_range_args(); args.tablename = tablename; args.startWith = startWith; args.stopAt = stopAt; args.maxResults = maxResults; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<String> recv_get_key_range() throws InvalidRequestException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } get_key_range_result result = new get_key_range_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } if (result.ire != null) { throw result.ire; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_key_range failed: unknown result"); } public String getStringProperty(String propertyName) throws TException { send_getStringProperty(propertyName); return recv_getStringProperty(); } public void send_getStringProperty(String propertyName) throws TException { oprot_.writeMessageBegin(new TMessage("getStringProperty", TMessageType.CALL, seqid_)); getStringProperty_args args = new getStringProperty_args(); args.propertyName = propertyName; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public String recv_getStringProperty() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } getStringProperty_result result = new getStringProperty_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "getStringProperty failed: unknown result"); } public List<String> getStringListProperty(String propertyName) throws TException { send_getStringListProperty(propertyName); return recv_getStringListProperty(); } public void send_getStringListProperty(String propertyName) throws TException { oprot_.writeMessageBegin(new TMessage("getStringListProperty", TMessageType.CALL, seqid_)); getStringListProperty_args args = new getStringListProperty_args(); args.propertyName = propertyName; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public List<String> recv_getStringListProperty() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } getStringListProperty_result result = new getStringListProperty_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "getStringListProperty failed: unknown result"); } public String describeTable(String tableName) throws TException { send_describeTable(tableName); return recv_describeTable(); } public void send_describeTable(String tableName) throws TException { oprot_.writeMessageBegin(new TMessage("describeTable", TMessageType.CALL, seqid_)); describeTable_args args = new describeTable_args(); args.tableName = tableName; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public String recv_describeTable() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } describeTable_result result = new describeTable_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "describeTable failed: unknown result"); } public CqlResult_t executeQuery(String query) throws TException { send_executeQuery(query); return recv_executeQuery(); } public void send_executeQuery(String query) throws TException { oprot_.writeMessageBegin(new TMessage("executeQuery", TMessageType.CALL, seqid_)); executeQuery_args args = new executeQuery_args(); args.query = query; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public CqlResult_t recv_executeQuery() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } executeQuery_result result = new executeQuery_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "executeQuery failed: unknown result"); } } public static class Processor implements TProcessor { private static final Logger LOGGER = Logger.getLogger(Processor.class.getName()); public Processor(Iface iface) { iface_ = iface; processMap_.put("get_slice", new get_slice()); processMap_.put("get_slice_by_name_range", new get_slice_by_name_range()); processMap_.put("get_slice_by_names", new get_slice_by_names()); processMap_.put("get_column", new get_column()); processMap_.put("get_column_count", new get_column_count()); processMap_.put("insert", new insert()); processMap_.put("batch_insert", new batch_insert()); processMap_.put("remove", new remove()); processMap_.put("get_columns_since", new get_columns_since()); processMap_.put("get_slice_super", new get_slice_super()); processMap_.put("get_slice_super_by_names", new get_slice_super_by_names()); processMap_.put("get_superColumn", new get_superColumn()); processMap_.put("batch_insert_superColumn", new batch_insert_superColumn()); processMap_.put("touch", new touch()); processMap_.put("get_key_range", new get_key_range()); processMap_.put("getStringProperty", new getStringProperty()); processMap_.put("getStringListProperty", new getStringListProperty()); processMap_.put("describeTable", new describeTable()); processMap_.put("executeQuery", new executeQuery()); } protected static interface ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; } private Iface iface_; protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>(); public boolean process(TProtocol iprot, TProtocol oprot) throws TException { TMessage msg = iprot.readMessageBegin(); ProcessFunction fn = processMap_.get(msg.name); if (fn == null) { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return true; } fn.process(msg.seqid, iprot, oprot); return true; } private class get_slice implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_slice_args args = new get_slice_args(); args.read(iprot); iprot.readMessageEnd(); get_slice_result result = new get_slice_result(); try { result.success = iface_.get_slice(args.tablename, args.key, args.columnFamily_column, args.start, args.count); } catch (InvalidRequestException ire) { result.ire = ire; } catch (NotFoundException nfe) { result.nfe = nfe; } catch (Throwable th) { LOGGER.error("Internal error processing get_slice", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_slice"); oprot.writeMessageBegin(new TMessage("get_slice", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_slice", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_slice_by_name_range implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_slice_by_name_range_args args = new get_slice_by_name_range_args(); args.read(iprot); iprot.readMessageEnd(); get_slice_by_name_range_result result = new get_slice_by_name_range_result(); try { result.success = iface_.get_slice_by_name_range(args.tablename, args.key, args.columnFamily, args.start, args.end, args.count); } catch (InvalidRequestException ire) { result.ire = ire; } catch (NotFoundException nfe) { result.nfe = nfe; } catch (Throwable th) { LOGGER.error("Internal error processing get_slice_by_name_range", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_slice_by_name_range"); oprot.writeMessageBegin(new TMessage("get_slice_by_name_range", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_slice_by_name_range", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_slice_by_names implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_slice_by_names_args args = new get_slice_by_names_args(); args.read(iprot); iprot.readMessageEnd(); get_slice_by_names_result result = new get_slice_by_names_result(); try { result.success = iface_.get_slice_by_names(args.tablename, args.key, args.columnFamily, args.columnNames); } catch (InvalidRequestException ire) { result.ire = ire; } catch (NotFoundException nfe) { result.nfe = nfe; } catch (Throwable th) { LOGGER.error("Internal error processing get_slice_by_names", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_slice_by_names"); oprot.writeMessageBegin(new TMessage("get_slice_by_names", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_slice_by_names", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_column implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_column_args args = new get_column_args(); args.read(iprot); iprot.readMessageEnd(); get_column_result result = new get_column_result(); try { result.success = iface_.get_column(args.tablename, args.key, args.columnFamily_column); } catch (InvalidRequestException ire) { result.ire = ire; } catch (NotFoundException nfe) { result.nfe = nfe; } catch (Throwable th) { LOGGER.error("Internal error processing get_column", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_column"); oprot.writeMessageBegin(new TMessage("get_column", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_column", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_column_count implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_column_count_args args = new get_column_count_args(); args.read(iprot); iprot.readMessageEnd(); get_column_count_result result = new get_column_count_result(); try { result.success = iface_.get_column_count(args.tablename, args.key, args.columnFamily_column); result.__isset.success = true; } catch (InvalidRequestException ire) { result.ire = ire; } catch (Throwable th) { LOGGER.error("Internal error processing get_column_count", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_column_count"); oprot.writeMessageBegin(new TMessage("get_column_count", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_column_count", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class insert implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { insert_args args = new insert_args(); args.read(iprot); iprot.readMessageEnd(); insert_result result = new insert_result(); try { iface_.insert(args.tablename, args.key, args.columnFamily_column, args.cellData, args.timestamp, args.block); } catch (InvalidRequestException ire) { result.ire = ire; } catch (UnavailableException ue) { result.ue = ue; } catch (Throwable th) { LOGGER.error("Internal error processing insert", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing insert"); oprot.writeMessageBegin(new TMessage("insert", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("insert", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class batch_insert implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { batch_insert_args args = new batch_insert_args(); args.read(iprot); iprot.readMessageEnd(); batch_insert_result result = new batch_insert_result(); try { iface_.batch_insert(args.batchMutation, args.block); } catch (InvalidRequestException ire) { result.ire = ire; } catch (UnavailableException ue) { result.ue = ue; } catch (Throwable th) { LOGGER.error("Internal error processing batch_insert", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing batch_insert"); oprot.writeMessageBegin(new TMessage("batch_insert", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("batch_insert", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class remove implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { remove_args args = new remove_args(); args.read(iprot); iprot.readMessageEnd(); remove_result result = new remove_result(); try { iface_.remove(args.tablename, args.key, args.columnFamily_column, args.timestamp, args.block); } catch (InvalidRequestException ire) { result.ire = ire; } catch (UnavailableException ue) { result.ue = ue; } catch (Throwable th) { LOGGER.error("Internal error processing remove", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing remove"); oprot.writeMessageBegin(new TMessage("remove", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("remove", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_columns_since implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_columns_since_args args = new get_columns_since_args(); args.read(iprot); iprot.readMessageEnd(); get_columns_since_result result = new get_columns_since_result(); try { result.success = iface_.get_columns_since(args.tablename, args.key, args.columnFamily_column, args.timeStamp); } catch (InvalidRequestException ire) { result.ire = ire; } catch (NotFoundException nfe) { result.nfe = nfe; } catch (Throwable th) { LOGGER.error("Internal error processing get_columns_since", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_columns_since"); oprot.writeMessageBegin(new TMessage("get_columns_since", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_columns_since", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_slice_super implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_slice_super_args args = new get_slice_super_args(); args.read(iprot); iprot.readMessageEnd(); get_slice_super_result result = new get_slice_super_result(); try { result.success = iface_.get_slice_super(args.tablename, args.key, args.columnFamily_superColumnName, args.start, args.count); } catch (InvalidRequestException ire) { result.ire = ire; } catch (Throwable th) { LOGGER.error("Internal error processing get_slice_super", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_slice_super"); oprot.writeMessageBegin(new TMessage("get_slice_super", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_slice_super", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_slice_super_by_names implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_slice_super_by_names_args args = new get_slice_super_by_names_args(); args.read(iprot); iprot.readMessageEnd(); get_slice_super_by_names_result result = new get_slice_super_by_names_result(); try { result.success = iface_.get_slice_super_by_names(args.tablename, args.key, args.columnFamily, args.superColumnNames); } catch (InvalidRequestException ire) { result.ire = ire; } catch (Throwable th) { LOGGER.error("Internal error processing get_slice_super_by_names", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_slice_super_by_names"); oprot.writeMessageBegin(new TMessage("get_slice_super_by_names", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_slice_super_by_names", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class get_superColumn implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_superColumn_args args = new get_superColumn_args(); args.read(iprot); iprot.readMessageEnd(); get_superColumn_result result = new get_superColumn_result(); try { result.success = iface_.get_superColumn(args.tablename, args.key, args.columnFamily); } catch (InvalidRequestException ire) { result.ire = ire; } catch (NotFoundException nfe) { result.nfe = nfe; } catch (Throwable th) { LOGGER.error("Internal error processing get_superColumn", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_superColumn"); oprot.writeMessageBegin(new TMessage("get_superColumn", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_superColumn", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class batch_insert_superColumn implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { batch_insert_superColumn_args args = new batch_insert_superColumn_args(); args.read(iprot); iprot.readMessageEnd(); batch_insert_superColumn_result result = new batch_insert_superColumn_result(); try { iface_.batch_insert_superColumn(args.batchMutationSuper, args.block); } catch (InvalidRequestException ire) { result.ire = ire; } catch (UnavailableException ue) { result.ue = ue; } catch (Throwable th) { LOGGER.error("Internal error processing batch_insert_superColumn", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing batch_insert_superColumn"); oprot.writeMessageBegin(new TMessage("batch_insert_superColumn", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("batch_insert_superColumn", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class touch implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { touch_args args = new touch_args(); args.read(iprot); iprot.readMessageEnd(); iface_.touch(args.key, args.fData); return; } } private class get_key_range implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { get_key_range_args args = new get_key_range_args(); args.read(iprot); iprot.readMessageEnd(); get_key_range_result result = new get_key_range_result(); try { result.success = iface_.get_key_range(args.tablename, args.startWith, args.stopAt, args.maxResults); } catch (InvalidRequestException ire) { result.ire = ire; } catch (Throwable th) { LOGGER.error("Internal error processing get_key_range", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_key_range"); oprot.writeMessageBegin(new TMessage("get_key_range", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("get_key_range", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class getStringProperty implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getStringProperty_args args = new getStringProperty_args(); args.read(iprot); iprot.readMessageEnd(); getStringProperty_result result = new getStringProperty_result(); result.success = iface_.getStringProperty(args.propertyName); oprot.writeMessageBegin(new TMessage("getStringProperty", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class getStringListProperty implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { getStringListProperty_args args = new getStringListProperty_args(); args.read(iprot); iprot.readMessageEnd(); getStringListProperty_result result = new getStringListProperty_result(); result.success = iface_.getStringListProperty(args.propertyName); oprot.writeMessageBegin(new TMessage("getStringListProperty", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class describeTable implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { describeTable_args args = new describeTable_args(); args.read(iprot); iprot.readMessageEnd(); describeTable_result result = new describeTable_result(); result.success = iface_.describeTable(args.tableName); oprot.writeMessageBegin(new TMessage("describeTable", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class executeQuery implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { executeQuery_args args = new executeQuery_args(); args.read(iprot); iprot.readMessageEnd(); executeQuery_result result = new executeQuery_result(); result.success = iface_.executeQuery(args.query); oprot.writeMessageBegin(new TMessage("executeQuery", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } } public static class get_slice_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)3); private static final TField START_FIELD_DESC = new TField("start", TType.I32, (short)4); private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)5); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_column; public static final int COLUMNFAMILY_COLUMN = 3; public int start; public static final int START = 4; public int count; public static final int COUNT = 5; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean start = false; public boolean count = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); put(COUNT, new FieldMetaData("count", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_args.class, metaDataMap); } public get_slice_args() { this.start = -1; this.count = -1; } public get_slice_args( String tablename, String key, String columnFamily_column, int start, int count) { this(); this.tablename = tablename; this.key = key; this.columnFamily_column = columnFamily_column; this.start = start; this.__isset.start = true; this.count = count; this.__isset.count = true; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_args(get_slice_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_column()) { this.columnFamily_column = other.columnFamily_column; } __isset.start = other.__isset.start; this.start = other.start; __isset.count = other.__isset.count; this.count = other.count; } @Override public get_slice_args clone() { return new get_slice_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_column() { return this.columnFamily_column; } public void setColumnFamily_column(String columnFamily_column) { this.columnFamily_column = columnFamily_column; } public void unsetColumnFamily_column() { this.columnFamily_column = null; } // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_column() { return this.columnFamily_column != null; } public void setColumnFamily_columnIsSet(boolean value) { if (!value) { this.columnFamily_column = null; } } public int getStart() { return this.start; } public void setStart(int start) { this.start = start; this.__isset.start = true; } public void unsetStart() { this.__isset.start = false; } // Returns true if field start is set (has been asigned a value) and false otherwise public boolean isSetStart() { return this.__isset.start; } public void setStartIsSet(boolean value) { this.__isset.start = value; } public int getCount() { return this.count; } public void setCount(int count) { this.count = count; this.__isset.count = true; } public void unsetCount() { this.__isset.count = false; } // Returns true if field count is set (has been asigned a value) and false otherwise public boolean isSetCount() { return this.__isset.count; } public void setCountIsSet(boolean value) { this.__isset.count = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_COLUMN: if (value == null) { unsetColumnFamily_column(); } else { setColumnFamily_column((String)value); } break; case START: if (value == null) { unsetStart(); } else { setStart((Integer)value); } break; case COUNT: if (value == null) { unsetCount(); } else { setCount((Integer)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_COLUMN: return getColumnFamily_column(); case START: return new Integer(getStart()); case COUNT: return new Integer(getCount()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_COLUMN: return isSetColumnFamily_column(); case START: return isSetStart(); case COUNT: return isSetCount(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_args) return this.equals((get_slice_args)that); return false; } public boolean equals(get_slice_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_column = true && this.isSetColumnFamily_column(); boolean that_present_columnFamily_column = true && that.isSetColumnFamily_column(); if (this_present_columnFamily_column || that_present_columnFamily_column) { if (!(this_present_columnFamily_column && that_present_columnFamily_column)) return false; if (!this.columnFamily_column.equals(that.columnFamily_column)) return false; } boolean this_present_start = true; boolean that_present_start = true; if (this_present_start || that_present_start) { if (!(this_present_start && that_present_start)) return false; if (this.start != that.start) return false; } boolean this_present_count = true; boolean that_present_count = true; if (this_present_count || that_present_count) { if (!(this_present_count && that_present_count)) return false; if (this.count != that.count) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case START: if (field.type == TType.I32) { this.start = iprot.readI32(); this.__isset.start = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case COUNT: if (field.type == TType.I32) { this.count = iprot.readI32(); this.__isset.count = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeI32(this.start); oprot.writeFieldEnd(); oprot.writeFieldBegin(COUNT_FIELD_DESC); oprot.writeI32(this.count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_column:"); if (this.columnFamily_column == null) { sb.append("null"); } else { sb.append(this.columnFamily_column); } first = false; if (!first) sb.append(", "); sb.append("start:"); sb.append(this.start); first = false; if (!first) sb.append(", "); sb.append("count:"); sb.append(this.count); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2); public List<column_t> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; public NotFoundException nfe; public static final int NFE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, column_t.class)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_result.class, metaDataMap); } public get_slice_result() { } public get_slice_result( List<column_t> success, InvalidRequestException ire, NotFoundException nfe) { this(); this.success = success; this.ire = ire; this.nfe = nfe; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_result(get_slice_result other) { if (other.isSetSuccess()) { List<column_t> __this__success = new ArrayList<column_t>(); for (column_t other_element : other.success) { __this__success.add(new column_t(other_element)); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetNfe()) { this.nfe = new NotFoundException(other.nfe); } } @Override public get_slice_result clone() { return new get_slice_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<column_t> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(column_t elem) { if (this.success == null) { this.success = new ArrayList<column_t>(); } this.success.add(elem); } public List<column_t> getSuccess() { return this.success; } public void setSuccess(List<column_t> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public NotFoundException getNfe() { return this.nfe; } public void setNfe(NotFoundException nfe) { this.nfe = nfe; } public void unsetNfe() { this.nfe = null; } // Returns true if field nfe is set (has been asigned a value) and false otherwise public boolean isSetNfe() { return this.nfe != null; } public void setNfeIsSet(boolean value) { if (!value) { this.nfe = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<column_t>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case NFE: if (value == null) { unsetNfe(); } else { setNfe((NotFoundException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); case NFE: return getNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); case NFE: return isSetNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_result) return this.equals((get_slice_result)that); return false; } public boolean equals(get_slice_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_nfe = true && this.isSetNfe(); boolean that_present_nfe = true && that.isSetNfe(); if (this_present_nfe || that_present_nfe) { if (!(this_present_nfe && that_present_nfe)) return false; if (!this.nfe.equals(that.nfe)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list31 = iprot.readListBegin(); this.success = new ArrayList<column_t>(_list31.size); for (int _i32 = 0; _i32 < _list31.size; ++_i32) { column_t _elem33; _elem33 = new column_t(); _elem33.read(iprot); this.success.add(_elem33); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case NFE: if (field.type == TType.STRUCT) { this.nfe = new NotFoundException(); this.nfe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter34 : this.success) { _iter34.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetNfe()) { oprot.writeFieldBegin(NFE_FIELD_DESC); this.nfe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("nfe:"); if (this.nfe == null) { sb.append("null"); } else { sb.append(this.nfe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_by_name_range_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_by_name_range_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)3); private static final TField START_FIELD_DESC = new TField("start", TType.STRING, (short)4); private static final TField END_FIELD_DESC = new TField("end", TType.STRING, (short)5); private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)6); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily; public static final int COLUMNFAMILY = 3; public String start; public static final int START = 4; public String end; public static final int END = 5; public int count; public static final int COUNT = 6; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean count = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(END, new FieldMetaData("end", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COUNT, new FieldMetaData("count", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_by_name_range_args.class, metaDataMap); } public get_slice_by_name_range_args() { this.count = -1; } public get_slice_by_name_range_args( String tablename, String key, String columnFamily, String start, String end, int count) { this(); this.tablename = tablename; this.key = key; this.columnFamily = columnFamily; this.start = start; this.end = end; this.count = count; this.__isset.count = true; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_by_name_range_args(get_slice_by_name_range_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily()) { this.columnFamily = other.columnFamily; } if (other.isSetStart()) { this.start = other.start; } if (other.isSetEnd()) { this.end = other.end; } __isset.count = other.__isset.count; this.count = other.count; } @Override public get_slice_by_name_range_args clone() { return new get_slice_by_name_range_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily() { return this.columnFamily; } public void setColumnFamily(String columnFamily) { this.columnFamily = columnFamily; } public void unsetColumnFamily() { this.columnFamily = null; } // Returns true if field columnFamily is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily() { return this.columnFamily != null; } public void setColumnFamilyIsSet(boolean value) { if (!value) { this.columnFamily = null; } } public String getStart() { return this.start; } public void setStart(String start) { this.start = start; } public void unsetStart() { this.start = null; } // Returns true if field start is set (has been asigned a value) and false otherwise public boolean isSetStart() { return this.start != null; } public void setStartIsSet(boolean value) { if (!value) { this.start = null; } } public String getEnd() { return this.end; } public void setEnd(String end) { this.end = end; } public void unsetEnd() { this.end = null; } // Returns true if field end is set (has been asigned a value) and false otherwise public boolean isSetEnd() { return this.end != null; } public void setEndIsSet(boolean value) { if (!value) { this.end = null; } } public int getCount() { return this.count; } public void setCount(int count) { this.count = count; this.__isset.count = true; } public void unsetCount() { this.__isset.count = false; } // Returns true if field count is set (has been asigned a value) and false otherwise public boolean isSetCount() { return this.__isset.count; } public void setCountIsSet(boolean value) { this.__isset.count = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY: if (value == null) { unsetColumnFamily(); } else { setColumnFamily((String)value); } break; case START: if (value == null) { unsetStart(); } else { setStart((String)value); } break; case END: if (value == null) { unsetEnd(); } else { setEnd((String)value); } break; case COUNT: if (value == null) { unsetCount(); } else { setCount((Integer)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY: return getColumnFamily(); case START: return getStart(); case END: return getEnd(); case COUNT: return new Integer(getCount()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY: return isSetColumnFamily(); case START: return isSetStart(); case END: return isSetEnd(); case COUNT: return isSetCount(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_by_name_range_args) return this.equals((get_slice_by_name_range_args)that); return false; } public boolean equals(get_slice_by_name_range_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily = true && this.isSetColumnFamily(); boolean that_present_columnFamily = true && that.isSetColumnFamily(); if (this_present_columnFamily || that_present_columnFamily) { if (!(this_present_columnFamily && that_present_columnFamily)) return false; if (!this.columnFamily.equals(that.columnFamily)) return false; } boolean this_present_start = true && this.isSetStart(); boolean that_present_start = true && that.isSetStart(); if (this_present_start || that_present_start) { if (!(this_present_start && that_present_start)) return false; if (!this.start.equals(that.start)) return false; } boolean this_present_end = true && this.isSetEnd(); boolean that_present_end = true && that.isSetEnd(); if (this_present_end || that_present_end) { if (!(this_present_end && that_present_end)) return false; if (!this.end.equals(that.end)) return false; } boolean this_present_count = true; boolean that_present_count = true; if (this_present_count || that_present_count) { if (!(this_present_count && that_present_count)) return false; if (this.count != that.count) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case START: if (field.type == TType.STRING) { this.start = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case END: if (field.type == TType.STRING) { this.end = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COUNT: if (field.type == TType.I32) { this.count = iprot.readI32(); this.__isset.count = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } if (this.start != null) { oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeString(this.start); oprot.writeFieldEnd(); } if (this.end != null) { oprot.writeFieldBegin(END_FIELD_DESC); oprot.writeString(this.end); oprot.writeFieldEnd(); } oprot.writeFieldBegin(COUNT_FIELD_DESC); oprot.writeI32(this.count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_by_name_range_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily:"); if (this.columnFamily == null) { sb.append("null"); } else { sb.append(this.columnFamily); } first = false; if (!first) sb.append(", "); sb.append("start:"); if (this.start == null) { sb.append("null"); } else { sb.append(this.start); } first = false; if (!first) sb.append(", "); sb.append("end:"); if (this.end == null) { sb.append("null"); } else { sb.append(this.end); } first = false; if (!first) sb.append(", "); sb.append("count:"); sb.append(this.count); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_by_name_range_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_by_name_range_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2); public List<column_t> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; public NotFoundException nfe; public static final int NFE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, column_t.class)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_by_name_range_result.class, metaDataMap); } public get_slice_by_name_range_result() { } public get_slice_by_name_range_result( List<column_t> success, InvalidRequestException ire, NotFoundException nfe) { this(); this.success = success; this.ire = ire; this.nfe = nfe; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_by_name_range_result(get_slice_by_name_range_result other) { if (other.isSetSuccess()) { List<column_t> __this__success = new ArrayList<column_t>(); for (column_t other_element : other.success) { __this__success.add(new column_t(other_element)); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetNfe()) { this.nfe = new NotFoundException(other.nfe); } } @Override public get_slice_by_name_range_result clone() { return new get_slice_by_name_range_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<column_t> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(column_t elem) { if (this.success == null) { this.success = new ArrayList<column_t>(); } this.success.add(elem); } public List<column_t> getSuccess() { return this.success; } public void setSuccess(List<column_t> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public NotFoundException getNfe() { return this.nfe; } public void setNfe(NotFoundException nfe) { this.nfe = nfe; } public void unsetNfe() { this.nfe = null; } // Returns true if field nfe is set (has been asigned a value) and false otherwise public boolean isSetNfe() { return this.nfe != null; } public void setNfeIsSet(boolean value) { if (!value) { this.nfe = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<column_t>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case NFE: if (value == null) { unsetNfe(); } else { setNfe((NotFoundException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); case NFE: return getNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); case NFE: return isSetNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_by_name_range_result) return this.equals((get_slice_by_name_range_result)that); return false; } public boolean equals(get_slice_by_name_range_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_nfe = true && this.isSetNfe(); boolean that_present_nfe = true && that.isSetNfe(); if (this_present_nfe || that_present_nfe) { if (!(this_present_nfe && that_present_nfe)) return false; if (!this.nfe.equals(that.nfe)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list35 = iprot.readListBegin(); this.success = new ArrayList<column_t>(_list35.size); for (int _i36 = 0; _i36 < _list35.size; ++_i36) { column_t _elem37; _elem37 = new column_t(); _elem37.read(iprot); this.success.add(_elem37); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case NFE: if (field.type == TType.STRUCT) { this.nfe = new NotFoundException(); this.nfe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter38 : this.success) { _iter38.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetNfe()) { oprot.writeFieldBegin(NFE_FIELD_DESC); this.nfe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_by_name_range_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("nfe:"); if (this.nfe == null) { sb.append("null"); } else { sb.append(this.nfe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_by_names_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_by_names_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)3); private static final TField COLUMN_NAMES_FIELD_DESC = new TField("columnNames", TType.LIST, (short)4); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily; public static final int COLUMNFAMILY = 3; public List<String> columnNames; public static final int COLUMNNAMES = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNNAMES, new FieldMetaData("columnNames", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_by_names_args.class, metaDataMap); } public get_slice_by_names_args() { } public get_slice_by_names_args( String tablename, String key, String columnFamily, List<String> columnNames) { this(); this.tablename = tablename; this.key = key; this.columnFamily = columnFamily; this.columnNames = columnNames; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_by_names_args(get_slice_by_names_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily()) { this.columnFamily = other.columnFamily; } if (other.isSetColumnNames()) { List<String> __this__columnNames = new ArrayList<String>(); for (String other_element : other.columnNames) { __this__columnNames.add(other_element); } this.columnNames = __this__columnNames; } } @Override public get_slice_by_names_args clone() { return new get_slice_by_names_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily() { return this.columnFamily; } public void setColumnFamily(String columnFamily) { this.columnFamily = columnFamily; } public void unsetColumnFamily() { this.columnFamily = null; } // Returns true if field columnFamily is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily() { return this.columnFamily != null; } public void setColumnFamilyIsSet(boolean value) { if (!value) { this.columnFamily = null; } } public int getColumnNamesSize() { return (this.columnNames == null) ? 0 : this.columnNames.size(); } public java.util.Iterator<String> getColumnNamesIterator() { return (this.columnNames == null) ? null : this.columnNames.iterator(); } public void addToColumnNames(String elem) { if (this.columnNames == null) { this.columnNames = new ArrayList<String>(); } this.columnNames.add(elem); } public List<String> getColumnNames() { return this.columnNames; } public void setColumnNames(List<String> columnNames) { this.columnNames = columnNames; } public void unsetColumnNames() { this.columnNames = null; } // Returns true if field columnNames is set (has been asigned a value) and false otherwise public boolean isSetColumnNames() { return this.columnNames != null; } public void setColumnNamesIsSet(boolean value) { if (!value) { this.columnNames = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY: if (value == null) { unsetColumnFamily(); } else { setColumnFamily((String)value); } break; case COLUMNNAMES: if (value == null) { unsetColumnNames(); } else { setColumnNames((List<String>)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY: return getColumnFamily(); case COLUMNNAMES: return getColumnNames(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY: return isSetColumnFamily(); case COLUMNNAMES: return isSetColumnNames(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_by_names_args) return this.equals((get_slice_by_names_args)that); return false; } public boolean equals(get_slice_by_names_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily = true && this.isSetColumnFamily(); boolean that_present_columnFamily = true && that.isSetColumnFamily(); if (this_present_columnFamily || that_present_columnFamily) { if (!(this_present_columnFamily && that_present_columnFamily)) return false; if (!this.columnFamily.equals(that.columnFamily)) return false; } boolean this_present_columnNames = true && this.isSetColumnNames(); boolean that_present_columnNames = true && that.isSetColumnNames(); if (this_present_columnNames || that_present_columnNames) { if (!(this_present_columnNames && that_present_columnNames)) return false; if (!this.columnNames.equals(that.columnNames)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNNAMES: if (field.type == TType.LIST) { { TList _list39 = iprot.readListBegin(); this.columnNames = new ArrayList<String>(_list39.size); for (int _i40 = 0; _i40 < _list39.size; ++_i40) { String _elem41; _elem41 = iprot.readString(); this.columnNames.add(_elem41); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } if (this.columnNames != null) { oprot.writeFieldBegin(COLUMN_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columnNames.size())); for (String _iter42 : this.columnNames) { oprot.writeString(_iter42); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_by_names_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily:"); if (this.columnFamily == null) { sb.append("null"); } else { sb.append(this.columnFamily); } first = false; if (!first) sb.append(", "); sb.append("columnNames:"); if (this.columnNames == null) { sb.append("null"); } else { sb.append(this.columnNames); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_by_names_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_by_names_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2); public List<column_t> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; public NotFoundException nfe; public static final int NFE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, column_t.class)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_by_names_result.class, metaDataMap); } public get_slice_by_names_result() { } public get_slice_by_names_result( List<column_t> success, InvalidRequestException ire, NotFoundException nfe) { this(); this.success = success; this.ire = ire; this.nfe = nfe; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_by_names_result(get_slice_by_names_result other) { if (other.isSetSuccess()) { List<column_t> __this__success = new ArrayList<column_t>(); for (column_t other_element : other.success) { __this__success.add(new column_t(other_element)); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetNfe()) { this.nfe = new NotFoundException(other.nfe); } } @Override public get_slice_by_names_result clone() { return new get_slice_by_names_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<column_t> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(column_t elem) { if (this.success == null) { this.success = new ArrayList<column_t>(); } this.success.add(elem); } public List<column_t> getSuccess() { return this.success; } public void setSuccess(List<column_t> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public NotFoundException getNfe() { return this.nfe; } public void setNfe(NotFoundException nfe) { this.nfe = nfe; } public void unsetNfe() { this.nfe = null; } // Returns true if field nfe is set (has been asigned a value) and false otherwise public boolean isSetNfe() { return this.nfe != null; } public void setNfeIsSet(boolean value) { if (!value) { this.nfe = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<column_t>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case NFE: if (value == null) { unsetNfe(); } else { setNfe((NotFoundException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); case NFE: return getNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); case NFE: return isSetNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_by_names_result) return this.equals((get_slice_by_names_result)that); return false; } public boolean equals(get_slice_by_names_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_nfe = true && this.isSetNfe(); boolean that_present_nfe = true && that.isSetNfe(); if (this_present_nfe || that_present_nfe) { if (!(this_present_nfe && that_present_nfe)) return false; if (!this.nfe.equals(that.nfe)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list43 = iprot.readListBegin(); this.success = new ArrayList<column_t>(_list43.size); for (int _i44 = 0; _i44 < _list43.size; ++_i44) { column_t _elem45; _elem45 = new column_t(); _elem45.read(iprot); this.success.add(_elem45); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case NFE: if (field.type == TType.STRUCT) { this.nfe = new NotFoundException(); this.nfe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter46 : this.success) { _iter46.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetNfe()) { oprot.writeFieldBegin(NFE_FIELD_DESC); this.nfe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_by_names_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("nfe:"); if (this.nfe == null) { sb.append("null"); } else { sb.append(this.nfe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_column_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_column_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)3); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_column; public static final int COLUMNFAMILY_COLUMN = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(get_column_args.class, metaDataMap); } public get_column_args() { } public get_column_args( String tablename, String key, String columnFamily_column) { this(); this.tablename = tablename; this.key = key; this.columnFamily_column = columnFamily_column; } /** * Performs a deep copy on <i>other</i>. */ public get_column_args(get_column_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_column()) { this.columnFamily_column = other.columnFamily_column; } } @Override public get_column_args clone() { return new get_column_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_column() { return this.columnFamily_column; } public void setColumnFamily_column(String columnFamily_column) { this.columnFamily_column = columnFamily_column; } public void unsetColumnFamily_column() { this.columnFamily_column = null; } // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_column() { return this.columnFamily_column != null; } public void setColumnFamily_columnIsSet(boolean value) { if (!value) { this.columnFamily_column = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_COLUMN: if (value == null) { unsetColumnFamily_column(); } else { setColumnFamily_column((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_COLUMN: return getColumnFamily_column(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_COLUMN: return isSetColumnFamily_column(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_column_args) return this.equals((get_column_args)that); return false; } public boolean equals(get_column_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_column = true && this.isSetColumnFamily_column(); boolean that_present_columnFamily_column = true && that.isSetColumnFamily_column(); if (this_present_columnFamily_column || that_present_columnFamily_column) { if (!(this_present_columnFamily_column && that_present_columnFamily_column)) return false; if (!this.columnFamily_column.equals(that.columnFamily_column)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_column:"); if (this.columnFamily_column == null) { sb.append("null"); } else { sb.append(this.columnFamily_column); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_column_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_column_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2); public column_t success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; public NotFoundException nfe; public static final int NFE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, column_t.class))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_column_result.class, metaDataMap); } public get_column_result() { } public get_column_result( column_t success, InvalidRequestException ire, NotFoundException nfe) { this(); this.success = success; this.ire = ire; this.nfe = nfe; } /** * Performs a deep copy on <i>other</i>. */ public get_column_result(get_column_result other) { if (other.isSetSuccess()) { this.success = new column_t(other.success); } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetNfe()) { this.nfe = new NotFoundException(other.nfe); } } @Override public get_column_result clone() { return new get_column_result(this); } public column_t getSuccess() { return this.success; } public void setSuccess(column_t success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public NotFoundException getNfe() { return this.nfe; } public void setNfe(NotFoundException nfe) { this.nfe = nfe; } public void unsetNfe() { this.nfe = null; } // Returns true if field nfe is set (has been asigned a value) and false otherwise public boolean isSetNfe() { return this.nfe != null; } public void setNfeIsSet(boolean value) { if (!value) { this.nfe = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((column_t)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case NFE: if (value == null) { unsetNfe(); } else { setNfe((NotFoundException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); case NFE: return getNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); case NFE: return isSetNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_column_result) return this.equals((get_column_result)that); return false; } public boolean equals(get_column_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_nfe = true && this.isSetNfe(); boolean that_present_nfe = true && that.isSetNfe(); if (this_present_nfe || that_present_nfe) { if (!(this_present_nfe && that_present_nfe)) return false; if (!this.nfe.equals(that.nfe)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.STRUCT) { this.success = new column_t(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case NFE: if (field.type == TType.STRUCT) { this.nfe = new NotFoundException(); this.nfe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetNfe()) { oprot.writeFieldBegin(NFE_FIELD_DESC); this.nfe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("nfe:"); if (this.nfe == null) { sb.append("null"); } else { sb.append(this.nfe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_column_count_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_column_count_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)3); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_column; public static final int COLUMNFAMILY_COLUMN = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(get_column_count_args.class, metaDataMap); } public get_column_count_args() { } public get_column_count_args( String tablename, String key, String columnFamily_column) { this(); this.tablename = tablename; this.key = key; this.columnFamily_column = columnFamily_column; } /** * Performs a deep copy on <i>other</i>. */ public get_column_count_args(get_column_count_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_column()) { this.columnFamily_column = other.columnFamily_column; } } @Override public get_column_count_args clone() { return new get_column_count_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_column() { return this.columnFamily_column; } public void setColumnFamily_column(String columnFamily_column) { this.columnFamily_column = columnFamily_column; } public void unsetColumnFamily_column() { this.columnFamily_column = null; } // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_column() { return this.columnFamily_column != null; } public void setColumnFamily_columnIsSet(boolean value) { if (!value) { this.columnFamily_column = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_COLUMN: if (value == null) { unsetColumnFamily_column(); } else { setColumnFamily_column((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_COLUMN: return getColumnFamily_column(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_COLUMN: return isSetColumnFamily_column(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_column_count_args) return this.equals((get_column_count_args)that); return false; } public boolean equals(get_column_count_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_column = true && this.isSetColumnFamily_column(); boolean that_present_columnFamily_column = true && that.isSetColumnFamily_column(); if (this_present_columnFamily_column || that_present_columnFamily_column) { if (!(this_present_columnFamily_column && that_present_columnFamily_column)) return false; if (!this.columnFamily_column.equals(that.columnFamily_column)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_count_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_column:"); if (this.columnFamily_column == null) { sb.append("null"); } else { sb.append(this.columnFamily_column); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_column_count_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_column_count_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); public int success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean success = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_column_count_result.class, metaDataMap); } public get_column_count_result() { } public get_column_count_result( int success, InvalidRequestException ire) { this(); this.success = success; this.__isset.success = true; this.ire = ire; } /** * Performs a deep copy on <i>other</i>. */ public get_column_count_result(get_column_count_result other) { __isset.success = other.__isset.success; this.success = other.success; if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } } @Override public get_column_count_result clone() { return new get_column_count_result(this); } public int getSuccess() { return this.success; } public void setSuccess(int success) { this.success = success; this.__isset.success = true; } public void unsetSuccess() { this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.__isset.success; } public void setSuccessIsSet(boolean value) { this.__isset.success = value; } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return new Integer(getSuccess()); case IRE: return getIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_column_count_result) return this.equals((get_column_count_result)that); return false; } public boolean equals(get_column_count_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.I32) { this.success = iprot.readI32(); this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(this.success); oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_count_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class insert_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("insert_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)3); private static final TField CELL_DATA_FIELD_DESC = new TField("cellData", TType.STRING, (short)4); private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)5); private static final TField BLOCK_FIELD_DESC = new TField("block", TType.BOOL, (short)6); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_column; public static final int COLUMNFAMILY_COLUMN = 3; public byte[] cellData; public static final int CELLDATA = 4; public long timestamp; public static final int TIMESTAMP = 5; public boolean block; public static final int BLOCK = 6; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean timestamp = false; public boolean block = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(CELLDATA, new FieldMetaData("cellData", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); put(BLOCK, new FieldMetaData("block", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); }}); static { FieldMetaData.addStructMetaDataMap(insert_args.class, metaDataMap); } public insert_args() { this.block = false; } public insert_args( String tablename, String key, String columnFamily_column, byte[] cellData, long timestamp, boolean block) { this(); this.tablename = tablename; this.key = key; this.columnFamily_column = columnFamily_column; this.cellData = cellData; this.timestamp = timestamp; this.__isset.timestamp = true; this.block = block; this.__isset.block = true; } /** * Performs a deep copy on <i>other</i>. */ public insert_args(insert_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_column()) { this.columnFamily_column = other.columnFamily_column; } if (other.isSetCellData()) { this.cellData = new byte[other.cellData.length]; System.arraycopy(other.cellData, 0, cellData, 0, other.cellData.length); } __isset.timestamp = other.__isset.timestamp; this.timestamp = other.timestamp; __isset.block = other.__isset.block; this.block = other.block; } @Override public insert_args clone() { return new insert_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_column() { return this.columnFamily_column; } public void setColumnFamily_column(String columnFamily_column) { this.columnFamily_column = columnFamily_column; } public void unsetColumnFamily_column() { this.columnFamily_column = null; } // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_column() { return this.columnFamily_column != null; } public void setColumnFamily_columnIsSet(boolean value) { if (!value) { this.columnFamily_column = null; } } public byte[] getCellData() { return this.cellData; } public void setCellData(byte[] cellData) { this.cellData = cellData; } public void unsetCellData() { this.cellData = null; } // Returns true if field cellData is set (has been asigned a value) and false otherwise public boolean isSetCellData() { return this.cellData != null; } public void setCellDataIsSet(boolean value) { if (!value) { this.cellData = null; } } public long getTimestamp() { return this.timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; this.__isset.timestamp = true; } public void unsetTimestamp() { this.__isset.timestamp = false; } // Returns true if field timestamp is set (has been asigned a value) and false otherwise public boolean isSetTimestamp() { return this.__isset.timestamp; } public void setTimestampIsSet(boolean value) { this.__isset.timestamp = value; } public boolean isBlock() { return this.block; } public void setBlock(boolean block) { this.block = block; this.__isset.block = true; } public void unsetBlock() { this.__isset.block = false; } // Returns true if field block is set (has been asigned a value) and false otherwise public boolean isSetBlock() { return this.__isset.block; } public void setBlockIsSet(boolean value) { this.__isset.block = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_COLUMN: if (value == null) { unsetColumnFamily_column(); } else { setColumnFamily_column((String)value); } break; case CELLDATA: if (value == null) { unsetCellData(); } else { setCellData((byte[])value); } break; case TIMESTAMP: if (value == null) { unsetTimestamp(); } else { setTimestamp((Long)value); } break; case BLOCK: if (value == null) { unsetBlock(); } else { setBlock((Boolean)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_COLUMN: return getColumnFamily_column(); case CELLDATA: return getCellData(); case TIMESTAMP: return new Long(getTimestamp()); case BLOCK: return new Boolean(isBlock()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_COLUMN: return isSetColumnFamily_column(); case CELLDATA: return isSetCellData(); case TIMESTAMP: return isSetTimestamp(); case BLOCK: return isSetBlock(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof insert_args) return this.equals((insert_args)that); return false; } public boolean equals(insert_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_column = true && this.isSetColumnFamily_column(); boolean that_present_columnFamily_column = true && that.isSetColumnFamily_column(); if (this_present_columnFamily_column || that_present_columnFamily_column) { if (!(this_present_columnFamily_column && that_present_columnFamily_column)) return false; if (!this.columnFamily_column.equals(that.columnFamily_column)) return false; } boolean this_present_cellData = true && this.isSetCellData(); boolean that_present_cellData = true && that.isSetCellData(); if (this_present_cellData || that_present_cellData) { if (!(this_present_cellData && that_present_cellData)) return false; if (!java.util.Arrays.equals(this.cellData, that.cellData)) return false; } boolean this_present_timestamp = true; boolean that_present_timestamp = true; if (this_present_timestamp || that_present_timestamp) { if (!(this_present_timestamp && that_present_timestamp)) return false; if (this.timestamp != that.timestamp) return false; } boolean this_present_block = true; boolean that_present_block = true; if (this_present_block || that_present_block) { if (!(this_present_block && that_present_block)) return false; if (this.block != that.block) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case CELLDATA: if (field.type == TType.STRING) { this.cellData = iprot.readBinary(); } else { TProtocolUtil.skip(iprot, field.type); } break; case TIMESTAMP: if (field.type == TType.I64) { this.timestamp = iprot.readI64(); this.__isset.timestamp = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case BLOCK: if (field.type == TType.BOOL) { this.block = iprot.readBool(); this.__isset.block = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } if (this.cellData != null) { oprot.writeFieldBegin(CELL_DATA_FIELD_DESC); oprot.writeBinary(this.cellData); oprot.writeFieldEnd(); } oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); oprot.writeI64(this.timestamp); oprot.writeFieldEnd(); oprot.writeFieldBegin(BLOCK_FIELD_DESC); oprot.writeBool(this.block); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("insert_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_column:"); if (this.columnFamily_column == null) { sb.append("null"); } else { sb.append(this.columnFamily_column); } first = false; if (!first) sb.append(", "); sb.append("cellData:"); if (this.cellData == null) { sb.append("null"); } else { int __cellData_size = Math.min(this.cellData.length, 128); for (int i = 0; i < __cellData_size; i++) { if (i != 0) sb.append(" "); sb.append(Integer.toHexString(this.cellData[i]).length() > 1 ? Integer.toHexString(this.cellData[i]).substring(Integer.toHexString(this.cellData[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.cellData[i]).toUpperCase()); } if (this.cellData.length > 128) sb.append(" ..."); } first = false; if (!first) sb.append(", "); sb.append("timestamp:"); sb.append(this.timestamp); first = false; if (!first) sb.append(", "); sb.append("block:"); sb.append(this.block); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class insert_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("insert_result"); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField UE_FIELD_DESC = new TField("ue", TType.STRUCT, (short)2); public InvalidRequestException ire; public static final int IRE = 1; public UnavailableException ue; public static final int UE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(insert_result.class, metaDataMap); } public insert_result() { } public insert_result( InvalidRequestException ire, UnavailableException ue) { this(); this.ire = ire; this.ue = ue; } /** * Performs a deep copy on <i>other</i>. */ public insert_result(insert_result other) { if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetUe()) { this.ue = new UnavailableException(other.ue); } } @Override public insert_result clone() { return new insert_result(this); } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public UnavailableException getUe() { return this.ue; } public void setUe(UnavailableException ue) { this.ue = ue; } public void unsetUe() { this.ue = null; } // Returns true if field ue is set (has been asigned a value) and false otherwise public boolean isSetUe() { return this.ue != null; } public void setUeIsSet(boolean value) { if (!value) { this.ue = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case UE: if (value == null) { unsetUe(); } else { setUe((UnavailableException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case IRE: return getIre(); case UE: return getUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case IRE: return isSetIre(); case UE: return isSetUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof insert_result) return this.equals((insert_result)that); return false; } public boolean equals(insert_result that) { if (that == null) return false; boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_ue = true && this.isSetUe(); boolean that_present_ue = true && that.isSetUe(); if (this_present_ue || that_present_ue) { if (!(this_present_ue && that_present_ue)) return false; if (!this.ue.equals(that.ue)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case UE: if (field.type == TType.STRUCT) { this.ue = new UnavailableException(); this.ue.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetUe()) { oprot.writeFieldBegin(UE_FIELD_DESC); this.ue.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("insert_result("); boolean first = true; sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("ue:"); if (this.ue == null) { sb.append("null"); } else { sb.append(this.ue); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class batch_insert_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("batch_insert_args"); private static final TField BATCH_MUTATION_FIELD_DESC = new TField("batchMutation", TType.STRUCT, (short)1); private static final TField BLOCK_FIELD_DESC = new TField("block", TType.BOOL, (short)2); public batch_mutation_t batchMutation; public static final int BATCHMUTATION = 1; public boolean block; public static final int BLOCK = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean block = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(BATCHMUTATION, new FieldMetaData("batchMutation", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, batch_mutation_t.class))); put(BLOCK, new FieldMetaData("block", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); }}); static { FieldMetaData.addStructMetaDataMap(batch_insert_args.class, metaDataMap); } public batch_insert_args() { this.block = false; } public batch_insert_args( batch_mutation_t batchMutation, boolean block) { this(); this.batchMutation = batchMutation; this.block = block; this.__isset.block = true; } /** * Performs a deep copy on <i>other</i>. */ public batch_insert_args(batch_insert_args other) { if (other.isSetBatchMutation()) { this.batchMutation = new batch_mutation_t(other.batchMutation); } __isset.block = other.__isset.block; this.block = other.block; } @Override public batch_insert_args clone() { return new batch_insert_args(this); } public batch_mutation_t getBatchMutation() { return this.batchMutation; } public void setBatchMutation(batch_mutation_t batchMutation) { this.batchMutation = batchMutation; } public void unsetBatchMutation() { this.batchMutation = null; } // Returns true if field batchMutation is set (has been asigned a value) and false otherwise public boolean isSetBatchMutation() { return this.batchMutation != null; } public void setBatchMutationIsSet(boolean value) { if (!value) { this.batchMutation = null; } } public boolean isBlock() { return this.block; } public void setBlock(boolean block) { this.block = block; this.__isset.block = true; } public void unsetBlock() { this.__isset.block = false; } // Returns true if field block is set (has been asigned a value) and false otherwise public boolean isSetBlock() { return this.__isset.block; } public void setBlockIsSet(boolean value) { this.__isset.block = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case BATCHMUTATION: if (value == null) { unsetBatchMutation(); } else { setBatchMutation((batch_mutation_t)value); } break; case BLOCK: if (value == null) { unsetBlock(); } else { setBlock((Boolean)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case BATCHMUTATION: return getBatchMutation(); case BLOCK: return new Boolean(isBlock()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case BATCHMUTATION: return isSetBatchMutation(); case BLOCK: return isSetBlock(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batch_insert_args) return this.equals((batch_insert_args)that); return false; } public boolean equals(batch_insert_args that) { if (that == null) return false; boolean this_present_batchMutation = true && this.isSetBatchMutation(); boolean that_present_batchMutation = true && that.isSetBatchMutation(); if (this_present_batchMutation || that_present_batchMutation) { if (!(this_present_batchMutation && that_present_batchMutation)) return false; if (!this.batchMutation.equals(that.batchMutation)) return false; } boolean this_present_block = true; boolean that_present_block = true; if (this_present_block || that_present_block) { if (!(this_present_block && that_present_block)) return false; if (this.block != that.block) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case BATCHMUTATION: if (field.type == TType.STRUCT) { this.batchMutation = new batch_mutation_t(); this.batchMutation.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case BLOCK: if (field.type == TType.BOOL) { this.block = iprot.readBool(); this.__isset.block = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.batchMutation != null) { oprot.writeFieldBegin(BATCH_MUTATION_FIELD_DESC); this.batchMutation.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(BLOCK_FIELD_DESC); oprot.writeBool(this.block); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_args("); boolean first = true; sb.append("batchMutation:"); if (this.batchMutation == null) { sb.append("null"); } else { sb.append(this.batchMutation); } first = false; if (!first) sb.append(", "); sb.append("block:"); sb.append(this.block); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class batch_insert_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("batch_insert_result"); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField UE_FIELD_DESC = new TField("ue", TType.STRUCT, (short)2); public InvalidRequestException ire; public static final int IRE = 1; public UnavailableException ue; public static final int UE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(batch_insert_result.class, metaDataMap); } public batch_insert_result() { } public batch_insert_result( InvalidRequestException ire, UnavailableException ue) { this(); this.ire = ire; this.ue = ue; } /** * Performs a deep copy on <i>other</i>. */ public batch_insert_result(batch_insert_result other) { if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetUe()) { this.ue = new UnavailableException(other.ue); } } @Override public batch_insert_result clone() { return new batch_insert_result(this); } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public UnavailableException getUe() { return this.ue; } public void setUe(UnavailableException ue) { this.ue = ue; } public void unsetUe() { this.ue = null; } // Returns true if field ue is set (has been asigned a value) and false otherwise public boolean isSetUe() { return this.ue != null; } public void setUeIsSet(boolean value) { if (!value) { this.ue = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case UE: if (value == null) { unsetUe(); } else { setUe((UnavailableException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case IRE: return getIre(); case UE: return getUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case IRE: return isSetIre(); case UE: return isSetUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batch_insert_result) return this.equals((batch_insert_result)that); return false; } public boolean equals(batch_insert_result that) { if (that == null) return false; boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_ue = true && this.isSetUe(); boolean that_present_ue = true && that.isSetUe(); if (this_present_ue || that_present_ue) { if (!(this_present_ue && that_present_ue)) return false; if (!this.ue.equals(that.ue)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case UE: if (field.type == TType.STRUCT) { this.ue = new UnavailableException(); this.ue.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetUe()) { oprot.writeFieldBegin(UE_FIELD_DESC); this.ue.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_result("); boolean first = true; sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("ue:"); if (this.ue == null) { sb.append("null"); } else { sb.append(this.ue); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class remove_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("remove_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)3); private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)4); private static final TField BLOCK_FIELD_DESC = new TField("block", TType.BOOL, (short)5); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_column; public static final int COLUMNFAMILY_COLUMN = 3; public long timestamp; public static final int TIMESTAMP = 4; public boolean block; public static final int BLOCK = 5; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean timestamp = false; public boolean block = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); put(BLOCK, new FieldMetaData("block", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); }}); static { FieldMetaData.addStructMetaDataMap(remove_args.class, metaDataMap); } public remove_args() { this.block = false; } public remove_args( String tablename, String key, String columnFamily_column, long timestamp, boolean block) { this(); this.tablename = tablename; this.key = key; this.columnFamily_column = columnFamily_column; this.timestamp = timestamp; this.__isset.timestamp = true; this.block = block; this.__isset.block = true; } /** * Performs a deep copy on <i>other</i>. */ public remove_args(remove_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_column()) { this.columnFamily_column = other.columnFamily_column; } __isset.timestamp = other.__isset.timestamp; this.timestamp = other.timestamp; __isset.block = other.__isset.block; this.block = other.block; } @Override public remove_args clone() { return new remove_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_column() { return this.columnFamily_column; } public void setColumnFamily_column(String columnFamily_column) { this.columnFamily_column = columnFamily_column; } public void unsetColumnFamily_column() { this.columnFamily_column = null; } // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_column() { return this.columnFamily_column != null; } public void setColumnFamily_columnIsSet(boolean value) { if (!value) { this.columnFamily_column = null; } } public long getTimestamp() { return this.timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; this.__isset.timestamp = true; } public void unsetTimestamp() { this.__isset.timestamp = false; } // Returns true if field timestamp is set (has been asigned a value) and false otherwise public boolean isSetTimestamp() { return this.__isset.timestamp; } public void setTimestampIsSet(boolean value) { this.__isset.timestamp = value; } public boolean isBlock() { return this.block; } public void setBlock(boolean block) { this.block = block; this.__isset.block = true; } public void unsetBlock() { this.__isset.block = false; } // Returns true if field block is set (has been asigned a value) and false otherwise public boolean isSetBlock() { return this.__isset.block; } public void setBlockIsSet(boolean value) { this.__isset.block = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_COLUMN: if (value == null) { unsetColumnFamily_column(); } else { setColumnFamily_column((String)value); } break; case TIMESTAMP: if (value == null) { unsetTimestamp(); } else { setTimestamp((Long)value); } break; case BLOCK: if (value == null) { unsetBlock(); } else { setBlock((Boolean)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_COLUMN: return getColumnFamily_column(); case TIMESTAMP: return new Long(getTimestamp()); case BLOCK: return new Boolean(isBlock()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_COLUMN: return isSetColumnFamily_column(); case TIMESTAMP: return isSetTimestamp(); case BLOCK: return isSetBlock(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof remove_args) return this.equals((remove_args)that); return false; } public boolean equals(remove_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_column = true && this.isSetColumnFamily_column(); boolean that_present_columnFamily_column = true && that.isSetColumnFamily_column(); if (this_present_columnFamily_column || that_present_columnFamily_column) { if (!(this_present_columnFamily_column && that_present_columnFamily_column)) return false; if (!this.columnFamily_column.equals(that.columnFamily_column)) return false; } boolean this_present_timestamp = true; boolean that_present_timestamp = true; if (this_present_timestamp || that_present_timestamp) { if (!(this_present_timestamp && that_present_timestamp)) return false; if (this.timestamp != that.timestamp) return false; } boolean this_present_block = true; boolean that_present_block = true; if (this_present_block || that_present_block) { if (!(this_present_block && that_present_block)) return false; if (this.block != that.block) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case TIMESTAMP: if (field.type == TType.I64) { this.timestamp = iprot.readI64(); this.__isset.timestamp = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case BLOCK: if (field.type == TType.BOOL) { this.block = iprot.readBool(); this.__isset.block = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); oprot.writeI64(this.timestamp); oprot.writeFieldEnd(); oprot.writeFieldBegin(BLOCK_FIELD_DESC); oprot.writeBool(this.block); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("remove_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_column:"); if (this.columnFamily_column == null) { sb.append("null"); } else { sb.append(this.columnFamily_column); } first = false; if (!first) sb.append(", "); sb.append("timestamp:"); sb.append(this.timestamp); first = false; if (!first) sb.append(", "); sb.append("block:"); sb.append(this.block); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class remove_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("remove_result"); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField UE_FIELD_DESC = new TField("ue", TType.STRUCT, (short)2); public InvalidRequestException ire; public static final int IRE = 1; public UnavailableException ue; public static final int UE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(remove_result.class, metaDataMap); } public remove_result() { } public remove_result( InvalidRequestException ire, UnavailableException ue) { this(); this.ire = ire; this.ue = ue; } /** * Performs a deep copy on <i>other</i>. */ public remove_result(remove_result other) { if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetUe()) { this.ue = new UnavailableException(other.ue); } } @Override public remove_result clone() { return new remove_result(this); } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public UnavailableException getUe() { return this.ue; } public void setUe(UnavailableException ue) { this.ue = ue; } public void unsetUe() { this.ue = null; } // Returns true if field ue is set (has been asigned a value) and false otherwise public boolean isSetUe() { return this.ue != null; } public void setUeIsSet(boolean value) { if (!value) { this.ue = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case UE: if (value == null) { unsetUe(); } else { setUe((UnavailableException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case IRE: return getIre(); case UE: return getUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case IRE: return isSetIre(); case UE: return isSetUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof remove_result) return this.equals((remove_result)that); return false; } public boolean equals(remove_result that) { if (that == null) return false; boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_ue = true && this.isSetUe(); boolean that_present_ue = true && that.isSetUe(); if (this_present_ue || that_present_ue) { if (!(this_present_ue && that_present_ue)) return false; if (!this.ue.equals(that.ue)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case UE: if (field.type == TType.STRUCT) { this.ue = new UnavailableException(); this.ue.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetUe()) { oprot.writeFieldBegin(UE_FIELD_DESC); this.ue.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("remove_result("); boolean first = true; sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("ue:"); if (this.ue == null) { sb.append("null"); } else { sb.append(this.ue); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_columns_since_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_columns_since_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)3); private static final TField TIME_STAMP_FIELD_DESC = new TField("timeStamp", TType.I64, (short)4); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_column; public static final int COLUMNFAMILY_COLUMN = 3; public long timeStamp; public static final int TIMESTAMP = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean timeStamp = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(TIMESTAMP, new FieldMetaData("timeStamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); }}); static { FieldMetaData.addStructMetaDataMap(get_columns_since_args.class, metaDataMap); } public get_columns_since_args() { } public get_columns_since_args( String tablename, String key, String columnFamily_column, long timeStamp) { this(); this.tablename = tablename; this.key = key; this.columnFamily_column = columnFamily_column; this.timeStamp = timeStamp; this.__isset.timeStamp = true; } /** * Performs a deep copy on <i>other</i>. */ public get_columns_since_args(get_columns_since_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_column()) { this.columnFamily_column = other.columnFamily_column; } __isset.timeStamp = other.__isset.timeStamp; this.timeStamp = other.timeStamp; } @Override public get_columns_since_args clone() { return new get_columns_since_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_column() { return this.columnFamily_column; } public void setColumnFamily_column(String columnFamily_column) { this.columnFamily_column = columnFamily_column; } public void unsetColumnFamily_column() { this.columnFamily_column = null; } // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_column() { return this.columnFamily_column != null; } public void setColumnFamily_columnIsSet(boolean value) { if (!value) { this.columnFamily_column = null; } } public long getTimeStamp() { return this.timeStamp; } public void setTimeStamp(long timeStamp) { this.timeStamp = timeStamp; this.__isset.timeStamp = true; } public void unsetTimeStamp() { this.__isset.timeStamp = false; } // Returns true if field timeStamp is set (has been asigned a value) and false otherwise public boolean isSetTimeStamp() { return this.__isset.timeStamp; } public void setTimeStampIsSet(boolean value) { this.__isset.timeStamp = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_COLUMN: if (value == null) { unsetColumnFamily_column(); } else { setColumnFamily_column((String)value); } break; case TIMESTAMP: if (value == null) { unsetTimeStamp(); } else { setTimeStamp((Long)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_COLUMN: return getColumnFamily_column(); case TIMESTAMP: return new Long(getTimeStamp()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_COLUMN: return isSetColumnFamily_column(); case TIMESTAMP: return isSetTimeStamp(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_columns_since_args) return this.equals((get_columns_since_args)that); return false; } public boolean equals(get_columns_since_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_column = true && this.isSetColumnFamily_column(); boolean that_present_columnFamily_column = true && that.isSetColumnFamily_column(); if (this_present_columnFamily_column || that_present_columnFamily_column) { if (!(this_present_columnFamily_column && that_present_columnFamily_column)) return false; if (!this.columnFamily_column.equals(that.columnFamily_column)) return false; } boolean this_present_timeStamp = true; boolean that_present_timeStamp = true; if (this_present_timeStamp || that_present_timeStamp) { if (!(this_present_timeStamp && that_present_timeStamp)) return false; if (this.timeStamp != that.timeStamp) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case TIMESTAMP: if (field.type == TType.I64) { this.timeStamp = iprot.readI64(); this.__isset.timeStamp = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } oprot.writeFieldBegin(TIME_STAMP_FIELD_DESC); oprot.writeI64(this.timeStamp); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_columns_since_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_column:"); if (this.columnFamily_column == null) { sb.append("null"); } else { sb.append(this.columnFamily_column); } first = false; if (!first) sb.append(", "); sb.append("timeStamp:"); sb.append(this.timeStamp); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_columns_since_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_columns_since_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2); public List<column_t> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; public NotFoundException nfe; public static final int NFE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, column_t.class)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_columns_since_result.class, metaDataMap); } public get_columns_since_result() { } public get_columns_since_result( List<column_t> success, InvalidRequestException ire, NotFoundException nfe) { this(); this.success = success; this.ire = ire; this.nfe = nfe; } /** * Performs a deep copy on <i>other</i>. */ public get_columns_since_result(get_columns_since_result other) { if (other.isSetSuccess()) { List<column_t> __this__success = new ArrayList<column_t>(); for (column_t other_element : other.success) { __this__success.add(new column_t(other_element)); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetNfe()) { this.nfe = new NotFoundException(other.nfe); } } @Override public get_columns_since_result clone() { return new get_columns_since_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<column_t> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(column_t elem) { if (this.success == null) { this.success = new ArrayList<column_t>(); } this.success.add(elem); } public List<column_t> getSuccess() { return this.success; } public void setSuccess(List<column_t> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public NotFoundException getNfe() { return this.nfe; } public void setNfe(NotFoundException nfe) { this.nfe = nfe; } public void unsetNfe() { this.nfe = null; } // Returns true if field nfe is set (has been asigned a value) and false otherwise public boolean isSetNfe() { return this.nfe != null; } public void setNfeIsSet(boolean value) { if (!value) { this.nfe = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<column_t>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case NFE: if (value == null) { unsetNfe(); } else { setNfe((NotFoundException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); case NFE: return getNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); case NFE: return isSetNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_columns_since_result) return this.equals((get_columns_since_result)that); return false; } public boolean equals(get_columns_since_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_nfe = true && this.isSetNfe(); boolean that_present_nfe = true && that.isSetNfe(); if (this_present_nfe || that_present_nfe) { if (!(this_present_nfe && that_present_nfe)) return false; if (!this.nfe.equals(that.nfe)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list47 = iprot.readListBegin(); this.success = new ArrayList<column_t>(_list47.size); for (int _i48 = 0; _i48 < _list47.size; ++_i48) { column_t _elem49; _elem49 = new column_t(); _elem49.read(iprot); this.success.add(_elem49); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case NFE: if (field.type == TType.STRUCT) { this.nfe = new NotFoundException(); this.nfe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter50 : this.success) { _iter50.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetNfe()) { oprot.writeFieldBegin(NFE_FIELD_DESC); this.nfe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_columns_since_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("nfe:"); if (this.nfe == null) { sb.append("null"); } else { sb.append(this.nfe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_super_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_SUPER_COLUMN_NAME_FIELD_DESC = new TField("columnFamily_superColumnName", TType.STRING, (short)3); private static final TField START_FIELD_DESC = new TField("start", TType.I32, (short)4); private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)5); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily_superColumnName; public static final int COLUMNFAMILY_SUPERCOLUMNNAME = 3; public int start; public static final int START = 4; public int count; public static final int COUNT = 5; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean start = false; public boolean count = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY_SUPERCOLUMNNAME, new FieldMetaData("columnFamily_superColumnName", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); put(COUNT, new FieldMetaData("count", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_super_args.class, metaDataMap); } public get_slice_super_args() { this.start = -1; this.count = -1; } public get_slice_super_args( String tablename, String key, String columnFamily_superColumnName, int start, int count) { this(); this.tablename = tablename; this.key = key; this.columnFamily_superColumnName = columnFamily_superColumnName; this.start = start; this.__isset.start = true; this.count = count; this.__isset.count = true; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_super_args(get_slice_super_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily_superColumnName()) { this.columnFamily_superColumnName = other.columnFamily_superColumnName; } __isset.start = other.__isset.start; this.start = other.start; __isset.count = other.__isset.count; this.count = other.count; } @Override public get_slice_super_args clone() { return new get_slice_super_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily_superColumnName() { return this.columnFamily_superColumnName; } public void setColumnFamily_superColumnName(String columnFamily_superColumnName) { this.columnFamily_superColumnName = columnFamily_superColumnName; } public void unsetColumnFamily_superColumnName() { this.columnFamily_superColumnName = null; } // Returns true if field columnFamily_superColumnName is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily_superColumnName() { return this.columnFamily_superColumnName != null; } public void setColumnFamily_superColumnNameIsSet(boolean value) { if (!value) { this.columnFamily_superColumnName = null; } } public int getStart() { return this.start; } public void setStart(int start) { this.start = start; this.__isset.start = true; } public void unsetStart() { this.__isset.start = false; } // Returns true if field start is set (has been asigned a value) and false otherwise public boolean isSetStart() { return this.__isset.start; } public void setStartIsSet(boolean value) { this.__isset.start = value; } public int getCount() { return this.count; } public void setCount(int count) { this.count = count; this.__isset.count = true; } public void unsetCount() { this.__isset.count = false; } // Returns true if field count is set (has been asigned a value) and false otherwise public boolean isSetCount() { return this.__isset.count; } public void setCountIsSet(boolean value) { this.__isset.count = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY_SUPERCOLUMNNAME: if (value == null) { unsetColumnFamily_superColumnName(); } else { setColumnFamily_superColumnName((String)value); } break; case START: if (value == null) { unsetStart(); } else { setStart((Integer)value); } break; case COUNT: if (value == null) { unsetCount(); } else { setCount((Integer)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY_SUPERCOLUMNNAME: return getColumnFamily_superColumnName(); case START: return new Integer(getStart()); case COUNT: return new Integer(getCount()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY_SUPERCOLUMNNAME: return isSetColumnFamily_superColumnName(); case START: return isSetStart(); case COUNT: return isSetCount(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_super_args) return this.equals((get_slice_super_args)that); return false; } public boolean equals(get_slice_super_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily_superColumnName = true && this.isSetColumnFamily_superColumnName(); boolean that_present_columnFamily_superColumnName = true && that.isSetColumnFamily_superColumnName(); if (this_present_columnFamily_superColumnName || that_present_columnFamily_superColumnName) { if (!(this_present_columnFamily_superColumnName && that_present_columnFamily_superColumnName)) return false; if (!this.columnFamily_superColumnName.equals(that.columnFamily_superColumnName)) return false; } boolean this_present_start = true; boolean that_present_start = true; if (this_present_start || that_present_start) { if (!(this_present_start && that_present_start)) return false; if (this.start != that.start) return false; } boolean this_present_count = true; boolean that_present_count = true; if (this_present_count || that_present_count) { if (!(this_present_count && that_present_count)) return false; if (this.count != that.count) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY_SUPERCOLUMNNAME: if (field.type == TType.STRING) { this.columnFamily_superColumnName = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case START: if (field.type == TType.I32) { this.start = iprot.readI32(); this.__isset.start = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case COUNT: if (field.type == TType.I32) { this.count = iprot.readI32(); this.__isset.count = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_superColumnName != null) { oprot.writeFieldBegin(COLUMN_FAMILY_SUPER_COLUMN_NAME_FIELD_DESC); oprot.writeString(this.columnFamily_superColumnName); oprot.writeFieldEnd(); } oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeI32(this.start); oprot.writeFieldEnd(); oprot.writeFieldBegin(COUNT_FIELD_DESC); oprot.writeI32(this.count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily_superColumnName:"); if (this.columnFamily_superColumnName == null) { sb.append("null"); } else { sb.append(this.columnFamily_superColumnName); } first = false; if (!first) sb.append(", "); sb.append("start:"); sb.append(this.start); first = false; if (!first) sb.append(", "); sb.append("count:"); sb.append(this.count); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_super_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); public List<superColumn_t> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, superColumn_t.class)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_super_result.class, metaDataMap); } public get_slice_super_result() { } public get_slice_super_result( List<superColumn_t> success, InvalidRequestException ire) { this(); this.success = success; this.ire = ire; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_super_result(get_slice_super_result other) { if (other.isSetSuccess()) { List<superColumn_t> __this__success = new ArrayList<superColumn_t>(); for (superColumn_t other_element : other.success) { __this__success.add(new superColumn_t(other_element)); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } } @Override public get_slice_super_result clone() { return new get_slice_super_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<superColumn_t> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(superColumn_t elem) { if (this.success == null) { this.success = new ArrayList<superColumn_t>(); } this.success.add(elem); } public List<superColumn_t> getSuccess() { return this.success; } public void setSuccess(List<superColumn_t> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<superColumn_t>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_super_result) return this.equals((get_slice_super_result)that); return false; } public boolean equals(get_slice_super_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list51 = iprot.readListBegin(); this.success = new ArrayList<superColumn_t>(_list51.size); for (int _i52 = 0; _i52 < _list51.size; ++_i52) { superColumn_t _elem53; _elem53 = new superColumn_t(); _elem53.read(iprot); this.success.add(_elem53); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (superColumn_t _iter54 : this.success) { _iter54.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_super_by_names_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_by_names_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)3); private static final TField SUPER_COLUMN_NAMES_FIELD_DESC = new TField("superColumnNames", TType.LIST, (short)4); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily; public static final int COLUMNFAMILY = 3; public List<String> superColumnNames; public static final int SUPERCOLUMNNAMES = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(SUPERCOLUMNNAMES, new FieldMetaData("superColumnNames", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_super_by_names_args.class, metaDataMap); } public get_slice_super_by_names_args() { } public get_slice_super_by_names_args( String tablename, String key, String columnFamily, List<String> superColumnNames) { this(); this.tablename = tablename; this.key = key; this.columnFamily = columnFamily; this.superColumnNames = superColumnNames; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_super_by_names_args(get_slice_super_by_names_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily()) { this.columnFamily = other.columnFamily; } if (other.isSetSuperColumnNames()) { List<String> __this__superColumnNames = new ArrayList<String>(); for (String other_element : other.superColumnNames) { __this__superColumnNames.add(other_element); } this.superColumnNames = __this__superColumnNames; } } @Override public get_slice_super_by_names_args clone() { return new get_slice_super_by_names_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily() { return this.columnFamily; } public void setColumnFamily(String columnFamily) { this.columnFamily = columnFamily; } public void unsetColumnFamily() { this.columnFamily = null; } // Returns true if field columnFamily is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily() { return this.columnFamily != null; } public void setColumnFamilyIsSet(boolean value) { if (!value) { this.columnFamily = null; } } public int getSuperColumnNamesSize() { return (this.superColumnNames == null) ? 0 : this.superColumnNames.size(); } public java.util.Iterator<String> getSuperColumnNamesIterator() { return (this.superColumnNames == null) ? null : this.superColumnNames.iterator(); } public void addToSuperColumnNames(String elem) { if (this.superColumnNames == null) { this.superColumnNames = new ArrayList<String>(); } this.superColumnNames.add(elem); } public List<String> getSuperColumnNames() { return this.superColumnNames; } public void setSuperColumnNames(List<String> superColumnNames) { this.superColumnNames = superColumnNames; } public void unsetSuperColumnNames() { this.superColumnNames = null; } // Returns true if field superColumnNames is set (has been asigned a value) and false otherwise public boolean isSetSuperColumnNames() { return this.superColumnNames != null; } public void setSuperColumnNamesIsSet(boolean value) { if (!value) { this.superColumnNames = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY: if (value == null) { unsetColumnFamily(); } else { setColumnFamily((String)value); } break; case SUPERCOLUMNNAMES: if (value == null) { unsetSuperColumnNames(); } else { setSuperColumnNames((List<String>)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY: return getColumnFamily(); case SUPERCOLUMNNAMES: return getSuperColumnNames(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY: return isSetColumnFamily(); case SUPERCOLUMNNAMES: return isSetSuperColumnNames(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_super_by_names_args) return this.equals((get_slice_super_by_names_args)that); return false; } public boolean equals(get_slice_super_by_names_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily = true && this.isSetColumnFamily(); boolean that_present_columnFamily = true && that.isSetColumnFamily(); if (this_present_columnFamily || that_present_columnFamily) { if (!(this_present_columnFamily && that_present_columnFamily)) return false; if (!this.columnFamily.equals(that.columnFamily)) return false; } boolean this_present_superColumnNames = true && this.isSetSuperColumnNames(); boolean that_present_superColumnNames = true && that.isSetSuperColumnNames(); if (this_present_superColumnNames || that_present_superColumnNames) { if (!(this_present_superColumnNames && that_present_superColumnNames)) return false; if (!this.superColumnNames.equals(that.superColumnNames)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case SUPERCOLUMNNAMES: if (field.type == TType.LIST) { { TList _list55 = iprot.readListBegin(); this.superColumnNames = new ArrayList<String>(_list55.size); for (int _i56 = 0; _i56 < _list55.size; ++_i56) { String _elem57; _elem57 = iprot.readString(); this.superColumnNames.add(_elem57); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } if (this.superColumnNames != null) { oprot.writeFieldBegin(SUPER_COLUMN_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.superColumnNames.size())); for (String _iter58 : this.superColumnNames) { oprot.writeString(_iter58); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_by_names_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily:"); if (this.columnFamily == null) { sb.append("null"); } else { sb.append(this.columnFamily); } first = false; if (!first) sb.append(", "); sb.append("superColumnNames:"); if (this.superColumnNames == null) { sb.append("null"); } else { sb.append(this.superColumnNames); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_slice_super_by_names_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_by_names_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); public List<superColumn_t> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, superColumn_t.class)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_slice_super_by_names_result.class, metaDataMap); } public get_slice_super_by_names_result() { } public get_slice_super_by_names_result( List<superColumn_t> success, InvalidRequestException ire) { this(); this.success = success; this.ire = ire; } /** * Performs a deep copy on <i>other</i>. */ public get_slice_super_by_names_result(get_slice_super_by_names_result other) { if (other.isSetSuccess()) { List<superColumn_t> __this__success = new ArrayList<superColumn_t>(); for (superColumn_t other_element : other.success) { __this__success.add(new superColumn_t(other_element)); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } } @Override public get_slice_super_by_names_result clone() { return new get_slice_super_by_names_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<superColumn_t> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(superColumn_t elem) { if (this.success == null) { this.success = new ArrayList<superColumn_t>(); } this.success.add(elem); } public List<superColumn_t> getSuccess() { return this.success; } public void setSuccess(List<superColumn_t> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<superColumn_t>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_slice_super_by_names_result) return this.equals((get_slice_super_by_names_result)that); return false; } public boolean equals(get_slice_super_by_names_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list59 = iprot.readListBegin(); this.success = new ArrayList<superColumn_t>(_list59.size); for (int _i60 = 0; _i60 < _list59.size; ++_i60) { superColumn_t _elem61; _elem61 = new superColumn_t(); _elem61.read(iprot); this.success.add(_elem61); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (superColumn_t _iter62 : this.success) { _iter62.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_by_names_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_superColumn_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_superColumn_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)3); public String tablename; public static final int TABLENAME = 1; public String key; public static final int KEY = 2; public String columnFamily; public static final int COLUMNFAMILY = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(get_superColumn_args.class, metaDataMap); } public get_superColumn_args() { } public get_superColumn_args( String tablename, String key, String columnFamily) { this(); this.tablename = tablename; this.key = key; this.columnFamily = columnFamily; } /** * Performs a deep copy on <i>other</i>. */ public get_superColumn_args(get_superColumn_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetKey()) { this.key = other.key; } if (other.isSetColumnFamily()) { this.columnFamily = other.columnFamily; } } @Override public get_superColumn_args clone() { return new get_superColumn_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public String getColumnFamily() { return this.columnFamily; } public void setColumnFamily(String columnFamily) { this.columnFamily = columnFamily; } public void unsetColumnFamily() { this.columnFamily = null; } // Returns true if field columnFamily is set (has been asigned a value) and false otherwise public boolean isSetColumnFamily() { return this.columnFamily != null; } public void setColumnFamilyIsSet(boolean value) { if (!value) { this.columnFamily = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case COLUMNFAMILY: if (value == null) { unsetColumnFamily(); } else { setColumnFamily((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case KEY: return getKey(); case COLUMNFAMILY: return getColumnFamily(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case KEY: return isSetKey(); case COLUMNFAMILY: return isSetColumnFamily(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_superColumn_args) return this.equals((get_superColumn_args)that); return false; } public boolean equals(get_superColumn_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columnFamily = true && this.isSetColumnFamily(); boolean that_present_columnFamily = true && that.isSetColumnFamily(); if (this_present_columnFamily || that_present_columnFamily) { if (!(this_present_columnFamily && that_present_columnFamily)) return false; if (!this.columnFamily.equals(that.columnFamily)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_superColumn_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("columnFamily:"); if (this.columnFamily == null) { sb.append("null"); } else { sb.append(this.columnFamily); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_superColumn_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_superColumn_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2); public superColumn_t success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; public NotFoundException nfe; public static final int NFE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, superColumn_t.class))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_superColumn_result.class, metaDataMap); } public get_superColumn_result() { } public get_superColumn_result( superColumn_t success, InvalidRequestException ire, NotFoundException nfe) { this(); this.success = success; this.ire = ire; this.nfe = nfe; } /** * Performs a deep copy on <i>other</i>. */ public get_superColumn_result(get_superColumn_result other) { if (other.isSetSuccess()) { this.success = new superColumn_t(other.success); } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetNfe()) { this.nfe = new NotFoundException(other.nfe); } } @Override public get_superColumn_result clone() { return new get_superColumn_result(this); } public superColumn_t getSuccess() { return this.success; } public void setSuccess(superColumn_t success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public NotFoundException getNfe() { return this.nfe; } public void setNfe(NotFoundException nfe) { this.nfe = nfe; } public void unsetNfe() { this.nfe = null; } // Returns true if field nfe is set (has been asigned a value) and false otherwise public boolean isSetNfe() { return this.nfe != null; } public void setNfeIsSet(boolean value) { if (!value) { this.nfe = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((superColumn_t)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case NFE: if (value == null) { unsetNfe(); } else { setNfe((NotFoundException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); case NFE: return getNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); case NFE: return isSetNfe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_superColumn_result) return this.equals((get_superColumn_result)that); return false; } public boolean equals(get_superColumn_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_nfe = true && this.isSetNfe(); boolean that_present_nfe = true && that.isSetNfe(); if (this_present_nfe || that_present_nfe) { if (!(this_present_nfe && that_present_nfe)) return false; if (!this.nfe.equals(that.nfe)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.STRUCT) { this.success = new superColumn_t(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case NFE: if (field.type == TType.STRUCT) { this.nfe = new NotFoundException(); this.nfe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetNfe()) { oprot.writeFieldBegin(NFE_FIELD_DESC); this.nfe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_superColumn_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("nfe:"); if (this.nfe == null) { sb.append("null"); } else { sb.append(this.nfe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class batch_insert_superColumn_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("batch_insert_superColumn_args"); private static final TField BATCH_MUTATION_SUPER_FIELD_DESC = new TField("batchMutationSuper", TType.STRUCT, (short)1); private static final TField BLOCK_FIELD_DESC = new TField("block", TType.BOOL, (short)2); public batch_mutation_super_t batchMutationSuper; public static final int BATCHMUTATIONSUPER = 1; public boolean block; public static final int BLOCK = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean block = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(BATCHMUTATIONSUPER, new FieldMetaData("batchMutationSuper", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, batch_mutation_super_t.class))); put(BLOCK, new FieldMetaData("block", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); }}); static { FieldMetaData.addStructMetaDataMap(batch_insert_superColumn_args.class, metaDataMap); } public batch_insert_superColumn_args() { this.block = false; } public batch_insert_superColumn_args( batch_mutation_super_t batchMutationSuper, boolean block) { this(); this.batchMutationSuper = batchMutationSuper; this.block = block; this.__isset.block = true; } /** * Performs a deep copy on <i>other</i>. */ public batch_insert_superColumn_args(batch_insert_superColumn_args other) { if (other.isSetBatchMutationSuper()) { this.batchMutationSuper = new batch_mutation_super_t(other.batchMutationSuper); } __isset.block = other.__isset.block; this.block = other.block; } @Override public batch_insert_superColumn_args clone() { return new batch_insert_superColumn_args(this); } public batch_mutation_super_t getBatchMutationSuper() { return this.batchMutationSuper; } public void setBatchMutationSuper(batch_mutation_super_t batchMutationSuper) { this.batchMutationSuper = batchMutationSuper; } public void unsetBatchMutationSuper() { this.batchMutationSuper = null; } // Returns true if field batchMutationSuper is set (has been asigned a value) and false otherwise public boolean isSetBatchMutationSuper() { return this.batchMutationSuper != null; } public void setBatchMutationSuperIsSet(boolean value) { if (!value) { this.batchMutationSuper = null; } } public boolean isBlock() { return this.block; } public void setBlock(boolean block) { this.block = block; this.__isset.block = true; } public void unsetBlock() { this.__isset.block = false; } // Returns true if field block is set (has been asigned a value) and false otherwise public boolean isSetBlock() { return this.__isset.block; } public void setBlockIsSet(boolean value) { this.__isset.block = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case BATCHMUTATIONSUPER: if (value == null) { unsetBatchMutationSuper(); } else { setBatchMutationSuper((batch_mutation_super_t)value); } break; case BLOCK: if (value == null) { unsetBlock(); } else { setBlock((Boolean)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case BATCHMUTATIONSUPER: return getBatchMutationSuper(); case BLOCK: return new Boolean(isBlock()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case BATCHMUTATIONSUPER: return isSetBatchMutationSuper(); case BLOCK: return isSetBlock(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batch_insert_superColumn_args) return this.equals((batch_insert_superColumn_args)that); return false; } public boolean equals(batch_insert_superColumn_args that) { if (that == null) return false; boolean this_present_batchMutationSuper = true && this.isSetBatchMutationSuper(); boolean that_present_batchMutationSuper = true && that.isSetBatchMutationSuper(); if (this_present_batchMutationSuper || that_present_batchMutationSuper) { if (!(this_present_batchMutationSuper && that_present_batchMutationSuper)) return false; if (!this.batchMutationSuper.equals(that.batchMutationSuper)) return false; } boolean this_present_block = true; boolean that_present_block = true; if (this_present_block || that_present_block) { if (!(this_present_block && that_present_block)) return false; if (this.block != that.block) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case BATCHMUTATIONSUPER: if (field.type == TType.STRUCT) { this.batchMutationSuper = new batch_mutation_super_t(); this.batchMutationSuper.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case BLOCK: if (field.type == TType.BOOL) { this.block = iprot.readBool(); this.__isset.block = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.batchMutationSuper != null) { oprot.writeFieldBegin(BATCH_MUTATION_SUPER_FIELD_DESC); this.batchMutationSuper.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(BLOCK_FIELD_DESC); oprot.writeBool(this.block); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_superColumn_args("); boolean first = true; sb.append("batchMutationSuper:"); if (this.batchMutationSuper == null) { sb.append("null"); } else { sb.append(this.batchMutationSuper); } first = false; if (!first) sb.append(", "); sb.append("block:"); sb.append(this.block); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class batch_insert_superColumn_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("batch_insert_superColumn_result"); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); private static final TField UE_FIELD_DESC = new TField("ue", TType.STRUCT, (short)2); public InvalidRequestException ire; public static final int IRE = 1; public UnavailableException ue; public static final int UE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(batch_insert_superColumn_result.class, metaDataMap); } public batch_insert_superColumn_result() { } public batch_insert_superColumn_result( InvalidRequestException ire, UnavailableException ue) { this(); this.ire = ire; this.ue = ue; } /** * Performs a deep copy on <i>other</i>. */ public batch_insert_superColumn_result(batch_insert_superColumn_result other) { if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } if (other.isSetUe()) { this.ue = new UnavailableException(other.ue); } } @Override public batch_insert_superColumn_result clone() { return new batch_insert_superColumn_result(this); } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public UnavailableException getUe() { return this.ue; } public void setUe(UnavailableException ue) { this.ue = ue; } public void unsetUe() { this.ue = null; } // Returns true if field ue is set (has been asigned a value) and false otherwise public boolean isSetUe() { return this.ue != null; } public void setUeIsSet(boolean value) { if (!value) { this.ue = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; case UE: if (value == null) { unsetUe(); } else { setUe((UnavailableException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case IRE: return getIre(); case UE: return getUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case IRE: return isSetIre(); case UE: return isSetUe(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batch_insert_superColumn_result) return this.equals((batch_insert_superColumn_result)that); return false; } public boolean equals(batch_insert_superColumn_result that) { if (that == null) return false; boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } boolean this_present_ue = true && this.isSetUe(); boolean that_present_ue = true && that.isSetUe(); if (this_present_ue || that_present_ue) { if (!(this_present_ue && that_present_ue)) return false; if (!this.ue.equals(that.ue)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case UE: if (field.type == TType.STRUCT) { this.ue = new UnavailableException(); this.ue.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetUe()) { oprot.writeFieldBegin(UE_FIELD_DESC); this.ue.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_superColumn_result("); boolean first = true; sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; if (!first) sb.append(", "); sb.append("ue:"); if (this.ue == null) { sb.append("null"); } else { sb.append(this.ue); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class touch_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("touch_args"); private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)1); private static final TField F_DATA_FIELD_DESC = new TField("fData", TType.BOOL, (short)2); public String key; public static final int KEY = 1; public boolean fData; public static final int FDATA = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean fData = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(FDATA, new FieldMetaData("fData", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); }}); static { FieldMetaData.addStructMetaDataMap(touch_args.class, metaDataMap); } public touch_args() { } public touch_args( String key, boolean fData) { this(); this.key = key; this.fData = fData; this.__isset.fData = true; } /** * Performs a deep copy on <i>other</i>. */ public touch_args(touch_args other) { if (other.isSetKey()) { this.key = other.key; } __isset.fData = other.__isset.fData; this.fData = other.fData; } @Override public touch_args clone() { return new touch_args(this); } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public void unsetKey() { this.key = null; } // Returns true if field key is set (has been asigned a value) and false otherwise public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public boolean isFData() { return this.fData; } public void setFData(boolean fData) { this.fData = fData; this.__isset.fData = true; } public void unsetFData() { this.__isset.fData = false; } // Returns true if field fData is set (has been asigned a value) and false otherwise public boolean isSetFData() { return this.__isset.fData; } public void setFDataIsSet(boolean value) { this.__isset.fData = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case FDATA: if (value == null) { unsetFData(); } else { setFData((Boolean)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case KEY: return getKey(); case FDATA: return new Boolean(isFData()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case KEY: return isSetKey(); case FDATA: return isSetFData(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof touch_args) return this.equals((touch_args)that); return false; } public boolean equals(touch_args that) { if (that == null) return false; boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_fData = true; boolean that_present_fData = true; if (this_present_fData || that_present_fData) { if (!(this_present_fData && that_present_fData)) return false; if (this.fData != that.fData) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case FDATA: if (field.type == TType.BOOL) { this.fData = iprot.readBool(); this.__isset.fData = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } oprot.writeFieldBegin(F_DATA_FIELD_DESC); oprot.writeBool(this.fData); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("touch_args("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("fData:"); sb.append(this.fData); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_key_range_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_key_range_args"); private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)1); private static final TField START_WITH_FIELD_DESC = new TField("startWith", TType.STRING, (short)2); private static final TField STOP_AT_FIELD_DESC = new TField("stopAt", TType.STRING, (short)3); private static final TField MAX_RESULTS_FIELD_DESC = new TField("maxResults", TType.I32, (short)4); public String tablename; public static final int TABLENAME = 1; public String startWith; public static final int STARTWITH = 2; public String stopAt; public static final int STOPAT = 3; public int maxResults; public static final int MAXRESULTS = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { public boolean maxResults = false; } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(STARTWITH, new FieldMetaData("startWith", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(STOPAT, new FieldMetaData("stopAt", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(MAXRESULTS, new FieldMetaData("maxResults", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); }}); static { FieldMetaData.addStructMetaDataMap(get_key_range_args.class, metaDataMap); } public get_key_range_args() { this.startWith = ""; this.stopAt = ""; this.maxResults = 1000; } public get_key_range_args( String tablename, String startWith, String stopAt, int maxResults) { this(); this.tablename = tablename; this.startWith = startWith; this.stopAt = stopAt; this.maxResults = maxResults; this.__isset.maxResults = true; } /** * Performs a deep copy on <i>other</i>. */ public get_key_range_args(get_key_range_args other) { if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetStartWith()) { this.startWith = other.startWith; } if (other.isSetStopAt()) { this.stopAt = other.stopAt; } __isset.maxResults = other.__isset.maxResults; this.maxResults = other.maxResults; } @Override public get_key_range_args clone() { return new get_key_range_args(this); } public String getTablename() { return this.tablename; } public void setTablename(String tablename) { this.tablename = tablename; } public void unsetTablename() { this.tablename = null; } // Returns true if field tablename is set (has been asigned a value) and false otherwise public boolean isSetTablename() { return this.tablename != null; } public void setTablenameIsSet(boolean value) { if (!value) { this.tablename = null; } } public String getStartWith() { return this.startWith; } public void setStartWith(String startWith) { this.startWith = startWith; } public void unsetStartWith() { this.startWith = null; } // Returns true if field startWith is set (has been asigned a value) and false otherwise public boolean isSetStartWith() { return this.startWith != null; } public void setStartWithIsSet(boolean value) { if (!value) { this.startWith = null; } } public String getStopAt() { return this.stopAt; } public void setStopAt(String stopAt) { this.stopAt = stopAt; } public void unsetStopAt() { this.stopAt = null; } // Returns true if field stopAt is set (has been asigned a value) and false otherwise public boolean isSetStopAt() { return this.stopAt != null; } public void setStopAtIsSet(boolean value) { if (!value) { this.stopAt = null; } } public int getMaxResults() { return this.maxResults; } public void setMaxResults(int maxResults) { this.maxResults = maxResults; this.__isset.maxResults = true; } public void unsetMaxResults() { this.__isset.maxResults = false; } // Returns true if field maxResults is set (has been asigned a value) and false otherwise public boolean isSetMaxResults() { return this.__isset.maxResults; } public void setMaxResultsIsSet(boolean value) { this.__isset.maxResults = value; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTablename(); } else { setTablename((String)value); } break; case STARTWITH: if (value == null) { unsetStartWith(); } else { setStartWith((String)value); } break; case STOPAT: if (value == null) { unsetStopAt(); } else { setStopAt((String)value); } break; case MAXRESULTS: if (value == null) { unsetMaxResults(); } else { setMaxResults((Integer)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTablename(); case STARTWITH: return getStartWith(); case STOPAT: return getStopAt(); case MAXRESULTS: return new Integer(getMaxResults()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTablename(); case STARTWITH: return isSetStartWith(); case STOPAT: return isSetStopAt(); case MAXRESULTS: return isSetMaxResults(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_key_range_args) return this.equals((get_key_range_args)that); return false; } public boolean equals(get_key_range_args that) { if (that == null) return false; boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_startWith = true && this.isSetStartWith(); boolean that_present_startWith = true && that.isSetStartWith(); if (this_present_startWith || that_present_startWith) { if (!(this_present_startWith && that_present_startWith)) return false; if (!this.startWith.equals(that.startWith)) return false; } boolean this_present_stopAt = true && this.isSetStopAt(); boolean that_present_stopAt = true && that.isSetStopAt(); if (this_present_stopAt || that_present_stopAt) { if (!(this_present_stopAt && that_present_stopAt)) return false; if (!this.stopAt.equals(that.stopAt)) return false; } boolean this_present_maxResults = true; boolean that_present_maxResults = true; if (this_present_maxResults || that_present_maxResults) { if (!(this_present_maxResults && that_present_maxResults)) return false; if (this.maxResults != that.maxResults) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case STARTWITH: if (field.type == TType.STRING) { this.startWith = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case STOPAT: if (field.type == TType.STRING) { this.stopAt = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case MAXRESULTS: if (field.type == TType.I32) { this.maxResults = iprot.readI32(); this.__isset.maxResults = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.startWith != null) { oprot.writeFieldBegin(START_WITH_FIELD_DESC); oprot.writeString(this.startWith); oprot.writeFieldEnd(); } if (this.stopAt != null) { oprot.writeFieldBegin(STOP_AT_FIELD_DESC); oprot.writeString(this.stopAt); oprot.writeFieldEnd(); } oprot.writeFieldBegin(MAX_RESULTS_FIELD_DESC); oprot.writeI32(this.maxResults); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_key_range_args("); boolean first = true; sb.append("tablename:"); if (this.tablename == null) { sb.append("null"); } else { sb.append(this.tablename); } first = false; if (!first) sb.append(", "); sb.append("startWith:"); if (this.startWith == null) { sb.append("null"); } else { sb.append(this.startWith); } first = false; if (!first) sb.append(", "); sb.append("stopAt:"); if (this.stopAt == null) { sb.append("null"); } else { sb.append(this.stopAt); } first = false; if (!first) sb.append(", "); sb.append("maxResults:"); sb.append(this.maxResults); first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class get_key_range_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_key_range_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1); public List<String> success; public static final int SUCCESS = 0; public InvalidRequestException ire; public static final int IRE = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { FieldMetaData.addStructMetaDataMap(get_key_range_result.class, metaDataMap); } public get_key_range_result() { } public get_key_range_result( List<String> success, InvalidRequestException ire) { this(); this.success = success; this.ire = ire; } /** * Performs a deep copy on <i>other</i>. */ public get_key_range_result(get_key_range_result other) { if (other.isSetSuccess()) { List<String> __this__success = new ArrayList<String>(); for (String other_element : other.success) { __this__success.add(other_element); } this.success = __this__success; } if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); } } @Override public get_key_range_result clone() { return new get_key_range_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<String> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(String elem) { if (this.success == null) { this.success = new ArrayList<String>(); } this.success.add(elem); } public List<String> getSuccess() { return this.success; } public void setSuccess(List<String> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidRequestException getIre() { return this.ire; } public void setIre(InvalidRequestException ire) { this.ire = ire; } public void unsetIre() { this.ire = null; } // Returns true if field ire is set (has been asigned a value) and false otherwise public boolean isSetIre() { return this.ire != null; } public void setIreIsSet(boolean value) { if (!value) { this.ire = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<String>)value); } break; case IRE: if (value == null) { unsetIre(); } else { setIre((InvalidRequestException)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); case IRE: return getIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); case IRE: return isSetIre(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_key_range_result) return this.equals((get_key_range_result)that); return false; } public boolean equals(get_key_range_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ire = true && this.isSetIre(); boolean that_present_ire = true && that.isSetIre(); if (this_present_ire || that_present_ire) { if (!(this_present_ire && that_present_ire)) return false; if (!this.ire.equals(that.ire)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list63 = iprot.readListBegin(); this.success = new ArrayList<String>(_list63.size); for (int _i64 = 0; _i64 < _list63.size; ++_i64) { String _elem65; _elem65 = iprot.readString(); this.success.add(_elem65); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case IRE: if (field.type == TType.STRUCT) { this.ire = new InvalidRequestException(); this.ire.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); for (String _iter66 : this.success) { oprot.writeString(_iter66); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } else if (this.isSetIre()) { oprot.writeFieldBegin(IRE_FIELD_DESC); this.ire.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_key_range_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ire:"); if (this.ire == null) { sb.append("null"); } else { sb.append(this.ire); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class getStringProperty_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getStringProperty_args"); private static final TField PROPERTY_NAME_FIELD_DESC = new TField("propertyName", TType.STRING, (short)1); public String propertyName; public static final int PROPERTYNAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(PROPERTYNAME, new FieldMetaData("propertyName", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(getStringProperty_args.class, metaDataMap); } public getStringProperty_args() { } public getStringProperty_args( String propertyName) { this(); this.propertyName = propertyName; } /** * Performs a deep copy on <i>other</i>. */ public getStringProperty_args(getStringProperty_args other) { if (other.isSetPropertyName()) { this.propertyName = other.propertyName; } } @Override public getStringProperty_args clone() { return new getStringProperty_args(this); } public String getPropertyName() { return this.propertyName; } public void setPropertyName(String propertyName) { this.propertyName = propertyName; } public void unsetPropertyName() { this.propertyName = null; } // Returns true if field propertyName is set (has been asigned a value) and false otherwise public boolean isSetPropertyName() { return this.propertyName != null; } public void setPropertyNameIsSet(boolean value) { if (!value) { this.propertyName = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case PROPERTYNAME: if (value == null) { unsetPropertyName(); } else { setPropertyName((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case PROPERTYNAME: return getPropertyName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case PROPERTYNAME: return isSetPropertyName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStringProperty_args) return this.equals((getStringProperty_args)that); return false; } public boolean equals(getStringProperty_args that) { if (that == null) return false; boolean this_present_propertyName = true && this.isSetPropertyName(); boolean that_present_propertyName = true && that.isSetPropertyName(); if (this_present_propertyName || that_present_propertyName) { if (!(this_present_propertyName && that_present_propertyName)) return false; if (!this.propertyName.equals(that.propertyName)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case PROPERTYNAME: if (field.type == TType.STRING) { this.propertyName = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.propertyName != null) { oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC); oprot.writeString(this.propertyName); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStringProperty_args("); boolean first = true; sb.append("propertyName:"); if (this.propertyName == null) { sb.append("null"); } else { sb.append(this.propertyName); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class getStringProperty_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getStringProperty_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); public String success; public static final int SUCCESS = 0; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(getStringProperty_result.class, metaDataMap); } public getStringProperty_result() { } public getStringProperty_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getStringProperty_result(getStringProperty_result other) { if (other.isSetSuccess()) { this.success = other.success; } } @Override public getStringProperty_result clone() { return new getStringProperty_result(this); } public String getSuccess() { return this.success; } public void setSuccess(String success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStringProperty_result) return this.equals((getStringProperty_result)that); return false; } public boolean equals(getStringProperty_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.STRING) { this.success = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(this.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStringProperty_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class getStringListProperty_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getStringListProperty_args"); private static final TField PROPERTY_NAME_FIELD_DESC = new TField("propertyName", TType.STRING, (short)1); public String propertyName; public static final int PROPERTYNAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(PROPERTYNAME, new FieldMetaData("propertyName", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(getStringListProperty_args.class, metaDataMap); } public getStringListProperty_args() { } public getStringListProperty_args( String propertyName) { this(); this.propertyName = propertyName; } /** * Performs a deep copy on <i>other</i>. */ public getStringListProperty_args(getStringListProperty_args other) { if (other.isSetPropertyName()) { this.propertyName = other.propertyName; } } @Override public getStringListProperty_args clone() { return new getStringListProperty_args(this); } public String getPropertyName() { return this.propertyName; } public void setPropertyName(String propertyName) { this.propertyName = propertyName; } public void unsetPropertyName() { this.propertyName = null; } // Returns true if field propertyName is set (has been asigned a value) and false otherwise public boolean isSetPropertyName() { return this.propertyName != null; } public void setPropertyNameIsSet(boolean value) { if (!value) { this.propertyName = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case PROPERTYNAME: if (value == null) { unsetPropertyName(); } else { setPropertyName((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case PROPERTYNAME: return getPropertyName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case PROPERTYNAME: return isSetPropertyName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStringListProperty_args) return this.equals((getStringListProperty_args)that); return false; } public boolean equals(getStringListProperty_args that) { if (that == null) return false; boolean this_present_propertyName = true && this.isSetPropertyName(); boolean that_present_propertyName = true && that.isSetPropertyName(); if (this_present_propertyName || that_present_propertyName) { if (!(this_present_propertyName && that_present_propertyName)) return false; if (!this.propertyName.equals(that.propertyName)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case PROPERTYNAME: if (field.type == TType.STRING) { this.propertyName = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.propertyName != null) { oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC); oprot.writeString(this.propertyName); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStringListProperty_args("); boolean first = true; sb.append("propertyName:"); if (this.propertyName == null) { sb.append("null"); } else { sb.append(this.propertyName); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class getStringListProperty_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("getStringListProperty_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); public List<String> success; public static final int SUCCESS = 0; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); }}); static { FieldMetaData.addStructMetaDataMap(getStringListProperty_result.class, metaDataMap); } public getStringListProperty_result() { } public getStringListProperty_result( List<String> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getStringListProperty_result(getStringListProperty_result other) { if (other.isSetSuccess()) { List<String> __this__success = new ArrayList<String>(); for (String other_element : other.success) { __this__success.add(other_element); } this.success = __this__success; } } @Override public getStringListProperty_result clone() { return new getStringListProperty_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<String> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(String elem) { if (this.success == null) { this.success = new ArrayList<String>(); } this.success.add(elem); } public List<String> getSuccess() { return this.success; } public void setSuccess(List<String> success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<String>)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStringListProperty_result) return this.equals((getStringListProperty_result)that); return false; } public boolean equals(getStringListProperty_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.LIST) { { TList _list67 = iprot.readListBegin(); this.success = new ArrayList<String>(_list67.size); for (int _i68 = 0; _i68 < _list67.size; ++_i68) { String _elem69; _elem69 = iprot.readString(); this.success.add(_elem69); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); for (String _iter70 : this.success) { oprot.writeString(_iter70); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStringListProperty_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class describeTable_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("describeTable_args"); private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)1); public String tableName; public static final int TABLENAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(TABLENAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(describeTable_args.class, metaDataMap); } public describeTable_args() { } public describeTable_args( String tableName) { this(); this.tableName = tableName; } /** * Performs a deep copy on <i>other</i>. */ public describeTable_args(describeTable_args other) { if (other.isSetTableName()) { this.tableName = other.tableName; } } @Override public describeTable_args clone() { return new describeTable_args(this); } public String getTableName() { return this.tableName; } public void setTableName(String tableName) { this.tableName = tableName; } public void unsetTableName() { this.tableName = null; } // Returns true if field tableName is set (has been asigned a value) and false otherwise public boolean isSetTableName() { return this.tableName != null; } public void setTableNameIsSet(boolean value) { if (!value) { this.tableName = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: if (value == null) { unsetTableName(); } else { setTableName((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case TABLENAME: return getTableName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case TABLENAME: return isSetTableName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof describeTable_args) return this.equals((describeTable_args)that); return false; } public boolean equals(describeTable_args that) { if (that == null) return false; boolean this_present_tableName = true && this.isSetTableName(); boolean that_present_tableName = true && that.isSetTableName(); if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) return false; if (!this.tableName.equals(that.tableName)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case TABLENAME: if (field.type == TType.STRING) { this.tableName = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.tableName != null) { oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); oprot.writeString(this.tableName); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("describeTable_args("); boolean first = true; sb.append("tableName:"); if (this.tableName == null) { sb.append("null"); } else { sb.append(this.tableName); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class describeTable_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("describeTable_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); public String success; public static final int SUCCESS = 0; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(describeTable_result.class, metaDataMap); } public describeTable_result() { } public describeTable_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public describeTable_result(describeTable_result other) { if (other.isSetSuccess()) { this.success = other.success; } } @Override public describeTable_result clone() { return new describeTable_result(this); } public String getSuccess() { return this.success; } public void setSuccess(String success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof describeTable_result) return this.equals((describeTable_result)that); return false; } public boolean equals(describeTable_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.STRING) { this.success = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(this.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("describeTable_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class executeQuery_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("executeQuery_args"); private static final TField QUERY_FIELD_DESC = new TField("query", TType.STRING, (short)1); public String query; public static final int QUERY = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(QUERY, new FieldMetaData("query", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(executeQuery_args.class, metaDataMap); } public executeQuery_args() { } public executeQuery_args( String query) { this(); this.query = query; } /** * Performs a deep copy on <i>other</i>. */ public executeQuery_args(executeQuery_args other) { if (other.isSetQuery()) { this.query = other.query; } } @Override public executeQuery_args clone() { return new executeQuery_args(this); } public String getQuery() { return this.query; } public void setQuery(String query) { this.query = query; } public void unsetQuery() { this.query = null; } // Returns true if field query is set (has been asigned a value) and false otherwise public boolean isSetQuery() { return this.query != null; } public void setQueryIsSet(boolean value) { if (!value) { this.query = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case QUERY: if (value == null) { unsetQuery(); } else { setQuery((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case QUERY: return getQuery(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case QUERY: return isSetQuery(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof executeQuery_args) return this.equals((executeQuery_args)that); return false; } public boolean equals(executeQuery_args that) { if (that == null) return false; boolean this_present_query = true && this.isSetQuery(); boolean that_present_query = true && that.isSetQuery(); if (this_present_query || that_present_query) { if (!(this_present_query && that_present_query)) return false; if (!this.query.equals(that.query)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case QUERY: if (field.type == TType.STRING) { this.query = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.query != null) { oprot.writeFieldBegin(QUERY_FIELD_DESC); oprot.writeString(this.query); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("executeQuery_args("); boolean first = true; sb.append("query:"); if (this.query == null) { sb.append("null"); } else { sb.append(this.query); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } public static class executeQuery_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("executeQuery_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); public CqlResult_t success; public static final int SUCCESS = 0; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, CqlResult_t.class))); }}); static { FieldMetaData.addStructMetaDataMap(executeQuery_result.class, metaDataMap); } public executeQuery_result() { } public executeQuery_result( CqlResult_t success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public executeQuery_result(executeQuery_result other) { if (other.isSetSuccess()) { this.success = new CqlResult_t(other.success); } } @Override public executeQuery_result clone() { return new executeQuery_result(this); } public CqlResult_t getSuccess() { return this.success; } public void setSuccess(CqlResult_t success) { this.success = success; } public void unsetSuccess() { this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((CqlResult_t)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: return getSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SUCCESS: return isSetSuccess(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof executeQuery_result) return this.equals((executeQuery_result)that); return false; } public boolean equals(executeQuery_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case SUCCESS: if (field.type == TType.STRUCT) { this.success = new CqlResult_t(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("executeQuery_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } } }
0cd81388f3871aae8263deb03a5073a0e4fcb65e
280dc43491bb296fe84f0583e4cd0c1fba1dd4ba
/myweight/Activity/MainActivity.java
26d98c1ae438366c499719653316ecca51176b6d
[]
no_license
HitoshiMatsuda/Weight
32504879b734da94e4c94b5145623a53d3c0c3a1
761fbac187d22a3f42d0b8f075c4b3338fdc114e
refs/heads/main
2023-03-06T07:00:40.056143
2021-02-10T13:32:47
2021-02-10T13:32:47
328,344,740
0
0
null
null
null
null
UTF-8
Java
false
false
5,712
java
package jp.co.futureantiques.myweight.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import com.github.mikephil.charting.components.XAxis; import com.github.mikephil.charting.components.YAxis; import jp.co.futureantiques.myweight.Chart.ChartManager; import jp.co.futureantiques.myweight.Database.DBManager; import jp.co.futureantiques.myweight.R; public class MainActivity extends AbstractWeightBaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override protected void onResume() { super.onResume(); setContentView(R.layout.activity_main); toolbar = findViewById(R.id.MenuBar); setSupportActionBar(toolbar); homeButton = findViewById(R.id.home); mDBManager = new DBManager(MainActivity.this); mId = findViewById(R.id.id_Text); mWeight = findViewById(R.id.weight_Text); mFat = findViewById(R.id.fat_Text); //グラフ部分設計 chartManager = new ChartManager(); //ホームボタン homeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, MainActivity.class); startActivity(intent); } }); //登録 Button registerButton = findViewById(R.id.register_Button); registerButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i("InsertButton", "登録ボタンが押されました"); //EditTextに入力された値を変数へ格納する weight = mWeight.getText().toString(); fat = mFat.getText().toString(); //DataBaseManagerクラスのinsertメソッドを使用してDBへ保存 mDBManager.insert(weight, fat); } }); //更新処理 Button upDataButton = findViewById(R.id.read_Button); upDataButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mDBManager = new DBManager(MainActivity.this); iId = Integer.parseInt(mId.getText().toString()); iWeight = Integer.parseInt(mWeight.getText().toString()); iFat = Integer.parseInt(mFat.getText().toString()); mDBManager.UpData(iId, iWeight, iFat); } }); //体重と体脂肪を取り出す wBox = mDBManager.wSelect(); fBox = mDBManager.fSelect(); Log.i("wfBox_Insert", "wBox,fBoxへ取り込みました。"); //LineSetへ格納 lineData = chartManager.setData(wBox, fBox); //折れ線グラフを紐付けする mChart = findViewById(R.id.lineChartExample1); //グラフの背景色 mChart.setDrawGridBackground(true); //グラフの説明テキスト表示を許可 mChart.getDescription().setEnabled(true); //グラフの説明テキスト(アプリ名など) mChart.getDescription().setText(getResources().getString(R.string.app_name)); //X軸の設定 XAxis xAxis = mChart.getXAxis(); //X軸のラベルの傾き指定 xAxis.setLabelRotationAngle(45f); //X軸のMAX,min //X軸に同時に表示できるデータの数 //10個まで同時に表示可能と設定する xAxis.setAxisMaximum(60f); xAxis.setAxisMinimum(0f); //DBへ登録した年月日をX軸へ追加 //同じ日に複数登録した場合は? //xAxis.setValueFormatter(new IndexAxisValueFormatter(getDate())); //X軸を破線にする xAxis.enableAxisLineDashedLine(5f, 5f, 1f); xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); //Y軸の設定 YAxis yAxis = mChart.getAxisLeft(); //Y軸のMAX,min yAxis.setAxisMaximum(120f); yAxis.setAxisMinimum(0f); //Y軸を破線にする yAxis.enableAxisLineDashedLine(5f, 5f, 1f); yAxis.setDrawZeroLine(true); //グラフの右側に目盛りが不要であれば"false" mChart.getAxisRight().setEnabled(false); mChart.animateX(1500); //グラフをスクロール可能にする mChart.setVisibleXRangeMaximum(10f); mChart.setData(lineData); //グラフの表示 mChart.invalidate(); Log.i("Chart", "グラフが表示されます。"); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_icon: Log.i("add_icon_buttonP", "AddIconが選択されました。"); Intent intent0 = new Intent(MainActivity.this, SecondActivity.class); startActivity(intent0); return true; case R.id.dash_icon: Log.i("add_icon_buttonP", "AddIconが選択されました。"); Intent intent1 = new Intent(MainActivity.this, ThirdActivity.class); startActivity(intent1); return true; default: return super.onOptionsItemSelected(item); } } }
1a2ef3fd6ccbdd5ffdeec3f1de9a41cc98f4c29e
7d5c871f8c9ccd85aaf60eed4b120a367a825bab
/src/DSRSNetwork.java
abfef19c4f3fa544703deaea64ebc8624a3e84f9
[]
no_license
David-Xia0/DroneNetworkPathFinder
def5e475d3418987b99354a118d53fff6ec7e247
cf00d06656d04cce368c36ed617b7525b9950c63
refs/heads/master
2022-12-02T18:00:54.018626
2020-08-22T01:57:18
2020-08-22T01:57:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,617
java
import java.io.*; import java.util.*; import java.net.*; public class DSRSNetwork { //Name of this drone private static final String name = "Relay1"; private static final int localPort = 10120; public static void main(String args[]) { System.out.println("Starting ping process #1"); List<String[]> clients = readCSV(); System.out.println("Reading client list: starting"); System.out.format("Reading client list: finished - %d clients read%n", clients.size()); System.out.println("Pinging all clients: starting"); List<Integer> pingData = pingDrones(clients); System.out.println("Pinging all clients: finished - "+pingData.size()+" clients pinged"); writeCSV(pingData,clients); System.out.println("Writing client list: started"); System.out.println("Writing client list: finished - "+pingData.size()+" clients written"); System.out.println("Ping Process #1 finished"); socketListen(); } public static void sendUpdate(String[] changes, List<String[]> clients) { if(changes==null) { System.out.println("Skipping DV update send"); return; } System.out.println("Sending updated DVs"); //goes through all neighbors and checks if they are relays for(String[] client : clients) { if(client[1].equals("Relay") && !client[3].equals("-1")) { try { System.out.print("- Sending to "+client[0]); String[] ipAddress = client[2].split(":"); Socket socket = new Socket(ipAddress[0], Integer.parseInt(ipAddress[1])); DataInputStream dataIn = new DataInputStream(socket.getInputStream()); DataOutputStream dataOut = new DataOutputStream(socket.getOutputStream()); dataOut.writeUTF("UPDATE:"+name+":"+changes[0]+":"+changes[1]+"\n"); dataOut.flush(); String msg = ""; while(!msg.equals("ACK\n")){ msg = dataIn.readUTF(); if(msg.equals("NAK\n")){ System.out.println("...could not ping"); break; } } dataOut.close(); dataIn.close(); socket.close(); System.out.println("...done"); } catch (IOException e) { System.out.println("...could not ping"); } } } } /** * * @param socket * @return * @throws IOException */ public static String[] handleUpdateRecieve(Socket socket) throws IOException { DataInputStream dataIn = new DataInputStream(socket.getInputStream()); DataOutputStream dataOut = new DataOutputStream(socket.getOutputStream()); String[] msg = new String[0]; while (msg.length!=4) { msg = dataIn.readUTF().split(":"); if(msg.length==4) { if(msg[0].equals("UPDATE")) { dataOut.writeUTF("ACK\n"); dataOut.flush(); }else { dataIn.close(); dataOut.close(); socket.close(); return new String[0]; } } } dataIn.close(); dataOut.close(); socket.close(); return msg; } /** * */ public static void socketListen() { List<String[]> clients = readCSV(); ForwardingTable ft = new ForwardingTable(clients); while(true) { try { ServerSocket serverSocket = new ServerSocket(localPort); Socket socket = serverSocket.accept(); System.out.println("New DVs received"); String[] update = handleUpdateRecieve(socket); //ft.insertDvUpdate(update); //ft.fullUpdate(); //Full Dijkstra's implementation ft.newUpdate(ft.insertDvUpdate(update), update[1]); //ft.printTable(); //used for testing ft.writeTable(); sendUpdate(ft.getUpdate(), clients); System.out.println("DV update calculation finished"); socket.close(); serverSocket.close(); } catch (IOException e) { e.printStackTrace(); } } } /** This method writes all data into a CSV file "clients-[name].csv" * * @param pingData contains time taken for each response ACK ping * @param clients contains previous data about each drone */ public static void writeCSV(List<Integer> pingData, List<String[]> clients ) { File file = new File("clients-"+name+".csv"); try { PrintWriter pw = new PrintWriter(file); Iterator<Integer> data = pingData.iterator(); //prints each set of client drone data into a line seperated by commas for(String[] client : clients) { pw.println(client[0]+","+client[1]+","+client[2]+","+data.next()); } pw.close(); }catch(FileNotFoundException e) { } } //MAYBE CONVERT TO HASHTABLE /** Reads CSV file "clients-[name].csv", data is return as a List<String[]> * * @return */ public static List<String[]> readCSV(){ try { BufferedReader br = new BufferedReader(new FileReader("clients-"+name+".csv")); String line; List<String[]> clients = new ArrayList<String[]>(); while((line = br.readLine()) != null){ String[] data = line.split(","); if(!data[0].equals(name)) { clients.add(data); } } br.close(); return clients; }catch(IOException e) { e.printStackTrace(); } return null; } /** Pings ip addresses read from file * * @param clients file containing all address information of drones * @return */ public static List<Integer> pingDrones(List<String[]> clients){ String ping = "PING\n"; List<Integer> pingCount = new ArrayList<Integer>(); for(String[] client : clients){ System.out.print("- Pinging " + client[0] + "..."); try { String msg = ""; String[] ipAddress = client[2].split(":"); Socket socket = new Socket(ipAddress[0], Integer.parseInt(ipAddress[1])); DataInputStream dataIn = new DataInputStream(socket.getInputStream()); DataOutputStream dataOut = new DataOutputStream(socket.getOutputStream()); long startTime = System.currentTimeMillis(); boolean connected = true; dataOut.writeUTF(ping); dataOut.flush(); //this loop waits until acknowledgement message is recieved while(!msg.equals("ACK\n")){ msg = dataIn.readUTF(); if(msg.equals("NAK\n")){ connected=false; System.out.println("could not ping"); pingCount.add(-1); break; /* }else if(System.currentTimeMillis()-startTime > 5000) { connected=false; System.out.println("connection Timed out after 5s"); pingCount.add(-1); break; */ } } if(connected) { //times how long it took to recieve acknowledgement message long endTime = System.currentTimeMillis(); int time = (int)(endTime-startTime)/1000; System.out.println("ping received after "+time+"s"); pingCount.add(time); } socket.close(); }catch(IOException e) { System.out.println("could not ping"); pingCount.add(-1); } } return pingCount; } }
7b4f5deee34ce76c51ca28be61cee7a68a4dd5dd
ae558ed9d842e64660db8b4d85adad03a42a3f38
/exercises/src/main/java/ch/diso/ex06_String_Processing/Shirt.java
5df08f1e0a0b5096864ab235c5110b840e97182e
[]
no_license
albertoesteva2288/OCP
7c3f0d7c494fc940c8770dbe1c5180987e56a2ac
f62ac6c6016981f2242c2c9a901f6125a4ec3094
refs/heads/master
2020-03-23T15:25:28.184017
2016-11-30T05:26:51
2016-11-30T05:26:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,051
java
package ch.diso.ex06_String_Processing; public class Shirt { private String id = ""; private String description = ""; private String color = ""; private String size = ""; public Shirt(String id, String description, String color, String size) { this.id = id; this.description = description; this.color = color; this.size = size; } public String getId() { return this.id; } public String getDescription() { return description; } public String getColor() { return color; } public String getSize() { return size; } @Override public String toString() { StringBuilder sb = new StringBuilder(256); sb.append("Shirt ID: ").append(this.getId()).append("\n"); sb.append("Description: ").append(this.getDescription()).append("\n"); sb.append("Color: ").append(this.getColor()).append("\n"); sb.append("Size: ").append(this.getSize()).append("\n"); return sb.toString(); } }
4f842370f08f26ed39108f24141c14770212ba44
6ed1954d5b350454512fb671f48bad05092c19e4
/game/herphone/src/main/java/com/globalgame/auto/json/EveryDayVideo_Json.java
4d98d1e4dc22f10a7a663f51bc041bb86792fbdf
[]
no_license
yuzelong620/Buzhayan
5eb9eb81b7a2f500905c9a1ce7b78f2ad809e1af
04de6ebfd90ff0763e694a2fb3d8b95486fc81b0
refs/heads/master
2022-12-01T04:01:04.197792
2019-12-20T09:30:29
2019-12-20T09:30:29
229,233,912
1
1
null
2022-11-24T06:27:26
2019-12-20T09:31:54
Java
UTF-8
Java
false
false
1,084
java
package com.globalgame.auto.json; import java.util.List; import com.mind.core.util.StringIntTuple; import com.mind.core.util.IntDoubleTuple; import com.mind.core.util.IntTuple; import com.mind.core.util.ThreeTuple; import com.mind.core.util.StringFloatTuple; /** *自动生成类 */ public class EveryDayVideo_Json{ /** 编号::*/ private Integer id; /** 第几天::*/ private Integer day; /** 视频地址::*/ private String videoUrl; /** 图片::*/ private String pictrue; /** 编号::*/ public Integer getId(){ return this.id; } /** 第几天::*/ public Integer getDay(){ return this.day; } /** 视频地址::*/ public String getVideoUrl(){ return this.videoUrl; } /** 图片::*/ public String getPictrue(){ return this.pictrue; } /**编号::*/ public void setId(Integer id){ this.id = id; } /**第几天::*/ public void setDay(Integer day){ this.day = day; } /**视频地址::*/ public void setVideoUrl(String videoUrl){ this.videoUrl = videoUrl; } /**图片::*/ public void setPictrue(String pictrue){ this.pictrue = pictrue; } }
93bd1b3fe954b705e0359b36e17811774831faf0
798d1c95a43cbd6637181888b6fa27197034fc66
/PerimeterSquare.java
2ba7665181fe472253af2d0c3f959e1cfd0a89d0
[]
no_license
sonalisikarwar/java-tutorial
b40ab15a6ca71a9c8fd6e9c076be406e358140fe
fa596b2a039b070f29ad404ab61d8dad47ab1217
refs/heads/main
2023-02-07T05:01:02.764588
2020-12-27T18:12:27
2020-12-27T18:12:27
315,644,010
0
0
null
null
null
null
UTF-8
Java
false
false
212
java
public class PerimeterSquare{ public static void main(String[] args) { double s,p; s=10; //side of square; p=s*4; //compute peimeter System.out.println("Perimeter of circle is a " + p); } }
d4bb4ef16f39503ca22979a9c3f9451541f745a4
e46d8e8fd1848a93472d9b8a50335cfc422a87c6
/src/main/java/com/netsuite/webservices/platform/common_2018_1/ChargeSearchBasic.java
e6777fea9d8af1edde781d50f29f434d51f9a119
[]
no_license
djXplosivo/suitetalk-webservices
6d0f1737c52c566fde07eb6e008603b3c271d8d1
bff927f0acb45e772a5944272d0f7d55b87caf2a
refs/heads/master
2020-03-28T02:56:52.772003
2018-09-06T02:52:57
2018-09-06T02:52:57
147,608,548
0
0
null
null
null
null
UTF-8
Java
false
false
21,401
java
package com.netsuite.webservices.platform.common_2018_1; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import com.netsuite.webservices.platform.common_2018_1.types.PostingPeriodDate; import com.netsuite.webservices.platform.core_2018_1.RecordRef; import com.netsuite.webservices.platform.core_2018_1.SearchCustomFieldList; import com.netsuite.webservices.platform.core_2018_1.SearchDateField; import com.netsuite.webservices.platform.core_2018_1.SearchDoubleField; import com.netsuite.webservices.platform.core_2018_1.SearchEnumMultiSelectField; import com.netsuite.webservices.platform.core_2018_1.SearchLongField; import com.netsuite.webservices.platform.core_2018_1.SearchMultiSelectField; import com.netsuite.webservices.platform.core_2018_1.SearchRecordBasic; import com.netsuite.webservices.platform.core_2018_1.SearchStringField; /** * <p>Java class for ChargeSearchBasic complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ChargeSearchBasic"> * &lt;complexContent> * &lt;extension base="{urn:core_2018_1.platform.webservices.netsuite.com}SearchRecordBasic"> * &lt;sequence> * &lt;element name="amount" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchDoubleField" minOccurs="0"/> * &lt;element name="billingAccount" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="billingItem" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="billTo" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="chargeDate" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchDateField" minOccurs="0"/> * &lt;element name="class" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="chargeType" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="createdDate" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchDateField" minOccurs="0"/> * &lt;element name="currency" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="department" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="externalId" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="externalIdString" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchStringField" minOccurs="0"/> * &lt;element name="internalId" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="internalIdNumber" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchLongField" minOccurs="0"/> * &lt;element name="location" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="modifiedDate" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchDateField" minOccurs="0"/> * &lt;element name="postingPeriod" type="{urn:core_2018_1.platform.webservices.netsuite.com}RecordRef" minOccurs="0"/> * &lt;element name="postingPeriodRelative" type="{urn:types.common_2018_1.platform.webservices.netsuite.com}PostingPeriodDate" minOccurs="0"/> * &lt;element name="quantity" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchDoubleField" minOccurs="0"/> * &lt;element name="rate" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchDoubleField" minOccurs="0"/> * &lt;element name="rule" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="runId" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchStringField" minOccurs="0"/> * &lt;element name="salesOrder" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchLongField" minOccurs="0"/> * &lt;element name="stage" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchEnumMultiSelectField" minOccurs="0"/> * &lt;element name="subscriptionLine" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchMultiSelectField" minOccurs="0"/> * &lt;element name="use" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchEnumMultiSelectField" minOccurs="0"/> * &lt;element name="customFieldList" type="{urn:core_2018_1.platform.webservices.netsuite.com}SearchCustomFieldList" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ChargeSearchBasic", propOrder = { "amount", "billingAccount", "billingItem", "billTo", "chargeDate", "clazz", "chargeType", "createdDate", "currency", "department", "externalId", "externalIdString", "internalId", "internalIdNumber", "location", "modifiedDate", "postingPeriod", "postingPeriodRelative", "quantity", "rate", "rule", "runId", "salesOrder", "stage", "subscriptionLine", "use", "customFieldList" }) public class ChargeSearchBasic extends SearchRecordBasic { protected SearchDoubleField amount; protected SearchMultiSelectField billingAccount; protected SearchMultiSelectField billingItem; protected SearchMultiSelectField billTo; protected SearchDateField chargeDate; @XmlElement(name = "class") protected SearchMultiSelectField clazz; protected SearchMultiSelectField chargeType; protected SearchDateField createdDate; protected SearchMultiSelectField currency; protected SearchMultiSelectField department; protected SearchMultiSelectField externalId; protected SearchStringField externalIdString; protected SearchMultiSelectField internalId; protected SearchLongField internalIdNumber; protected SearchMultiSelectField location; protected SearchDateField modifiedDate; protected RecordRef postingPeriod; @XmlSchemaType(name = "string") protected PostingPeriodDate postingPeriodRelative; protected SearchDoubleField quantity; protected SearchDoubleField rate; protected SearchMultiSelectField rule; protected SearchStringField runId; protected SearchLongField salesOrder; protected SearchEnumMultiSelectField stage; protected SearchMultiSelectField subscriptionLine; protected SearchEnumMultiSelectField use; protected SearchCustomFieldList customFieldList; /** * Gets the value of the amount property. * * @return * possible object is * {@link SearchDoubleField } * */ public SearchDoubleField getAmount() { return amount; } /** * Sets the value of the amount property. * * @param value * allowed object is * {@link SearchDoubleField } * */ public void setAmount(SearchDoubleField value) { this.amount = value; } /** * Gets the value of the billingAccount property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getBillingAccount() { return billingAccount; } /** * Sets the value of the billingAccount property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setBillingAccount(SearchMultiSelectField value) { this.billingAccount = value; } /** * Gets the value of the billingItem property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getBillingItem() { return billingItem; } /** * Sets the value of the billingItem property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setBillingItem(SearchMultiSelectField value) { this.billingItem = value; } /** * Gets the value of the billTo property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getBillTo() { return billTo; } /** * Sets the value of the billTo property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setBillTo(SearchMultiSelectField value) { this.billTo = value; } /** * Gets the value of the chargeDate property. * * @return * possible object is * {@link SearchDateField } * */ public SearchDateField getChargeDate() { return chargeDate; } /** * Sets the value of the chargeDate property. * * @param value * allowed object is * {@link SearchDateField } * */ public void setChargeDate(SearchDateField value) { this.chargeDate = value; } /** * Gets the value of the clazz property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getClazz() { return clazz; } /** * Sets the value of the clazz property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setClazz(SearchMultiSelectField value) { this.clazz = value; } /** * Gets the value of the chargeType property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getChargeType() { return chargeType; } /** * Sets the value of the chargeType property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setChargeType(SearchMultiSelectField value) { this.chargeType = value; } /** * Gets the value of the createdDate property. * * @return * possible object is * {@link SearchDateField } * */ public SearchDateField getCreatedDate() { return createdDate; } /** * Sets the value of the createdDate property. * * @param value * allowed object is * {@link SearchDateField } * */ public void setCreatedDate(SearchDateField value) { this.createdDate = value; } /** * Gets the value of the currency property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getCurrency() { return currency; } /** * Sets the value of the currency property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setCurrency(SearchMultiSelectField value) { this.currency = value; } /** * Gets the value of the department property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getDepartment() { return department; } /** * Sets the value of the department property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setDepartment(SearchMultiSelectField value) { this.department = value; } /** * Gets the value of the externalId property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getExternalId() { return externalId; } /** * Sets the value of the externalId property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setExternalId(SearchMultiSelectField value) { this.externalId = value; } /** * Gets the value of the externalIdString property. * * @return * possible object is * {@link SearchStringField } * */ public SearchStringField getExternalIdString() { return externalIdString; } /** * Sets the value of the externalIdString property. * * @param value * allowed object is * {@link SearchStringField } * */ public void setExternalIdString(SearchStringField value) { this.externalIdString = value; } /** * Gets the value of the internalId property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getInternalId() { return internalId; } /** * Sets the value of the internalId property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setInternalId(SearchMultiSelectField value) { this.internalId = value; } /** * Gets the value of the internalIdNumber property. * * @return * possible object is * {@link SearchLongField } * */ public SearchLongField getInternalIdNumber() { return internalIdNumber; } /** * Sets the value of the internalIdNumber property. * * @param value * allowed object is * {@link SearchLongField } * */ public void setInternalIdNumber(SearchLongField value) { this.internalIdNumber = value; } /** * Gets the value of the location property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getLocation() { return location; } /** * Sets the value of the location property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setLocation(SearchMultiSelectField value) { this.location = value; } /** * Gets the value of the modifiedDate property. * * @return * possible object is * {@link SearchDateField } * */ public SearchDateField getModifiedDate() { return modifiedDate; } /** * Sets the value of the modifiedDate property. * * @param value * allowed object is * {@link SearchDateField } * */ public void setModifiedDate(SearchDateField value) { this.modifiedDate = value; } /** * Gets the value of the postingPeriod property. * * @return * possible object is * {@link RecordRef } * */ public RecordRef getPostingPeriod() { return postingPeriod; } /** * Sets the value of the postingPeriod property. * * @param value * allowed object is * {@link RecordRef } * */ public void setPostingPeriod(RecordRef value) { this.postingPeriod = value; } /** * Gets the value of the postingPeriodRelative property. * * @return * possible object is * {@link PostingPeriodDate } * */ public PostingPeriodDate getPostingPeriodRelative() { return postingPeriodRelative; } /** * Sets the value of the postingPeriodRelative property. * * @param value * allowed object is * {@link PostingPeriodDate } * */ public void setPostingPeriodRelative(PostingPeriodDate value) { this.postingPeriodRelative = value; } /** * Gets the value of the quantity property. * * @return * possible object is * {@link SearchDoubleField } * */ public SearchDoubleField getQuantity() { return quantity; } /** * Sets the value of the quantity property. * * @param value * allowed object is * {@link SearchDoubleField } * */ public void setQuantity(SearchDoubleField value) { this.quantity = value; } /** * Gets the value of the rate property. * * @return * possible object is * {@link SearchDoubleField } * */ public SearchDoubleField getRate() { return rate; } /** * Sets the value of the rate property. * * @param value * allowed object is * {@link SearchDoubleField } * */ public void setRate(SearchDoubleField value) { this.rate = value; } /** * Gets the value of the rule property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getRule() { return rule; } /** * Sets the value of the rule property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setRule(SearchMultiSelectField value) { this.rule = value; } /** * Gets the value of the runId property. * * @return * possible object is * {@link SearchStringField } * */ public SearchStringField getRunId() { return runId; } /** * Sets the value of the runId property. * * @param value * allowed object is * {@link SearchStringField } * */ public void setRunId(SearchStringField value) { this.runId = value; } /** * Gets the value of the salesOrder property. * * @return * possible object is * {@link SearchLongField } * */ public SearchLongField getSalesOrder() { return salesOrder; } /** * Sets the value of the salesOrder property. * * @param value * allowed object is * {@link SearchLongField } * */ public void setSalesOrder(SearchLongField value) { this.salesOrder = value; } /** * Gets the value of the stage property. * * @return * possible object is * {@link SearchEnumMultiSelectField } * */ public SearchEnumMultiSelectField getStage() { return stage; } /** * Sets the value of the stage property. * * @param value * allowed object is * {@link SearchEnumMultiSelectField } * */ public void setStage(SearchEnumMultiSelectField value) { this.stage = value; } /** * Gets the value of the subscriptionLine property. * * @return * possible object is * {@link SearchMultiSelectField } * */ public SearchMultiSelectField getSubscriptionLine() { return subscriptionLine; } /** * Sets the value of the subscriptionLine property. * * @param value * allowed object is * {@link SearchMultiSelectField } * */ public void setSubscriptionLine(SearchMultiSelectField value) { this.subscriptionLine = value; } /** * Gets the value of the use property. * * @return * possible object is * {@link SearchEnumMultiSelectField } * */ public SearchEnumMultiSelectField getUse() { return use; } /** * Sets the value of the use property. * * @param value * allowed object is * {@link SearchEnumMultiSelectField } * */ public void setUse(SearchEnumMultiSelectField value) { this.use = value; } /** * Gets the value of the customFieldList property. * * @return * possible object is * {@link SearchCustomFieldList } * */ public SearchCustomFieldList getCustomFieldList() { return customFieldList; } /** * Sets the value of the customFieldList property. * * @param value * allowed object is * {@link SearchCustomFieldList } * */ public void setCustomFieldList(SearchCustomFieldList value) { this.customFieldList = value; } }
2ef70ff3be92d24ced89ecc3a237202a90770dc2
bdaca57107a7ef62b770e62b53f6361f740d6a5d
/XMLTest/src/xml/entity/XMLFacility.java
766373121749b36178ab276e5f0efdb8528e12cb
[]
no_license
rogvold/OrskRestaurant
8ba5c1e194337d7c1e3858a29e4669d54d98a092
04f01be5122d91aa786cfb9c68b5d295829b52f3
refs/heads/master
2020-11-26T16:32:20.216656
2012-09-03T12:21:16
2012-09-03T12:21:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,235
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package xml.entity; import java.util.ArrayList; import java.util.List; /** * * @author rogvold */ public class XMLFacility { private String name; private String phone; private String site; private String description; private String schedule; private String address; private List<XMLFeature> features; private List<String> types; private List<String> images; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getSchedule() { return schedule; } public void setSchedule(String schedule) { this.schedule = schedule; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public List<XMLFeature> getFeatures() { return features; } public void setFeatures(List<XMLFeature> features) { this.features = features; } public List<String> getImages() { return images; } public void setImages(List<String> images) { this.images = images; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getScedule() { return schedule; } public void setScedule(String scedule) { this.schedule = scedule; } public String getSite() { return site; } public void setSite(String site) { this.site = site; } public List<String> getTypes() { return types; } public void setTypes(List<String> types) { this.types = types; } public void trimAllFields() { this.address = this.address.trim(); this.name = this.name.trim(); this.phone = this.phone.trim(); this.site = this.site.trim(); this.schedule = this.schedule.trim(); this.description = this.description.trim(); List<String> imlist = new ArrayList(); for (String s : images) { imlist.add(s.trim()); } images = imlist; List<String> tlist = new ArrayList(); for (String s : types) { tlist.add(s.trim()); } types = tlist; List<XMLFeature> list = new ArrayList(); for (XMLFeature f : features) { f.trimAllFields(); } } @Override public String toString() { String s = ""; s += "name = " + name + "\n" + "address = " + address + "\n" + "site = " + site + "\n" + "phone = " + phone + "\n" + "description = " + description + "\n" + "schedule = " + schedule + "\n" + "images = " + images + "\n" + "types = " + types + "\n" + "features = " + features + "\n"; return s; } }
ac70f3cbf735da887d09c058426f172930a13fc9
cb627dfc8849d3c8c39cbcff4fab73be065b2372
/app/src/main/java/mx/com/cceo/emprezando/Fragment/ImageShowcaseFragment.java
034d7467bf137652b2d57561c69ec2c5b8d1b157
[]
no_license
CCEO/Emprezando
82e5667d26810e8011ce6f51143a7fca4e9905ee
f92a6c6c59a3432fcd4edd00baeb352d09a6429d
refs/heads/master
2021-01-13T01:00:58.053986
2015-12-04T15:42:51
2015-12-04T15:42:51
43,501,438
0
0
null
2015-12-04T15:42:52
2015-10-01T14:34:02
Java
UTF-8
Java
false
false
909
java
package mx.com.cceo.emprezando.Fragment; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import mx.com.cceo.emprezando.R; /** * Created by Hugo on 11/22/2015. */ public class ImageShowcaseFragment extends Fragment { private int id; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //container.removeAllViews(); ViewGroup rootView = (ViewGroup) inflater.inflate( R.layout.fragment_image_showcase, container, false); ImageView image = (ImageView) rootView.findViewById(R.id.item_image_showcase_image); image.setImageResource(id); return rootView; } public void setImageId(int id) { this.id = id; } }
34fa2ce2e9bdb97d7f14d4f93b6b8295670160e6
8cd6d92e8f62a951cdf0333bf08e8b50e3f9c24f
/src/main/java/com/example/demo/Movie.java
badd67f75d5852e2f402e1d34a2cda61ec504d0e
[]
no_license
MalikMbaye/Springboot_14
becd37317c786f4cc30ba6883a314649e748d699
2918ad89f853b684a69ad1b29b10cf04e0772f46
refs/heads/master
2021-08-14T19:56:36.891945
2017-11-16T16:05:48
2017-11-16T16:05:48
110,992,781
0
0
null
null
null
null
UTF-8
Java
false
false
1,067
java
package com.example.demo; import javax.persistence.*; @Entity public class Movie { @Id @GeneratedValue( strategy = GenerationType.AUTO) private long id; private String title; private long year; private String description; @ManyToOne (fetch = FetchType.EAGER) @JoinColumn(name = "director_id") private Director director; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public long getYear() { return year; } public void setYear(long year) { this.year = year; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Director getDirector() { return director; } public void setDirector(Director director) { this.director = director; } }
73a13acac30a32a05d799bfb11252894da600be1
bf3670c3a7a4bce95aa0038f5016777f6e07220b
/processor/src/main/java/com/kish/cloudstream/supplier/ProcessorApplication.java
89c5c0970f3d799912194fb2a03c179f4ffc735c
[]
no_license
ThejKishore/boot-kafka
0c9c8f646379118000a9114171e95433821f34d2
fa344437dbd65610cf8c11e030b44ae8f3e9c915
refs/heads/master
2022-11-05T21:57:57.879596
2020-06-22T03:46:37
2020-06-22T03:46:37
273,991,979
0
0
null
null
null
null
UTF-8
Java
false
false
525
java
package com.kish.cloudstream.supplier; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import java.util.function.Function; @SpringBootApplication public class ProcessorApplication { public static void main(String[] args) { SpringApplication.run(ProcessorApplication.class, args); } @Bean public Function<String,String> test(){ return String::toUpperCase; } }
fb35656d0e082eda21e9f1f0a423a6826500220e
c49d17bc0ea18308455dfa19e0f9560d87d0954f
/thor-communication/src/main/java/com/mob/thor/communication/core/delegation/rmi/RmiCommunicationConnection.java
1bce1319953fb050483597a55f18b118645a4203
[ "Apache-2.0" ]
permissive
MOBX/Thor
4b6ed58ba167bde1a8e4148de4a05268314e86d4
68b650d7ee05efe67dc1fca8dd0194a47d683f72
refs/heads/master
2020-12-31T02:49:31.603273
2016-01-30T12:49:39
2016-01-30T12:49:39
48,224,631
2
0
null
null
null
null
UTF-8
Java
false
false
1,187
java
/* * Copyright 2015-2020 uuzu.com All right reserved. */ package com.mob.thor.communication.core.delegation.rmi; import com.mob.thor.communication.core.CommunicationEndpoint; import com.mob.thor.communication.core.delegation.connection.CommunicationConnection; import com.mob.thor.communication.core.exception.CommunicationException; import com.mob.thor.communication.core.model.CommunicationParam; import com.mob.thor.communication.core.model.Event; /** * 对应rmi的connection实现 * * @author zxc Dec 24, 2015 4:41:14 PM */ public class RmiCommunicationConnection implements CommunicationConnection { private CommunicationEndpoint endpoint; private CommunicationParam params; public RmiCommunicationConnection(CommunicationParam params, CommunicationEndpoint endpoint) { this.params = params; this.endpoint = endpoint; } public void close() throws CommunicationException { // do nothing } public Object call(Event event) { // 调用rmi传递数据到目标server上 return endpoint.acceptEvent(event); } @Override public CommunicationParam getParams() { return params; } }
ddf27789ab3e3f80f053a83f06df908010ec793c
918595e3b4f1db7c9588684924988a3f319e4607
/bit-java01/src/main/java/step11/ex3/Test03.java
1254e5255bea4d6fb1ec7ca1628d6da7ab1c21f0
[]
no_license
eomjinyoung/bigdata3
d849c4a8634a48ae3d30ce5f5ff1ad839195aff9
ef90e729ec42177b8384af06f6b947cc6e117307
refs/heads/master
2021-07-12T22:11:20.989729
2018-01-18T00:45:08
2018-01-18T00:45:08
95,863,374
0
4
null
null
null
null
UTF-8
Java
false
false
785
java
package step11.ex3; public class Test03 { public static void main(String[] args) { // 1) Calculator3 설계도에 따라 메모리를 준비한다. Calculator3 calc = new Calculator3(); // 2) Calculator3 설계도에 정의된 연산자를 사용하여 // Calculator3 설계도에 따라 만든 메모리를 다룬다. calc.plus(10); // 수퍼 클래스 Calculator.plus() calc.plus(20); // 수퍼 클래스 Calculator.plus() calc.minus(7); // 수퍼 클래스 Calculator.minus() calc.multiple(2); // 수퍼 클래스 Calculator2.multiple() calc.divide(3); // 수퍼 클래스 Calculator2.divide() calc.mod(12); // 자신의 메서드 Calculator3.mod() System.out.println(calc.result); } }
7524fc036caf90eff191d3e02f50bd52bccaa854
8cc45b7ea89d8152b8c0f82f3cb97c8e1860d405
/src/test/java/com/searchmodule/tests/SearchTest.java
cd0bb4ab59aa036c7f63928e9f0d2e3702459eba
[]
no_license
wajslicd/selenium-docker
d7673973353b7ba09ce75aa0ea13da5bab8442ef
98f57dce084872ad8f332485be2e361b64375919
refs/heads/master
2020-05-23T21:43:59.570547
2019-05-21T04:51:05
2019-05-21T04:51:05
186,960,705
1
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.searchmodule.tests; import org.testng.Assert; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import com.searchmodules.pages.SearchPage; import com.tests.BaseTest; public class SearchTest extends BaseTest{ @Test @Parameters({"keyword"}) public void search(String keyword) { SearchPage searchPage = new SearchPage(driver); searchPage.goTo(); searchPage.doSearch(keyword); searchPage.goToVideos(); int size = searchPage.getResult(); Assert.assertTrue(size > 0); } }
ad3902b148495f610d6ad4055f69e260e2b85e96
4ed388e3d90f9267f6bbdf8cb06dbc62b58f2fb7
/src/test/java/BaseTest.java
ba06cd71cecfa987b7c002977a0575360a97fda5
[]
no_license
IndiraMB/SeleniumPOM
5c86dd8bb2932154ced9d29f740b79b31a89c3dc
c3d7ab62d80ca8a6a3f1e105c2256a6a6583c936
refs/heads/master
2022-12-31T08:19:31.237964
2020-10-23T20:16:20
2020-10-23T20:16:20
306,424,936
0
0
null
null
null
null
UTF-8
Java
false
false
836
java
import Utilities.ConfigFileReader; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeSuite; import org.testng.annotations.BeforeTest; public class BaseTest extends ConfigFileReader { ConfigFileReader configFileReader = new ConfigFileReader(); public static WebDriver webDriver = new ChromeDriver(); @BeforeSuite public void browserDriver(){ System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+configFileReader.getDriverPath()); } @BeforeTest public void browserLoad(){ webDriver.get(configFileReader.getApplicationURL()); } @AfterTest public void driverClose(){ webDriver.quit(); } }
9216ddd9c0a758c31b6a7746a77045b9deb7cfc2
44641b8aded524b7b203dd1f487cd43774269e3c
/sd-lector-events/src/main/java/ed/cracken/code/servlets/PushHandler.java
ee168913015736f38e3759dd4504f556eeab1f83
[]
no_license
eliudiaz/StripesTest
788c3423dffbefcb186223ca23b947c355175dc4
430f747fa98f3c841528b95917a7f329c6481c97
refs/heads/master
2021-01-11T05:24:28.760802
2017-01-06T14:40:05
2017-01-06T14:40:05
71,803,736
0
1
null
2016-11-02T07:17:02
2016-10-24T15:35:02
Java
UTF-8
Java
false
false
3,586
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ed.cracken.code.servlets; import com.google.gson.Gson; import com.google.gson.stream.JsonReader; import ed.cracken.code.managers.IDsManager; import ed.cracken.code.servlets.dto.Persona; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StringReader; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author eliud */ @WebServlet(name = "PushProcessor", urlPatterns = {"/push"}) public class PushHandler extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8")); String json = ""; StringBuilder sb = new StringBuilder(); while ((json = br.readLine()) != null) { sb.append(json); } br.close(); System.out.println(">> " + sb.toString()); JsonReader reader = new JsonReader(new StringReader(sb.toString())); reader.setLenient(true); Persona persona = new Gson().fromJson(reader, Persona.class); IDsManager idsManager; if ((idsManager = (IDsManager) request.getServletContext().getAttribute("idsmanager")) == null) { idsManager = new IDsManager(); request.getServletContext().setAttribute("idsmanager", idsManager); } idsManager.getIds().put(persona.getSession(), persona); response.setStatus(HttpServletResponse.SC_ACCEPTED); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
b5c44a8b092cfbccbdf10a265995a40da62c853c
7bf7d3a0b09671ce9f9aaef6d3bd7597a5dcf5b1
/app/src/main/java/com/cognizant/flymanager/activity/MainActivity.java
c19a9581531d9a377c6c9ad0a4600a48cd4da979
[]
no_license
dipanjanBot/FlightManager
fae6766d6eacc4a7d8517450ad2ec56283e1379c
8529d96eb8788369952748007a67ca697ec2d119
refs/heads/master
2021-04-06T08:55:41.932314
2018-03-19T11:45:46
2018-03-19T11:45:46
124,369,484
0
0
null
null
null
null
UTF-8
Java
false
false
4,842
java
package com.cognizant.flymanager.activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.cognizant.flymanager.R; import com.cognizant.flymanager.adapter.DrawerItemCustomAdapter; import com.cognizant.flymanager.fragment.BookingFragment; import com.cognizant.flymanager.fragment.FixturesFragment; import com.cognizant.flymanager.fragment.HomePageFragment; import com.cognizant.flymanager.model.DataModel; public class MainActivity extends AppCompatActivity { Toolbar toolbar; android.support.v7.app.ActionBarDrawerToggle mDrawerToggle; private String[] mNavigationDrawerItemTitles; private DrawerLayout mDrawerLayout; private ListView mDrawerList; private CharSequence mDrawerTitle; private CharSequence mTitle; private FragmentManager defaultfragmentManager; private Fragment baseFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTitle = mDrawerTitle = getTitle(); mNavigationDrawerItemTitles= getResources().getStringArray(R.array.navigation_drawer_items_array); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerList = (ListView) findViewById(R.id.left_drawer); setupToolbar(); DataModel[] drawerItem = new DataModel[3]; drawerItem[0] = new DataModel(R.drawable.connect, "Home"); drawerItem[1] = new DataModel(R.drawable.fixtures, "Book a flight"); drawerItem[2] = new DataModel(R.drawable.table, "Flight Status"); getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setHomeButtonEnabled(true); DrawerItemCustomAdapter adapter = new DrawerItemCustomAdapter(this, R.layout.drawer_list_view_item_row, drawerItem); mDrawerList.setAdapter(adapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener()); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerLayout.setDrawerListener(mDrawerToggle); setupDrawerToggle(); defaultfragmentManager = getSupportFragmentManager(); baseFragment = new HomePageFragment(); defaultfragmentManager.beginTransaction().replace(R.id.content_frame, baseFragment).commit(); } private void selectItem(int position) { Fragment fragment = null; switch (position) { case 0: fragment = new HomePageFragment(); break; case 1: fragment = new BookingFragment(); break; case 2: fragment = new FixturesFragment(); break; default: break; } if (fragment != null) { defaultfragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit(); mDrawerList.setItemChecked(position, true); mDrawerList.setSelection(position); setTitle(mNavigationDrawerItemTitles[position]); mDrawerLayout.closeDrawer(mDrawerList); } else { Log.e("MainActivity", "Error in creating fragment"); } } @Override public boolean onOptionsItemSelected(MenuItem item) { if (mDrawerToggle.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } @Override public void setTitle(CharSequence title) { mTitle = title; getSupportActionBar().setTitle(mTitle); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); mDrawerToggle.syncState(); } void setupToolbar(){ toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayShowHomeEnabled(true); } void setupDrawerToggle(){ mDrawerToggle = new android.support.v7.app.ActionBarDrawerToggle(this,mDrawerLayout,toolbar,R.string.app_name, R.string.app_name); //This is necessary to change the icon of the Drawer Toggle upon state change. mDrawerToggle.syncState(); } private class DrawerItemClickListener implements ListView.OnItemClickListener { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { selectItem(position); } } }
61184c229ce18742ef5369d06f9bd29b0a189e56
f01e6ad8fec23ec9c96153706b48250c05d82b7e
/src/main/java/com/statera/cloudsort/entity/ImageFile.java
692bf42415bd5b9b62f35b8d809c704cfdf3fb5d
[]
no_license
fiomolv/cloudsort
eb8b73c90e733f2e64f6031f469812cb61cb2752
260c7145e479a341d7002d11994ee7cbc1ceb4a8
refs/heads/master
2021-01-10T11:31:46.804699
2009-12-11T03:25:14
2009-12-11T03:25:14
51,680,269
0
0
null
null
null
null
UTF-8
Java
false
false
1,136
java
package com.statera.cloudsort.entity; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; @Entity public class ImageFile implements Serializable { private static final long serialVersionUID = 5736455873645418556L; private Integer id; private String filename; @Id @GeneratedValue(strategy=GenerationType.AUTO) public Integer getId() { return id; } protected void setId(Integer id) { this.id = id; } public String getFilename() { return filename; } public void setFilename(String filename) { this.filename = filename; } public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } public String toString() { return ToStringBuilder.reflectionToString(this); } }
[ "knoernschild@3c72c6fc-d3a7-11de-a505-35228575a32e" ]
knoernschild@3c72c6fc-d3a7-11de-a505-35228575a32e
2a6991b2776e45e95edbfbde9db5cc62ac27302f
cf29ccb4411a2652e95f1b2496c435a0850f3540
/main/java/marlon/minecraftai/build/reverse/ReverseBuildField.java
6a98cc4aa52e91aa55badb26c5e7810c6c338571
[]
no_license
marloncalleja/MC-Experiment-AI
0799cbad4f7f75f5d7c010fb3debd4cf63302048
95d5019dac85353b11d176a838fc265ddcb83eab
refs/heads/master
2022-07-21T04:10:44.333081
2022-07-10T10:13:24
2022-07-10T10:13:24
93,537,809
4
1
null
2018-10-01T09:44:24
2017-06-06T16:05:36
Java
UTF-8
Java
false
false
1,636
java
/******************************************************************************* * This file is part of Minebot. * * Minebot 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. * * Minebot 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 Minebot. If not, see <http://www.gnu.org/licenses/>. *******************************************************************************/ package marlon.minecraftai.build.reverse; import net.minecraft.block.Block; import net.minecraft.util.BlockPos; /** * A field where all tasks from the build reverser are stored. * * */ public class ReverseBuildField { private final Block[][][] buildBlocks; private final TaskDescription[][][] buildNames; public ReverseBuildField(int lx, int ly, int lz) { buildBlocks = new Block[lx][ly][lz]; buildNames = new TaskDescription[lx][ly][lz]; } public void setBlockAt(BlockPos relativePos, Block block, TaskDescription taskString) { buildBlocks[relativePos.getX()][relativePos.getY()][relativePos.getZ()] = block; buildNames[relativePos.getX()][relativePos.getY()][relativePos.getZ()] = taskString; } public Block getBlock(int x, int y, int z) { return buildBlocks[x][y][z]; } }
b88951553e66428ed1f4c1c4e407bc99aec19d2d
46bff083316478fca1ff6b7149deb64b5880733b
/src/main/java/com/oyo/pattern_23/pattern02/factory02/Main.java
f0ffc79c9d6c2b2eb7ea1627702bdb082d99e40d
[]
no_license
alterui/smartboot
182ad8a177f3cb9dd3e30ff23ffdee5c8fd4ba0e
9ffbe40ae7f2b45b668f6ee0a610e8f24f6201c0
refs/heads/master
2022-11-20T15:37:19.740323
2019-09-19T07:34:44
2019-09-19T07:34:44
204,700,498
0
0
null
2022-11-15T23:49:42
2019-08-27T12:40:35
Java
UTF-8
Java
false
false
820
java
package com.oyo.pattern_23.pattern02.factory02; /** * @author liurui * @date 2019/9/19 14:24 */ public class Main { public static void main(String[] args) { //android AndroidFactory androidFactory = new AndroidFactory(); OperationController androidOperationController = androidFactory.createOperationController(); UIController androidUiController = androidFactory.createUIController(); androidOperationController.control(); androidUiController.display(); //ios IOSFactory iosFactory = new IOSFactory(); OperationController iosFactoryOperation = iosFactory.createOperationController(); UIController iosUiController = iosFactory.createUIController(); iosFactoryOperation.control(); iosUiController.display(); } }
1ad6f4b6502a267e5b94e38bc6955c9711567181
4f1672a187707b1a1a6ca8a10d1f932118ec5e77
/src/commands/UpdateIdCommand.java
f779c7322db3797b9f59c1941b9898657fc8b020
[]
no_license
NikitaOrelskiy/laba5
fb2226ce447e6b353d008329a4890273a620800e
768f7a3a4d3df6fcf27b9ef252abbe6f0655691e
refs/heads/master
2023-08-09T11:25:29.499409
2021-09-14T17:52:02
2021-09-14T17:52:02
406,469,166
0
0
null
null
null
null
UTF-8
Java
false
false
947
java
package commands; import com.company.CityStorage; import com.company.Climate; import com.company.Coordinates; import com.company.Human; import managers.ConsoleDataManager; import java.util.Date; import java.util.List; public class UpdateIdCommand extends AbstractCommand{ private ConsoleDataManager consoleDataManager = new ConsoleDataManager(); public UpdateIdCommand(CityStorage storage, List<String> args) { super(storage, args); } @Override public void execute() { if (this.args.size() == 0) { throw new RuntimeException("no such arguments"); } Long id; try { id = Long.valueOf(this.args.get(0)); } catch (Exception e) { throw new RuntimeException("invalid argument"); } String cityName = consoleDataManager.getCityName(); storage.updateByKey( id, cityName ); } }
89f486b8184e5556bdcc8d6ec33ef41a95b8575f
b4347feddc232095e8b043f4eaed2c04c6d35eff
/app/src/main/java/com/likeit/as51scholarship/model/Messageabean.java
8ef0202fd2d4c460de1f1144639953d2a2876f14
[]
no_license
13512780735/51
f7b17c06f852965d76ec2789cd610f3faef32420
c3bc87993a933f040e5cb5b1fad0a7d795eba3c9
refs/heads/master
2021-09-12T19:28:49.386555
2017-12-14T12:26:31
2017-12-14T12:26:31
112,406,078
0
1
null
null
null
null
UTF-8
Java
false
false
1,214
java
package com.likeit.as51scholarship.model; /** * Created by Administrator on 2017/9/29. */ public class Messageabean { /** * id : 1 * title : test公告 * content : test公告test公告test公告test公告test公告test公告test公告test公告test公告test公告 * link : http://www.wbteam.cn * create_time : 2017-09-29 16:13:41 */ private String id; private String title; private String content; private String link; private String create_time; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public String getCreate_time() { return create_time; } public void setCreate_time(String create_time) { this.create_time = create_time; } }
d32472b9ea7c4d4f78afd1a5a82c0462907ba23a
4c70538fb305fb80abe27990b8bf508cf920b297
/app/src/main/java/com/walasys/conductor/Utiles/General.java
ce13e60afd87c3b204f0ebe356009ee6e423f18c
[]
no_license
wdariasm/TrlTransportador
eb032a491da1545c9578c7bed18ade77abf70a7d
14853197e16acf740cc48e6adaf09ef5056df9a3
refs/heads/master
2021-03-19T18:40:40.136379
2018-10-03T04:31:11
2018-10-03T04:31:11
118,202,313
0
0
null
null
null
null
UTF-8
Java
false
false
22,036
java
package com.walasys.conductor.Utiles; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.location.Criteria; import android.location.LocationManager; import android.os.Build; import android.provider.Settings; import android.telephony.TelephonyManager; import android.view.View; import android.view.ViewAnimationUtils; import android.view.Window; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.LinearLayout; import android.widget.TextView; import com.walasys.conductor.Modulos.Configuracion.Configuracion; import com.walasys.conductor.Modulos.Inicial.Login; import com.walasys.conductor.Modulos.Servicios.Historial; import com.walasys.conductor.Modulos.Servicios.Pagos; import com.walasys.conductor.Modulos.Servicios.Principal; import com.walasys.conductor.R; import com.walasys.conductor.Servicios.webServicesConductor; import com.walasys.conductor.Servicios.webServicesLogin; import com.walasys.conductor.Utiles.Modelos.Conductor; import com.walasys.conductor.Utiles.Modelos.ConfiguracionApp; import com.google.android.gms.maps.model.LatLng; import org.json.JSONObject; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; /** * Created by Gilmar Ocampo Nieves on 24/11/2016. */ public class General { public static Activity mActivity; private Activity context; private ProgressDialog dialogCargando; AlertDialog al; boolean banMenu = true; public General(Activity context,View v){ this.context = context; if(v != null){ } } public void menuPrincipal(View view,final View mRevealView){ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { int cx = (mRevealView.getLeft() + mRevealView.getRight()); int cy = (view.getTop()); int startradius=0; int endradius = Math.max(mRevealView.getWidth(), mRevealView.getHeight()); Animator animator = ViewAnimationUtils.createCircularReveal(mRevealView,cx, cy, startradius, endradius); animator.setInterpolator(new AccelerateDecelerateInterpolator()); animator.setDuration(300); int reverse_startradius = Math.max(mRevealView.getWidth(),mRevealView.getHeight()); int reverse_endradius=0; Animator animate = ViewAnimationUtils.createCircularReveal(mRevealView,cx,cy,reverse_startradius,reverse_endradius); if(banMenu){ mRevealView.setVisibility(View.VISIBLE); animator.start(); banMenu = false; }else{ mRevealView.setVisibility(View.VISIBLE); // to hide layout on animation end animate.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); mRevealView.setVisibility(View.INVISIBLE); banMenu = true; } }); animate.start(); } }else{ final Dialog dialog1 = new Dialog(context); dialog1.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog1.getWindow().setBackgroundDrawable(new ColorDrawable(Color.argb(0, 0, 0, 0))); dialog1.setContentView(R.layout.layout_menu_principal); LinearLayout div_servicios = (LinearLayout) dialog1.findViewById(R.id.div_servicios); LinearLayout div_historial = (LinearLayout) dialog1.findViewById(R.id.div_historial); LinearLayout div_pagos = (LinearLayout) dialog1.findViewById(R.id.div_pagos); LinearLayout div_ajustes = (LinearLayout) dialog1.findViewById(R.id.div_ajustes); LinearLayout div_salir = (LinearLayout) dialog1.findViewById(R.id.div_salir); TextView lblConductor = (TextView) dialog1.findViewById(R.id.lblConductor); TextView lblPlaca = (TextView) dialog1.findViewById(R.id.lblPlaca); Conductor con = cargarConductor(); lblConductor.setText(con.Nombre); lblPlaca.setText(con.CdPlaca); div_servicios.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { irMenuItem(view); dialog1.dismiss(); } }); div_historial.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { irMenuItem(view); dialog1.dismiss(); } }); div_pagos.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { irMenuItem(view); dialog1.dismiss(); } }); div_ajustes.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { irMenuItem(view); dialog1.dismiss(); } }); div_salir.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { irMenuItem(view); dialog1.dismiss(); } }); dialog1.show(); } } public void irMenuItem(View v){ Intent i; switch (v.getId()){ case R.id.div_servicios: i = new Intent(context,Principal.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); context.startActivity(i); break; case R.id.div_historial: i = new Intent(context,Historial.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); context.startActivity(i); break; case R.id.div_ajustes: i = new Intent(context,Configuracion.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); context.startActivity(i); break; case R.id.div_pagos: i = new Intent(context,Pagos.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); context.startActivity(i); break; case R.id.div_salir: ConfiguracionApp configApp = cargarConfiguracion(); if(configApp.cuadroConfirmacion){ AlertDialog.Builder alertDialog = new AlertDialog.Builder(context); alertDialog.setTitle("Aviso"); alertDialog.setMessage("Desea realizar la acción?"); alertDialog.setCancelable(false); alertDialog.setPositiveButton("Continuar", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); cerrarSesion(); } }); alertDialog.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog al = alertDialog.create(); al.show(); }else{ cerrarSesion(); } break; } } public void cerrarSesion(){ initCargando("Cerrando sesión..."); new Thread(new Runnable() { @Override public void run() { final webServicesLogin sc = new webServicesLogin(context); Conductor con = cargarConductor(); final JSONObject j = sc.cerrarSesion(con.idConductor,con.token); context.runOnUiThread(new Runnable() { @Override public void run() { try{ finishCargando(); quitarCuenta(); Intent i = new Intent(context,Login.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); try { Intent in = new Intent(context,ServicioGPS.class); context.stopService(in); }catch(Exception ex){} }catch(Exception ex){} } }); } }).start(); } public void mostrarDialog(String titulo,String mensaje,boolean cancelable){ AlertDialog.Builder b = new AlertDialog.Builder(context); b.setTitle(titulo); b.setMessage(mensaje); b.setCancelable(cancelable); b.setPositiveButton("Aceptar", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog al = b.create(); al.show(); } public void initCargando(String mensaje){ dialogCargando = new ProgressDialog(context); dialogCargando.setMessage(mensaje); dialogCargando.setProgressStyle(ProgressDialog.STYLE_SPINNER); dialogCargando.setCancelable(true); dialogCargando.show(); } public void finishCargando(){ dialogCargando.dismiss(); } public boolean validarGPSActivo(){ boolean ban = true; LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); String provider = locationManager.getBestProvider(criteria, false); if (provider != null && !provider.equals("")) { Boolean isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!isGPSEnabled) { mostarAlertDeConfiguracion(); ban = false; }else ban = true; }else ban = false; return ban; } public List<LatLng> decodePoly(String encoded) { List<LatLng> poly = new ArrayList<LatLng>(); int index = 0, len = encoded.length(); int lat = 0, lng = 0; while (index < len) { int b, shift = 0, result = 0; do { b = encoded.charAt(index++) - 63; result |= (b & 0x1f) << shift; shift += 5; } while (b >= 0x20); int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1)); lat += dlat; shift = 0; result = 0; do { b = encoded.charAt(index++) - 63; result |= (b & 0x1f) << shift; shift += 5; } while (b >= 0x20); int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1)); lng += dlng; LatLng p = new LatLng((((double) lat / 1E5)), (((double) lng / 1E5))); poly.add(p); } return poly; } private void mostarAlertDeConfiguracion() { if(al == null){ AlertDialog.Builder alertDialog = new AlertDialog.Builder(context); alertDialog.setTitle("Configuración del GPS"); alertDialog.setMessage("Debes activar el GPS para continuar."); alertDialog.setCancelable(false); alertDialog.setPositiveButton("Configurar", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); context.startActivity(intent); } }); al = alertDialog.create(); al.show(); } } public void actualizarServidor(String servidor){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString("rutaServidor", servidor); editor.commit(); } public String cargarServidor(){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); return prefs.getString("rutaServidor", "http://192.168.0.22/TrlTaxi/public/api"); //return prefs.getString("rutaServidor", "http://app.trl.com.co/public/api"); } public static String cargarServidor(Context context){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); return prefs.getString("rutaServidor", "http://192.168.0.22/TrlTaxi/public/api"); //return prefs.getString("rutaServidor", "http://app.trl.com.co/public/api"); } public void guardarConfiguracion(ConfiguracionApp con){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean("cfg_cuadroConfirm", con.cuadroConfirmacion); editor.commit(); } public ConfiguracionApp cargarConfiguracion(){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); ConfiguracionApp c = new ConfiguracionApp(); c.cuadroConfirmacion = prefs.getBoolean("cfg_cuadroConfirm", true); return c; } public void guardarConductor(Conductor con){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString("token", con.token); editor.putString("usuario", con.usuario); editor.putString("idUsuario", con.idUsuario); editor.putString("pass", con.pass); editor.putString("permisos", con.Permisos); editor.putString("idConductor", con.idConductor); editor.putString("email", con.Email); editor.putString("Nombre", con.Nombre); editor.putString("placa", con.CdPlaca); editor.putBoolean("cuenta", true); editor.commit(); } public Conductor cargarConductor(){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); Conductor c = new Conductor(); c.token = prefs.getString("token", null); c.usuario = prefs.getString("usuario", null); c.idUsuario = prefs.getString("idUsuario", null); c.pass = prefs.getString("pass", null); c.Permisos = prefs.getString("permisos", null); c.idConductor = prefs.getString("idConductor", null); c.Email = prefs.getString("Email", null); c.Nombre = prefs.getString("Nombre", null); c.CdPlaca = prefs.getString("placa", null); return c; } public boolean sesion(){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); return prefs.getBoolean("cuenta", false); } public void quitarCuenta(){ SharedPreferences prefs = context.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString("token", null); editor.putString("usuario", null); editor.putString("pass", null); editor.putString("placa", null); editor.putBoolean("cuenta", false); editor.putBoolean("cfg_cuadroConfirm", true); editor.commit(); } public static String getToken(Context con){ SharedPreferences prefs = con.getSharedPreferences("tlrConductor", Context.MODE_PRIVATE); return prefs.getString("token", null); } public String getIMEI(){ TelephonyManager mngr = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE); return mngr.getDeviceId(); } public Drawable getDrawable(Activity context, int id){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return context.getResources().getDrawable(id, context.getTheme()); } else { return context.getDrawable(id); } } public void determinarBotonActualizar(String estadoActual, TextView btnConfirmar, TextView btnCancelar){ btnCancelar.setText("Cancelar"); if(estadoActual.compareTo("ASIGNADO") == 0){ btnConfirmar.setText("Confirmar"); btnCancelar.setText("Rechazar"); }else{ if(estadoActual.compareTo("CONFIRMADO") == 0){ btnConfirmar.setText("Desplazandome"); }else{ if(estadoActual.compareTo("DESPLAZAMIENTO A SITIO") == 0){ btnConfirmar.setText("En sitio"); }else{ if(estadoActual.compareTo("EN SITIO") == 0){ btnConfirmar.setText("En ruta"); }else{ if(estadoActual.compareTo("EN RUTA") == 0){ btnConfirmar.setText("Finalizar"); btnCancelar.setVisibility(View.GONE); }else{ btnConfirmar.setText("Finalizar"); btnCancelar.setVisibility(View.GONE); } } } } } } public String determinarEstadoServicio(String estadoActual){ String nuevoEstado = "CONFIRMADO"; if(estadoActual.compareTo("ASIGNADO") == 0){ nuevoEstado = "CONFIRMADO"; }else{ if(estadoActual.compareTo("CONFIRMADO") == 0){ nuevoEstado = "DESPLAZAMIENTO A SITIO"; }else{ if(estadoActual.compareTo("DESPLAZAMIENTO A SITIO") == 0){ nuevoEstado = "EN SITIO"; }else{ if(estadoActual.compareTo("EN SITIO") == 0){ nuevoEstado = "EN RUTA"; }else{ if(estadoActual.compareTo("EN RUTA") == 0){ nuevoEstado = "FINALIZADO"; }else nuevoEstado = "FINALIZADO"; } } } } return nuevoEstado; } public void getDatosConductor(final TextView lblConductor,final TextView lblPlaca){ final Conductor con = cargarConductor(); if(con.CdPlaca == null) { new Thread(new Runnable() { @Override public void run() { final webServicesConductor sc = new webServicesConductor(context); final JSONObject obj = sc.getDatosConductor(con.idConductor, con.token); context.runOnUiThread(new Runnable() { @Override public void run() { try { if (obj != null) { con.CdPlaca = obj.getString("CdPlaca"); guardarConductor(con); lblConductor.setText(con.Nombre); lblPlaca.setText(con.CdPlaca); } } catch (Exception ex) { } } }); } }).start(); }else{ lblConductor.setText(con.Nombre); lblPlaca.setText(con.CdPlaca); } } public String fechaActual(){ final Calendar c= Calendar.getInstance(); String fecha = ""; int anio = c.get(Calendar.YEAR); int mes = c.get(Calendar.MONTH); int dia = c.get(Calendar.DAY_OF_MONTH); String me = String.valueOf((mes + 1)); String di = String.valueOf(dia); if((mes + 1) < 10){ me = "0" + String.valueOf((mes + 1)); } if((dia + 1) < 10){ di = "0" + String.valueOf(dia); } fecha = anio + "-" + me + "-" + di; return fecha; } public String formatearFecha(String fecha,String formatoViejo,String formatoNuevo){ try { Date date = new SimpleDateFormat(formatoViejo).parse(fecha); return new SimpleDateFormat(formatoNuevo).format(date); }catch(Exception ec){ return null; } } public String formatearNumero(Double numero){ DecimalFormat formatea = new DecimalFormat("###,###.##"); return formatea.format(numero); } public String formatearHora(String fe){ try { Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(fe); return new SimpleDateFormat("hh:mm a").format(date); }catch(Exception ex){} return null; } }