repo_name stringlengths 5 108 | path stringlengths 6 333 | size stringlengths 1 6 | content stringlengths 4 977k | license stringclasses 15
values |
|---|---|---|---|---|
dgomesbr/felaguiar-trip | src/main/java/org/springframework/social/instagram/api/Caption.java | 773 | package org.springframework.social.instagram.api;
import java.util.Date;
public class Caption {
private String id;
private Date createdTime;
private String text;
private InstagramProfile from;
public Caption(String id, Date createdTime, String text, InstagramProfile from) {
this.id = id;
this.createdTime = createdTime;
this.text = text;
this.from = from;
}
public String getId() {
return id;
}
public Date getCreatedTime() {
return createdTime;
}
public String getText() {
return text;
}
public InstagramProfile getFrom() {
return from;
}
@Override
public String toString() {
return "Caption{" +
"id='" + id + '\'' +
", createdTime=" + createdTime +
", text='" + text + '\'' +
", from=" + from +
'}';
}
}
| apache-2.0 |
Pardus-Engerek/engerek | gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskResultTabPanel.java | 5480 | /*
* Copyright (c) 2010-2017 Evolveum
*
* 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.evolveum.midpoint.web.page.admin.server;
import com.evolveum.midpoint.gui.api.component.result.OpResult;
import com.evolveum.midpoint.gui.api.component.result.OperationResultPanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.data.TablePanel;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.objectdetails.AbstractObjectTabPanel;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.util.ListDataProvider;
import com.evolveum.midpoint.web.page.admin.server.dto.TaskDto;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* @author semancik
*/
public class TaskResultTabPanel extends AbstractObjectTabPanel<TaskType> implements TaskTabPanel {
private static final long serialVersionUID = 1L;
private static final String ID_OPERATION_RESULT = "operationResult";
private static final String ID_SHOW_RESULT = "showResult";
private static final Trace LOGGER = TraceManager.getTrace(TaskResultTabPanel.class);
public TaskResultTabPanel(String id, Form mainForm,
LoadableModel<ObjectWrapper<TaskType>> taskWrapperModel,
IModel<TaskDto> taskDtoModel, PageBase pageBase) {
super(id, mainForm, taskWrapperModel, pageBase);
initLayout(taskDtoModel, pageBase);
setOutputMarkupId(true);
}
private void initLayout(final IModel<TaskDto> taskDtoModel, final PageBase pageBase) {
SortableDataProvider<OperationResult, String> provider = new ListDataProvider<>(this,
new PropertyModel<List<OperationResult>>(taskDtoModel, TaskDto.F_OP_RESULT));
TablePanel resultTablePanel = new TablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
resultTablePanel.setStyle("padding-top: 0px;");
resultTablePanel.setShowPaging(false);
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
add(new AjaxFallbackLink(ID_SHOW_RESULT) {
public void onClick(AjaxRequestTarget target) {
OperationResult opResult = taskDtoModel.getObject().getTaskOperationResult();
OperationResultPanel body = new OperationResultPanel(
pageBase.getMainPopupBodyId(),
new Model<>(OpResult.getOpResult(pageBase, opResult)),
pageBase);
body.setOutputMarkupId(true);
pageBase.showMainPopup(body, target);
}
});
}
private List<IColumn<OperationResult, String>> initResultColumns() {
List<IColumn<OperationResult, String>> columns = new ArrayList<IColumn<OperationResult, String>>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.token"), "token"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.operation"), "operation"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.status"), "status"));
columns.add(new AbstractColumn<OperationResult, String>(createStringResource("pageTaskEdit.opResult.message"), "message") {
@Override
public void populateItem(Item<ICellPopulator<OperationResult>> cellItem, String componentId,
IModel<OperationResult> rowModel) {
Label label = new Label(componentId, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return WebComponentUtil.nl2br(rowModel.getObject().getMessage());
}
});
label.setEscapeModelStrings(false);
cellItem.add(label);
}
});
//columns.add(new PropertyColumn(createStringResource("pageTaskEdit.opResult.message"), "message"));
return columns;
}
@Override
public Collection<Component> getComponentsToUpdate() {
return Collections.singleton(get(ID_OPERATION_RESULT));
}
}
| apache-2.0 |
mdgreenfield/rest-client-tools | rest-client-generator/src/main/java/com/opower/rest/client/ConfigurationCallback.java | 1056 | /**
* Copyright 2014 Opower, Inc.
* 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.opower.rest.client;
/**
* Configuration callback interface. The ClientBuilder will pass configurable object instances
* to allow users to customize them as needed.
* @param <T> The type of the object to be configured
*/
public interface ConfigurationCallback<T> {
/**
* Apply custom logic to the provided object.
* @param object The object to be customized.
*/
void configure(final T object);
}
| apache-2.0 |
jalaziz/cens-whatsinvasive | src/edu/ucla/cens/whatsinvasive/AreaList.java | 12107 | package edu.ucla.cens.whatsinvasive;
import java.util.Observable;
import java.util.Observer;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.SimpleCursorAdapter;
import edu.ucla.cens.whatsinvasive.data.TagDatabase;
import edu.ucla.cens.whatsinvasive.data.TagDatabase.AreaRow;
import edu.ucla.cens.whatsinvasive.services.LocationService;
import edu.ucla.cens.whatsinvasive.services.LocationService.AreaUpdateThread;
import edu.ucla.cens.whatsinvasive.services.LocationService.TagUpdateThread;
import edu.ucla.cens.whatsinvasive.tools.UpdateThread.UpdateData;
public class AreaList extends ListActivity implements Observer {
private final int DIALOG_DOWNLOAD_AREAS = 0;
private final int DIALOG_DOWNLOAD_TAGS = 1;
private final int DIALOG_TIMEOUT_AREA = 2;
private final int DIALOG_TIMEOUT_TAG = 3;
private final int DIALOG_NO_RESPONSE_TAG = 4;
private final int MESSAGE_COMPLETE_AREA = 0;
private final int MESSAGE_COMPLETE_TAG = 1;
private final int MESSAGE_DOWNLOAD_TAGS = 2;
private final int MESSAGE_TIMEOUT_AREA = 3;
private final int MESSAGE_TIMEOUT_TAG = 4;
private final int MESSAGE_RETRY_AREA = 5;
private final int MESSAGE_CANCEL = 7;
private final int MESSAGE_NO_RESPONSE_TAG = 8;
public static final int RESULT_TAGS_UPDATED = 0;
private static final String TAG = "AreaList";
protected static final int RESULT_TAGS_SAME = 22;
private final int VISIBLE_PARKS = 10;
private boolean locationServiceOn = true;
private SharedPreferences mPreferences;
private LocationManager mLocManager;
private TagDatabase mDatabase;
private Cursor mCursor;
private CheckBox mAllParks;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.area_list);
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
locationServiceOn = mPreferences.getBoolean("location_service_on", true);
mPreferences.edit().putBoolean("location_service_on", false).commit();
mLocManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
mDatabase = new TagDatabase(this);
getListView().setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long id) {
// Set fixed park and location
AreaRow row = mDatabase.getArea(id);
Bundle data = new Bundle();
data.putLong("id", row.id);
data.putDouble("latitude", row.latitude);
data.putDouble("longitude", row.longitude);
Message msg = new Message();
msg.what = MESSAGE_DOWNLOAD_TAGS;
msg.setData(data);
AreaList.this.handler.sendMessage(msg);
//editor.putBoolean("location_service_on", false).commit();
}});
mAllParks = (CheckBox) findViewById(R.id.check_all);
mAllParks.setChecked(mPreferences.getBoolean("all_parks", false));
mAllParks.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mPreferences.edit().putBoolean("all_parks", isChecked).commit();
setupList();
}
});
}
@Override
protected void onResume()
{
super.onResume();
// Download complete list of areas
this.showDialog(DIALOG_DOWNLOAD_AREAS);
AreaUpdateThread thread = new AreaUpdateThread(this, false, LocationService.getLocation(this));
thread.getObservable().addObserver(this);
thread.start();
mDatabase.openRead();
mAllParks.setVisibility(!(mLocManager.isProviderEnabled("gps") ||
mLocManager.isProviderEnabled("network"))
? View.GONE
: View.VISIBLE);
}
@Override
protected void onPause() {
mDatabase.close();
super.onPause();
}
private void setupList()
{
boolean orderedByName = false;
if(!(mLocManager.isProviderEnabled("gps") || mLocManager.isProviderEnabled("network"))){
// TODO: Location is disable, show dialog
mCursor = mDatabase.getAreasByName();
orderedByName = true;
}else{
// Check if we can actually get a location
Location location = null;
if(mLocManager.isProviderEnabled("gps"))
location = mLocManager.getLastKnownLocation("gps");
else if(mLocManager.isProviderEnabled("network"))
location = mLocManager.getLastKnownLocation("network");
if(location==null || mAllParks.isChecked()){
// Didn't get anything so ask user to set a location for now
mCursor = mDatabase.getAreasByName();
orderedByName = true;
}else{
// This assumes that the list is already sorted by the location service
mCursor = mDatabase.getAreas(VISIBLE_PARKS);
}
}
startManagingCursor(mCursor);
setListAdapter(!orderedByName
? new SimpleCursorAdapter(this,
R.layout.area_list_item, mCursor, new String[] {
TagDatabase.KEY_TITLE, TagDatabase.KEY_DISTANCE },
new int[] { android.R.id.text1, android.R.id.text2 })
: new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1, mCursor,
new String[] { TagDatabase.KEY_TITLE },
new int[] { android.R.id.text1 }));
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_BACK) {
// User effectively canceled manual selection show return to original mode
mPreferences.edit().putBoolean("location_service_on", locationServiceOn).commit();
this.dismissDialog(DIALOG_DOWNLOAD_AREAS);
this.setResult(RESULT_OK);
this.finish();
return true;
}
return false;
}
@Override
protected Dialog onCreateDialog(int id)
{
Dialog dialog = null;
ProgressDialog progress;
switch(id){
case DIALOG_DOWNLOAD_AREAS:
progress = new ProgressDialog(this);
progress.setTitle(getString(R.string.area_list_updating));
progress.setMessage(getString(R.string.area_list_wait));
progress.setIndeterminate(true);
progress.setCancelable(false);
dialog = progress;
break;
case DIALOG_DOWNLOAD_TAGS:
progress = new ProgressDialog(this);
progress.setTitle(getString(R.string.area_list_updating_invasives));
progress.setMessage(getString(R.string.area_list_wait_images));
progress.setIndeterminate(true);
progress.setCancelable(false);
dialog = progress;
break;
case DIALOG_TIMEOUT_AREA:
dialog = new AlertDialog.Builder(this)
.setTitle(getString(R.string.area_list_timeout))
.setMessage(getString(R.string.area_list_fail))
.setPositiveButton(getString(R.string.area_list_retry_button), new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
AreaList.this.handler.sendEmptyMessage(MESSAGE_RETRY_AREA);
}})
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
AreaList.this.handler.sendEmptyMessage(MESSAGE_CANCEL);
}})
.create();
case DIALOG_TIMEOUT_TAG:
dialog = new AlertDialog.Builder(this)
.setTitle(getString(R.string.area_list_timeout))
.setMessage(getString(R.string.area_list_fail))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
}})
.create();
break;
case DIALOG_NO_RESPONSE_TAG:
dialog = new AlertDialog.Builder(this)
.setTitle(getString(R.string.area_list_timeout))
.setMessage(getString(R.string.area_list_fail))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
}})
.create();
break;
}
return dialog;
}
private final Handler handler = new Handler()
{
@Override
public void handleMessage(Message msg){
switch(msg.what){
case MESSAGE_DOWNLOAD_TAGS:
mPreferences.edit()
.putString("fixed_location", msg.getData().getDouble("latitude") +","+ msg.getData().getDouble("longitude"))
.putLong("fixed_area", msg.getData().getLong("id"))
.commit();
int availableTags = mDatabase.getTagsAvailable(msg.getData().getLong("id"), null);
if(availableTags == 0){
TagUpdateThread thread = new TagUpdateThread(AreaList.this, msg.getData().getLong("id"));
thread.getObservable().addObserver(AreaList.this);
thread.start();
AreaList.this.showDialog(DIALOG_DOWNLOAD_TAGS);
}
else{
AreaList.this.setResult(RESULT_TAGS_SAME);
AreaList.this.finish();
}
break;
case MESSAGE_COMPLETE_AREA:
dismissDialog(DIALOG_DOWNLOAD_AREAS);
AreaList.this.setupList();
break;
case MESSAGE_COMPLETE_TAG:
dismissDialog(DIALOG_DOWNLOAD_TAGS);
AreaList.this.setResult(RESULT_TAGS_UPDATED);
AreaList.this.finish();
break;
case MESSAGE_TIMEOUT_AREA:
AreaList.this.dismissDialog(DIALOG_DOWNLOAD_AREAS);
AreaList.this.showDialog(DIALOG_TIMEOUT_AREA);
break;
case MESSAGE_TIMEOUT_TAG:
AreaList.this.dismissDialog(DIALOG_DOWNLOAD_TAGS);
AreaList.this.showDialog(DIALOG_TIMEOUT_TAG);
break;
case MESSAGE_RETRY_AREA:
AreaList.this.showDialog(DIALOG_DOWNLOAD_AREAS);
AreaUpdateThread thread2 = new AreaUpdateThread(AreaList.this, false, LocationService.getLocation(AreaList.this));
thread2.getObservable().addObserver(AreaList.this);
thread2.start();
break;
case MESSAGE_NO_RESPONSE_TAG:
AreaList.this.dismissDialog(DIALOG_DOWNLOAD_TAGS);
AreaList.this.showDialog(DIALOG_NO_RESPONSE_TAG);
break;
case MESSAGE_CANCEL:
AreaList.this.finish();
break;
}
}
};
public void update(Observable observable, Object data)
{
UpdateData update = (UpdateData) data;
if(update.source.equals("AreaUpdateThread")) {
if(update.allDone){
this.handler.sendEmptyMessage(MESSAGE_COMPLETE_AREA);
} else if(update.description.equals("timeout")) {
this.handler.sendEmptyMessage(MESSAGE_TIMEOUT_AREA);
}
} else if(update.source.equals("TagUpdateThread")) {
if(update.allDone){
this.handler.sendEmptyMessage(MESSAGE_COMPLETE_TAG);
} else if(update.description.equals("timeout")) {
this.handler.sendEmptyMessage(MESSAGE_TIMEOUT_TAG);
} else if(update.description.equals("no_response")) {
this.handler.sendEmptyMessage(MESSAGE_NO_RESPONSE_TAG);
}
}
}
} | apache-2.0 |
jkorab/kafka-perf-test | kafka/kafka-listener/src/main/java/com/ameliant/tools/kafka/listener/OffsetStore.java | 1567 | package com.ameliant.tools.kafka.listener;
import org.apache.kafka.common.TopicPartition;
import java.util.Optional;
/**
* An offset store maintains the last successfully read position of topic partitions.
* Use of an offset store addresses the problem of keeping track of previously consumed messages in a batch
* polling scenario, where the cursor for the message group may need to be rewound on system restart.
*
* There is some overlap with an idempotent store as both keep track of previously seen messages.
* The critical difference being that the latter does not contain enough information to allow a cursor rewind.
*
* TODO integrating the two. Processing messages polled, when one of the the partitions is rebalanced will cause issues.
* TODO determine whether messages are polled from multiple partitions at the same time.
*
* It is used as a pessimistic store, keeping track of the last message to have been processed - not fetched.
* The two constructs vary as n messages may have been fetched via a poll, but are only then sequentially
* processed. The cursor for the consumer group, in the mean-time has already been moved forward by n places.
*
* On consumer startup, when partitions are allocated, the last successfully position for the consumer's group id
* is fetched and the cursor rewound back to it.
*
* @author jkorab
*/
public interface OffsetStore {
void markConsumed(TopicPartition topicPartition, String groupId, long offset);
Optional<Long> getLastConsumed(TopicPartition topicPartition, String groupId);
}
| apache-2.0 |
PolymathicCoder/Avempace | src/main/java/com/polymathiccoder/avempace/persistence/service/ddl/DynamoDBDDLOperationsServiceImpl.java | 7327 | package com.polymathiccoder.avempace.persistence.service.ddl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.amazonaws.AmazonClientException;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsync;
import com.amazonaws.services.dynamodbv2.model.AttributeDefinition;
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest;
import com.amazonaws.services.dynamodbv2.model.KeySchemaElement;
import com.amazonaws.services.dynamodbv2.model.KeyType;
import com.amazonaws.services.dynamodbv2.model.Projection;
import com.amazonaws.services.dynamodbv2.model.ProjectionType;
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
import com.polymathiccoder.avempace.config.Region;
import com.polymathiccoder.avempace.persistence.domain.Table;
import com.polymathiccoder.avempace.persistence.domain.attribute.AttributeSchema;
import com.polymathiccoder.avempace.persistence.domain.attribute.constraint.LocalSecondaryIndex;
import com.polymathiccoder.avempace.persistence.domain.operation.DDLOperation;
import com.polymathiccoder.avempace.persistence.domain.operation.ddl.CreateTable;
import com.polymathiccoder.avempace.persistence.domain.operation.ddl.DeleteTable;
public class DynamoDBDDLOperationsServiceImpl implements DynamoDBDDLOperationsService {
// Static fields
private static final Logger LOGGER = LoggerFactory.getLogger("com.polymathiccoder.nimble");
// Fields
private final Map<Region, AmazonDynamoDB> amazonDynamoDBsIndexedByRegion;
private final Map<Region, AmazonDynamoDBAsync> amazonDynamoDBAsyncsIndexedByRegion;
// Life cycle
public DynamoDBDDLOperationsServiceImpl(final Map<Region, AmazonDynamoDB> amazonDynamoDBsIndexedByRegion, final Map<Region, AmazonDynamoDBAsync> amazonDynamoDBAsyncsIndexedByRegion) {
this.amazonDynamoDBsIndexedByRegion = amazonDynamoDBsIndexedByRegion;
this.amazonDynamoDBAsyncsIndexedByRegion = amazonDynamoDBAsyncsIndexedByRegion;
}
// Behavior
@Override
public void execute(final DDLOperation ddlOperation) {
if (ddlOperation instanceof CreateTable) {
createTable((CreateTable) ddlOperation);
} else if (ddlOperation instanceof DeleteTable) {
deleteTable((DeleteTable) ddlOperation);
} else {
throw new UnsupportedOperationException();
}
}
@Override
public void batch(final List<? extends DDLOperation> ddlOperations) {
BatchOperationExecutor.execute(this, ddlOperations.toArray(new DDLOperation[ddlOperations.size()]));
}
@Override
public void createTable(final CreateTable createTable) {
final AmazonDynamoDB amazonDynamoDB = amazonDynamoDBsIndexedByRegion.get(createTable.getTable().getRegion());
final Table table = createTable.getTable();
final CreateTableRequest createTableRequest = new CreateTableRequest().withTableName(table.getDefinition().getName());
// Provisioned throughput
createTableRequest.setProvisionedThroughput(
new ProvisionedThroughput()
.withReadCapacityUnits(table.getDefinition().getReadCapacityUnits())
.withWriteCapacityUnits(table.getDefinition().getWriteCapacityUnits()));
// Attribute definitions
final ArrayList<AttributeDefinition> attributeDefinitions = new ArrayList<AttributeDefinition>();
// Key schema definition
final AttributeSchema hashKeySchema = table.getDefinition().getHashKeySchema();
attributeDefinitions.add(hashKeySchema.toDynamoDBAttributeDefinition());
if (table.getDefinition().getRangeKeySchema().isPresent()) {
final AttributeSchema rangeKey = table.getDefinition().getRangeKeySchema().get();
attributeDefinitions.add(rangeKey.toDynamoDBAttributeDefinition());
}
// Index key schema definition
final Iterable<AttributeSchema> indexedAttributes = table.getDefinition().getLocalSecondaryIndexes();
for (final AttributeSchema attributeSchema : indexedAttributes) {
attributeDefinitions.add(attributeSchema.toDynamoDBAttributeDefinition());
}
createTableRequest.setAttributeDefinitions(attributeDefinitions);
// Key schema
final ArrayList<KeySchemaElement> tableKeySchema = new ArrayList<KeySchemaElement>();
tableKeySchema.add(new KeySchemaElement().withAttributeName(hashKeySchema.getName().get()).withKeyType(KeyType.HASH));
if (table.getDefinition().getRangeKeySchema().isPresent()) {
final AttributeSchema rangeKey = table.getDefinition().getRangeKeySchema().get();
tableKeySchema.add(new KeySchemaElement().withAttributeName(rangeKey.getName().get()).withKeyType(KeyType.RANGE));
}
createTableRequest.setKeySchema(tableKeySchema);
// Indexes
final ArrayList<com.amazonaws.services.dynamodbv2.model.LocalSecondaryIndex> localSecondaryIndexes = new ArrayList<>();
for (final AttributeSchema attributeSchema : table.getDefinition().getLocalSecondaryIndexes()) {
final LocalSecondaryIndex localSecondaryIndex = (LocalSecondaryIndex) attributeSchema.getConstraint();
// Key schema
final ArrayList<KeySchemaElement> indexKeySchema = new ArrayList<KeySchemaElement>();
indexKeySchema.add(new KeySchemaElement().withAttributeName(hashKeySchema.getName().get()).withKeyType(KeyType.HASH));
indexKeySchema.add(new KeySchemaElement().withAttributeName(attributeSchema.getName().get()).withKeyType(KeyType.RANGE));
// Projection
final Projection projection = new Projection().withProjectionType(ProjectionType.INCLUDE);
final ArrayList<String> nonKeyAttributes = new ArrayList<String>();
if (! localSecondaryIndex.getProjectedAttributes().isEmpty()) {
nonKeyAttributes.addAll(localSecondaryIndex.getProjectedAttributes());
} else {
for (final AttributeSchema attribute : table.getDefinition().getAttributesSchemas()) {
nonKeyAttributes.add(attribute.getName().get());
}
}
projection.setNonKeyAttributes(nonKeyAttributes);
// LSI
localSecondaryIndexes.add(new com.amazonaws.services.dynamodbv2.model.LocalSecondaryIndex().withIndexName(localSecondaryIndex.getIndexName()).withKeySchema(indexKeySchema).withProjection(projection));
}
createTableRequest.setLocalSecondaryIndexes(localSecondaryIndexes);
// Create
try {
amazonDynamoDB.createTable(createTableRequest);
} catch (final AmazonClientException amazonClientException) {
// TODO Handle better
throw new RuntimeException(amazonClientException);
}
// TODO Add support for alarms
TableStatusCheckerRetryableTask.retryUntil(amazonDynamoDB, table, new TableStatusCheckerRetryableTask.TableStatusIsActiveCondition());
}
@Override
public void deleteTable(final DeleteTable deleteTable) {
final AmazonDynamoDB amazonDynamoDB = amazonDynamoDBsIndexedByRegion.get(deleteTable.getTable().getRegion());
final Table table = deleteTable.getTable();
final DeleteTableRequest deleteTableRequest = new DeleteTableRequest().withTableName(table.getDefinition().getName());
try {
amazonDynamoDB.deleteTable(deleteTableRequest);
} catch (final AmazonClientException amazonClientException) {
// TODO Handle better
throw new RuntimeException(amazonClientException);
}
TableStatusCheckerRetryableTask.retryUntil(amazonDynamoDB, table, new TableStatusCheckerRetryableTask.TableDoesNotExistCondition());
}
}
| apache-2.0 |
juanavelez/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/util/iterator/RestartingMemberIterator.java | 4910 | /*
* Copyright (c) 2008-2017, 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.internal.util.iterator;
import com.hazelcast.core.HazelcastException;
import com.hazelcast.core.HazelcastInstanceNotActiveException;
import com.hazelcast.core.Member;
import com.hazelcast.core.MemberLeftException;
import com.hazelcast.internal.cluster.ClusterService;
import com.hazelcast.internal.cluster.impl.ClusterTopologyChangedException;
import com.hazelcast.internal.util.futures.ChainingFuture;
import com.hazelcast.spi.exception.TargetNotMemberException;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import static java.lang.String.format;
/**
* Iterates over stable cluster from the oldest to youngest member.
* It restarts when detects a cluster topology change.
*
* It can be used from multiple threads, but not concurrently.
*
*/
public class RestartingMemberIterator implements Iterator<Member>, ChainingFuture.ExceptionHandler {
private final ClusterService clusterService;
private final Queue<Member> memberQueue = new ConcurrentLinkedQueue<Member>();
private final int maxRetries;
private volatile Set<Member> initialMembers;
private volatile Member nextMember;
private volatile int retryCounter;
private volatile boolean topologyChanged;
public RestartingMemberIterator(ClusterService clusterService, int maxRetries) {
this.clusterService = clusterService;
this.maxRetries = maxRetries;
Set<Member> currentMembers = clusterService.getMembers();
startNewRound(currentMembers);
}
private void startNewRound(Set<Member> currentMembers) {
topologyChanged = false;
for (Member member : currentMembers) {
memberQueue.add(member);
}
nextMember = memberQueue.poll();
this.initialMembers = currentMembers;
}
@Override
public boolean hasNext() {
if (nextMember != null) {
return true;
}
return advance();
}
private boolean advance() {
Set<Member> currentMembers = clusterService.getMembers();
if (topologyChanged(currentMembers)) {
retry(currentMembers);
// at any given moment there should always be at least 1 cluster member (our own member)
assert nextMember != null;
return true;
}
nextMember = memberQueue.poll();
return nextMember != null;
}
@SuppressFBWarnings(value = "VO_VOLATILE_INCREMENT",
justification = "retryCounter is accessed by multiple threads, but never concurrently")
private void retry(Set<Member> currentMembers) {
retryCounter++;
if (retryCounter > maxRetries) {
throw new HazelcastException(format("Cluster topology was not stable for %d retries,"
+ " invoke on stable cluster failed", maxRetries));
}
memberQueue.clear();
startNewRound(currentMembers);
}
private boolean topologyChanged(Set<Member> currentMembers) {
return topologyChanged || !currentMembers.equals(initialMembers);
}
@Override
public Member next() {
Member memberToReturn = nextMember;
nextMember = null;
if (memberToReturn != null) {
return memberToReturn;
}
if (!advance()) {
throw new NoSuchElementException("no more elements");
}
memberToReturn = nextMember;
nextMember = null;
return memberToReturn;
}
@Override
public void remove() {
throw new UnsupportedOperationException("not implemented");
}
@Override
public <T extends Throwable> void handle(T throwable)
throws T {
if (throwable instanceof ClusterTopologyChangedException) {
topologyChanged = true;
return;
}
if (throwable instanceof MemberLeftException || throwable instanceof TargetNotMemberException
|| throwable instanceof HazelcastInstanceNotActiveException) {
return;
}
throw throwable;
}
public int getRetryCount() {
return retryCounter;
}
}
| apache-2.0 |
spring-projects/spring-framework | spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSchedulerLifecycleTests.java | 2175 | /*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.scheduling.quartz;
import org.junit.jupiter.api.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.util.StopWatch;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Mark Fisher
* @since 3.0
*/
public class QuartzSchedulerLifecycleTests {
@Test // SPR-6354
public void destroyLazyInitSchedulerWithDefaultShutdownOrderDoesNotHang() {
ConfigurableApplicationContext context =
new ClassPathXmlApplicationContext("quartzSchedulerLifecycleTests.xml", getClass());
assertThat(context.getBean("lazyInitSchedulerWithDefaultShutdownOrder")).isNotNull();
StopWatch sw = new StopWatch();
sw.start("lazyScheduler");
context.close();
sw.stop();
assertThat(sw.getTotalTimeMillis() < 500).as("Quartz Scheduler with lazy-init is hanging on destruction: " +
sw.getTotalTimeMillis()).isTrue();
}
@Test // SPR-6354
public void destroyLazyInitSchedulerWithCustomShutdownOrderDoesNotHang() {
ConfigurableApplicationContext context =
new ClassPathXmlApplicationContext("quartzSchedulerLifecycleTests.xml", getClass());
assertThat(context.getBean("lazyInitSchedulerWithCustomShutdownOrder")).isNotNull();
StopWatch sw = new StopWatch();
sw.start("lazyScheduler");
context.close();
sw.stop();
assertThat(sw.getTotalTimeMillis() < 500).as("Quartz Scheduler with lazy-init is hanging on destruction: " +
sw.getTotalTimeMillis()).isTrue();
}
}
| apache-2.0 |
adamjhamer/hdiv-archive | hdiv-core/src/main/java/org/hdiv/config/multipart/IMultipartConfig.java | 4469 | /**
* Copyright 2005-2010 hdiv.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hdiv.config.multipart;
import javax.servlet.ServletContext;
import org.apache.commons.fileupload.DiskFileUpload;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.hdiv.filter.RequestWrapper;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
/**
* Class containing multipart request configuration and methods initialized from
* Spring Factory.
*
* @author Gorka Vicente
*/
public interface IMultipartConfig {
/**
* The default value for the maximum allowable size, in bytes, of an uploaded
* file. The value is equivalent to 2MB.
*/
public static final long DEFAULT_SIZE_MAX = 2 * 1024 * 1024;
/**
* The default value for the threshold which determines whether an uploaded file
* will be written to disk or cached in memory. The value is equivalent to 250KB.
*/
public static final int DEFAULT_SIZE_THRESHOLD = 256 * 1024;
/**
* This is the ServletRequest attribute that should be set when a multipart
* request is being read and the maximum length is exceeded. The value is a
* Boolean. If the maximum length isn't exceeded, this attribute shouldn't be put
* in the ServletRequest. It's the job of the implementation to put this
* attribute in the request if the maximum length is exceeded; in the
* handleRequest(HttpServletRequest) method.
*/
public static final String ATTRIBUTE_MAX_LENGTH_EXCEEDED = "org.apache.struts.upload.MaxLengthExceeded";
/**
* This is the ServletRequest attribute that should be set when a multipart
* request is being read and failed. It's the job of the implementation to
* put this attribute in the request if multipart process failed; in the
* handleRequest(HttpServletRequest) method.
* @since HDIV 2.0.1
*/
public static final String FILEUPLOAD_EXCEPTION = "org.hdiv.exception.HDIVMultipartException";
/**
* Parses the input stream and partitions the parsed items into a set of form
* fields and a set of file items.
*
* @param request The multipart request wrapper.
* @param servletContext Our ServletContext object
* @throws FileUploadException if an unrecoverable error occurs.
* @throws DiskFileUpload.SizeLimitExceededException if size limit exceeded
*/
public void handleMultipartRequest(RequestWrapper request, ServletContext servletContext)
throws FileUploadException, DiskFileUpload.SizeLimitExceededException, MaxUploadSizeExceededException;
/**
* Returns the path to the temporary directory to be used for uploaded files
* which are written to disk. The directory used is determined from the first of
* the following to be non-empty.
* <ol>
* <li>A temp dir explicitly defined using the <code>saveDir</code> attribute
* of the <multipartConfig> element in the Spring config file.</li>
* <li>The temp dir specified by the <code>javax.servlet.context.tempdir</code>
* attribute.</li>
* </ol>
*
* @param servletContext servlet context
* @return The path to the directory to be used to store uploaded files.
*/
public String getRepositoryPath(ServletContext servletContext);
/**
* Adds a file parameter to the set of file parameters for this request and also
* to the list of all parameters.
*
* @param request The request in which the parameter was specified.
* @param item The file item for the parameter to add.
*/
public void addFileParameter(RequestWrapper request, FileItem item);
/**
* Adds a regular text parameter to the set of text parameters for this request.
* Handles the case of multiple values for the same parameter by using an array
* for the parameter value.
*
* @param request The request in which the parameter was specified.
* @param item The file item for the parameter to add.
*/
public void addTextParameter(RequestWrapper request, FileItem item);
}
| apache-2.0 |
Sargul/dbeaver | plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGException.java | 1398 | /*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2021 DBeaver Corp and others
* Copyright (C) 2017-2018 Andrew Khitrin (ahitrin@gmail.com)
* Copyright (C) 2017-2018 Alexander Fedorov (alexander.fedorov@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.debug;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPDataSource;
@SuppressWarnings("serial")
public class DBGException extends DBException {
public DBGException(String message, Throwable e) {
super(message, e);
}
public DBGException(String message) {
super(message);
}
public DBGException(Throwable cause, DBPDataSource dataSource) {
super(cause, dataSource);
}
public DBGException(String message, Throwable cause, DBPDataSource dataSource) {
super(message, cause, dataSource);
}
}
| apache-2.0 |
JLospinoso/juno | juno-core/src/main/java/net/lospi/juno/estimation/proposal/diagonal/insert/DiagonalNetworkMinistepInsertionProposalRatioCalculator.java | 1582 | /*
* Copyright (c) 2014. Josh Lospinoso. All rights reserved
*/
package net.lospi.juno.estimation.proposal.diagonal.insert;
import net.lospi.juno.elements.Chain;
import net.lospi.juno.elements.MinistepChainCalculator;
import net.lospi.juno.estimation.proposal.ProposalRatioCalculator;
import net.lospi.juno.stat.CachedNaturalLogarithm;
public class DiagonalNetworkMinistepInsertionProposalRatioCalculator
implements ProposalRatioCalculator<DiagonalNetworkMinistepInsertionModification> {
private CachedNaturalLogarithm naturalLogarithm;
private final MinistepChainCalculator ministepChainCalculator;
public DiagonalNetworkMinistepInsertionProposalRatioCalculator(CachedNaturalLogarithm naturalLogarithm,
MinistepChainCalculator ministepChainCalculator) {
this.naturalLogarithm = naturalLogarithm;
this.ministepChainCalculator = ministepChainCalculator;
}
@Override
public double calculateLogProposalRatio(double insertionProbability,
DiagonalNetworkMinistepInsertionModification modification, Chain state) {
int diagonalLinksCount = ministepChainCalculator.getDiagonalLinksCount(state);
return naturalLogarithm.apply(1 - insertionProbability)
- naturalLogarithm.apply(insertionProbability)
+ naturalLogarithm.apply(state.getSize() + 1)
+ naturalLogarithm.apply(state.getActorAspectCount())
- naturalLogarithm.apply(diagonalLinksCount + 1);
}
}
| apache-2.0 |
ismaylovrx/java_qa_course | addressbook-web-tests/src/test/java/rustam/addressbook/appmanager/ApplicationManager.java | 2256 | package rustam.addressbook.appmanager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.BrowserType;
import java.util.concurrent.TimeUnit;
import static org.testng.Assert.fail;
public class ApplicationManager {
WebDriver driver;
private UserHelper userHelper;
private SessionHelper sessionHelper;
private NavigationHelper navigationHelper;
private GroupsHelper groupsHelper;
public StringBuffer verificationErrors = new StringBuffer();
private String browser;
public ApplicationManager(String browser) {
this.browser = browser;
}
public void init() {
System.setProperty("webdriver.chrome.driver", "D:\\selenium\\chromedriver.exe");
System.setProperty("webdriver.ie.driver", "D:\\selenium\\IEDriverServer.exe");
if (browser.equals (BrowserType.FIREFOX)) {
driver = new FirefoxDriver(new FirefoxOptions().setLegacy(true));
} else if (browser.equals(BrowserType.CHROME)) {
driver = new ChromeDriver();
} else if (browser.equals(BrowserType.IE)) {
driver = new InternetExplorerDriver();
}
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
driver.get("http://localhost:8080/addressbook/");
groupsHelper = new GroupsHelper(driver);
navigationHelper = new NavigationHelper(driver);
sessionHelper = new SessionHelper(driver);
userHelper = new UserHelper(driver);
sessionHelper.login("admin", "secret");
}
public void stop() {
sessionHelper.Logout();
//driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
public GroupsHelper getGroupsHelper() {
return groupsHelper;
}
public NavigationHelper getNavigationHelper() {
return navigationHelper;
}
public UserHelper getUserHelper() {
return userHelper;
}
}
| apache-2.0 |
jimv39/qvcsos | qvcse-test/src/test/java/com/qumasoft/TestHelper.java | 16125 | // Copyright 2004-2014 Jim Voris
//
// 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.
//
// $FilePath$
// $Date: Wednesday, March 21, 2012 10:31:06 PM $
// $Header: TestHelper.java Revision:1.7 Wednesday, March 21, 2012 10:31:06 PM JimVoris $
// $Copyright 2011-2012 Define this string in the qvcs.keywords.properties property file $
package com.qumasoft;
import com.qumasoft.qvcslib.QVCSConstants;
import com.qumasoft.qvcslib.QVCSException;
import com.qumasoft.qvcslib.ServerResponseFactoryBaseClass;
import com.qumasoft.qvcslib.Utility;
import com.qumasoft.server.QVCSEnterpriseServer;
import com.qumasoft.server.ServerUtility;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Helper class for JUnit tests.
*
* @author JimVoris
*/
public class TestHelper {
/**
* Create our logger object
*/
private static Logger logger = Logger.getLogger("com.qumasoft.TestHelper");
private static QVCSEnterpriseServer enterpriseServer = null;
private static Timer killTimer = null;
private static TimerTask killServerTask = null;
private static final long KILL_DELAY = 5000;
private static final long START_DELAY = 25000;
public static final String SERVER_NAME = "Test Server";
public static final String USER_NAME = "JimVoris";
public static final String PASSWORD = "password";
public static final String SUBPROJECT_DIR_NAME = "subProjectDirectory";
public static final String SUBPROJECT_APPENDED_PATH = "subProjectDirectory";
public static final String SUBPROJECT2_DIR_NAME = "subProjectDirectory2";
public static final String SUBPROJECT2_APPENDED_PATH = "subProjectDirectory/subProjectDirectory2";
public static final String SUBPROJECT_FIRST_SHORTWORKFILENAME = "QVCSEnterpriseServer.java";
public static final String SECOND_SHORTWORKFILENAME = "Server.java";
public static final String THIRD_SHORTWORKFILENAME = "AnotherServer.java";
public static final String SUBPROJECT2_FIRST_SHORTWORKFILENAME = "ThirdDirectoryFile.java";
/**
* Start the QVCS Enterprise server.
*/
public static void startServer() {
if (enterpriseServer == null) {
// So the server starts fresh.
initDirectories();
// So the server uses a project property file useful for the machine the tests are running on.
initProjectProperties();
// For unit testing, listen on the 2xxxx ports.
String args[] = {System.getProperty("user.dir"), "29887", "29888", "29889", "29890", "29080"};
enterpriseServer = new QVCSEnterpriseServer(args);
ServerResponseFactoryBaseClass.setShutdownInProgress(false);
killTimer = new Timer();
Runnable worker = new Runnable() {
@Override
public void run() {
try {
enterpriseServer.startServer();
} catch (SQLException e) {
logger.log(Level.SEVERE, null, e);
} catch (QVCSException e) {
logger.log(Level.SEVERE, null, e);
}
}
};
// Put all this on a separate worker thread.
new Thread(worker).start();
try {
Thread.sleep(START_DELAY);
} catch (InterruptedException ex) {
logger.log(Level.SEVERE, null, ex);
}
} else {
// Kill the timer job that will stop the server.
if (killServerTask != null) {
killServerTask.cancel();
killServerTask = null;
}
}
logger.log(Level.INFO, "returning from startServer");
}
/**
* Stop the QVCS Enterprise server. The server will exit after a delay period so that we don't create and destroy the server for every unit test.
*/
public static synchronized void stopServer() {
TimerTask killTask = new TimerTask() {
@Override
public void run() {
String args[] = {};
QVCSEnterpriseServer.stopServer(args);
}
};
Date now = new Date();
Date whenToRun = new Date(now.getTime() + KILL_DELAY);
killTimer.schedule(killTask, whenToRun);
killServerTask = killTask;
}
/**
* Kill the server -- i.e. shut it down immediately. Some tests need the server to have been shutdown so that their initialization code works correctly.
*/
public static synchronized void stopServerImmediately() {
String args[] = {};
QVCSEnterpriseServer.stopServer(args);
try {
Thread.sleep(KILL_DELAY);
} catch (InterruptedException ex) {
Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Get the enterprise server instance.
*
* @return the Enterprise server instance.
*/
public static QVCSEnterpriseServer getServer() {
return enterpriseServer;
}
private static void initDirectories() {
// Delete the file id store so the server starts fresh.
String storeName = System.getProperty("user.dir")
+ File.separator
+ QVCSConstants.QVCS_META_DATA_DIRECTORY
+ File.separator
+ QVCSConstants.QVCS_FILEID_STORE_NAME
+ ".dat";
File storeFile = new File(storeName);
if (storeFile.exists()) {
storeFile.delete();
}
}
/**
* Delete the view store.
*/
public static void deleteViewStore() {
String viewStoreName = System.getProperty("user.dir")
+ File.separator
+ QVCSConstants.QVCS_ADMIN_DATA_DIRECTORY
+ File.separator
+ QVCSConstants.QVCS_VIEW_STORE_NAME + "dat";
File viewStoreFile = new File(viewStoreName);
if (viewStoreFile.exists()) {
viewStoreFile.delete();
}
String viewLabelStoreName = System.getProperty("user.dir")
+ File.separator
+ QVCSConstants.QVCS_META_DATA_DIRECTORY
+ File.separator
+ QVCSConstants.DIRECTORY_CONTENTS_LABEL_STORE_NAME
+ ".dat";
File viewLabelStoreFile = new File(viewLabelStoreName);
if (viewLabelStoreFile.exists()) {
viewLabelStoreFile.delete();
}
}
/**
* Create archive files that we'll use for testing.
*/
static public void initializeArchiveFiles() {
File sourceFile = new File(System.getProperty("user.dir") + File.separator + "QVCSEnterpriseServer.kbwb");
String firstDestinationDirName = System.getProperty("user.dir")
+ File.separator
+ QVCSConstants.QVCS_PROJECTS_DIRECTORY
+ File.separator
+ getTestProjectName();
File firstDestinationDirectory = new File(firstDestinationDirName);
firstDestinationDirectory.mkdirs();
File firstDestinationFile = new File(firstDestinationDirName + File.separator + "QVCSEnterpriseServer.kbwb");
String secondDestinationDirName = firstDestinationDirName + File.separator + SUBPROJECT_DIR_NAME;
File secondDestinationDirectory = new File(secondDestinationDirName);
secondDestinationDirectory.mkdirs();
File secondDestinationFile = new File(secondDestinationDirName + File.separator + "QVCSEnterpriseServer.kbwb");
String thirdDestinationDirName = secondDestinationDirName + File.separator + SUBPROJECT2_DIR_NAME;
File thirdDestinationDirectory = new File(thirdDestinationDirName);
thirdDestinationDirectory.mkdirs();
File thirdDestinationFile = new File(thirdDestinationDirName + File.separator + "ThirdDirectoryFile.kbwb");
File fourthDestinationFile = new File(firstDestinationDirName + File.separator + "Server.kbwb");
File fifthDestinationFile = new File(firstDestinationDirName + File.separator + "AnotherServer.kbwb");
try {
ServerUtility.copyFile(sourceFile, firstDestinationFile);
ServerUtility.copyFile(sourceFile, secondDestinationFile);
ServerUtility.copyFile(sourceFile, thirdDestinationFile);
ServerUtility.copyFile(sourceFile, fourthDestinationFile);
ServerUtility.copyFile(sourceFile, fifthDestinationFile);
} catch (IOException ex) {
Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Remove archive files created during testing.
*/
static public void removeArchiveFiles() {
String firstDestinationDirName = System.getProperty("user.dir")
+ File.separator
+ QVCSConstants.QVCS_PROJECTS_DIRECTORY
+ File.separator
+ getTestProjectName();
File firstDestinationDirectory = new File(firstDestinationDirName);
String secondDestinationDirName = firstDestinationDirName + File.separator + "subProjectDirectory";
File secondDestinationDirectory = new File(secondDestinationDirName);
String thirdDestinationDirName = secondDestinationDirName + File.separator + "subProjectDirectory2";
File thirdDestinationDirectory = new File(thirdDestinationDirName);
String fourthDestinationDirName = firstDestinationDirName + File.separator + QVCSConstants.QVCS_CEMETERY_DIRECTORY;
File fourthDestinationDirectory = new File(fourthDestinationDirName);
String fifthDestinationDirName = firstDestinationDirName + File.separator + QVCSConstants.QVCS_DIRECTORY_METADATA_DIRECTORY;
File fifthDestinationDirectory = new File(fifthDestinationDirName);
String sixthDestinationDirName = firstDestinationDirName + File.separator + QVCSConstants.QVCS_BRANCH_ARCHIVES_DIRECTORY;
File sixthDestinationDirectory = new File(sixthDestinationDirName);
deleteDirectory(sixthDestinationDirectory);
deleteDirectory(fifthDestinationDirectory);
deleteDirectory(fourthDestinationDirectory);
deleteDirectory(thirdDestinationDirectory);
deleteDirectory(secondDestinationDirectory);
deleteDirectory(firstDestinationDirectory);
}
/**
* Delete all the files in a directory and then delete the directory itself.
*
* @param directory the directory to delete.
*/
static public void deleteDirectory(File directory) {
File[] firstDirectoryFiles = directory.listFiles();
if (firstDirectoryFiles != null) {
for (File file : firstDirectoryFiles) {
file.delete();
}
}
directory.delete();
}
/**
* Clean out the test directory. This is not fully recursive, since we don't want a run-away delete to wipe out all the contents of the disk by mistake.
*
* @param derbyTestDirectory the root directory of a derby db.
*/
static public void emptyDerbyTestDirectory(final String derbyTestDirectory) {
// Delete the files in the derbyTestDirectory directory.
File tempDirectory = new File(derbyTestDirectory);
File[] files = tempDirectory.listFiles();
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
File[] subFiles = file.listFiles();
for (File subFile : subFiles) {
if (subFile.isDirectory()) {
File[] subSubFiles = subFile.listFiles();
for (File subSubFile : subSubFiles) {
subSubFile.delete();
}
}
subFile.delete();
}
}
file.delete();
}
}
}
/**
* Need this so that we use a different project properties file for testing on Windows.
*
* @return the project name that we use for the given platform.
*/
public static String getTestProjectName() {
if (Utility.isMacintosh()) {
return "Test Project";
} else {
return "Test ProjectW";
}
}
public static void initProjectProperties() {
try {
String propertiesDirectory = System.getProperty("user.dir") + File.separator + QVCSConstants.QVCS_PROPERTIES_DIRECTORY;
File originFile;
File destinationFile;
if (Utility.isMacintosh()) {
originFile = new File(propertiesDirectory + File.separator + "hide-qvcs.served.project.Test Project.properties");
destinationFile = new File(propertiesDirectory + File.separator + "qvcs.served.project.Test Project.properties");
} else {
originFile = new File(propertiesDirectory + File.separator + "hide-qvcs.served.project.Test ProjectW.properties");
destinationFile = new File(propertiesDirectory + File.separator + "qvcs.served.project.Test ProjectW.properties");
}
ServerUtility.copyFile(originFile, destinationFile);
} catch (IOException ex) {
Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Compare 2 files to see if they have the same contents.
*
* @param file1 the first file
* @param file2 the 2nd file.
* @return true if they have exactly the same contents; false if they are different.
* @throws FileNotFoundException if either file cannot be found
*/
public static boolean compareFilesByteForByte(File file1, File file2) throws FileNotFoundException, IOException {
boolean compareResult = true;
if (file1.exists() && file2.exists()) {
if (file1.length() == file2.length()) {
FileInputStream file1InputStream = new FileInputStream(file1);
BufferedInputStream buffered1InputStream = new BufferedInputStream(file1InputStream);
FileInputStream file2InputStream = new FileInputStream(file2);
BufferedInputStream buffered2InputStream = new BufferedInputStream(file2InputStream);
byte[] file1Buffer = new byte[(int) file1.length()];
byte[] file2Buffer = new byte[(int) file2.length()];
buffered1InputStream.read(file1Buffer);
buffered2InputStream.read(file2Buffer);
for (int i = 0; i < file1.length(); i++) {
if (file1Buffer[i] != file2Buffer[i]) {
compareResult = false;
break;
}
}
file1InputStream.close();
file2InputStream.close();
} else {
compareResult = false;
}
} else if (file1.exists() && !file2.exists()) {
compareResult = false;
} else if (!file1.exists() && file2.exists()) {
compareResult = false;
} else {
// Neither file exists, so they are 'equal'.
compareResult = true;
}
return compareResult;
}
}
| apache-2.0 |
saulbein/web3j | core/src/main/java/org/web3j/abi/datatypes/generated/Fixed224x16.java | 587 | package org.web3j.abi.datatypes.generated;
import java.math.BigInteger;
import org.web3j.abi.datatypes.Fixed;
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.</p>
*/
public class Fixed224x16 extends Fixed {
public static final Fixed224x16 DEFAULT = new Fixed224x16(BigInteger.ZERO);
public Fixed224x16(BigInteger value) {
super(224, 16, value);
}
public Fixed224x16(int mBitSize, int nBitSize, BigInteger m, BigInteger n) {
super(224, 16, m, n);
}
}
| apache-2.0 |
LayneMobile/Stash | stash-core/src/main/java/stash/types/TypeHandler.java | 3176 | /*
* Copyright 2016 Layne Mobile, LLC
*
* 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 stash.types;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TypeHandler<T> {
final Class<? extends T> type;
final Map<String, List<MethodHandler>> handlers;
protected TypeHandler(Builder<T> builder) {
this.type = builder.type;
this.handlers = Collections.unmodifiableMap(builder.handlers);
}
@Override public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TypeHandler module = (TypeHandler) o;
return type.equals(module.type);
}
@Override public int hashCode() {
return type.hashCode();
}
public static final class Builder<T> {
private final Class<? extends T> type;
private final Map<String, List<MethodHandler>> handlers
= new HashMap<String, List<MethodHandler>>();
public Builder(Class<? extends T> type) {
this.type = type;
}
public MethodBuilder<T> method(String methodName) {
return new MethodBuilder<T>(this, methodName);
}
public Builder<T> handle(String methodName, MethodHandler handler) {
return method(methodName)
.handle(handler)
.add();
}
public TypeHandler<T> build() {
return new TypeHandler<T>(this);
}
private Builder<T> add(MethodBuilder<T> builder) {
List<MethodHandler> handlerList = this.handlers.get(builder.methodName);
if (handlerList == null) {
handlerList = new ArrayList<MethodHandler>();
this.handlers.put(builder.methodName, handlerList);
}
handlerList.add(builder.handler);
return this;
}
}
public static final class MethodBuilder<T> {
private final Builder<T> builder;
private final String methodName;
private MethodHandler handler;
private MethodBuilder(Builder<T> builder, String methodName) {
this.builder = builder;
this.methodName = methodName;
}
public MethodBuilder<T> handle(MethodHandler handler) {
this.handler = handler;
return this;
}
public Builder<T> add() {
if (handler == null) {
throw new IllegalArgumentException("must set a handler");
}
return builder.add(this);
}
}
}
| apache-2.0 |
jphp-compiler/jphp | jphp-runtime/src/php/runtime/OperatorUtils.java | 6716 | package php.runtime;
import php.runtime.memory.BinaryMemory;
import php.runtime.memory.DoubleMemory;
import php.runtime.memory.LongMemory;
import java.util.Arrays;
public class OperatorUtils {
public static boolean isset(Memory[] values){
for (Memory value : values)
if (value.getRealType() == Memory.Type.NULL)
return false;
return true;
}
public static boolean empty(Memory value){
return !value.toBoolean();
}
public static boolean toBoolean(double value){
return value != 0.0;
}
public static boolean toBoolean(long value){
return value != 0;
}
public static boolean toBoolean(int value){
return value != 0;
}
public static boolean toBoolean(short value){
return value != 0;
}
public static boolean toBoolean(byte value){
return value != 0;
}
public static boolean toBoolean(char ch){
return ch != 0;
}
public static boolean toBoolean(String value){
return value != null && !value.equals("0") && !value.isEmpty();
}
public static String concat(String value, Memory memory){
return value.concat(memory.toString());
}
// PLUS
public static Memory plus(long o1, Memory value) {
switch (value.type){
case INT: return LongMemory.valueOf(o1 + value.toLong());
case DOUBLE: return DoubleMemory.valueOf(o1 + value.toDouble());
}
return plus(o1, value.toNumeric());
}
public static Memory plus(double o1, Memory value) { return DoubleMemory.valueOf(o1 + value.toDouble()); }
public static Memory plus(boolean o1, Memory value) {
return o1 ? Memory.TRUE.plus(value) : Memory.FALSE.plus(value);
}
// MINUS
public static Memory minus(long o1, Memory value) {
switch (value.type){
case INT: return LongMemory.valueOf(o1 - value.toLong());
case DOUBLE: return DoubleMemory.valueOf(o1 - value.toDouble());
}
return minus(o1, value.toNumeric());
}
public static Memory minus(double o1, Memory value) { return DoubleMemory.valueOf(o1 - value.toDouble()); }
public static Memory minus(boolean o1, Memory value) {
return o1 ? Memory.TRUE.minus(value) : Memory.FALSE.minus(value);
}
// MUL
public static Memory mul(long o1, Memory value) {
switch (value.type){
case INT: return LongMemory.valueOf(o1 * value.toLong());
case DOUBLE: return DoubleMemory.valueOf(o1 * value.toDouble());
}
return mul(o1, value.toNumeric());
}
public static Memory mul(double o1, Memory value) { return DoubleMemory.valueOf(o1 * value.toDouble()); }
public static Memory mul(boolean o1, Memory value) {
return o1 ? Memory.TRUE.mul(value) : Memory.FALSE.mul(value);
}
// MOD
public static Memory mod(long o1, Memory value) { return LongMemory.valueOf(o1 % value.toLong()); }
public static Memory mod(double o1, Memory value) { return LongMemory.valueOf((long)o1 % value.toLong()); }
public static Memory mod(boolean o1, Memory value) {
return o1 ? Memory.TRUE.mod(value) : Memory.FALSE.mod(value);
}
public static char toChar(String o){
return o.isEmpty() ? '\0' : o.charAt(0);
}
public static char toChar(long o){ return (char)o; }
public static char toChar(int o){ return (char)o; }
public static char toChar(short o){ return (char)o; }
public static char toChar(byte o){ return (char)o; }
public static char toChar(double o){ return (char)o; }
public static char toChar(float o){ return (char)o; }
public static char toChar(boolean o){ return (char)(o ? 0 : 1); }
public static Memory binaryXor(Memory o1, Memory o2){
byte[] bytes1 = o1.getBinaryBytes();
byte[] bytes2 = o2.getBinaryBytes();
byte[] result = bytes1.length <= bytes2.length
? Arrays.copyOf(bytes1, bytes1.length)
: Arrays.copyOf(bytes2, bytes2.length);
for(int i = 0; i < result.length; i++){
result[i] = (byte)(bytes1[i] ^ bytes2[i]);
}
return new BinaryMemory(result);
}
public static Memory binaryAnd(Memory o1, Memory o2){
byte[] bytes1 = o1.getBinaryBytes();
byte[] bytes2 = o2.getBinaryBytes();
byte[] result = bytes1.length <= bytes2.length
? Arrays.copyOf(bytes1, bytes1.length)
: Arrays.copyOf(bytes2, bytes2.length);
for(int i = 0; i < result.length; i++){
result[i] = (byte)(bytes1[i] & bytes2[i]);
}
return new BinaryMemory(result);
}
public static Memory binaryOr(Memory o1, Memory o2){
byte[] bytes1 = o1.getBinaryBytes();
byte[] bytes2 = o2.getBinaryBytes();
int min = Math.min(bytes1.length, bytes2.length);
byte[] result = bytes1.length > bytes2.length
? Arrays.copyOf(bytes1, bytes1.length)
: Arrays.copyOf(bytes2, bytes2.length);
for(int i = 0; i < min; i++){
result[i] = (byte)(bytes1[i] | bytes2[i]);
}
return new BinaryMemory(result);
}
public static Memory binaryShr(Memory o1, Memory o2){
byte[] bytes1 = o1.getBinaryBytes();
byte[] bytes2 = o2.getBinaryBytes();
byte[] result = bytes1.length <= bytes2.length
? Arrays.copyOf(bytes1, bytes1.length)
: Arrays.copyOf(bytes2, bytes2.length);
for(int i = 0; i < result.length; i++){
result[i] = (byte)(bytes1[i] >> bytes2[i]);
}
return new BinaryMemory(result);
}
public static Memory binaryShl(Memory o1, Memory o2){
byte[] bytes1 = o1.getBinaryBytes();
byte[] bytes2 = o2.getBinaryBytes();
byte[] result = bytes1.length <= bytes2.length
? Arrays.copyOf(bytes1, bytes1.length)
: Arrays.copyOf(bytes2, bytes2.length);
for(int i = 0; i < result.length; i++){
result[i] = (byte)(bytes1[i] << bytes2[i]);
}
return new BinaryMemory(result);
}
public static Memory binaryNot(Memory o1){
byte[] bytes = o1.getBinaryBytes();
bytes = Arrays.copyOf(bytes, bytes.length);
for(int i = 0; i < bytes.length; i++){
bytes[i] = (byte)~bytes[i];
}
return new BinaryMemory(bytes);
}
public static String concatRight(String s1, String s2) {
return s2.concat(s1);
}
public static boolean instanceOfRight(String name, String lowerName, Memory o) {
return o.instanceOf(name, lowerName);
}
}
| apache-2.0 |
osbominix/java_gof_facade | src/main/java/com/gof/designpattern/facade/basis/Firework.java | 131 | package com.gof.designpattern.facade.basis;
/**
* Created by yl3 on 27.11.15.
*/
public interface Firework {
void fire();
}
| apache-2.0 |
mihirshekhar/InformationGainLibSVM | src/prune/feature/csv/package-info.java | 73 | /**
*
*/
/**
* @author mihirshekhar
*
*/
package prune.feature.csv; | apache-2.0 |
kamir/Humulus | CumulusOnYARN/src/main/java/org/etosha/cumulusonyarn/CumulusConfiguration.java | 2720 | package org.etosha.cumulusonyarn;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
public class CumulusConfiguration implements CumulusConstants {
private static String jbossHome;
private static String jbossServerGroupName;
private static String jbossServerName;
private static String jbossAdminUserName;
private static String jbossAdminUserPassword;
private static String jbossDomainController;
private static String jbossHostName;
private static int portOffset;
private static final Logger LOG = Logger.getLogger(CumulusConfiguration.class
.getName());
private Options opts;
/**
* Constructor that creates the configuration
*/
public CumulusConfiguration() {
opts = new Options();
opts.addOption("home", true, "JBoss AS home directory");
opts.addOption("server_group", true, "JBoss AS server group name");
opts.addOption("server", true, "JBoss AS server name");
opts.addOption("port_offset", true,
"JBoss AS server instance port number offset");
opts.addOption("admin_user", true,
"Initial admin user added to ManagementRealm");
opts.addOption("admin_password", true,
"Initial admin user password added to ManagementRealm");
opts.addOption("domain_controller", true,
"Host for domain control");
opts.addOption("host", true,
"Hostname of JBoss AS instance");
}
public static void main(String[] args) {
CumulusConfiguration conf = new CumulusConfiguration();
try {
conf.init(args);
Util.addAdminUser(jbossHome, jbossAdminUserName,
jbossAdminUserPassword, JBOSS_MGT_REALM);
Util.addDomainServerGroup(jbossHome, jbossServerGroupName);
Util.addDomainServer(jbossHome, jbossServerGroupName,
jbossServerName, portOffset);
Util.addDomainController(jbossHome, jbossDomainController,
jbossHostName, portOffset);
} catch (Exception e) {
LOG.log(Level.SEVERE, "Problem configuring JBoss AS", e);
}
}
private void init(String[] args) throws ParseException {
CommandLine cliParser = new GnuParser().parse(opts, args);
jbossHome = cliParser.getOptionValue("home");
jbossServerGroupName = cliParser.getOptionValue("server_group");
jbossServerName = cliParser.getOptionValue("server");
jbossAdminUserName = cliParser.getOptionValue("admin_user");
jbossAdminUserPassword = cliParser.getOptionValue("admin_password");
portOffset = Integer.parseInt(cliParser.getOptionValue("port_offset"));
jbossDomainController = cliParser.getOptionValue("domain_controller");
jbossHostName = cliParser.getOptionValue("host");
}
}
| apache-2.0 |
speedycontrol/googleapis | output/com/google/datastore/v1beta3/AllocateIdsRequest.java | 32535 | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/datastore/v1beta3/datastore.proto
package com.google.datastore.v1beta3;
/**
* <pre>
* The request for [Datastore.AllocateIds][google.datastore.v1beta3.Datastore.AllocateIds].
* </pre>
*
* Protobuf type {@code google.datastore.v1beta3.AllocateIdsRequest}
*/
public final class AllocateIdsRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.datastore.v1beta3.AllocateIdsRequest)
AllocateIdsRequestOrBuilder {
// Use AllocateIdsRequest.newBuilder() to construct.
private AllocateIdsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AllocateIdsRequest() {
projectId_ = "";
keys_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private AllocateIdsRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
keys_ = new java.util.ArrayList<com.google.datastore.v1beta3.Key>();
mutable_bitField0_ |= 0x00000002;
}
keys_.add(
input.readMessage(com.google.datastore.v1beta3.Key.parser(), extensionRegistry));
break;
}
case 66: {
java.lang.String s = input.readStringRequireUtf8();
projectId_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
keys_ = java.util.Collections.unmodifiableList(keys_);
}
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.datastore.v1beta3.DatastoreProto.internal_static_google_datastore_v1beta3_AllocateIdsRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1beta3.DatastoreProto.internal_static_google_datastore_v1beta3_AllocateIdsRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1beta3.AllocateIdsRequest.class, com.google.datastore.v1beta3.AllocateIdsRequest.Builder.class);
}
private int bitField0_;
public static final int PROJECT_ID_FIELD_NUMBER = 8;
private volatile java.lang.Object projectId_;
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public java.lang.String getProjectId() {
java.lang.Object ref = projectId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
projectId_ = s;
return s;
}
}
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public com.google.protobuf.ByteString
getProjectIdBytes() {
java.lang.Object ref = projectId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
projectId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int KEYS_FIELD_NUMBER = 1;
private java.util.List<com.google.datastore.v1beta3.Key> keys_;
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public java.util.List<com.google.datastore.v1beta3.Key> getKeysList() {
return keys_;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public java.util.List<? extends com.google.datastore.v1beta3.KeyOrBuilder>
getKeysOrBuilderList() {
return keys_;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public int getKeysCount() {
return keys_.size();
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.Key getKeys(int index) {
return keys_.get(index);
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.KeyOrBuilder getKeysOrBuilder(
int index) {
return keys_.get(index);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < keys_.size(); i++) {
output.writeMessage(1, keys_.get(i));
}
if (!getProjectIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, projectId_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < keys_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, keys_.get(i));
}
if (!getProjectIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, projectId_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.datastore.v1beta3.AllocateIdsRequest)) {
return super.equals(obj);
}
com.google.datastore.v1beta3.AllocateIdsRequest other = (com.google.datastore.v1beta3.AllocateIdsRequest) obj;
boolean result = true;
result = result && getProjectId()
.equals(other.getProjectId());
result = result && getKeysList()
.equals(other.getKeysList());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER;
hash = (53 * hash) + getProjectId().hashCode();
if (getKeysCount() > 0) {
hash = (37 * hash) + KEYS_FIELD_NUMBER;
hash = (53 * hash) + getKeysList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1beta3.AllocateIdsRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.datastore.v1beta3.AllocateIdsRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* The request for [Datastore.AllocateIds][google.datastore.v1beta3.Datastore.AllocateIds].
* </pre>
*
* Protobuf type {@code google.datastore.v1beta3.AllocateIdsRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:google.datastore.v1beta3.AllocateIdsRequest)
com.google.datastore.v1beta3.AllocateIdsRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.datastore.v1beta3.DatastoreProto.internal_static_google_datastore_v1beta3_AllocateIdsRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1beta3.DatastoreProto.internal_static_google_datastore_v1beta3_AllocateIdsRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1beta3.AllocateIdsRequest.class, com.google.datastore.v1beta3.AllocateIdsRequest.Builder.class);
}
// Construct using com.google.datastore.v1beta3.AllocateIdsRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getKeysFieldBuilder();
}
}
public Builder clear() {
super.clear();
projectId_ = "";
if (keysBuilder_ == null) {
keys_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
keysBuilder_.clear();
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.datastore.v1beta3.DatastoreProto.internal_static_google_datastore_v1beta3_AllocateIdsRequest_descriptor;
}
public com.google.datastore.v1beta3.AllocateIdsRequest getDefaultInstanceForType() {
return com.google.datastore.v1beta3.AllocateIdsRequest.getDefaultInstance();
}
public com.google.datastore.v1beta3.AllocateIdsRequest build() {
com.google.datastore.v1beta3.AllocateIdsRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.datastore.v1beta3.AllocateIdsRequest buildPartial() {
com.google.datastore.v1beta3.AllocateIdsRequest result = new com.google.datastore.v1beta3.AllocateIdsRequest(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.projectId_ = projectId_;
if (keysBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
keys_ = java.util.Collections.unmodifiableList(keys_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.keys_ = keys_;
} else {
result.keys_ = keysBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.datastore.v1beta3.AllocateIdsRequest) {
return mergeFrom((com.google.datastore.v1beta3.AllocateIdsRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.datastore.v1beta3.AllocateIdsRequest other) {
if (other == com.google.datastore.v1beta3.AllocateIdsRequest.getDefaultInstance()) return this;
if (!other.getProjectId().isEmpty()) {
projectId_ = other.projectId_;
onChanged();
}
if (keysBuilder_ == null) {
if (!other.keys_.isEmpty()) {
if (keys_.isEmpty()) {
keys_ = other.keys_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureKeysIsMutable();
keys_.addAll(other.keys_);
}
onChanged();
}
} else {
if (!other.keys_.isEmpty()) {
if (keysBuilder_.isEmpty()) {
keysBuilder_.dispose();
keysBuilder_ = null;
keys_ = other.keys_;
bitField0_ = (bitField0_ & ~0x00000002);
keysBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getKeysFieldBuilder() : null;
} else {
keysBuilder_.addAllMessages(other.keys_);
}
}
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.datastore.v1beta3.AllocateIdsRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.datastore.v1beta3.AllocateIdsRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object projectId_ = "";
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public java.lang.String getProjectId() {
java.lang.Object ref = projectId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
projectId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public com.google.protobuf.ByteString
getProjectIdBytes() {
java.lang.Object ref = projectId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
projectId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public Builder setProjectId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
projectId_ = value;
onChanged();
return this;
}
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public Builder clearProjectId() {
projectId_ = getDefaultInstance().getProjectId();
onChanged();
return this;
}
/**
* <pre>
* The ID of the project against which to make the request.
* </pre>
*
* <code>optional string project_id = 8;</code>
*/
public Builder setProjectIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
projectId_ = value;
onChanged();
return this;
}
private java.util.List<com.google.datastore.v1beta3.Key> keys_ =
java.util.Collections.emptyList();
private void ensureKeysIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
keys_ = new java.util.ArrayList<com.google.datastore.v1beta3.Key>(keys_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.datastore.v1beta3.Key, com.google.datastore.v1beta3.Key.Builder, com.google.datastore.v1beta3.KeyOrBuilder> keysBuilder_;
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public java.util.List<com.google.datastore.v1beta3.Key> getKeysList() {
if (keysBuilder_ == null) {
return java.util.Collections.unmodifiableList(keys_);
} else {
return keysBuilder_.getMessageList();
}
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public int getKeysCount() {
if (keysBuilder_ == null) {
return keys_.size();
} else {
return keysBuilder_.getCount();
}
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.Key getKeys(int index) {
if (keysBuilder_ == null) {
return keys_.get(index);
} else {
return keysBuilder_.getMessage(index);
}
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder setKeys(
int index, com.google.datastore.v1beta3.Key value) {
if (keysBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureKeysIsMutable();
keys_.set(index, value);
onChanged();
} else {
keysBuilder_.setMessage(index, value);
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder setKeys(
int index, com.google.datastore.v1beta3.Key.Builder builderForValue) {
if (keysBuilder_ == null) {
ensureKeysIsMutable();
keys_.set(index, builderForValue.build());
onChanged();
} else {
keysBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder addKeys(com.google.datastore.v1beta3.Key value) {
if (keysBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureKeysIsMutable();
keys_.add(value);
onChanged();
} else {
keysBuilder_.addMessage(value);
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder addKeys(
int index, com.google.datastore.v1beta3.Key value) {
if (keysBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureKeysIsMutable();
keys_.add(index, value);
onChanged();
} else {
keysBuilder_.addMessage(index, value);
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder addKeys(
com.google.datastore.v1beta3.Key.Builder builderForValue) {
if (keysBuilder_ == null) {
ensureKeysIsMutable();
keys_.add(builderForValue.build());
onChanged();
} else {
keysBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder addKeys(
int index, com.google.datastore.v1beta3.Key.Builder builderForValue) {
if (keysBuilder_ == null) {
ensureKeysIsMutable();
keys_.add(index, builderForValue.build());
onChanged();
} else {
keysBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder addAllKeys(
java.lang.Iterable<? extends com.google.datastore.v1beta3.Key> values) {
if (keysBuilder_ == null) {
ensureKeysIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, keys_);
onChanged();
} else {
keysBuilder_.addAllMessages(values);
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder clearKeys() {
if (keysBuilder_ == null) {
keys_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
keysBuilder_.clear();
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public Builder removeKeys(int index) {
if (keysBuilder_ == null) {
ensureKeysIsMutable();
keys_.remove(index);
onChanged();
} else {
keysBuilder_.remove(index);
}
return this;
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.Key.Builder getKeysBuilder(
int index) {
return getKeysFieldBuilder().getBuilder(index);
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.KeyOrBuilder getKeysOrBuilder(
int index) {
if (keysBuilder_ == null) {
return keys_.get(index); } else {
return keysBuilder_.getMessageOrBuilder(index);
}
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public java.util.List<? extends com.google.datastore.v1beta3.KeyOrBuilder>
getKeysOrBuilderList() {
if (keysBuilder_ != null) {
return keysBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(keys_);
}
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.Key.Builder addKeysBuilder() {
return getKeysFieldBuilder().addBuilder(
com.google.datastore.v1beta3.Key.getDefaultInstance());
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public com.google.datastore.v1beta3.Key.Builder addKeysBuilder(
int index) {
return getKeysFieldBuilder().addBuilder(
index, com.google.datastore.v1beta3.Key.getDefaultInstance());
}
/**
* <pre>
* A list of keys with incomplete key paths for which to allocate IDs.
* No key may be reserved/read-only.
* </pre>
*
* <code>repeated .google.datastore.v1beta3.Key keys = 1;</code>
*/
public java.util.List<com.google.datastore.v1beta3.Key.Builder>
getKeysBuilderList() {
return getKeysFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.datastore.v1beta3.Key, com.google.datastore.v1beta3.Key.Builder, com.google.datastore.v1beta3.KeyOrBuilder>
getKeysFieldBuilder() {
if (keysBuilder_ == null) {
keysBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.datastore.v1beta3.Key, com.google.datastore.v1beta3.Key.Builder, com.google.datastore.v1beta3.KeyOrBuilder>(
keys_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
keys_ = null;
}
return keysBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:google.datastore.v1beta3.AllocateIdsRequest)
}
// @@protoc_insertion_point(class_scope:google.datastore.v1beta3.AllocateIdsRequest)
private static final com.google.datastore.v1beta3.AllocateIdsRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.datastore.v1beta3.AllocateIdsRequest();
}
public static com.google.datastore.v1beta3.AllocateIdsRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AllocateIdsRequest>
PARSER = new com.google.protobuf.AbstractParser<AllocateIdsRequest>() {
public AllocateIdsRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AllocateIdsRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<AllocateIdsRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AllocateIdsRequest> getParserForType() {
return PARSER;
}
public com.google.datastore.v1beta3.AllocateIdsRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| apache-2.0 |
jconverter/jconverter | src/main/java/org/jconverter/factory/FactoryChainEvaluator.java | 775 | package org.jconverter.factory;
import java.util.function.Function;
public class FactoryChainEvaluator<T> implements Function<Object, T> {
private final Function<Factory<T>, T> factoryEvaluator;
public FactoryChainEvaluator(Function<Factory<T>, T> factoryEvaluator) {
this.factoryEvaluator = factoryEvaluator;
}
@Override
public T apply(Object processingObject) {
if(processingObject instanceof Factory)
return factoryEvaluator.apply((Factory<T>) processingObject);
else if(processingObject instanceof FactoryChain)
return applyChain((FactoryChain<T>)processingObject);
else
throw new RuntimeException("Wrong processing object.");
}
public T applyChain(FactoryChain<T> factoryChain) {
return (T)factoryChain.apply((Function)this);
}
}
| apache-2.0 |
oehme/analysing-gradle-performance | my-app/src/main/java/org/gradle/test/performance/mediummonolithicjavaproject/p311/Production6230.java | 1891 | package org.gradle.test.performance.mediummonolithicjavaproject.p311;
public class Production6230 {
private String property0;
public String getProperty0() {
return property0;
}
public void setProperty0(String value) {
property0 = value;
}
private String property1;
public String getProperty1() {
return property1;
}
public void setProperty1(String value) {
property1 = value;
}
private String property2;
public String getProperty2() {
return property2;
}
public void setProperty2(String value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | apache-2.0 |
StaticVillage/Trakt-Android | app/src/main/java/com/staticvillage/trakt_android/sync/ShowCollectionFragment.java | 672 | package com.staticvillage.trakt_android.sync;
import com.staticvillage.trakt_android.App;
import com.staticvillage.trakt_android.common.ExtendedResultFragment;
import rx.Observable;
/**
* Created by joelparrish on 11/6/16.
*/
public class ShowCollectionFragment extends ExtendedResultFragment {
public static ShowCollectionFragment newInstance() {
return new ShowCollectionFragment();
}
@Override
public Observable<String> getResult() {
boolean extended = extendedCheckBox.isChecked();
return App.getTraktService()
.getShowCollection(extended)
.map(response -> gson.toJson(response));
}
}
| apache-2.0 |
fenik17/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsQueryContext.java | 9640 | /*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.resolver.dns;
import io.netty.channel.AddressedEnvelope;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelPromise;
import io.netty.handler.codec.dns.AbstractDnsOptPseudoRrRecord;
import io.netty.handler.codec.dns.DnsQuery;
import io.netty.handler.codec.dns.DnsQuestion;
import io.netty.handler.codec.dns.DnsRecord;
import io.netty.handler.codec.dns.DnsResponse;
import io.netty.handler.codec.dns.DnsSection;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.GenericFutureListener;
import io.netty.util.concurrent.Promise;
import io.netty.util.concurrent.ScheduledFuture;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import java.net.InetSocketAddress;
import java.util.concurrent.TimeUnit;
import static io.netty.util.internal.ObjectUtil.checkNotNull;
abstract class DnsQueryContext implements FutureListener<AddressedEnvelope<DnsResponse, InetSocketAddress>> {
private static final InternalLogger logger = InternalLoggerFactory.getInstance(DnsQueryContext.class);
private final DnsNameResolver parent;
private final Promise<AddressedEnvelope<DnsResponse, InetSocketAddress>> promise;
private final int id;
private final DnsQuestion question;
private final DnsRecord[] additionals;
private final DnsRecord optResource;
private final InetSocketAddress nameServerAddr;
private final boolean recursionDesired;
private volatile ScheduledFuture<?> timeoutFuture;
DnsQueryContext(DnsNameResolver parent,
InetSocketAddress nameServerAddr,
DnsQuestion question,
DnsRecord[] additionals,
Promise<AddressedEnvelope<DnsResponse, InetSocketAddress>> promise) {
this.parent = checkNotNull(parent, "parent");
this.nameServerAddr = checkNotNull(nameServerAddr, "nameServerAddr");
this.question = checkNotNull(question, "question");
this.additionals = checkNotNull(additionals, "additionals");
this.promise = checkNotNull(promise, "promise");
recursionDesired = parent.isRecursionDesired();
id = parent.queryContextManager.add(this);
// Ensure we remove the id from the QueryContextManager once the query completes.
promise.addListener(this);
if (parent.isOptResourceEnabled()) {
optResource = new AbstractDnsOptPseudoRrRecord(parent.maxPayloadSize(), 0, 0) {
// We may want to remove this in the future and let the user just specify the opt record in the query.
};
} else {
optResource = null;
}
}
InetSocketAddress nameServerAddr() {
return nameServerAddr;
}
DnsQuestion question() {
return question;
}
DnsNameResolver parent() {
return parent;
}
protected abstract DnsQuery newQuery(int id);
protected abstract Channel channel();
protected abstract String protocol();
void query(boolean flush, ChannelPromise writePromise) {
final DnsQuestion question = question();
final InetSocketAddress nameServerAddr = nameServerAddr();
final DnsQuery query = newQuery(id);
query.setRecursionDesired(recursionDesired);
query.addRecord(DnsSection.QUESTION, question);
for (DnsRecord record: additionals) {
query.addRecord(DnsSection.ADDITIONAL, record);
}
if (optResource != null) {
query.addRecord(DnsSection.ADDITIONAL, optResource);
}
if (logger.isDebugEnabled()) {
logger.debug("{} WRITE: {}, [{}: {}], {}", channel(), protocol(), id, nameServerAddr, question);
}
sendQuery(query, flush, writePromise);
}
private void sendQuery(final DnsQuery query, final boolean flush, final ChannelPromise writePromise) {
if (parent.channelFuture.isDone()) {
writeQuery(query, flush, writePromise);
} else {
parent.channelFuture.addListener(new GenericFutureListener<Future<? super Channel>>() {
@Override
public void operationComplete(Future<? super Channel> future) {
if (future.isSuccess()) {
// If the query is done in a late fashion (as the channel was not ready yet) we always flush
// to ensure we did not race with a previous flush() that was done when the Channel was not
// ready yet.
writeQuery(query, true, writePromise);
} else {
Throwable cause = future.cause();
promise.tryFailure(cause);
writePromise.setFailure(cause);
}
}
});
}
}
private void writeQuery(final DnsQuery query, final boolean flush, final ChannelPromise writePromise) {
final ChannelFuture writeFuture = flush ? channel().writeAndFlush(query, writePromise) :
channel().write(query, writePromise);
if (writeFuture.isDone()) {
onQueryWriteCompletion(writeFuture);
} else {
writeFuture.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) {
onQueryWriteCompletion(writeFuture);
}
});
}
}
private void onQueryWriteCompletion(ChannelFuture writeFuture) {
if (!writeFuture.isSuccess()) {
tryFailure("failed to send a query via " + protocol(), writeFuture.cause(), false);
return;
}
// Schedule a query timeout task if necessary.
final long queryTimeoutMillis = parent.queryTimeoutMillis();
if (queryTimeoutMillis > 0) {
timeoutFuture = parent.ch.eventLoop().schedule(new Runnable() {
@Override
public void run() {
if (promise.isDone()) {
// Received a response before the query times out.
return;
}
tryFailure("query via " + protocol() + " timed out after " +
queryTimeoutMillis + " milliseconds", null, true);
}
}, queryTimeoutMillis, TimeUnit.MILLISECONDS);
}
}
/**
* Takes ownership of passed envelope
*/
void finish(AddressedEnvelope<? extends DnsResponse, InetSocketAddress> envelope) {
final DnsResponse res = envelope.content();
if (res.count(DnsSection.QUESTION) != 1) {
logger.warn("Received a DNS response with invalid number of questions: {}", envelope);
} else if (!question().equals(res.recordAt(DnsSection.QUESTION))) {
logger.warn("Received a mismatching DNS response: {}", envelope);
} else if (trySuccess(envelope)) {
return; // Ownership transferred, don't release
}
envelope.release();
}
@SuppressWarnings("unchecked")
private boolean trySuccess(AddressedEnvelope<? extends DnsResponse, InetSocketAddress> envelope) {
return promise.trySuccess((AddressedEnvelope<DnsResponse, InetSocketAddress>) envelope);
}
boolean tryFailure(String message, Throwable cause, boolean timeout) {
if (promise.isDone()) {
return false;
}
final InetSocketAddress nameServerAddr = nameServerAddr();
final StringBuilder buf = new StringBuilder(message.length() + 64);
buf.append('[')
.append(nameServerAddr)
.append("] ")
.append(message)
.append(" (no stack trace available)");
final DnsNameResolverException e;
if (timeout) {
// This was caused by an timeout so use DnsNameResolverTimeoutException to allow the user to
// handle it special (like retry the query).
e = new DnsNameResolverTimeoutException(nameServerAddr, question(), buf.toString());
} else {
e = new DnsNameResolverException(nameServerAddr, question(), buf.toString(), cause);
}
return promise.tryFailure(e);
}
@Override
public void operationComplete(Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> future) {
// Cancel the timeout task.
final ScheduledFuture<?> timeoutFuture = this.timeoutFuture;
if (timeoutFuture != null) {
this.timeoutFuture = null;
timeoutFuture.cancel(false);
}
// Remove the id from the manager as soon as the query completes. This may be because of success, failure or
// cancellation
parent.queryContextManager.remove(nameServerAddr, id);
}
}
| apache-2.0 |
volcacius/Giftlist | app/src/main/java/it/polimi/dima/giftlist/presentation/module/ProductDetailsPagerModule.java | 950 | package it.polimi.dima.giftlist.presentation.module;
import android.support.v4.app.FragmentManager;
import java.util.ArrayList;
import java.util.List;
import dagger.Module;
import dagger.Provides;
import it.polimi.dima.giftlist.data.model.Product;
import it.polimi.dima.giftlist.di.PerActivity;
import it.polimi.dima.giftlist.presentation.view.adapter.ProductDetailsPagerAdapter;
/**
* Created by Alessandro on 11/08/16.
*/
@Module
public class ProductDetailsPagerModule {
private FragmentManager fragmentManager;
private ArrayList<Product> productList;
public ProductDetailsPagerModule(FragmentManager fragmentManager, ArrayList<Product> productList) {
this.fragmentManager = fragmentManager;
this.productList = productList;
}
@Provides
@PerActivity
ProductDetailsPagerAdapter providesProductDetailsAdapter() {
return new ProductDetailsPagerAdapter(fragmentManager, productList);
}
}
| apache-2.0 |
zhangxin23/zookeeper-sandbox | src/main/java/net/coderland/zookeeper/dubbo/common/utils/ClassHelper.java | 7513 | package net.coderland.zookeeper.dubbo.common.utils;
import java.lang.reflect.Array;
import java.util.*;
/**
* User: zhangxin
* Date: 2017-01-11
* Time: 10:05:00
*/
public class ClassHelper {
public static Class<?> forNameWithThreadContextClassLoader(String name)
throws ClassNotFoundException {
return forName(name, Thread.currentThread().getContextClassLoader());
}
public static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller)
throws ClassNotFoundException {
return forName(name, caller.getClassLoader());
}
public static ClassLoader getCallerClassLoader(Class<?> caller) {
return caller.getClassLoader();
}
/**
* get class loader
*
* @param cls
* @return class loader
*/
public static ClassLoader getClassLoader(Class<?> cls) {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back to system class loader...
}
if (cl == null) {
// No thread context class loader -> use class loader of this class.
cl = cls.getClassLoader();
}
return cl;
}
/**
* Return the default ClassLoader to use: typically the thread context
* ClassLoader, if available; the ClassLoader that loaded the ClassUtils
* class will be used as fallback.
* <p>
* Call this method if you intend to use the thread context ClassLoader in a
* scenario where you absolutely need a non-null ClassLoader reference: for
* example, for class path resource loading (but not necessarily for
* <code>Class.forName</code>, which accepts a <code>null</code> ClassLoader
* reference as well).
*
* @return the default ClassLoader (never <code>null</code>)
* @see java.lang.Thread#getContextClassLoader()
*/
public static ClassLoader getClassLoader() {
return getClassLoader(ClassHelper.class);
}
/**
* Same as <code>Class.forName()</code>, except that it works for primitive
* types.
*/
public static Class<?> forName(String name) throws ClassNotFoundException {
return forName(name, getClassLoader());
}
/**
* Replacement for <code>Class.forName()</code> that also returns Class
* instances for primitives (like "int") and array class names (like
* "String[]").
*
* @param name the name of the Class
* @param classLoader the class loader to use (may be <code>null</code>,
* which indicates the default class loader)
* @return Class instance for the supplied name
* @throws ClassNotFoundException if the class was not found
* @throws LinkageError if the class file could not be loaded
* @see Class#forName(String, boolean, ClassLoader)
*/
public static Class<?> forName(String name, ClassLoader classLoader)
throws ClassNotFoundException, LinkageError {
Class<?> clazz = resolvePrimitiveClassName(name);
if (clazz != null) {
return clazz;
}
// "java.lang.String[]" style arrays
if (name.endsWith(ARRAY_SUFFIX)) {
String elementClassName = name.substring(0, name.length() - ARRAY_SUFFIX.length());
Class<?> elementClass = forName(elementClassName, classLoader);
return Array.newInstance(elementClass, 0).getClass();
}
// "[Ljava.lang.String;" style arrays
int internalArrayMarker = name.indexOf(INTERNAL_ARRAY_PREFIX);
if (internalArrayMarker != -1 && name.endsWith(";")) {
String elementClassName = null;
if (internalArrayMarker == 0) {
elementClassName = name
.substring(INTERNAL_ARRAY_PREFIX.length(), name.length() - 1);
} else if (name.startsWith("[")) {
elementClassName = name.substring(1);
}
Class<?> elementClass = forName(elementClassName, classLoader);
return Array.newInstance(elementClass, 0).getClass();
}
ClassLoader classLoaderToUse = classLoader;
if (classLoaderToUse == null) {
classLoaderToUse = getClassLoader();
}
return classLoaderToUse.loadClass(name);
}
/**
* Resolve the given class name as primitive class, if appropriate,
* according to the JVM's naming rules for primitive classes.
* <p>
* Also supports the JVM's internal class names for primitive arrays. Does
* <i>not</i> support the "[]" suffix notation for primitive arrays; this is
* only supported by {@link #forName}.
*
* @param name the name of the potentially primitive class
* @return the primitive class, or <code>null</code> if the name does not
* denote a primitive class or primitive array class
*/
public static Class<?> resolvePrimitiveClassName(String name) {
Class<?> result = null;
// Most class names will be quite long, considering that they
// SHOULD sit in a package, so a length check is worthwhile.
if (name != null && name.length() <= 8) {
// Could be a primitive - likely.
result = (Class<?>) primitiveTypeNameMap.get(name);
}
return result;
}
/** Suffix for array class names: "[]" */
public static final String ARRAY_SUFFIX = "[]";
/** Prefix for internal array class names: "[L" */
private static final String INTERNAL_ARRAY_PREFIX = "[L";
/**
* Map with primitive type name as key and corresponding primitive type as
* value, for example: "int" -> "int.class".
*/
private static final Map<String,Class<?>> primitiveTypeNameMap = new HashMap<String, Class<?>>(16);
/**
* Map with primitive wrapper type as key and corresponding primitive type
* as value, for example: Integer.class -> int.class.
*/
private static final Map<Class<?>,Class<?>> primitiveWrapperTypeMap = new HashMap<Class<?>, Class<?>>(8);
static {
primitiveWrapperTypeMap.put(Boolean.class, boolean.class);
primitiveWrapperTypeMap.put(Byte.class, byte.class);
primitiveWrapperTypeMap.put(Character.class, char.class);
primitiveWrapperTypeMap.put(Double.class, double.class);
primitiveWrapperTypeMap.put(Float.class, float.class);
primitiveWrapperTypeMap.put(Integer.class, int.class);
primitiveWrapperTypeMap.put(Long.class, long.class);
primitiveWrapperTypeMap.put(Short.class, short.class);
Set<Class<?>> primitiveTypeNames = new HashSet<Class<?>>(16);
primitiveTypeNames.addAll(primitiveWrapperTypeMap.values());
primitiveTypeNames.addAll(Arrays
.asList(new Class<?>[] { boolean[].class, byte[].class, char[].class, double[].class,
float[].class, int[].class, long[].class, short[].class }));
for (Iterator<Class<?>> it = primitiveTypeNames.iterator(); it.hasNext();) {
Class<?> primitiveClass = (Class<?>) it.next();
primitiveTypeNameMap.put(primitiveClass.getName(), primitiveClass);
}
}
public static String toShortString(Object obj){
if(obj == null){
return "null";
}
return obj.getClass().getSimpleName() + "@" + System.identityHashCode(obj);
}
} | apache-2.0 |
secondflying/dfyy | src/main/java/com/dfyy/dto/FollowSta.java | 849 | package com.dfyy.dto;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.dfyy.bussiness.SUser;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class FollowSta implements Serializable {
private static final long serialVersionUID = 1L;
@XmlElement
private SUser user;
@XmlElement
private Long count;
public FollowSta() {
}
public FollowSta(Long count, SUser rUser) {
super();
this.user = rUser;
this.count = count;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public SUser getUser() {
return user;
}
public void setUser(SUser user) {
this.user = user;
}
}
| apache-2.0 |
azuki-framework/azuki-business | src/main/java/org/azkfw/business/logic/AbstractDatabaseLogic.java | 2455 | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.azkfw.business.logic;
import java.sql.SQLException;
import org.azkfw.persistence.database.DatabaseConnection;
import org.azkfw.persistence.database.DatabaseConnectionSupport;
/**
* このクラスは、データベース機能を実装するロジッククラスです。
*
* @since 1.0.0
* @version 1.0.0 2013/02/05
* @author Kawakicchi
*/
public abstract class AbstractDatabaseLogic extends AbstractPersistenceLogic implements DatabaseConnectionSupport {
/**
* コネクション情報
*/
private DatabaseConnection connection;
/**
* コンストラクタ
*/
public AbstractDatabaseLogic() {
super();
}
/**
* コンストラクタ
*
* @param aName 名前
*/
public AbstractDatabaseLogic(final String aName) {
super(aName);
}
/**
* コンストラクタ
*
* @param aClass クラス
*/
public AbstractDatabaseLogic(final Class<?> aClass) {
super(aClass);
}
@Override
public final void setConnection(final DatabaseConnection aConnection) {
connection = aConnection;
}
/**
* コネクションを取得する。
*
* @return コネクション
*/
protected final DatabaseConnection getConnection() {
return connection;
}
/**
* コミット処理を行う。
*
* @throws SQLException SQL実行中に問題が発生した場合
*/
protected final void commit() throws SQLException {
connection.getConnection().commit();
}
/**
* ロールバック処理を行う。
*
* @throws SQLException SQL実行中に問題が発生した場合
*/
protected final void rollback() throws SQLException {
connection.getConnection().rollback();
}
}
| apache-2.0 |
vespa-engine/vespa | indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/NormalizeExpression.java | 2999 | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.indexinglanguage.expressions;
import com.yahoo.document.DataType;
import com.yahoo.document.datatypes.StringFieldValue;
import com.yahoo.language.Linguistics;
import com.yahoo.language.process.Transformer;
import java.util.logging.Logger;
import java.util.logging.Level;
/**
* @author Simon Thoresen Hult
*/
public final class NormalizeExpression extends Expression {
private final Linguistics linguistics;
private static final Logger logger = Logger.getLogger(NormalizeExpression.class.getName());
public NormalizeExpression(Linguistics linguistics) {
super(DataType.STRING);
this.linguistics = linguistics;
}
public Linguistics getLinguistics() {
return linguistics;
}
private static String escape(String str) {
StringBuilder buf = new StringBuilder();
for (char c : str.toCharArray()) {
if (c >= ' ') {
buf.append(c);
} else {
buf.append(String.format("U+%04X", (int)c));
}
}
return buf.toString();
}
@Override
protected void doExecute(ExecutionContext context) {
Transformer transformer = linguistics.getTransformer();
var orig = String.valueOf(context.getValue());
if (orig.isEmpty()) {
return; // must be a no-op for all linguistics/language combinations
}
var lang = context.resolveLanguage(linguistics);
var transformed = transformer.accentDrop(orig, lang);
try {
context.setValue(new StringFieldValue(transformed));
return;
} catch (IllegalArgumentException ex) {
String msg = ("bad normalize, \n" +
"original: >>> " + escape(orig) + " <<<\n" +
" -> accentDrop(" + lang + ") -> \n" +
"transformed: >>> " + escape(transformed) + " <<<");
logger.log(Level.SEVERE, msg);
}
context.setValue(new StringFieldValue(transformer.accentDrop(String.valueOf(context.getValue()),
context.resolveLanguage(linguistics))));
}
@Override
protected void doVerify(VerificationContext context) {
context.setValueType(createdOutputType());
}
@Override
public DataType createdOutputType() {
return DataType.STRING;
}
@Override
public String toString() {
return "normalize";
}
@Override
public boolean equals(Object o) {
if (!(o instanceof NormalizeExpression)) return false;
NormalizeExpression other = (NormalizeExpression)o;
if (linguistics.getClass() != other.linguistics.getClass()) return false;
return true;
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
| apache-2.0 |
googleads/google-ads-java | google-ads-stubs-v8/src/test/java/com/google/ads/googleads/v8/services/MockThirdPartyAppAnalyticsLinkServiceImpl.java | 3833 | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.ads.googleads.v8.services;
import com.google.ads.googleads.v8.resources.ThirdPartyAppAnalyticsLink;
import com.google.ads.googleads.v8.services.ThirdPartyAppAnalyticsLinkServiceGrpc.ThirdPartyAppAnalyticsLinkServiceImplBase;
import com.google.api.core.BetaApi;
import com.google.protobuf.AbstractMessage;
import io.grpc.stub.StreamObserver;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import javax.annotation.Generated;
@BetaApi
@Generated("by gapic-generator-java")
public class MockThirdPartyAppAnalyticsLinkServiceImpl
extends ThirdPartyAppAnalyticsLinkServiceImplBase {
private List<AbstractMessage> requests;
private Queue<Object> responses;
public MockThirdPartyAppAnalyticsLinkServiceImpl() {
requests = new ArrayList<>();
responses = new LinkedList<>();
}
public List<AbstractMessage> getRequests() {
return requests;
}
public void addResponse(AbstractMessage response) {
responses.add(response);
}
public void setResponses(List<AbstractMessage> responses) {
this.responses = new LinkedList<Object>(responses);
}
public void addException(Exception exception) {
responses.add(exception);
}
public void reset() {
requests = new ArrayList<>();
responses = new LinkedList<>();
}
@Override
public void getThirdPartyAppAnalyticsLink(
GetThirdPartyAppAnalyticsLinkRequest request,
StreamObserver<ThirdPartyAppAnalyticsLink> responseObserver) {
Object response = responses.poll();
if (response instanceof ThirdPartyAppAnalyticsLink) {
requests.add(request);
responseObserver.onNext(((ThirdPartyAppAnalyticsLink) response));
responseObserver.onCompleted();
} else if (response instanceof Exception) {
responseObserver.onError(((Exception) response));
} else {
responseObserver.onError(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetThirdPartyAppAnalyticsLink, expected %s or %s",
response == null ? "null" : response.getClass().getName(),
ThirdPartyAppAnalyticsLink.class.getName(),
Exception.class.getName())));
}
}
@Override
public void regenerateShareableLinkId(
RegenerateShareableLinkIdRequest request,
StreamObserver<RegenerateShareableLinkIdResponse> responseObserver) {
Object response = responses.poll();
if (response instanceof RegenerateShareableLinkIdResponse) {
requests.add(request);
responseObserver.onNext(((RegenerateShareableLinkIdResponse) response));
responseObserver.onCompleted();
} else if (response instanceof Exception) {
responseObserver.onError(((Exception) response));
} else {
responseObserver.onError(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method RegenerateShareableLinkId, expected %s or %s",
response == null ? "null" : response.getClass().getName(),
RegenerateShareableLinkIdResponse.class.getName(),
Exception.class.getName())));
}
}
}
| apache-2.0 |
jentfoo/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/DescribeActivationsResultJsonUnmarshaller.java | 3208 | /*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.simplesystemsmanagement.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.simplesystemsmanagement.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DescribeActivationsResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeActivationsResultJsonUnmarshaller implements Unmarshaller<DescribeActivationsResult, JsonUnmarshallerContext> {
public DescribeActivationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DescribeActivationsResult describeActivationsResult = new DescribeActivationsResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return describeActivationsResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("ActivationList", targetDepth)) {
context.nextToken();
describeActivationsResult.setActivationList(new ListUnmarshaller<Activation>(ActivationJsonUnmarshaller.getInstance()).unmarshall(context));
}
if (context.testExpression("NextToken", targetDepth)) {
context.nextToken();
describeActivationsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return describeActivationsResult;
}
private static DescribeActivationsResultJsonUnmarshaller instance;
public static DescribeActivationsResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DescribeActivationsResultJsonUnmarshaller();
return instance;
}
}
| apache-2.0 |
Sproutigy/Java-Commons-Async | src/main/java/com/sproutigy/commons/async/OptionalLogger.java | 2376 | package com.sproutigy.commons.async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final class OptionalLogger {
private OptionalLogger() {
}
public static <T> Logger getLogger(Class<T> clazz) {
try {
Class.forName("org.slf4j.Logger");
return LoggerFactory.getLogger(clazz);
} catch (ClassNotFoundException ignore) {
}
return null;
}
public static void trace(Logger logger, String message, Object... objects) {
if (logger != null) {
logger.trace(message, objects);
} else {
System.err.println("[TRACE] " + resolveString(message, objects));
}
}
public static void debug(Logger logger, String message, Object... objects) {
if (logger != null) {
logger.debug(message, objects);
} else {
System.err.println("[DEBUG] " + resolveString(message, objects));
}
}
public static void info(Logger logger, String message, Object... objects) {
if (logger != null) {
logger.info(message, objects);
} else {
System.err.println("[INFO] " + resolveString(message, objects));
}
}
public static void warn(Logger logger, String message, Object... objects) {
if (logger != null) {
logger.warn(message, objects);
} else {
System.err.println("[WARN] " + resolveString(message, objects));
}
}
public static void error(Logger logger, String message, Object... objects) {
if (logger != null) {
logger.error(resolveString(message, objects));
} else {
System.err.println("[ERROR] " + resolveString(message, objects));
if (objects.length > 0) {
Object lastObj = objects[objects.length - 1];
if (lastObj instanceof Throwable) {
((Throwable) lastObj).printStackTrace();
}
}
}
}
private static String resolveString(String message, Object... objects) {
String msg = message;
for (int i = 0; i < objects.length; i++) {
int idx = message.indexOf("{}");
if (idx >= 0) {
msg = msg.substring(idx) + objects[i] + msg.substring(idx + 2);
}
}
return msg;
}
}
| apache-2.0 |
herrevilkitten/slack-java-rtm | src/main/java/org/evilkitten/slack/SlackBot.java | 10515 | package org.evilkitten.slack;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
import lombok.Singular;
import net.jodah.typetools.TypeResolver;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.StatusLine;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.evilkitten.slack.client.DefaultRtmWebSocketClient;
import org.evilkitten.slack.client.RtmWebSocketClient;
import org.evilkitten.slack.entity.*;
import org.evilkitten.slack.handler.RtmHandler;
import org.evilkitten.slack.handler.RtmMessageHandler;
import org.evilkitten.slack.response.PostProcessing;
import org.evilkitten.slack.response.Response;
import org.evilkitten.slack.response.api.RtmStartResponse;
import org.evilkitten.slack.response.rtm.RtmEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.websocket.ContainerProvider;
import javax.websocket.DeploymentException;
import javax.websocket.Session;
import javax.websocket.WebSocketContainer;
import java.io.Closeable;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.*;
import java.util.stream.Collectors;
@Data
public class SlackBot implements Closeable {
private final static String API_PROTOCOL = "https";
private final static String API_HOST = "api.slack.com";
private final static String API_PATH = "/api/";
private final static String API_QUERY = API_PROTOCOL + "://" + API_HOST + API_PATH;
private final static String AGENT_KEY = "agent";
private final static String TOKEN_KEY = "token";
private final static String DEFAULT_AGENT_NAME = "java-slack";
private final static String DEFAULT_PING_MESSAGE = "{\"type\": \"ping\"}";
private final static long DEFAULT_PING_INTERVAL = 5000L;
private final static String CONTENT_TYPE_HEADER = "Content-Type";
private final static String CONTENT_TYPE = "application/x-www-form-urlencoded";
private final static Logger LOGGER = LoggerFactory.getLogger(SlackBot.class);
private final List<RtmHandler> handlers = new ArrayList<>();
private final String token;
private final ObjectMapper objectMapper;
private final long pingInterval;
private final String agentName;
@Singular
private final Map<String, User> users = new HashMap<>();
@Singular
private final Map<String, Channel> channels = new HashMap<>();
// private final Map<String, Group> groups = new HashMap<>();
// private final Map<String, Im> ims = new HashMap<>();
// Subteams
@Singular
private final Map<String, Bot> bots = new HashMap<>();
@Setter(AccessLevel.NONE)
private Session webSocketSession;
@Setter(AccessLevel.NONE)
private RtmWebSocketClient rtmWebSocketClient;
@Setter(AccessLevel.NONE)
private RtmStartResponse rtmRtmStartResponse;
@Setter(AccessLevel.NONE)
private PingTimerTask pingTimerTask;
@Setter(AccessLevel.NONE)
private Timer pingTimer;
@Setter(AccessLevel.NONE)
private long currentEventId = 0;
private SlackBot(String token, ObjectMapper objectMapper, long pingInterval, String agentName) {
this.pingInterval = pingInterval;
this.agentName = agentName;
this.token = Objects.requireNonNull(token, "API token must be defined");
this.objectMapper = Objects.requireNonNull(objectMapper, "A Jackson ObjectMapper must be provided")
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
this.rtmWebSocketClient = new DefaultRtmWebSocketClient(objectMapper, this);
}
private HttpEntity stringifyParameters(Map<String, String> parameters) throws UnsupportedEncodingException {
List<NameValuePair> entries = parameters.entrySet().stream().map(entry -> new BasicNameValuePair(entry.getKey(), entry.getValue())).collect(Collectors.toList());
return new UrlEncodedFormEntity(entries);
}
private ApiResponse api(String method, Map<String, String> parameters, Class<? extends Response> responseClass) {
if (parameters == null) {
parameters = new HashMap<>();
}
parameters.put(TOKEN_KEY, token);
if (!StringUtils.isEmpty(agentName)) {
parameters.put(AGENT_KEY, agentName);
}
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost(API_QUERY + method);
httpPost.setHeader(CONTENT_TYPE_HEADER, CONTENT_TYPE);
httpPost.setEntity(stringifyParameters(parameters));
CloseableHttpResponse httpResponse = httpClient.execute(httpPost);
StatusLine statusLine = httpResponse.getStatusLine();
HttpEntity entity = httpResponse.getEntity();
String responseText = EntityUtils.toString(entity);
LOGGER.debug("Received status code {}", statusLine);
LOGGER.debug("Received response: {}", responseText);
Response responseObject = objectMapper.readValue(responseText, responseClass);
if (responseObject instanceof PostProcessing) {
((PostProcessing) responseObject).postProcess(this);
}
return new ApiResponse(statusLine.getStatusCode(), statusLine.getReasonPhrase(), responseText, responseObject);
} catch (IOException e) {
LOGGER.error(e.toString(), e);
throw new SlackException(e);
}
}
synchronized public void send(RtmEvent event) {
try {
event.setId(currentEventId++);
send(objectMapper.writeValueAsString(event));
} catch (JsonProcessingException e) {
throw new SlackException(e);
}
}
public void send(Object object) {
try {
send(objectMapper.writeValueAsString(object));
} catch (JsonProcessingException e) {
throw new SlackException(e);
}
}
synchronized public void send(String text) {
try {
this.webSocketSession.getBasicRemote().sendText(text);
} catch (IOException e) {
throw new SlackException(e);
}
}
public void connect() {
try {
ApiResponse apiResponse = api("rtm.start", new HashMap<>(), RtmStartResponse.class);
rtmRtmStartResponse = (RtmStartResponse) apiResponse.getResponseObject();
LOGGER.debug("json {}", objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(rtmRtmStartResponse));
if (!rtmRtmStartResponse.isOk()) {
throw new SlackException(rtmRtmStartResponse.getError());
}
WebSocketContainer webSocketContainer = ContainerProvider.getWebSocketContainer();
webSocketSession = webSocketContainer.connectToServer(rtmWebSocketClient, rtmRtmStartResponse.getUrl());
if (pingInterval > 0L) {
pingTimerTask = new PingTimerTask();
pingTimer = new Timer(true);
pingTimer.scheduleAtFixedRate(pingTimerTask, 0, pingInterval);
}
} catch (DeploymentException | IOException e) {
throw new SlackException(e);
}
}
public void disconnect() {
try {
webSocketSession.close();
if (pingTimer != null) {
pingTimer.cancel();
pingTimer = null;
}
} catch (IOException e) {
throw new SlackException(e);
}
}
public boolean isConnected() {
return webSocketSession != null && webSocketSession.isOpen();
}
public Self getSelf() {
if (rtmRtmStartResponse != null) {
return rtmRtmStartResponse.getSelf();
}
return null;
}
public Team getTeam() {
if (rtmRtmStartResponse != null) {
return rtmRtmStartResponse.getTeam();
}
return null;
}
public Channel getChannel(String channelId) {
if (!channels.containsKey(channelId)) {
channels.put(channelId, new Channel());
}
return channels.get(channelId);
}
public User getUser(String userId) {
if (!users.containsKey(userId)) {
users.put(userId, new User());
}
return users.get(userId);
}
@Override
public void close() throws IOException {
disconnect();
}
/*
public void addHandler(RtmMessageHandler<?> handler) {
this.handlers.add(handler);
if (rtmWebSocketClient instanceof DefaultRtmWebSocketClient) {
((DefaultRtmWebSocketClient) rtmWebSocketClient).addHandler(handler);
}
return this;
}
*/
public SlackBot addHandler(RtmHandler handler) {
this.handlers.add(handler);
if (rtmWebSocketClient instanceof DefaultRtmWebSocketClient) {
((DefaultRtmWebSocketClient) rtmWebSocketClient).addHandler(handler);
}
return this;
}
public static class Builder {
private String token = "";
private ObjectMapper objectMapper = new ObjectMapper();
public Builder(String token) {
this.token = Objects.requireNonNull(token, "API token must be set");
}
public Builder setObjectMapper(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
return this;
}
public Builder setPingInterval(long pingInterval) {
this.pingInterval = pingInterval;
return this;
}
public Builder setAgentName(String agentName) {
this.agentName = agentName;
return this;
}
public SlackBot build() {
if (StringUtils.isEmpty(token)) {
throw new IllegalArgumentException("API token must be set");
}
return new SlackBot(token, objectMapper, pingInterval, agentName);
}
private String agentName = DEFAULT_AGENT_NAME;
private long pingInterval = DEFAULT_PING_INTERVAL;
}
@Data
public class ApiResponse {
private int statusCode;
private String statusLine;
private String responseText;
private Response responseObject;
public ApiResponse(int statusCode, String statusLine, String responseText, Response responseObject) {
this.statusCode = statusCode;
this.statusLine = statusLine;
this.responseText = responseText;
this.responseObject = responseObject;
}
}
private class PingTimerTask extends TimerTask {
@Override
public void run() {
try {
webSocketSession.getBasicRemote().sendText(DEFAULT_PING_MESSAGE);
} catch (IOException e) {
LOGGER.warn("Unable to send ping", e);
pingTimer.cancel();
}
}
}
}
| apache-2.0 |
devacfr/multicast-event | multicastevent-core/src/test/java/org/cfr/multicastevent/core/MemberLeftEventTest.java | 961 | /**
* Copyright 2014 devacfr<christophefriederich@mac.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cfr.multicastevent.core;
import org.cfr.multicastevent.core.spi.IMember;
import org.easymock.EasyMock;
import org.junit.Test;
public class MemberLeftEventTest {
@Test
public void testMemberLeftEvent() {
new MemberLeftEvent(EasyMock.createMock(IMember.class), new Object());
}
}
| apache-2.0 |
aws/aws-sdk-java | aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/model/PluginNameValue.java | 1850 | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.databasemigrationservice.model;
import javax.annotation.Generated;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum PluginNameValue {
NoPreference("no-preference"),
TestDecoding("test-decoding"),
Pglogical("pglogical");
private String value;
private PluginNameValue(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
/**
* Use this in place of valueOf.
*
* @param value
* real value
* @return PluginNameValue corresponding to the value
*
* @throws IllegalArgumentException
* If the specified value does not map to one of the known values in this enum.
*/
public static PluginNameValue fromValue(String value) {
if (value == null || "".equals(value)) {
throw new IllegalArgumentException("Value cannot be null or empty!");
}
for (PluginNameValue enumEntry : PluginNameValue.values()) {
if (enumEntry.toString().equals(value)) {
return enumEntry;
}
}
throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
}
}
| apache-2.0 |
LineChen/MultipleMenu | library/src/test/java/com/beiing/library/ExampleUnitTest.java | 396 | package com.beiing.library;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | apache-2.0 |
Mahoney/wiremock | src/test/java/com/github/tomakehurst/wiremock/direct/DirectCallHttpServerTest.java | 6255 | package com.github.tomakehurst.wiremock.direct;
import com.github.tomakehurst.wiremock.common.JettySettings;
import com.github.tomakehurst.wiremock.core.Options;
import com.github.tomakehurst.wiremock.http.*;
import com.google.common.base.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import java.util.concurrent.TimeoutException;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
@ExtendWith(MockitoExtension.class)
class DirectCallHttpServerTest {
@Mock
private SleepFacade sleepFacade;
@Mock
private Options options;
@Mock
private JettySettings jettySettings;
@Mock
private
AdminRequestHandler adminRequestHandler;
@Mock
private StubRequestHandler stubRequestHandler;
private DirectCallHttpServer server;
@BeforeEach
void setup() {
when(options.jettySettings()).thenReturn(jettySettings);
when(jettySettings.getStopTimeout()).thenReturn(Optional.absent());
server = new DirectCallHttpServer(sleepFacade, options, adminRequestHandler, stubRequestHandler);
}
@Nested
class Constructor {
@Test
void publicConstructor() {
assertDoesNotThrow(() -> new DirectCallHttpServer(options, adminRequestHandler, stubRequestHandler));
}
}
@Nested
class Start {
@Test
void doesNothing() {
assertDoesNotThrow(() -> server.start());
}
}
@Nested
class Stop {
@Test
void doesNothing() {
assertDoesNotThrow(() -> server.start());
}
}
@Nested
class IsRunning {
@Test
void isAlwaysTrue() {
assertTrue(server.isRunning());
}
@Test
void isUnaffectedByStop() {
boolean isRunning = server.isRunning();
server.stop();
assertEquals(server.isRunning(), isRunning);
}
}
@Nested
class Port {
@Test
void isInvalidPortNumber() {
assertEquals(server.port(), -1);
}
}
@Nested
class HttpsPort {
@Test
void isInvalidPortNumber() {
assertEquals(server.httpsPort(), -2);
}
}
@Nested
class AdminRequest extends AbstractRequestHandlerTest {
@Override
AbstractRequestHandler handler() {
return adminRequestHandler;
}
@Override
Response handle(Request request) {
return server.adminRequest(request);
}
}
@Nested
class StubRequest extends AbstractRequestHandlerTest {
@Override
AbstractRequestHandler handler() {
return stubRequestHandler;
}
@Override
Response handle(Request request) {
return server.stubRequest(request);
}
}
abstract class AbstractRequestHandlerTest {
abstract AbstractRequestHandler handler();
abstract Response handle(Request request);
@Mock
private Request request;
@Mock
private Response response;
private Response actual;
@Nested
class HappyPath {
@BeforeEach
void setup() {
doAnswer((i) -> {
HttpResponder responder = i.getArgument(1, HttpResponder.class);
responder.respond(request, response);
return null;
}).when(handler()).handle(any(), any());
actual = handle(request);
}
@Test
void delegatesRequest() {
verify(handler()).handle(eq(request), any());
}
@Test
void returnsResponse() {
assertEquals(response, actual);
}
}
@Nested
class WhenDelay {
@Nested
class WhenFixed {
@BeforeEach
void setup() {
when(response.getInitialDelay()).thenReturn(1000L);
doAnswer((i) -> {
HttpResponder responder = i.getArgument(1, HttpResponder.class);
responder.respond(request, response);
return null;
}).when(handler()).handle(any(), any());
actual = handle(request);
}
@Test
void delegatesRequest() {
verify(handler()).handle(eq(request), any());
}
@Test
void delegatesDelays() {
verify(sleepFacade).sleep(1000L);
}
@Test
void returnsResponse() {
assertEquals(response, actual);
}
}
@Nested
class WhenRandomDelay {
@Disabled("Needs to be implemented")
@Test
void todo() {
fail();
}
}
@Disabled("Is not implemented")
@Nested
class ChunkedDribbleDelay {
}
}
@Disabled("Is not implemented")
@Nested
class Fault {
}
@Nested
class AsyncTimeout {
@BeforeEach
void setup() {
when(jettySettings.getStopTimeout()).thenReturn(Optional.of(5L));
server = new DirectCallHttpServer(options, adminRequestHandler, stubRequestHandler);
}
@Test
void throwsIllegalStateExceptionWhenNoResponse() {
IllegalStateException actual = assertThrows(IllegalStateException.class, () -> handle(request));
assertEquals("The request was not handled within the timeout of 5ms", actual.getMessage());
assertTrue(actual.getCause() instanceof TimeoutException);
}
}
}
}
| apache-2.0 |
touwolf/kasije | kasije-core/src/main/java/com/kasije/core/impl/themes/WebSiteThemeImpl.java | 2997 | /*
* Copyright 2016 Kasije Framework.
*
* 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.kasije.core.impl.themes;
import com.kasije.core.RequestContext;
import com.kasije.core.WebSite;
import com.kasije.core.WebSiteTheme;
import com.kasije.core.config.sites.model.Theme;
import com.kasije.core.tpl.TemplateContext;
import com.kasije.core.tpl.TemplateEngine;
import java.io.File;
import java.io.IOException;
import org.apache.commons.lang.StringUtils;
/**
*
*/
public class WebSiteThemeImpl implements WebSiteTheme
{
private final String name;
private final TemplateEngine[] tplEngines;
private final File file;
public WebSiteThemeImpl(WebSite webSite, TemplateEngine[] tplEngines)
{
this.name = webSite.getTheme().getName();
this.tplEngines = tplEngines;
this.file = findThemeFile(webSite);
}
@Override
public String getName()
{
return name;
}
@Override
public File getFile()
{
return file;
}
@Override
public boolean render(RequestContext reqCtx) throws IOException
{
for (TemplateEngine engine : tplEngines)
{
TemplateContext context = engine.createContext(file);
if (context.render(reqCtx))
{
return true;
}
}
return false;
}
private File findThemeFile(WebSite webSite)
{
Theme themeConfig = webSite.getTheme();
String name = themeConfig.getName();
if (StringUtils.isNotBlank(themeConfig.getPath()))
{
File file = new File(themeConfig.getPath() + "/" + name);
if (file.exists() && file.isDirectory())
{
return file;
}
}
File file = new File("./themes/" + name);
if (file.exists() && file.isDirectory())
{
return file;
}
file = new File(webSite.getFile().getParent(), "themes/" + name);
if (file.exists())
{
return file;
}
file = new File(webSite.getFile().getParent(), name);
if (file.exists())
{
return file;
}
file = new File(webSite.getFile(), "themes/" + name);
if (file.exists())
{
return file;
}
file = new File(webSite.getFile(), name);
if (file.exists())
{
return file;
}
return null;
}
}
| apache-2.0 |
sabriarabacioglu/engerek | infra/util/src/main/java/com/evolveum/midpoint/util/Transformer.java | 724 | /**
* Copyright (c) 2014 Evolveum
*
* 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.evolveum.midpoint.util;
/**
* @author semancik
*
*/
public interface Transformer<T> {
T transform(T in);
}
| apache-2.0 |
RoamTouch/gesturekit-helper-android | GestureKitHelper/gen/com/roamtouch/gesturekit/helper/BuildConfig.java | 173 | /** Automatically generated file. DO NOT MODIFY */
package com.roamtouch.gesturekit.helper;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | apache-2.0 |
bozaixing/Notes | factory/src/main/java/com/bozaixing/factory/model/api/account/LoginModel.java | 986 | package com.bozaixing.factory.model.api.account;
/**
* Descr: 登录请求的model类
* Author: bozaixing.
* Date: 2017-02-17.
* Email: 654152983@qq.com.
*/
public class LoginModel {
// 用户名
private String phone;
// 密码
private String password;
/**
* 构造方法
*
* @param phone
* @param password
*/
public LoginModel(String phone, String password){
this.phone = phone;
this.password = password;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "LoginModel{" +
"phone='" + phone + '\'' +
", password='" + password + '\'' +
'}';
}
}
| apache-2.0 |
spring-projects/spring-data-examples | jpa/deferred/src/main/java/example/model/Customer1514.java | 628 | package example.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Customer1514 {
@Id @GeneratedValue(strategy = GenerationType.AUTO) private long id;
private String firstName;
private String lastName;
protected Customer1514() {}
public Customer1514(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format("Customer1514[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName);
}
}
| apache-2.0 |
ahwxl/deep | src/main/java/com/ckfinder/connector/utils/XMLCreator.java | 5038 | /*
* CKFinder
* ========
* http://cksource.com/ckfinder
* Copyright (C) 2007-2015, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*/
package com.ckfinder.connector.utils;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import com.ckfinder.connector.configuration.Constants;
import com.ckfinder.connector.errors.ConnectorException;
import javax.xml.transform.TransformerException;
/**
* Class to create XML document.
*/
public class XMLCreator {
/**
* dom4j document.
*/
private Document document;
/**
*
* errors list.
*/
private List<ErrorNode> errorList;
/**
* Creates document.
*
* @throws ConnectorException if a DocumentBuilder cannot be created which satisfies the configuration requested.
*/
@SuppressWarnings("UseSpecificCatch")
public void createDocument() throws ConnectorException {
try {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
document = documentBuilder.newDocument();
document.setXmlStandalone(true);
} catch (Exception e) {
throw new ConnectorException(
Constants.Errors.CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED, e);
}
}
/**
* standard constructor.
*/
public XMLCreator() {
this.errorList = new ArrayList<ErrorNode>();
}
/**
* gets document.
*
* @return document
*/
public Document getDocument() {
return document;
}
/**
*
* @return XML as text
* @throws ConnectorException If an unrecoverable error occurs during the course of the transformation or when it is not possible to
* create a Transformer instance.
*/
public String getDocumentAsText() throws ConnectorException {
try {
StringWriter stw = new StringWriter();
Transformer serializer = TransformerFactory.newInstance().newTransformer();
serializer.transform(new DOMSource(document), new StreamResult(stw));
return stw.toString();
} catch (TransformerException e) {
throw new ConnectorException(
Constants.Errors.CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED, e);
}
}
/**
* adds error node to root element with error code.
*
* @param rootElement XML root node.
* @param errorNum error code number.
* @param errorText error text.
*/
public void addErrorCommandToRoot(final Element rootElement,
final int errorNum, final String errorText) {
// errors
Element element = this.getDocument().createElement("Error");
element.setAttribute("number", String.valueOf(errorNum));
if (errorText != null) {
element.setTextContent(errorText);
}
rootElement.appendChild(element);
}
/**
* save errors node to list.
*
* @param errorCode error code
* @param name file name
* @param path current folder
* @param type resource type
*/
public void appendErrorNodeChild(final int errorCode, final String name,
final String path, final String type) {
ErrorNode errorNode = new ErrorNode(path, type, name, errorCode);
errorList.add(errorNode);
}
/**
* add all error nodes from saved list to xml.
*
* @param errorsNode XML errors node
*/
public void addErrors(final Element errorsNode) {
for (ErrorNode item : this.errorList) {
Element childElem = this.getDocument().createElement("Error");
childElem.setAttribute("code", String.valueOf(item.errorCode));
childElem.setAttribute("name", item.name);
childElem.setAttribute("type", item.type);
childElem.setAttribute("folder", item.folder);
errorsNode.appendChild(childElem);
}
}
/**
* error node object.
*/
private class ErrorNode {
private String folder;
private String type;
private String name;
private int errorCode;
/**
* @param folder folder param
* @param type resource type param
* @param name file name param
* @param errorCode error code param
*/
public ErrorNode(final String folder, final String type,
final String name, final int errorCode) {
super();
this.folder = folder;
this.type = type;
this.name = name;
this.errorCode = errorCode;
}
}
/**
* checks if error list contains errors.
*
* @return true if there are any errors.
*/
public boolean hasErrors() {
return !errorList.isEmpty();
}
}
| apache-2.0 |
NationalSecurityAgency/timely | server/src/main/java/timely/netty/http/timeseries/HttpSuggestRequestHandler.java | 1874 | package timely.netty.http.timeseries;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import timely.api.request.timeseries.SuggestRequest;
import timely.api.response.TimelyException;
import timely.netty.Constants;
import timely.netty.http.TimelyHttpHandler;
import timely.store.DataStore;
import timely.util.JsonUtil;
public class HttpSuggestRequestHandler extends SimpleChannelInboundHandler<SuggestRequest>
implements TimelyHttpHandler {
private static final Logger LOG = LoggerFactory.getLogger(HttpSuggestRequestHandler.class);
private final DataStore dataStore;
public HttpSuggestRequestHandler(DataStore dataStore) {
this.dataStore = dataStore;
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, SuggestRequest msg) throws Exception {
byte[] buf = null;
try {
buf = JsonUtil.getObjectMapper().writeValueAsBytes(dataStore.suggest(msg));
} catch (TimelyException e) {
LOG.error(e.getMessage(), e);
this.sendHttpError(ctx, e);
return;
}
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK,
Unpooled.copiedBuffer(buf));
response.headers().set(HttpHeaderNames.CONTENT_TYPE, Constants.JSON_TYPE);
response.headers().set(HttpHeaderNames.CONTENT_LENGTH, response.content().readableBytes());
sendResponse(ctx, response);
}
}
| apache-2.0 |
cloudfoundry/cf-java-client | cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/uaa/users/ReactorUsersTest.java | 33277 | /*
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cloudfoundry.reactor.uaa.users;
import org.cloudfoundry.reactor.InteractionContext;
import org.cloudfoundry.reactor.TestRequest;
import org.cloudfoundry.reactor.TestResponse;
import org.cloudfoundry.reactor.uaa.AbstractUaaApiTest;
import org.cloudfoundry.uaa.users.Approval;
import org.cloudfoundry.uaa.users.ChangeUserPasswordRequest;
import org.cloudfoundry.uaa.users.ChangeUserPasswordResponse;
import org.cloudfoundry.uaa.users.CreateUserRequest;
import org.cloudfoundry.uaa.users.CreateUserResponse;
import org.cloudfoundry.uaa.users.DeleteUserRequest;
import org.cloudfoundry.uaa.users.DeleteUserResponse;
import org.cloudfoundry.uaa.users.Email;
import org.cloudfoundry.uaa.users.ExpirePasswordRequest;
import org.cloudfoundry.uaa.users.ExpirePasswordResponse;
import org.cloudfoundry.uaa.users.GetUserVerificationLinkRequest;
import org.cloudfoundry.uaa.users.GetUserVerificationLinkResponse;
import org.cloudfoundry.uaa.users.Group;
import org.cloudfoundry.uaa.users.Invite;
import org.cloudfoundry.uaa.users.InviteUsersRequest;
import org.cloudfoundry.uaa.users.InviteUsersResponse;
import org.cloudfoundry.uaa.users.ListUsersRequest;
import org.cloudfoundry.uaa.users.ListUsersResponse;
import org.cloudfoundry.uaa.users.LookupUserIdsRequest;
import org.cloudfoundry.uaa.users.LookupUserIdsResponse;
import org.cloudfoundry.uaa.users.Meta;
import org.cloudfoundry.uaa.users.Name;
import org.cloudfoundry.uaa.users.PhoneNumber;
import org.cloudfoundry.uaa.users.UpdateUserRequest;
import org.cloudfoundry.uaa.users.UpdateUserResponse;
import org.cloudfoundry.uaa.users.User;
import org.cloudfoundry.uaa.users.UserId;
import org.cloudfoundry.uaa.users.UserInfoRequest;
import org.cloudfoundry.uaa.users.UserInfoResponse;
import org.cloudfoundry.uaa.users.VerifyUserRequest;
import org.cloudfoundry.uaa.users.VerifyUserResponse;
import org.junit.Test;
import reactor.test.StepVerifier;
import java.time.Duration;
import java.util.Collections;
import static io.netty.handler.codec.http.HttpMethod.DELETE;
import static io.netty.handler.codec.http.HttpMethod.GET;
import static io.netty.handler.codec.http.HttpMethod.PATCH;
import static io.netty.handler.codec.http.HttpMethod.POST;
import static io.netty.handler.codec.http.HttpMethod.PUT;
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
import static org.cloudfoundry.uaa.SortOrder.ASCENDING;
import static org.cloudfoundry.uaa.SortOrder.DESCENDING;
import static org.cloudfoundry.uaa.users.ApprovalStatus.APPROVED;
import static org.cloudfoundry.uaa.users.ApprovalStatus.DENIED;
import static org.cloudfoundry.uaa.users.MembershipType.DIRECT;
public final class ReactorUsersTest extends AbstractUaaApiTest {
private final ReactorUsers users = new ReactorUsers(CONNECTION_CONTEXT, this.root, TOKEN_PROVIDER, Collections.emptyMap());
@Test
public void changePassword() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(PUT).path("/Users/9140c37c-c5d9-4c4d-a265-b6fe2f9dd02d/password")
.payload("fixtures/uaa/users/PUT_request.json")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/PUT_response.json")
.build())
.build());
this.users
.changePassword(ChangeUserPasswordRequest.builder()
.oldPassword("secret")
.password("newsecret")
.userId("9140c37c-c5d9-4c4d-a265-b6fe2f9dd02d")
.build())
.as(StepVerifier::create)
.expectNext(ChangeUserPasswordResponse.builder()
.status("ok")
.message("password updated")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void create() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(POST).path("/Users")
.payload("fixtures/uaa/users/POST_request.json")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/POST_response.json")
.build())
.build());
this.users
.create(CreateUserRequest.builder()
.externalId("test-user")
.userName("ZO6FEI@test.org")
.name(Name.builder()
.familyName("family name")
.givenName("given name")
.build())
.email(Email.builder()
.value("ZO6FEI@test.org")
.primary(true)
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.active(true)
.verified(true)
.origin("")
.password("secret")
.build())
.as(StepVerifier::create)
.expectNext(CreateUserResponse.builder()
.id("9d175c69-8f25-4460-82d7-be9657f87a68")
.externalId("test-user")
.meta(Meta.builder()
.version(0)
.created("2016-05-18T18:25:24.559Z")
.lastModified("2016-05-18T18:25:24.559Z")
.build())
.userName("ZO6FEI@test.org")
.name(Name.builder()
.familyName("family name")
.givenName("given name")
.build())
.email(Email.builder()
.value("ZO6FEI@test.org")
.primary(false)
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.group(Group.builder()
.value("4622c5e1-ddfd-4e17-9e81-2ae3c03972be")
.display("password.write")
.type(DIRECT)
.build())
.group(Group.builder()
.value("62f67643-05d8-43c6-b193-4cd6ab9960cb")
.display("cloud_controller.write")
.type(DIRECT)
.build())
.group(Group.builder()
.value("c47bf470-f9c4-4eea-97e4-490ce7b8f6f7")
.display("uaa.user")
.type(DIRECT)
.build())
.group(Group.builder()
.value("8a6add1f-d3ee-400c-a263-c4197351b78e")
.display("approvals.me")
.type(DIRECT)
.build())
.group(Group.builder()
.value("e10424ed-ed80-45ac-848b-7f7e79b00c42")
.display("cloud_controller.read")
.type(DIRECT)
.build())
.group(Group.builder()
.value("ede11441-6ffe-4510-81f8-bb40626155f0")
.display("openid")
.type(DIRECT)
.build())
.group(Group.builder()
.value("7e3d4b06-0d6b-43a1-ac3a-5f1b2642262c")
.display("scim.me")
.type(DIRECT)
.build())
.group(Group.builder()
.value("3b481f3c-d9a7-4920-a687-72cb0381b671")
.display("cloud_controller_service_permissions.read")
.type(DIRECT)
.build())
.group(Group.builder()
.value("4480c647-4047-4c6a-877f-70f5f96e8c11")
.display("oauth.approvals")
.type(DIRECT)
.build())
.group(Group.builder()
.value("542bb178-1c04-4bb5-813a-5a038319ac1d")
.display("user_attributes")
.type(DIRECT)
.build())
.group(Group.builder()
.value("c4ac4653-2fdd-4901-a028-9c9866cb4e9c")
.display("scim.userids")
.type(DIRECT)
.build())
.group(Group.builder()
.value("74fde138-daf3-4e4d-bb52-93a6cb727030")
.display("profile")
.type(DIRECT)
.build())
.group(Group.builder()
.value("1b18551f-eead-4076-90dd-b464998f6ddd")
.display("roles")
.type(DIRECT)
.build())
.active(true)
.verified(true)
.origin("uaa")
.zoneId("uaa")
.passwordLastModified("2016-05-18T18:25:24.000Z")
.schemas(Collections.singletonList("urn:scim:schemas:core:1.0"))
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void delete() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(DELETE).path("/Users/421225f4-318e-4a4d-9219-4b6a0ed3678a")
.header("If-Match", "*")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/DELETE_response.json")
.build())
.build());
this.users
.delete(DeleteUserRequest.builder()
.userId("421225f4-318e-4a4d-9219-4b6a0ed3678a")
.version("*")
.build())
.as(StepVerifier::create)
.expectNext(DeleteUserResponse.builder()
.id("421225f4-318e-4a4d-9219-4b6a0ed3678a")
.externalId("test-user")
.meta(Meta.builder()
.version(0)
.created("2016-05-18T18:25:23.102Z")
.lastModified("2016-05-18T18:25:23.102Z")
.build())
.userName("7Q4Rqr@test.org")
.name(Name.builder()
.familyName("family name")
.givenName("given name")
.build())
.email(Email.builder()
.value("7Q4Rqr@test.org")
.primary(false)
.build())
.group(Group.builder()
.value("4622c5e1-ddfd-4e17-9e81-2ae3c03972be")
.display("password.write")
.type(DIRECT)
.build())
.group(Group.builder()
.value("62f67643-05d8-43c6-b193-4cd6ab9960cb")
.display("cloud_controller.write")
.type(DIRECT)
.build())
.group(Group.builder()
.value("c47bf470-f9c4-4eea-97e4-490ce7b8f6f7")
.display("uaa.user")
.type(DIRECT)
.build())
.group(Group.builder()
.value("8a6add1f-d3ee-400c-a263-c4197351b78e")
.display("approvals.me")
.type(DIRECT)
.build())
.group(Group.builder()
.value("e10424ed-ed80-45ac-848b-7f7e79b00c42")
.display("cloud_controller.read")
.type(DIRECT)
.build())
.group(Group.builder()
.value("ede11441-6ffe-4510-81f8-bb40626155f0")
.display("openid")
.type(DIRECT)
.build())
.group(Group.builder()
.value("7e3d4b06-0d6b-43a1-ac3a-5f1b2642262c")
.display("scim.me")
.type(DIRECT)
.build())
.group(Group.builder()
.value("3b481f3c-d9a7-4920-a687-72cb0381b671")
.display("cloud_controller_service_permissions.read")
.type(DIRECT)
.build())
.group(Group.builder()
.value("4480c647-4047-4c6a-877f-70f5f96e8c11")
.display("oauth.approvals")
.type(DIRECT)
.build())
.group(Group.builder()
.value("542bb178-1c04-4bb5-813a-5a038319ac1d")
.display("user_attributes")
.type(DIRECT)
.build())
.group(Group.builder()
.value("c4ac4653-2fdd-4901-a028-9c9866cb4e9c")
.display("scim.userids")
.type(DIRECT)
.build())
.group(Group.builder()
.value("74fde138-daf3-4e4d-bb52-93a6cb727030")
.display("profile")
.type(DIRECT)
.build())
.group(Group.builder()
.value("1b18551f-eead-4076-90dd-b464998f6ddd")
.display("roles")
.type(DIRECT)
.build())
.approval(Approval.builder()
.userId("421225f4-318e-4a4d-9219-4b6a0ed3678a")
.clientId("identity")
.scope("uaa.user")
.status(APPROVED)
.lastUpdatedAt("2016-05-18T18:25:53.114Z")
.expiresAt("2016-05-18T18:25:53.114Z")
.build())
.approval(Approval.builder()
.userId("421225f4-318e-4a4d-9219-4b6a0ed3678a")
.clientId("client id")
.scope("scim.read")
.status(APPROVED)
.lastUpdatedAt("2016-05-18T18:25:23.112Z")
.expiresAt("2016-05-18T18:25:33.112Z")
.build())
.active(true)
.verified(true)
.origin("uaa")
.zoneId("uaa")
.passwordLastModified("2016-05-18T18:25:23.000Z")
.schemas(Collections.singletonList("urn:scim:schemas:core:1.0"))
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void expirePassword() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(PATCH).path("/Users/9022f2cf-2663-479e-82e6-d2ccc348a1e4/status")
.payload("fixtures/uaa/users/PATCH_{id}_status_request.json")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/PATCH_{id}_status_response.json")
.build())
.build());
this.users
.expirePassword(ExpirePasswordRequest.builder()
.passwordChangeRequired(true)
.userId("9022f2cf-2663-479e-82e6-d2ccc348a1e4")
.build())
.as(StepVerifier::create)
.expectNext(ExpirePasswordResponse.builder()
.passwordChangeRequired(true)
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void getVerificationLink() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(GET).path("/Users/1faa46a0-0c6f-4e13-8334-d1f6e5f2e1dd/verify-link?redirect_uri=http%3A%2F%2Fredirect.to%2Fapp")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/GET_{id}_verify_link_response.json")
.build())
.build());
this.users
.getVerificationLink(GetUserVerificationLinkRequest.builder()
.redirectUri("http://redirect.to/app")
.userId("1faa46a0-0c6f-4e13-8334-d1f6e5f2e1dd")
.build())
.as(StepVerifier::create)
.expectNext(GetUserVerificationLinkResponse.builder()
.verifyLink("http://localhost/verify_user?code=nOGQWBqCx5")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void inviteUsers() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(POST).path("/invite_users?client_id=u7ptqw&redirect_uri=example.com")
.payload("fixtures/uaa/users/POST_invite_users_request.json")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users//POST_invite_users_response.json")
.build())
.build());
this.users
.invite(InviteUsersRequest.builder()
.clientId("u7ptqw")
.emails("user1@pjy596.com", "user2@pjy596.com")
.redirectUri("example.com")
.build())
.as(StepVerifier::create)
.expectNext(InviteUsersResponse.builder()
.newInvite(Invite.builder()
.email("user1@pjy596.com")
.userId("68af461b-484e-464a-96ac-a336abed48ad")
.origin("uaa")
.success(true)
.inviteLink("http://localhost/invitations/accept?code=WEqtpOh73k")
.build())
.newInvite(Invite.builder()
.email("user2@pjy596.com")
.userId("d256cf96-5c14-4649-9a0d-5564c66411b5")
.origin("uaa")
.success(true)
.inviteLink("http://localhost/invitations/accept?code=n5X0hCsD3N")
.build())
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void list() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(GET).path(
"/Users?count=50&filter=id%2Beq%2B%22a94534d5-de08-41eb-8712-a51314e6a484%22%2Bor%2Bemail%2Beq%2B%22Da63pG%40test.org%22&sortBy=email&sortOrder=ascending&startIndex=1")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/GET_response.json")
.build())
.build());
this.users
.list(ListUsersRequest.builder()
.filter("id+eq+\"a94534d5-de08-41eb-8712-a51314e6a484\"+or+email+eq+\"Da63pG@test.org\"")
.count(50)
.startIndex(1)
.sortBy("email")
.sortOrder(ASCENDING)
.build())
.as(StepVerifier::create)
.expectNext(ListUsersResponse.builder()
.resource(User.builder()
.id("a94534d5-de08-41eb-8712-a51314e6a484")
.externalId("test-user")
.meta(Meta.builder()
.version(0)
.created("2016-05-18T18:25:24.036Z")
.lastModified("2016-05-18T18:25:24.036Z")
.build())
.userName("Da63pG@test.org")
.name(Name.builder()
.familyName("family name")
.givenName("given name")
.build())
.email(Email.builder()
.value("Da63pG@test.org")
.primary(false)
.build())
.group(Group.builder()
.value("4622c5e1-ddfd-4e17-9e81-2ae3c03972be")
.display("password.write")
.type(DIRECT)
.build())
.group(Group.builder()
.value("62f67643-05d8-43c6-b193-4cd6ab9960cb")
.display("cloud_controller.write")
.type(DIRECT)
.build())
.group(Group.builder()
.value("c47bf470-f9c4-4eea-97e4-490ce7b8f6f7")
.display("uaa.user")
.type(DIRECT)
.build())
.group(Group.builder()
.value("8a6add1f-d3ee-400c-a263-c4197351b78e")
.display("approvals.me")
.type(DIRECT)
.build())
.group(Group.builder()
.value("e10424ed-ed80-45ac-848b-7f7e79b00c42")
.display("cloud_controller.read")
.type(DIRECT)
.build())
.group(Group.builder()
.value("ede11441-6ffe-4510-81f8-bb40626155f0")
.display("openid")
.type(DIRECT)
.build())
.group(Group.builder()
.value("7e3d4b06-0d6b-43a1-ac3a-5f1b2642262c")
.display("scim.me")
.type(DIRECT)
.build())
.group(Group.builder()
.value("3b481f3c-d9a7-4920-a687-72cb0381b671")
.display("cloud_controller_service_permissions.read")
.type(DIRECT)
.build())
.group(Group.builder()
.value("4480c647-4047-4c6a-877f-70f5f96e8c11")
.display("oauth.approvals")
.type(DIRECT)
.build())
.group(Group.builder()
.value("542bb178-1c04-4bb5-813a-5a038319ac1d")
.display("user_attributes")
.type(DIRECT)
.build())
.group(Group.builder()
.value("c4ac4653-2fdd-4901-a028-9c9866cb4e9c")
.display("scim.userids")
.type(DIRECT)
.build())
.group(Group.builder()
.value("74fde138-daf3-4e4d-bb52-93a6cb727030")
.display("profile")
.type(DIRECT)
.build())
.group(Group.builder()
.value("1b18551f-eead-4076-90dd-b464998f6ddd")
.display("roles")
.type(DIRECT)
.build())
.approval(Approval.builder()
.userId("a94534d5-de08-41eb-8712-a51314e6a484")
.clientId("client id")
.scope("scim.read")
.status(APPROVED)
.lastUpdatedAt("2016-05-18T18:25:24.047Z")
.expiresAt("2016-05-18T18:25:34.047Z")
.build())
.active(true)
.verified(true)
.origin("uaa")
.zoneId("uaa")
.passwordLastModified("2016-05-18T18:25:24.000Z")
.schema("urn:scim:schemas:core:1.0")
.build())
.startIndex(1)
.itemsPerPage(50)
.totalResults(1)
.schema("urn:scim:schemas:core:1.0")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void lookup() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(GET).path(
"/ids/Users?count=10&filter=userName%2Beq%2B%22bobOu38vE%40test.org%22%2Bor%2Bid%2Beq%2B%22c1476587-5ec9-4b7e-9ed2-381e3133f07a%22" +
"&includeInactive=true&sortOrder=descending&startIndex=1")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/GET_ids_response.json")
.build())
.build());
this.users
.lookup(LookupUserIdsRequest.builder()
.filter("userName+eq+\"bobOu38vE@test.org\"+or+id+eq+\"c1476587-5ec9-4b7e-9ed2-381e3133f07a\"")
.count(10)
.startIndex(1)
.sortOrder(DESCENDING)
.includeInactive(true)
.build())
.as(StepVerifier::create)
.expectNext(LookupUserIdsResponse.builder()
.resource(UserId.builder()
.id("c1476587-5ec9-4b7e-9ed2-381e3133f07a")
.userName("dwayneSnbjBm@test.org")
.origin("uaa")
.build())
.resource(UserId.builder()
.id("2fc67623-ee31-4edc-9b1f-0b50416195fb")
.userName("bobOu38vE@test.org")
.origin("uaa")
.build())
.startIndex(1)
.itemsPerPage(10)
.totalResults(2)
.schema("urn:scim:schemas:core:1.0")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void update() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(PUT).path("/Users/test-user-id")
.header("If-Match", "*")
.payload("fixtures/uaa/users/PUT_{id}_request.json")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/PUT_{id}_response.json")
.build())
.build());
this.users
.update(UpdateUserRequest.builder()
.active(true)
.email(Email.builder()
.primary(false)
.value("oH4jON@test.org")
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.externalId("test-user")
.id(("test-user-id"))
.version("*")
.name(Name.builder()
.familyName("family name")
.givenName("given name")
.build())
.origin("uaa")
.userName("oH4jON@test.org")
.verified(true)
.build())
.as(StepVerifier::create)
.expectNext(UpdateUserResponse.builder()
.active(true)
.approval(Approval.builder()
.clientId("identity")
.expiresAt("2016-05-18T18:25:54.239Z")
.lastUpdatedAt("2016-05-18T18:25:54.239Z")
.scope("uaa.user")
.status(DENIED)
.userId("test-user-id")
.build())
.approval(Approval.builder()
.clientId("client id")
.expiresAt("2016-05-18T18:25:34.236Z")
.lastUpdatedAt("2016-05-18T18:25:34.236Z")
.scope("scim.read")
.status(APPROVED)
.userId("test-user-id")
.build())
.email(Email.builder()
.primary(false)
.value("oH4jON@test.org")
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.externalId("test-user")
.group(Group.builder()
.display("password.write")
.value("4622c5e1-ddfd-4e17-9e81-2ae3c03972be")
.type(DIRECT)
.build())
.group(Group.builder()
.display("cloud_controller.write")
.value("62f67643-05d8-43c6-b193-4cd6ab9960cb")
.type(DIRECT)
.build())
.group(Group.builder()
.display("uaa.user")
.value("c47bf470-f9c4-4eea-97e4-490ce7b8f6f7")
.type(DIRECT)
.build())
.id(("test-user-id"))
.meta(Meta.builder()
.created("2016-05-18T18:25:24.222Z")
.lastModified("2016-05-18T18:25:24.265Z")
.version(1)
.build())
.name(Name.builder()
.familyName("family name")
.givenName("given name")
.build())
.origin("uaa")
.passwordLastModified("2016-05-18T18:25:24.000Z")
.schema("urn:scim:schemas:core:1.0")
.userName("oH4jON@test.org")
.verified(true)
.zoneId("uaa")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void userInfo() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(GET).path("/userinfo")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/GET_userinfo_response.json")
.build())
.build());
this.users
.userInfo(UserInfoRequest.builder()
.build())
.as(StepVerifier::create)
.expectNext(UserInfoResponse.builder()
.email("anO0Lv@test.org")
.emailVerified(true)
.familyName("PasswordResetUserLast")
.givenName("PasswordResetUserFirst")
.name("PasswordResetUserFirst PasswordResetUserLast")
.phoneNumber("+15558880000")
.previousLogonTime(null)
.sub("ab485a4f-168a-4de8-b3ac-ab501767bfc9")
.userId("ab485a4f-168a-4de8-b3ac-ab501767bfc9")
.userName("anO0Lv@test.org")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
@Test
public void verifyUser() {
mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(GET).path("/Users/c0d42e48-9b69-461d-a77b-f75d3a5948b6/verify")
.header("If-Match", "12")
.build())
.response(TestResponse.builder()
.status(OK)
.payload("fixtures/uaa/users/GET_{id}_verify_user_response.json")
.build())
.build());
this.users
.verify(VerifyUserRequest.builder()
.userId("c0d42e48-9b69-461d-a77b-f75d3a5948b6")
.version("12")
.build())
.as(StepVerifier::create)
.expectNext(VerifyUserResponse.builder()
.id("c0d42e48-9b69-461d-a77b-f75d3a5948b6")
.meta(Meta.builder()
.version(12)
.created("2016-06-03T17:59:31.027Z")
.lastModified("2016-06-03T17:59:31.027Z")
.build())
.userName("billy_o@example.com")
.name(Name.builder()
.familyName("d'Orange")
.givenName("William")
.build())
.email(Email.builder()
.value("billy_o@example.com")
.primary(false)
.build())
.active(true)
.verified(true)
.origin("uaa")
.zoneId("uaa")
.passwordLastModified("2016-06-03T17:59:31.000Z")
.schema("urn:scim:schemas:core:1.0")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
}
}
| apache-2.0 |
tfredrich/jbel | src/main/java/com/strategicgains/jbel/predicate/NotPredicate.java | 1021 | /*
Copyright 2005 Strategic Gains, Inc.
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.strategicgains.jbel.predicate;
import com.strategicgains.jbel.exception.EvaluationException;
import com.strategicgains.jbel.expression.Expression;
public class NotPredicate
extends UnaryPredicate
{
public NotPredicate(Expression expression)
{
super(expression);
}
protected Object evaluateResults(Object object)
throws EvaluationException
{
return (((Boolean) object).booleanValue() ? Boolean.FALSE : Boolean.TRUE);
}
}
| apache-2.0 |
KarsekaVladimir/ANDROID_SocialSample | Econ.Calendar/app/src/androidTest/java/com/econcalendar/econcalendar/ExampleInstrumentedTest.java | 763 | package com.econcalendar.econcalendar;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.econcalendar.econcalendar", appContext.getPackageName());
}
}
| apache-2.0 |
krestenkrab/hotruby | modules/vm-shared/src/com/trifork/util/collection/PriorityQueue.java | 4207 | //
// Copyright (c) 2000, 2001 Trifork Technologies
// All Rights Reserved
// No part of this program may be copied, used or delivered to
// anyone without the express written consent of Trifork Technologies
//
package com.trifork.util.collection;
import java.util.Comparator;
/**
*
* @author Kresten Krab Thorup
*/
public class PriorityQueue {
/** the default queue size is 4 */
public static final int DEFAULT_QUEUE_SIZE = 4;
Comparator cmp;
int elem_count = 0;
int elem_max;
Object[] elem_data;
/** Construct a new <code>PriorityQueue</code> (primary constructor) */
public PriorityQueue(int size, Comparator cmp) {
if (size < 4)
elem_max = 4;
else
elem_max = size;
elem_count = 0;
elem_data = new Object[elem_max + 2];
this.cmp = cmp;
}
public PriorityQueue(int size) {
this(size, new ComparableComparator());
}
public PriorityQueue() {
this(DEFAULT_QUEUE_SIZE, new ComparableComparator());
}
public PriorityQueue(Comparator cmp) {
this(DEFAULT_QUEUE_SIZE, cmp);
}
public int size() {
return elem_count;
}
public Object[] toArray(Object[] result) {
if (result.length < size()) {
Class elementClass = result.getClass().getComponentType();
result = (Object[]) java.lang.reflect.Array.newInstance(elementClass, size());
}
int count = elem_count;
for (int i = 0; i < count; i++) {
result[i] = dequeue();
}
return result;
}
public void clear() {
elem_count = 0;
}
public Object dequeue() {
if (elem_count == 0)
return null;
Object result = elem_data[1];
elem_data[1] = elem_data[elem_count];
elem_count -= 1;
sift_down(1);
return result;
}
private void sift_down(int i) {
final int top_idx = i;
final int left_idx = i * 2;
final int right_idx = left_idx + 1;
if (elem_count < left_idx) {
return;
}
// the left one is the last
else if (elem_count == left_idx) {
Object top = elem_data[top_idx];
Object left = elem_data[left_idx];
if (cmp.compare(left, top) < 0) {
elem_data[top_idx] = left;
elem_data[left_idx] = top;
}
return;
}
// there are more...
else {
Object top = elem_data[top_idx];
Object left = elem_data[left_idx];
Object right = elem_data[right_idx];
if (cmp.compare(left, right) < 0) {
// left is now the smaller
if (cmp.compare(left, top) < 0) {
elem_data[top_idx] = left;
elem_data[left_idx] = top;
sift_down(left_idx);
}
}
else if (cmp.compare(right, top) < 0) {
// the right one is the smaller
elem_data[top_idx] = right;
elem_data[right_idx] = top;
sift_down(right_idx);
}
}
}
public void enqueue(Object o) {
// make room
if (elem_max == elem_count) {
int new_max = elem_max * 2;
Object[] new_data = new Object[new_max + 2];
System.arraycopy(elem_data, 0, new_data, 0, elem_max + 2);
elem_max = new_max;
elem_data = new_data;
}
elem_count += 1;
elem_data[elem_count] = o;
sift_up(elem_count);
}
private void sift_up(int idx) {
if (idx == 1)
return;
Object me = elem_data[idx];
Object top = elem_data[idx / 2];
if (cmp.compare(me, top) < 0) {
elem_data[idx] = top;
elem_data[idx / 2] = me;
sift_up(idx / 2);
}
}
public void push(Object o) {
enqueue(o);
}
}
class ComparableComparator implements Comparator {
public int compare(Object o1, Object o2) {
return ((Comparable) o1).compareTo(o2);
}
}
| apache-2.0 |
eSDK/esdk_sms | source/esdk_sms_neadp_royamas_v20/src/main/java/com/huawei/esdk/sms/north/royamas20/cxf/gen/server/APLogoutResult.java | 1329 |
package com.huawei.esdk.sms.north.royamas20.cxf.gen.server;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for APLogoutResult.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="APLogoutResult">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="success"/>
* <enumeration value="illegalAPid"/>
* <enumeration value="repeatedLogout"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "APLogoutResult")
@XmlEnum
public enum APLogoutResult {
@XmlEnumValue("success")
SUCCESS("success"),
@XmlEnumValue("illegalAPid")
ILLEGAL_A_PID("illegalAPid"),
@XmlEnumValue("repeatedLogout")
REPEATED_LOGOUT("repeatedLogout");
private final String value;
APLogoutResult(String v) {
value = v;
}
public String value() {
return value;
}
public static APLogoutResult fromValue(String v) {
for (APLogoutResult c: APLogoutResult.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| apache-2.0 |
eddumelendez/spring-security | openid/src/test/java/org/springframework/security/openid/MockOpenIDConsumer.java | 2440 | /*
* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.openid;
import org.springframework.security.openid.OpenIDAuthenticationToken;
import org.springframework.security.openid.OpenIDConsumer;
import org.springframework.security.openid.OpenIDConsumerException;
import javax.servlet.http.HttpServletRequest;
/**
* @author Robin Bramley, Opsera Ltd
*/
public class MockOpenIDConsumer implements OpenIDConsumer {
// ~ Instance fields
// ================================================================================================
private OpenIDAuthenticationToken token;
private String redirectUrl;
public MockOpenIDConsumer() {
}
public MockOpenIDConsumer(String redirectUrl, OpenIDAuthenticationToken token) {
this.redirectUrl = redirectUrl;
this.token = token;
}
public MockOpenIDConsumer(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public MockOpenIDConsumer(OpenIDAuthenticationToken token) {
this.token = token;
}
// ~ Methods
// ========================================================================================================
public String beginConsumption(HttpServletRequest req, String claimedIdentity,
String returnToUrl, String realm) throws OpenIDConsumerException {
return redirectUrl;
}
public OpenIDAuthenticationToken endConsumption(HttpServletRequest req)
throws OpenIDConsumerException {
return token;
}
/**
* Set the redirectUrl to be returned by beginConsumption
*
* @param redirectUrl
*/
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public void setReturnToUrl(String returnToUrl) {
// TODO Auto-generated method stub
}
/**
* Set the token to be returned by endConsumption
*
* @param token
*/
public void setToken(OpenIDAuthenticationToken token) {
this.token = token;
}
}
| apache-2.0 |
consulo/consulo-soy | src/main/java/com/google/bamboo/soy/insight/annotators/ClosingBraceSanityAnnotator.java | 4798 | // Copyright 2017 Google Inc.
//
// 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.google.bamboo.soy.insight.annotators;
import com.google.bamboo.soy.elements.TagElement;
import com.google.bamboo.soy.lexer.SoyTokenTypes;
import com.google.bamboo.soy.parser.impl.SoyAliasBlockImpl;
import com.google.bamboo.soy.parser.impl.SoyAtParamSingleImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginChoiceClauseImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginChoiceImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginElseIfImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginForImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginForeachImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginIfImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginLetImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginMsgImpl;
import com.google.bamboo.soy.parser.impl.SoyBeginTemplateImpl;
import com.google.bamboo.soy.parser.impl.SoyCssStatementImpl;
import com.google.bamboo.soy.parser.impl.SoyDelegatePackageBlockImpl;
import com.google.bamboo.soy.parser.impl.SoyElseTagImpl;
import com.google.bamboo.soy.parser.impl.SoyEndTagImpl;
import com.google.bamboo.soy.parser.impl.SoyFallbackMsgTagImpl;
import com.google.bamboo.soy.parser.impl.SoyLetSingleStatementImpl;
import com.google.bamboo.soy.parser.impl.SoyNamespaceBlockImpl;
import com.google.bamboo.soy.parser.impl.SoyPrintStatementImpl;
import com.google.bamboo.soy.parser.impl.SoySpecialCharacterStatementImpl;
import com.google.bamboo.soy.parser.impl.SoyXidStatementImpl;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.lang.annotation.Annotator;
import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.TokenSet;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
public class ClosingBraceSanityAnnotator implements Annotator {
@VisibleForTesting
static final ImmutableSet<Class> mustCloseRBraceTags =
ImmutableSet.<Class>builder()
.add(SoyAliasBlockImpl.class)
.add(SoyAtParamSingleImpl.class)
.add(SoyBeginChoiceClauseImpl.class)
.add(SoyBeginElseIfImpl.class)
.add(SoyBeginForImpl.class)
.add(SoyBeginForeachImpl.class)
.add(SoyBeginIfImpl.class)
.add(SoyBeginLetImpl.class)
.add(SoyBeginMsgImpl.class)
.add(SoyBeginChoiceImpl.class)
.add(SoyBeginTemplateImpl.class)
.add(SoyCssStatementImpl.class)
.add(SoyDelegatePackageBlockImpl.class)
.add(SoyElseTagImpl.class)
.add(SoyEndTagImpl.class)
.add(SoyFallbackMsgTagImpl.class)
.add(SoySpecialCharacterStatementImpl.class)
.add(SoyNamespaceBlockImpl.class)
.add(SoyPrintStatementImpl.class)
.add(SoyXidStatementImpl.class)
.build();
private static ImmutableSet<Class> mustCloseSlashRBraceTags =
ImmutableSet.of(SoyLetSingleStatementImpl.class);
@Override
public void annotate(@Nonnull PsiElement psiElement, @Nonnull AnnotationHolder annotationHolder) {
if (psiElement instanceof TagElement) {
TagElement tagElement = (TagElement) psiElement;
TokenSet allowedRBraces = SoyTokenTypes.RIGHT_BRACES;
if (mustCloseRBraceTags.contains(tagElement.getClass())) {
allowedRBraces = TokenSet.andNot(allowedRBraces, SoyTokenTypes.SLASH_R_BRACES);
} else if (mustCloseSlashRBraceTags.contains(tagElement.getClass())) {
allowedRBraces = TokenSet.andSet(allowedRBraces, SoyTokenTypes.SLASH_R_BRACES);
}
if (tagElement.isDoubleBraced()) {
allowedRBraces = TokenSet.andSet(allowedRBraces, SoyTokenTypes.DOUBLE_BRACES);
} else {
allowedRBraces = TokenSet.andNot(allowedRBraces, SoyTokenTypes.DOUBLE_BRACES);
}
if (!allowedRBraces.contains(tagElement.getClosingBraceType())) {
annotationHolder.createErrorAnnotation(tagElement, "Must close by " +
Stream.of(allowedRBraces.getTypes())
.map(SoyTokenTypes.BRACE_TYPE_TO_STRING::get)
.sorted()
.collect(Collectors.joining(" or ")));
}
}
}
}
| apache-2.0 |
mifodiy4j/smikhailov | chapter_302/carsale/src/main/java/ru/job4j/services/UserService.java | 486 | package ru.job4j.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ru.job4j.models.User;
import ru.job4j.storage.UserDAO;
import java.util.List;
@Service
public class UserService {
@Autowired
private UserDAO userDAO = UserDAO.getInstance();
public void add(User user) {
userDAO.save(user);
}
public List<User> getAll() {
return (List<User>) userDAO.getAll();
}
}
| apache-2.0 |
WBSS/myCoffeeStorm | src/main/java/com/wbss/mycoffee/storm/MQTTSpout.java | 5158 | /*
* Copyright 2015 W.B.S.S GmbH Zurich.
*
* 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.wbss.mycoffee.storm;
import java.util.LinkedList;
import java.util.Map;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.IRichSpout;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Values;
/**
* Spout which connects to the MQ Broker and reads the messages.
* The messages are validated and then emitted.
*
* @author Guido Amrein
*
*/
public class MQTTSpout implements MqttCallback, IRichSpout {
private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory
.getLogger(MQTTSpout.class);
private MqttClient client;
private SpoutOutputCollector collector;
private LinkedList<String> messages;
private String brokerUrl;
private String clientId;
private String topic;
private String userName;
private String password;
/**
* Constructor with the MQ broker connect information
* @param brokerUrl
* @param clientId
* @param topic
* @param userName
* @param password
*/
public MQTTSpout(String brokerUrl, String clientId, String topic,
String userName, String password) {
this.brokerUrl = brokerUrl;
this.clientId = clientId;
this.topic = topic;
this.userName = userName;
this.password = password;
messages = new LinkedList<String>();
}
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
// Declare the tuple
declarer.declare(new Fields("userId", "evaDts"));
}
/**
* Creates a MQ client and connects to the broker
*/
@SuppressWarnings("rawtypes")
@Override
public void open(Map conf, TopologyContext context,
SpoutOutputCollector collector) {
this.collector = collector;
try {
client = new MqttClient(brokerUrl, clientId);
// Construct the connection options object that contains connection
// parameters such as cleanSession and LWT
MqttConnectOptions conOpt = new MqttConnectOptions();
conOpt.setCleanSession(true);
conOpt.setPassword(this.password.toCharArray());
conOpt.setUserName(this.userName);
client.connect(conOpt);
client.setCallback(this);
client.subscribe(topic);
} catch (MqttException e) {
e.printStackTrace();
}
}
/**
* Validates the MQ message and splits the userId and the EvaDts.
* Then emits the tuple.
*/
@Override
public void nextTuple() {
while (!messages.isEmpty()) {
String message = messages.poll();
LOG.info("message: " + message);
if (message != null && message.trim().length() > 0 && message.startsWith("userId=")) {
// Split userId from evaDts
int endFirstLine = message.indexOf("\n");
String firstLine = message.substring(0, endFirstLine);
String userId = firstLine.substring(firstLine.indexOf("=") + 1);
String evaDts = message.substring(endFirstLine + 1);
collector.emit(new Values(Integer.valueOf(userId), evaDts), userId);
}
}
}
@Override
public void ack(Object msgId) {
LOG.info("Tuple tree successfully processed: " + msgId);
}
@Override
public void fail(Object msgId) {
LOG.error("Tuple tree processing failed: " + msgId);
}
@Override
public void close() {
}
@Override
public void activate() {
}
@Override
public void deactivate() {
}
/**
* Called when the MQ client gets a message (callback).
* It adds the MQ message to the messages variable
*/
@Override
public void messageArrived(String topic, MqttMessage message)
throws Exception {
messages.add(message.toString());
}
@Override
public void connectionLost(Throwable cause) {
}
@Override
public void deliveryComplete(IMqttDeliveryToken token) {
}
public Map<String, Object> getComponentConfiguration() {
return null;
}
} | apache-2.0 |
cer/pia | pia-ch-10-ejb3-spring-di/src/main/java/net/chrisrichardson/foodToGo/ejb3/facadeWithSpringDI/PlaceOrderFacadeUsingIntegratedDependencyInjectImpl.java | 5465 | /*
* Copyright (c) 2005 Chris Richardson
*
* 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 net.chrisrichardson.foodToGo.ejb3.facadeWithSpringDI;
import java.util.*;
import javax.annotation.*;
import javax.ejb.*;
import javax.naming.*;
import javax.persistence.*;
import net.chrisrichardson.foodToGo.ejb3.domain.*;
import net.chrisrichardson.foodToGo.ejb3.domain.Address;
import net.chrisrichardson.foodToGo.ejb3.facade.*;
import net.chrisrichardson.foodToGo.util.*;
import org.apache.commons.logging.*;
import org.jboss.annotation.ejb.*;
@Stateless
@Depends("jboss.j2ee:service=EJB3,type=service,name=net.chrisrichardson.foodToGo.ejb3.facadeWithSpringDI.SpringBeanReferenceInitializer")
@PersistenceContexts( { @PersistenceContext(name = "EntityManager", unitName = "pia") })
public class PlaceOrderFacadeUsingIntegratedDependencyInjectImpl implements
PlaceOrderFacadeUsingIntegratedDependencyInject {
private Log logger = LogFactory.getLog(getClass());
@Resource(name = "RestaurantRepository", mappedName = "RestaurantRepository")
private RestaurantRepository restaurantRepository;
@Resource(name = "PlaceOrderFacadeResultFactory", mappedName = "PlaceOrderFacadeResultFactory")
private PlaceOrderFacadeResultFactory resultFactory;
@Resource(name = "PlaceOrderService", mappedName = "PlaceOrderService")
private PlaceOrderService service;
public PlaceOrderFacadeUsingIntegratedDependencyInjectImpl() {
}
public PlaceOrderFacadeUsingIntegratedDependencyInjectImpl(
RestaurantRepository restaurantRepository,
PlaceOrderService service,
PlaceOrderFacadeResultFactory resultFactory) {
this.restaurantRepository = restaurantRepository;
this.service = service;
this.resultFactory = resultFactory;
}
public PlaceOrderFacadeResult updateDeliveryInfo(String pendingOrderId,
Address deliveryAddress, Date deliveryTime) {
// lookForEM();
PlaceOrderServiceResult result = service.updateDeliveryInfo(
pendingOrderId, deliveryAddress, deliveryTime);
PendingOrder pendingOrder = result.getPendingOrder();
if (result.getStatusCode() == PlaceOrderStatusCodes.OK) {
List restaurants = (List) restaurantRepository
.findAvailableRestaurants(deliveryAddress, deliveryTime);
// ...
return resultFactory.make(PlaceOrderStatusCodes.OK, pendingOrder,
restaurants);
} else {
return resultFactory.make(
PlaceOrderStatusCodes.INVALID_DELIVERY_INFO, pendingOrder,
null);
}
}
private void lookForEM() {
try {
InitialContext initialContext = new InitialContext();
String root = "java:comp.ejb3";
logger.debug("Starting listing");
listContext(initialContext, root);
logger.debug("End listing");
EntityManager em = (EntityManager) initialContext
.lookup("java:comp.ejb3/env/ejb/EntityManager");
logger.debug("Got entity manager2");
} catch (NamingException e) {
logger.error(e);
}
}
private void listContext(InitialContext initialContext, String root)
throws NamingException {
Enumeration<NameClassPair> enumeration = initialContext.list(root);
while (enumeration.hasMoreElements()) {
NameClassPair nc = enumeration.nextElement();
logger.debug("Name=" + root + "/" + nc.getName());
if (nc.getClassName().endsWith("NamingContext"))
listContext(initialContext, root + "/" + nc.getName());
}
}
public PlaceOrderFacadeResult updateRestaurant(String pendingOrderId,
String restaurantId) {
PlaceOrderServiceResult result = service.updateRestaurant(
pendingOrderId, restaurantId);
return resultFactory.make(PlaceOrderStatusCodes.OK, result
.getPendingOrder());
}
public PlaceOrderFacadeResult updateQuantities(String pendingOrderId,
int[] quantities) {
PlaceOrderServiceResult result = service.updateQuantities(
pendingOrderId, quantities);
return resultFactory.make(PlaceOrderStatusCodes.OK, result
.getPendingOrder(), null);
}
public PlaceOrderFacadeResult checkout(String pendingOrderId) {
PlaceOrderServiceResult result = service.checkout(pendingOrderId);
return resultFactory.make(PlaceOrderStatusCodes.OK, result
.getPendingOrder(), null);
}
public PlaceOrderFacadeResult updatePaymentInformation(
String pendingOrderId, PaymentInformation paymentInformation,
String couponCode) {
PlaceOrderServiceResult result = service.updatePaymentInformation(
pendingOrderId, paymentInformation, couponCode);
return resultFactory.make(PlaceOrderStatusCodes.OK, result
.getPendingOrder(), null);
}
public PlaceOrderFacadeResult confirmDeliveryInfoChange(
String pendingOrderId, Address deliveryAddress, Date deliveryTime) {
throw new NotYetImplementedException(); // FIXME
}
public PlaceOrderFacadeResult getPendingOrder(String pendingOrderId) {
throw new NotYetImplementedException(); // FIXME
}
} | apache-2.0 |
iritgo/iritgo-aktario | aktario-filetransfer/src/main/java/de/iritgo/aktario/filetransfer/FileTransferEvent.java | 1233 | /**
* This file is part of the Iritgo/Aktario Framework.
*
* Copyright (C) 2005-2011 Iritgo Technologies.
* Copyright (C) 2003-2005 BueroByte GbR.
*
* Iritgo licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.iritgo.aktario.filetransfer;
import de.iritgo.aktario.core.event.*;
public class FileTransferEvent implements Event
{
private FileTransferContext fileTransferContext;
private int state;
public FileTransferEvent(int state, FileTransferContext fileTransferContext)
{
this.state = state;
this.fileTransferContext = fileTransferContext;
}
public FileTransferContext getFileTransferContext()
{
return fileTransferContext;
}
public int getState()
{
return state;
}
}
| apache-2.0 |
Anteoy/jottings | src/main/java/com/anteoy/decisiveBattle/behavier/command/Broker.java | 376 | package com.anteoy.decisiveBattle.behavier.command;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhoudazhuang on 17-12-18.
*/
public class Broker {
List<Order> orderList = new ArrayList<Order>();
void takeOrder(Order order) {
orderList.add(order);
}
void placeOrder() {
orderList.forEach(a -> a.execute());
}
}
| apache-2.0 |
spring-projects/spring-data-examples | jpa/deferred/src/main/java/example/service/Customer849Service.java | 221 | package example.service;
import example.repo.Customer849Repository;
import org.springframework.stereotype.Service;
@Service
public class Customer849Service {
public Customer849Service(Customer849Repository repo) {}
}
| apache-2.0 |
torrances/swtk-commons | commons-dict-wordnet-indexbyid/src/main/java/org/swtk/commons/dict/wordnet/indexbyid/instance/p1/p4/WordnetNounIndexIdInstance1443.java | 14452 | package org.swtk.commons.dict.wordnet.indexbyid.instance.p1.p4; import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.TreeMap; import org.swtk.common.dict.dto.wordnet.IndexNoun; import com.trimc.blogger.commons.utils.GsonUtils; public final class WordnetNounIndexIdInstance1443 { private static Map<String, Collection<IndexNoun>> map = new TreeMap<String, Collection<IndexNoun>>(); static { add("14430304", "{\"term\":\"bummer\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14335136\", \"14430304\"]}");
add("14430474", "{\"term\":\"huff\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14430474\"]}");
add("14430474", "{\"term\":\"miff\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14430474\"]}");
add("14430474", "{\"term\":\"seeing red\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14430474\"]}");
add("14430615", "{\"term\":\"pinprick\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"03949899\", \"14430615\"]}");
add("14430687", "{\"term\":\"impatience\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04649953\", \"07529310\", \"14430687\"]}");
add("14430687", "{\"term\":\"restlessness\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"04632641\", \"07529034\", \"14430687\", \"04781982\"]}");
add("14430839", "{\"term\":\"snit\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14430839\"]}");
add("14430940", "{\"term\":\"enchantment\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"05988321\", \"14430940\", \"07513215\"]}");
add("14430940", "{\"term\":\"spell\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"07174442\", \"15271164\", \"15317305\", \"14430940\"]}");
add("14430940", "{\"term\":\"trance\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"05689175\", \"14430940\"]}");
add("14431199", "{\"term\":\"possession\", \"synsetCount\":7, \"upperType\":\"NOUN\", \"ids\":[\"00811363\", \"04869236\", \"08649106\", \"09205421\", \"14431199\", \"00032912\", \"00811126\"]}");
add("14431303", "{\"term\":\"captivation\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"07513215\", \"14431303\"]}");
add("14431303", "{\"term\":\"fascination\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04696799\", \"07513215\", \"14431303\"]}");
add("14431490", "{\"term\":\"difficulty\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"04716529\", \"14431490\", \"05694760\", \"00625102\"]}");
add("14431923", "{\"term\":\"bitch\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"02086324\", \"07224625\", \"10002403\", \"14431923\"]}");
add("14432050", "{\"term\":\"plight\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"07242765\", \"14432050\"]}");
add("14432050", "{\"term\":\"predicament\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14432050\"]}");
add("14432050", "{\"term\":\"quandary\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"05693891\", \"14432050\"]}");
add("14432355", "{\"term\":\"box\", \"synsetCount\":10, \"upperType\":\"NOUN\", \"ids\":[\"00135968\", \"02887252\", \"02887691\", \"02887848\", \"12766866\", \"13906151\", \"14432355\", \"13787764\", \"02887466\", \"02886585\"]}");
add("14432355", "{\"term\":\"corner\", \"synsetCount\":11, \"upperType\":\"NOUN\", \"ids\":[\"03114344\", \"08562168\", \"09279917\", \"14432355\", \"14468538\", \"13895060\", \"08677624\", \"03114137\", \"03114532\", \"08561850\", \"08561994\"]}");
add("14432541", "{\"term\":\"hot water\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14432541\"]}");
add("14432689", "{\"term\":\"rattrap\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04063525\", \"04063603\", \"14432689\"]}");
add("14432775", "{\"term\":\"pinch\", \"synsetCount\":7, \"upperType\":\"NOUN\", \"ids\":[\"00089545\", \"00358101\", \"00843942\", \"07432005\", \"13796315\", \"14318642\", \"14432775\"]}");
add("14432893", "{\"term\":\"fix\", \"synsetCount\":5, \"upperType\":\"NOUN\", \"ids\":[\"00156307\", \"00215015\", \"00267650\", \"00324088\", \"14432893\"]}");
add("14432893", "{\"term\":\"hole\", \"synsetCount\":8, \"upperType\":\"NOUN\", \"ids\":[\"05309806\", \"14432893\", \"14488377\", \"09327656\", \"13934444\", \"03531985\", \"03531378\", \"09327371\"]}");
add("14432893", "{\"term\":\"jam\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"01255966\", \"08200316\", \"14432893\", \"07658542\"]}");
add("14432893", "{\"term\":\"kettle of fish\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14432893\"]}");
add("14432893", "{\"term\":\"mess\", \"synsetCount\":6, \"upperType\":\"NOUN\", \"ids\":[\"13796604\", \"03756556\", \"07581173\", \"07666401\", \"14432893\", \"14523631\"]}");
add("14432893", "{\"term\":\"muddle\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14432893\", \"14524151\"]}");
add("14432893", "{\"term\":\"pickle\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14432893\", \"07840964\"]}");
add("14433122", "{\"term\":\"dog\u0027s breakfast\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14433122\"]}");
add("14433122", "{\"term\":\"dog\u0027s dinner\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14433122\"]}");
add("14433284", "{\"term\":\"hard time\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"15249774\", \"14433284\"]}");
add("14433284", "{\"term\":\"rough sledding\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14433284\"]}");
add("14433493", "{\"term\":\"strain\", \"synsetCount\":11, \"upperType\":\"NOUN\", \"ids\":[\"00547426\", \"00625793\", \"00790427\", \"05931082\", \"14321604\", \"08128123\", \"08118376\", \"14399295\", \"07041860\", \"14433493\", \"11535758\"]}");
add("14433493", "{\"term\":\"stress\", \"synsetCount\":5, \"upperType\":\"NOUN\", \"ids\":[\"11535238\", \"14433493\", \"14458653\", \"14399593\", \"07099567\"]}");
add("14433769", "{\"term\":\"mire\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"14433769\", \"14980662\", \"09378747\"]}");
add("14434009", "{\"term\":\"job\", \"synsetCount\":13, \"upperType\":\"NOUN\", \"ids\":[\"00784446\", \"06448609\", \"06584658\", \"10242619\", \"11105392\", \"14434009\", \"00577754\", \"00577914\", \"00585806\", \"03604953\", \"03604821\", \"00720957\", \"00583425\"]}");
add("14434009", "{\"term\":\"problem\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"05695143\", \"06796860\", \"14434009\"]}");
add("14434322", "{\"term\":\"race problem\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14434322\"]}");
add("14434483", "{\"term\":\"balance-of-payments problem\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14434483\"]}");
add("14434647", "{\"term\":\"situation\", \"synsetCount\":5, \"upperType\":\"NOUN\", \"ids\":[\"00587299\", \"08640525\", \"14434647\", \"13948785\", \"13950416\"]}");
add("14435176", "{\"term\":\"quicksand\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"09425819\", \"14435176\"]}");
add("14435288", "{\"term\":\"vogue\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14435288\", \"05758160\"]}");
add("14435385", "{\"term\":\"acknowledgement\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"06641368\", \"14435385\"]}");
add("14435385", "{\"term\":\"acknowledgment\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"06641368\", \"06776392\", \"14435385\"]}");
add("14435385", "{\"term\":\"recognition\", \"synsetCount\":8, \"upperType\":\"NOUN\", \"ids\":[\"00166384\", \"06203951\", \"07163815\", \"11523113\", \"05815548\", \"06701019\", \"05770995\", \"14435385\"]}");
add("14435778", "{\"term\":\"approval\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"06699481\", \"14435778\", \"07515398\", \"01217882\"]}");
add("14435778", "{\"term\":\"favorable reception\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14435778\"]}");
add("14435778", "{\"term\":\"favourable reception\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14435778\"]}");
add("14435968", "{\"term\":\"appro\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14435968\"]}");
add("14436129", "{\"term\":\"acceptation\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"00181262\", \"06615154\", \"14436129\"]}");
add("14436286", "{\"term\":\"content\", \"synsetCount\":7, \"upperType\":\"NOUN\", \"ids\":[\"04354303\", \"14436286\", \"05817200\", \"13801586\", \"13838733\", \"06611268\", \"07971643\"]}");
add("14436286", "{\"term\":\"contentedness\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14436286\"]}");
add("14436566", "{\"term\":\"acquiescence\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"07190226\", \"14436566\"]}");
add("14436669", "{\"term\":\"welcome\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"06643829\", \"14436669\"]}");
add("14436815", "{\"term\":\"apostasy\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"00205663\", \"14436815\"]}");
add("14436815", "{\"term\":\"defection\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14436815\", \"00056135\"]}");
add("14436815", "{\"term\":\"renunciation\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"00205928\", \"07269262\", \"14436815\", \"07222070\"]}");
add("14437048", "{\"term\":\"disfavor\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"06210476\", \"14437048\"]}");
add("14437048", "{\"term\":\"disfavour\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"06210476\", \"14437048\"]}");
add("14437235", "{\"term\":\"wilderness\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"05124030\", \"08701286\", \"09502554\", \"14437235\"]}");
add("14437397", "{\"term\":\"censure\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14437397\", \"06722937\"]}");
add("14437397", "{\"term\":\"exclusion\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"00207776\", \"05715216\", \"14437397\", \"13958260\"]}");
add("14437397", "{\"term\":\"excommunication\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"00209126\", \"14437397\"]}");
add("14437550", "{\"term\":\"reprobation\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"06210777\", \"14437550\"]}");
add("14437698", "{\"term\":\"separation\", \"synsetCount\":9, \"upperType\":\"NOUN\", \"ids\":[\"00384414\", \"01203919\", \"07310009\", \"08664696\", \"01203511\", \"01256840\", \"05097154\", \"07346000\", \"14437698\"]}");
add("14437907", "{\"term\":\"discreteness\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14437907\"]}");
add("14437907", "{\"term\":\"distinctness\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04750006\", \"14437907\", \"04710036\"]}");
add("14437907", "{\"term\":\"separateness\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04750006\", \"14024698\", \"14437907\"]}");
add("14437907", "{\"term\":\"severalty\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"13261869\", \"14437907\"]}");
add("14438119", "{\"term\":\"isolation\", \"synsetCount\":5, \"upperType\":\"NOUN\", \"ids\":[\"01242282\", \"13524876\", \"01204519\", \"07517815\", \"14438119\"]}");
add("14438384", "{\"term\":\"solitude\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"08670055\", \"14438384\", \"14438476\"]}");
add("14438476", "{\"term\":\"purdah\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04032027\", \"08396613\", \"14438476\"]}");
add("14438476", "{\"term\":\"solitude\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"08670055\", \"14438384\", \"14438476\"]}");
add("14438567", "{\"term\":\"loneliness\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"04629772\", \"07549496\", \"14438567\"]}");
add("14438567", "{\"term\":\"solitariness\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"04629772\", \"14438567\"]}");
add("14438739", "{\"term\":\"quarantine\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"01204135\", \"14438739\"]}");
add("14438922", "{\"term\":\"detachment\", \"synsetCount\":5, \"upperType\":\"NOUN\", \"ids\":[\"07346000\", \"08232169\", \"14438922\", \"00391714\", \"07521270\"]}");
add("14438922", "{\"term\":\"insularism\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14438922\"]}");
add("14438922", "{\"term\":\"insularity\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14438922\"]}");
add("14438922", "{\"term\":\"insulation\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"00828671\", \"14944995\", \"14438922\"]}");
add("14439177", "{\"term\":\"alienation\", \"synsetCount\":4, \"upperType\":\"NOUN\", \"ids\":[\"00036612\", \"01110055\", \"14439177\", \"07517626\"]}");
add("14439177", "{\"term\":\"estrangement\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"07517626\", \"14439177\"]}");
add("14439302", "{\"term\":\"anomie\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"04859096\", \"14439302\"]}");
add("14439302", "{\"term\":\"anomy\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"04859096\", \"14439302\"]}");
add("14439493", "{\"term\":\"concealment\", \"synsetCount\":3, \"upperType\":\"NOUN\", \"ids\":[\"01050836\", \"04159023\", \"14439493\"]}");
add("14439493", "{\"term\":\"privacy\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14439493\", \"04630289\"]}");
add("14439493", "{\"term\":\"privateness\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"04630289\", \"14439493\"]}");
add("14439493", "{\"term\":\"secrecy\", \"synsetCount\":2, \"upperType\":\"NOUN\", \"ids\":[\"14439493\", \"04659534\"]}");
add("14439753", "{\"term\":\"covertness\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14439753\"]}");
add("14439753", "{\"term\":\"hiddenness\", \"synsetCount\":1, \"upperType\":\"NOUN\", \"ids\":[\"14439753\"]}");
add("14439877", "{\"term\":\"bosom\", \"synsetCount\":6, \"upperType\":\"NOUN\", \"ids\":[\"05562038\", \"05927857\", \"00181619\", \"02879326\", \"05561119\", \"14439877\"]}");
} private static void add(final String ID, final String JSON) { IndexNoun indexNoun = GsonUtils.toObject(JSON, IndexNoun.class); Collection<IndexNoun> list = (map.containsKey(ID)) ? map.get(ID) : new ArrayList<IndexNoun>(); list.add(indexNoun); map.put(ID, list); } public static Collection<IndexNoun> get(final String TERM) { return map.get(TERM); } public static boolean has(final String TERM) { return map.containsKey(TERM); } public static Collection<String> ids() { return map.keySet(); } } | apache-2.0 |
CSCSI/Triana | triana-gui/src/main/java/org/trianacode/gui/hci/tools/ComponentSelectionHandler.java | 4749 | /*
* The University of Wales, Cardiff Triana Project Software License (Based
* on the Apache Software License Version 1.1)
*
* Copyright (c) 2007 University of Wales, Cardiff. All rights reserved.
*
* Redistribution and use of the software in source and binary forms, with
* or without modification, are permitted provided that the following
* conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. The end-user documentation included with the redistribution, if any,
* must include the following acknowledgment: "This product includes
* software developed by the University of Wales, Cardiff for the Triana
* Project (http://www.trianacode.org)." Alternately, this
* acknowledgment may appear in the software itself, if and wherever
* such third-party acknowledgments normally appear.
*
* 4. The names "Triana" and "University of Wales, Cardiff" must not be
* used to endorse or promote products derived from this software
* without prior written permission. For written permission, please
* contact triana@trianacode.org.
*
* 5. Products derived from this software may not be called "Triana," nor
* may Triana appear in their name, without prior written permission of
* the University of Wales, Cardiff.
*
* 6. This software may not be sold, used or incorporated into any product
* for sale to third parties.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL UNIVERSITY OF WALES, CARDIFF OR ITS CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* ------------------------------------------------------------------------
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Triana Project. For more information on the
* Triana Project, please see. http://www.trianacode.org.
*
* This license is based on the BSD license as adopted by the Apache
* Foundation and is governed by the laws of England and Wales.
*
*/
package org.trianacode.gui.hci.tools;
import org.trianacode.gui.action.ToolSelectionHandler;
import org.trianacode.gui.action.ToolSelectionListener;
import org.trianacode.taskgraph.Task;
import org.trianacode.taskgraph.TaskGraph;
import org.trianacode.taskgraph.service.TrianaClient;
import org.trianacode.taskgraph.tool.Tool;
/**
* A selection handler for a single preselected task.
*
* @author Ian Wang
* @version $Revision: 4048 $
*/
public class ComponentSelectionHandler implements ToolSelectionHandler {
private Task task;
private TaskGraph taskgraph;
public ComponentSelectionHandler(Task task) {
this.task = task;
this.taskgraph = task.getParent();
}
public ComponentSelectionHandler(TaskGraph taskgraph) {
this.taskgraph = taskgraph;
}
/**
* Adds a listener to be notified when the tool selection changes
*/
public void addToolSelectionListener(ToolSelectionListener listener) {
// empty because the tool selection never changes
}
/**
* Removes a listener from being notified when the tool selection changes
*/
public void removeToolSelectionListener(ToolSelectionListener listener) {
// empty because the tool selection never changes
}
public boolean isSingleSelectedTool() {
return task != null;
}
public Tool getSelectedTool() {
return task;
}
public Tool[] getSelectedTools() {
if (task == null) {
return new Tool[0];
} else {
return new Tool[]{task};
}
}
/**
* @return the currently selected taskgraph (usually parent of selected tool)
*/
public TaskGraph getSelectedTaskgraph() {
return taskgraph;
}
public TrianaClient getSelectedTrianaClient() {
return null;
}
}
| apache-2.0 |
347184068/gmenergy | src/main/java/com/tp/ems/modules/energywatermonitor/service/EnergyWaterRawdataService.java | 3081 | /**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.tp.ems.modules.energywatermonitor.service;
import java.text.SimpleDateFormat;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.github.abel533.echarts.axis.CategoryAxis;
import com.github.abel533.echarts.axis.ValueAxis;
import com.github.abel533.echarts.code.PointerType;
import com.github.abel533.echarts.code.Trigger;
import com.github.abel533.echarts.code.X;
import com.github.abel533.echarts.json.GsonOption;
import com.github.abel533.echarts.series.Line;
import com.tp.ems.modules.energyelecmonitor.entity.EnergyElecRawdata;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.tp.ems.common.persistence.Page;
import com.tp.ems.common.service.CrudService;
import com.tp.ems.modules.energywatermonitor.entity.EnergyWaterRawdata;
import com.tp.ems.modules.energywatermonitor.dao.EnergyWaterRawdataDao;
/**
* 水表在线监控Service
* @author 徐韵轩
* @version 2017-07-13
*/
@Service
@Transactional(readOnly = true)
public class EnergyWaterRawdataService extends CrudService<EnergyWaterRawdataDao, EnergyWaterRawdata> {
public EnergyWaterRawdata get(String id) {
return super.get(id);
}
public List<EnergyWaterRawdata> findList(EnergyWaterRawdata energyWaterRawdata) {
return super.findList(energyWaterRawdata);
}
public Page<EnergyWaterRawdata> findPage(Page<EnergyWaterRawdata> page, EnergyWaterRawdata energyWaterRawdata) {
return super.findPage(page, energyWaterRawdata);
}
@Transactional(readOnly = false)
public void save(EnergyWaterRawdata energyWaterRawdata) {
super.save(energyWaterRawdata);
}
@Transactional(readOnly = false)
public void delete(EnergyWaterRawdata energyWaterRawdata) {
super.delete(energyWaterRawdata);
}
public List<EnergyWaterRawdata> findNewDataByCount(EnergyWaterRawdata waterRawdata) {
return dao.findNewDataByCount(waterRawdata);
}
public GsonOption genBrokenLine(List<EnergyWaterRawdata> rawdatas) {
GsonOption option = new GsonOption();
String optionLegend = "实时水量";
option.title().text(optionLegend).left(X.center);
option.tooltip().trigger(Trigger.axis).axisPointer().type(PointerType.shadow);
option.legend().data("水量").left(X.right);
//纵轴为值轴
ValueAxis valueAxis = new ValueAxis();
valueAxis.name("单位(吨)");
option.yAxis(valueAxis);
// x轴为类目轴
CategoryAxis category = new CategoryAxis();
category.setBoundaryGap(false);
//柱状数据
Line line = new Line("水量");
line.setSmooth(true);
line.setAnimation(false);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
for(int i = rawdatas.size()-1 ; i >=0 ; i--){
EnergyWaterRawdata amount = rawdatas.get(i);
String strDate = sdf.format(amount.getDataTime());
category.data(strDate);
line.data(amount.getRawData());
}
option.xAxis(category);
option.series(line);
System.out.println(JSON.toJSON(option));
return option;
}
} | apache-2.0 |
CeH9/PackageTemplates | src/main/java/global/listeners/ReleaseListener.java | 554 | package global.listeners;
import javax.swing.event.MouseInputListener;
import java.awt.event.MouseEvent;
/**
* Created by CeH9 on 02.07.2016.
*/
public abstract class ReleaseListener implements MouseInputListener {
@Override public void mouseClicked(MouseEvent e) {}
@Override public void mousePressed(MouseEvent e) {}
@Override public void mouseEntered(MouseEvent e) {}
@Override public void mouseExited(MouseEvent e) {}
@Override public void mouseDragged(MouseEvent e) {}
@Override public void mouseMoved(MouseEvent e) {}}
| apache-2.0 |
skeleton-software-community/skeleton-generator | generator-model/src/main/java/org/sklsft/generator/model/metadata/IdGeneratorType.java | 212 | package org.sklsft.generator.model.metadata;
import javax.xml.bind.annotation.XmlEnum;
/**
*
* @author Nicolas Thibault
*
*/
@XmlEnum(String.class)
public enum IdGeneratorType {
NONE,
SEQUENCE,
UUID;
}
| apache-2.0 |
jprante/log4j2-elasticsearch | src/main/java/org/xbib/logging/log4j2/ElasticsearchTransportClient.java | 3968 | /**
* Copyright 2014 Jörg Prante
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.xbib.logging.log4j2;
import org.elasticsearch.ElasticsearchIllegalStateException;
import org.elasticsearch.action.bulk.BulkProcessor;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class ElasticsearchTransportClient {
private final Client client;
private final BulkProcessor bulkProcessor;
private final String index;
private final String type;
public ElasticsearchTransportClient(Client client, String index, String type,
int maxActionsPerBulkRequest,
int maxConcurrentBulkRequests,
ByteSizeValue maxVolumePerBulkRequest,
TimeValue flushInterval) {
this.client = client;
this.index = index;
this.type = type;
BulkProcessor.Listener listener = new BulkProcessor.Listener() {
@Override
public void beforeBulk(long executionId, BulkRequest request) {
}
@Override
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {
}
@Override
public void afterBulk(long executionId, BulkRequest requst, Throwable failure) {
}
};
BulkProcessor.Builder builder = BulkProcessor.builder(client, listener)
.setBulkActions(maxActionsPerBulkRequest)
.setConcurrentRequests(maxConcurrentBulkRequests)
.setFlushInterval(flushInterval);
if (maxVolumePerBulkRequest != null) {
builder.setBulkSize(maxVolumePerBulkRequest);
}
this.bulkProcessor = builder.build();
}
public ElasticsearchTransportClient index(Map<String, Object> source) {
if (((TransportClient)client).connectedNodes().isEmpty()) {
throw new ElasticsearchIllegalStateException("client is disconnected");
}
String index = this.index.indexOf('\'') < 0 ? this.index : getIndexNameDateFormat(this.index).format(new Date());
bulkProcessor.add(new IndexRequest(index).type(type).create(false).source(source));
return this;
}
public void close() {
bulkProcessor.close();
client.close();
}
private static final ThreadLocal<Map<String, SimpleDateFormat>> df = new ThreadLocal<Map<String, SimpleDateFormat>>() {
public Map<String, SimpleDateFormat> initialValue() {
return new HashMap<String, SimpleDateFormat>();
}
};
private SimpleDateFormat getIndexNameDateFormat(String index) {
Map<String, SimpleDateFormat> formatters = df.get();
SimpleDateFormat formatter = formatters.get(index);
if (formatter == null) {
formatter = new SimpleDateFormat();
formatter.applyPattern(index);
formatters.put(index, formatter);
}
return formatter;
}
}
| apache-2.0 |
leleuj/pac4j | pac4j-gae/src/main/java/org/pac4j/gae/client/GaeUserServiceClient.java | 3632 | /*
Copyright 2012 - 2014 Patrice de Saint Steban
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.pac4j.gae.client;
import org.pac4j.core.client.BaseClient;
import org.pac4j.core.client.Mechanism;
import org.pac4j.core.client.RedirectAction;
import org.pac4j.core.context.WebContext;
import org.pac4j.core.exception.RequiresHttpAction;
import org.pac4j.core.util.CommonHelper;
import org.pac4j.gae.credentials.GaeUserCredentials;
import org.pac4j.gae.profile.GaeUserServiceAttributesDefinition;
import org.pac4j.gae.profile.GaeUserServiceProfile;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
/**
* This class is the OpenID client to authenticate users with UserService on App Engine
* <p />
*
* @author Patrice de Saint Steban
* @since 1.6.0
*/
public class GaeUserServiceClient extends BaseClient<GaeUserCredentials, GaeUserServiceProfile> {
UserService service;
String authDomain = null;
public GaeUserServiceClient() {
setName("GaeUserServiceClient");
}
@Override
protected BaseClient<GaeUserCredentials, GaeUserServiceProfile> newClient() {
GaeUserServiceClient gaeUserServiceClient = new GaeUserServiceClient();
gaeUserServiceClient.setAuthDomain(authDomain);
return gaeUserServiceClient;
}
@Override
protected boolean isDirectRedirection() {
return true;
}
@Override
protected RedirectAction retrieveRedirectAction(WebContext context) {
String destinationUrl = getCallbackUrl();
String loginUrl = authDomain == null ? service.createLoginURL(destinationUrl) : service.createLoginURL(destinationUrl, authDomain);
return RedirectAction.redirect(loginUrl);
}
@Override
protected GaeUserCredentials retrieveCredentials(WebContext context)
throws RequiresHttpAction {
GaeUserCredentials credentials = new GaeUserCredentials();
credentials.setUser(service.getCurrentUser());
return credentials;
}
@Override
protected GaeUserServiceProfile retrieveUserProfile(GaeUserCredentials credentials, WebContext context) {
User user = credentials.getUser();
if (user != null) {
GaeUserServiceProfile gaeUserProfile = new GaeUserServiceProfile();
gaeUserProfile.setId(user.getEmail());
gaeUserProfile.addAttribute(GaeUserServiceAttributesDefinition.EMAIL, user.getEmail());
gaeUserProfile.addAttribute(GaeUserServiceAttributesDefinition.DISPLAYNAME, user.getNickname());
if (service.isUserAdmin()) {
gaeUserProfile.addRole(GaeUserServiceProfile.PAC4J_GAE_GLOBAL_ADMIN_ROLE);
}
return gaeUserProfile;
}
return null;
}
@Override
public Mechanism getMechanism() {
return Mechanism.GAE_MECHANISM;
}
@Override
protected void internalInit() {
service = UserServiceFactory.getUserService();
CommonHelper.assertNotBlank("callbackUrl", this.callbackUrl);
}
/**
* Set the authDomain for connect to google apps for domain with the UserService
* @param authDomain
*/
public void setAuthDomain(String authDomain) {
this.authDomain = authDomain;
}
public String getAuthDomain() {
return authDomain;
}
}
| apache-2.0 |
wmedvede/drools | drools-core/src/main/java/org/drools/core/common/InternalWorkingMemory.java | 6493 | /*
* Copyright 2010 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.drools.core.common;
import org.drools.core.SessionConfiguration;
import org.drools.core.WorkingMemory;
import org.drools.core.definitions.rule.impl.RuleImpl;
import org.drools.core.event.AgendaEventSupport;
import org.drools.core.event.RuleRuntimeEventSupport;
import org.drools.core.phreak.PropagationEntry;
import org.drools.core.reteoo.EntryPointNode;
import org.drools.core.reteoo.ObjectTypeConf;
import org.drools.core.rule.EntryPointId;
import org.drools.core.runtime.impl.ExecutionResultImpl;
import org.drools.core.runtime.process.InternalProcessRuntime;
import org.drools.core.spi.Activation;
import org.drools.core.spi.FactHandleFactory;
import org.drools.core.time.TimerService;
import org.drools.core.type.DateFormats;
import org.kie.api.runtime.Calendars;
import org.kie.api.runtime.Channel;
import org.kie.api.runtime.rule.EntryPoint;
import org.kie.api.runtime.rule.FactHandle;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.locks.Lock;
public interface InternalWorkingMemory
extends WorkingMemory {
InternalAgenda getAgenda();
int getId();
void setId(Long id);
void setRuleRuntimeEventSupport(RuleRuntimeEventSupport workingMemoryEventSupport);
void setAgendaEventSupport(AgendaEventSupport agendaEventSupport);
Memory getNodeMemory(MemoryFactory node);
void clearNodeMemory(MemoryFactory node);
NodeMemories getNodeMemories();
long getNextPropagationIdCounter();
ObjectStore getObjectStore();
void executeQueuedActionsForRete();
void queueWorkingMemoryAction(final WorkingMemoryAction action);
FactHandleFactory getFactHandleFactory();
EntryPointId getEntryPoint();
EntryPointNode getEntryPointNode();
EntryPoint getEntryPoint(String name);
void insert(final InternalFactHandle handle,
final Object object,
final RuleImpl rule,
final Activation activation,
ObjectTypeConf typeConf);
/**
* Looks for the fact handle associated to the given object
* by looking up the object IDENTITY (==), even if rule base
* is configured to AssertBehavior.EQUALITY.
*
* @param object
* @return null if fact handle not found
*/
FactHandle getFactHandleByIdentity(final Object object);
void delete(final FactHandle factHandle,
final RuleImpl rule,
final Activation activation);
Lock getLock();
boolean isSequential();
ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry();
InternalFactHandle getInitialFactHandle();
Calendars getCalendars();
/**
* Returns the TimerService instance (session clock) for this
* session.
*
* @return
*/
TimerService getTimerService();
InternalKnowledgeRuntime getKnowledgeRuntime();
/**
* Returns a map of channel Id->Channel of all channels in
* this working memory
*
* @return
*/
Map< String, Channel> getChannels();
Collection< ? extends EntryPoint> getEntryPoints();
SessionConfiguration getSessionConfiguration();
void startBatchExecution(ExecutionResultImpl results);
ExecutionResultImpl getExecutionResult();
void endBatchExecution();
/**
* This method must be called before starting any new work in the engine,
* like inserting a new fact or firing a new rule. It will reset the engine
* idle time counter.
*
* This method must be extremely light to avoid contentions when called by
* multiple threads/entry-points
*/
void startOperation();
/**
* This method must be called after finishing any work in the engine,
* like inserting a new fact or firing a new rule. It will reset the engine
* idle time counter.
*
* This method must be extremely light to avoid contentions when called by
* multiple threads/entry-points
*/
void endOperation();
/**
* Returns the number of time units (usually ms) that the engine is idle
* according to the session clock or -1 if it is not idle.
*
* This method is not synchronised and might return an approximate value.
*
* @return
*/
long getIdleTime();
/**
* Returns the number of time units (usually ms) to
* the next scheduled job
*
* @return the number of time units until the next scheduled job or -1 if
* there is no job scheduled
*/
long getTimeToNextJob();
void updateEntryPointsCache();
/**
* This method is called by the agenda before firing a new activation
* to ensure the working memory is in a safe state to fire the activation.
*/
public void prepareToFireActivation();
/**
* This method is called by the agenda right after an activation was fired
* to allow the working memory to resume any activities blocked during
* activation firing.
*/
void activationFired();
/**
* Returns the total number of facts in the working memory, i.e., counting
* all facts from all entry points. This is an approximate value and may not
* be accurate due to the concurrent nature of the entry points.
*
* @return
*/
long getTotalFactCount();
DateFormats getDateFormats();
InternalProcessRuntime getProcessRuntime();
void closeLiveQuery(InternalFactHandle factHandle);
void addPropagation(PropagationEntry propagationEntry);
void flushPropagations();
void flushNonMarshallablePropagations();
boolean hasPendingPropagations();
Iterator<? extends PropagationEntry> getActionsIterator();
void removeGlobal(String identifier);
}
| apache-2.0 |
nickman/HeliosStreams | stream-common/src/main/java/com/heliosapm/streams/common/kafka/producer/package-info.java | 946 | /*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* <p>Title: package-info</p>
* <p>Description: A shared kafka producer service</p>
* <p>Company: Helios Development Group LLC</p>
* @author Whitehead (nwhitehead AT heliosdev DOT org)
* <p><code>com.heliosapm.streams.common.kafka.producer.package-info</code></p>
*/
package com.heliosapm.streams.common.kafka.producer; | apache-2.0 |
google/graphicsfuzz | gles-worker/core/src/com/graphicsfuzz/glesworker/IWatchdog.java | 818 | /*
* Copyright 2018 The GraphicsFuzz Project Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.graphicsfuzz.glesworker;
public interface IWatchdog {
void start(Object watchdogMutex, String name, long seconds, PersistentData persistentData);
void stop();
void killNow();
}
| apache-2.0 |
lesaint/experimenting-annotation-processing | experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_6604.java | 151 | package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_6604 {
}
| apache-2.0 |
consulo/consulo-unity3d | shaderlab/src/main/java/consulo/unity3d/shaderlab/ide/highlight/SharpLabHighlightVisitor.java | 4627 | /*
* Copyright 2013-2016 consulo.io
*
* 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 consulo.unity3d.shaderlab.ide.highlight;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
import com.intellij.codeInsight.daemon.impl.HighlightVisitor;
import com.intellij.codeInsight.daemon.impl.analysis.HighlightInfoHolder;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import consulo.annotation.access.RequiredReadAction;
import consulo.unity3d.shaderlab.lang.ShaderLabPropertyType;
import consulo.unity3d.shaderlab.lang.psi.*;
import javax.annotation.Nonnull;
/**
* @author VISTALL
* @since 08.05.2015
*/
public class SharpLabHighlightVisitor extends SharpLabElementVisitor implements HighlightVisitor
{
private HighlightInfoHolder myHolder;
@Override
public void visitProperty(ShaderPropertyElement p)
{
super.visitProperty(p);
PsiElement nameIdentifier = p.getNameIdentifier();
if(nameIdentifier != null)
{
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.INFORMATION).range(nameIdentifier).textAttributes(DefaultLanguageHighlighterColors.INSTANCE_FIELD).create());
}
}
@Override
public void visitPropertyType(ShaderPropertyTypeElement type)
{
super.visitPropertyType(type);
PsiElement element = type.getTargetElement();
ShaderLabPropertyType shaderLabPropertyType = ShaderLabPropertyType.find(element.getText());
if(shaderLabPropertyType == null)
{
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(element).descriptionAndTooltip("Wrong type").create());
}
else
{
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.INFORMATION).range(element).textAttributes(DefaultLanguageHighlighterColors.TYPE_ALIAS_NAME).create());
}
}
@Override
@RequiredReadAction
public void visitReference(ShaderReference reference)
{
if(!reference.isSoft())
{
PsiElement resolve = reference.resolve();
if(resolve == null)
{
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(reference.getReferenceElement()).descriptionAndTooltip("'" + reference.getReferenceName() + "' is not " +
"resolved").create());
}
else
{
ShaderReference.ResolveKind kind = reference.kind();
TextAttributesKey key = null;
switch(kind)
{
case ATTRIBUTE:
key = DefaultLanguageHighlighterColors.METADATA;
break;
case PROPERTY:
key = DefaultLanguageHighlighterColors.INSTANCE_FIELD;
break;
default:
return;
}
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.INFORMATION).range(reference.getReferenceElement()).textAttributes(key).create());
}
}
}
@Override
public void visitElement(PsiElement element)
{
super.visitElement(element);
ASTNode node = element.getNode();
if(node != null)
{
if(node.getElementType() == ShaderLabKeyTokens.VALUE_KEYWORD)
{
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.INFORMATION).range(node).textAttributes(DefaultLanguageHighlighterColors.MACRO_KEYWORD).create());
}
else if(node.getElementType() == ShaderLabKeyTokens.START_KEYWORD)
{
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.INFORMATION).range(node).textAttributes(DefaultLanguageHighlighterColors.KEYWORD).create());
}
}
}
@Override
public boolean suitableForFile(@Nonnull PsiFile file)
{
return file instanceof ShaderLabFile;
}
@Override
public void visit(@Nonnull PsiElement element)
{
element.accept(this);
}
@Override
public boolean analyze(@Nonnull PsiFile file, boolean updateWholeFile, @Nonnull HighlightInfoHolder holder, @Nonnull Runnable action)
{
myHolder = holder;
action.run();
return true;
}
@Nonnull
@Override
public HighlightVisitor clone()
{
return new SharpLabHighlightVisitor();
}
@Override
public int order()
{
return 0;
}
}
| apache-2.0 |
google-code-export/google-api-dfp-java | src/com/google/api/ads/dfp/v201211/CompanyServiceSoapBindingStub.java | 50804 | /**
* CompanyServiceSoapBindingStub.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.v201211;
public class CompanyServiceSoapBindingStub extends org.apache.axis.client.Stub implements com.google.api.ads.dfp.v201211.CompanyServiceInterface {
private java.util.Vector cachedSerClasses = new java.util.Vector();
private java.util.Vector cachedSerQNames = new java.util.Vector();
private java.util.Vector cachedSerFactories = new java.util.Vector();
private java.util.Vector cachedDeserFactories = new java.util.Vector();
static org.apache.axis.description.OperationDesc [] _operations;
static {
_operations = new org.apache.axis.description.OperationDesc[6];
_initOperationDesc1();
}
private static void _initOperationDesc1(){
org.apache.axis.description.OperationDesc oper;
org.apache.axis.description.ParameterDesc param;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("createCompanies");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "companies"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"), com.google.api.ads.dfp.v201211.Company[].class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"));
oper.setReturnClass(com.google.api.ads.dfp.v201211.Company[].class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiExceptionFault"),
"com.google.api.ads.dfp.v201211.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException"),
true
));
_operations[0] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("createCompany");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "company"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"), com.google.api.ads.dfp.v201211.Company.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"));
oper.setReturnClass(com.google.api.ads.dfp.v201211.Company.class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiExceptionFault"),
"com.google.api.ads.dfp.v201211.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException"),
true
));
_operations[1] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("getCompaniesByStatement");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "filterStatement"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Statement"), com.google.api.ads.dfp.v201211.Statement.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CompanyPage"));
oper.setReturnClass(com.google.api.ads.dfp.v201211.CompanyPage.class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiExceptionFault"),
"com.google.api.ads.dfp.v201211.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException"),
true
));
_operations[2] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("getCompany");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "companyId"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), java.lang.Long.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"));
oper.setReturnClass(com.google.api.ads.dfp.v201211.Company.class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiExceptionFault"),
"com.google.api.ads.dfp.v201211.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException"),
true
));
_operations[3] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("updateCompanies");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "companies"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"), com.google.api.ads.dfp.v201211.Company[].class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"));
oper.setReturnClass(com.google.api.ads.dfp.v201211.Company[].class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiExceptionFault"),
"com.google.api.ads.dfp.v201211.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException"),
true
));
_operations[4] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("updateCompany");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "company"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"), com.google.api.ads.dfp.v201211.Company.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company"));
oper.setReturnClass(com.google.api.ads.dfp.v201211.Company.class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiExceptionFault"),
"com.google.api.ads.dfp.v201211.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException"),
true
));
_operations[5] = oper;
}
public CompanyServiceSoapBindingStub() throws org.apache.axis.AxisFault {
this(null);
}
public CompanyServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public CompanyServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
java.lang.Class cls;
javax.xml.namespace.QName qName;
javax.xml.namespace.QName qName2;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ApiError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiException");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ApiException.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiVersionError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ApiVersionError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApiVersionError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ApiVersionErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ApplicationException");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ApplicationException.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "AppliedLabel");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.AppliedLabel.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Authentication");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.Authentication.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "AuthenticationError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.AuthenticationError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "AuthenticationError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.AuthenticationErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "BooleanValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.BooleanValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ClientLogin");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ClientLogin.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CommonError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CommonError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CommonError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CommonErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.Company.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company.CreditStatus");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyCreditStatus.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Company.Type");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyType.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CompanyCreditStatusError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyCreditStatusError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CompanyCreditStatusError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyCreditStatusErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CompanyError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CompanyError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "CompanyPage");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.CompanyPage.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Date");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.Date.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "DateTime");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.DateTime.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "DateTimeValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.DateTimeValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "FeatureError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.FeatureError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "FeatureError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.FeatureErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "InternalApiError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.InternalApiError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "InternalApiError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.InternalApiErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "InvalidEmailError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.InvalidEmailError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "InvalidEmailError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.InvalidEmailErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "LabelEntityAssociationError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.LabelEntityAssociationError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "LabelEntityAssociationError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.LabelEntityAssociationErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "NotNullError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.NotNullError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "NotNullError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.NotNullErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "NumberValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.NumberValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "OAuth");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.OAuth.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ParseError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ParseError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ParseError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ParseErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "PermissionError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.PermissionError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "PermissionError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.PermissionErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "PublisherQueryLanguageContextError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.PublisherQueryLanguageContextError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "PublisherQueryLanguageContextError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.PublisherQueryLanguageContextErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "PublisherQueryLanguageSyntaxError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.PublisherQueryLanguageSyntaxError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "PublisherQueryLanguageSyntaxError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.PublisherQueryLanguageSyntaxErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "QuotaError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.QuotaError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "QuotaError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.QuotaErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "RequiredError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.RequiredError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "RequiredError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.RequiredErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ServerError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ServerError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "ServerError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.ServerErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "SoapRequestHeader");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.SoapRequestHeader.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "SoapResponseHeader");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.SoapResponseHeader.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Statement");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.Statement.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "StatementError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.StatementError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "StatementError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.StatementErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "String_ValueMapEntry");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.String_ValueMapEntry.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "StringLengthError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.StringLengthError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "StringLengthError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.StringLengthErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "TeamError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.TeamError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "TeamError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.TeamErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "TextValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.TextValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "TypeError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.TypeError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "UniqueError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.UniqueError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "Value");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.v201211.Value.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
}
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
try {
org.apache.axis.client.Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
java.lang.String key = (java.lang.String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
// All the type mapping information is registered
// when the first call is made.
// The type mapping information is actually registered in
// the TypeMappingRegistry of the service, which
// is the reason why registration is only needed for the first call.
synchronized (this) {
if (firstCall()) {
// must set encoding style before registering serializers
_call.setEncodingStyle(null);
for (int i = 0; i < cachedSerFactories.size(); ++i) {
java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
javax.xml.namespace.QName qName =
(javax.xml.namespace.QName) cachedSerQNames.get(i);
java.lang.Object x = cachedSerFactories.get(i);
if (x instanceof Class) {
java.lang.Class sf = (java.lang.Class)
cachedSerFactories.get(i);
java.lang.Class df = (java.lang.Class)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
cachedSerFactories.get(i);
org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
}
catch (java.lang.Throwable _t) {
throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
}
}
public com.google.api.ads.dfp.v201211.Company[] createCompanies(com.google.api.ads.dfp.v201211.Company[] companies) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201211.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "createCompanies"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {companies});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.v201211.Company[]) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.v201211.Company[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.v201211.Company[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.v201211.ApiException) {
throw (com.google.api.ads.dfp.v201211.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.v201211.Company createCompany(com.google.api.ads.dfp.v201211.Company company) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201211.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "createCompany"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {company});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.v201211.Company) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.v201211.Company) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.v201211.Company.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.v201211.ApiException) {
throw (com.google.api.ads.dfp.v201211.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.v201211.CompanyPage getCompaniesByStatement(com.google.api.ads.dfp.v201211.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201211.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "getCompaniesByStatement"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filterStatement});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.v201211.CompanyPage) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.v201211.CompanyPage) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.v201211.CompanyPage.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.v201211.ApiException) {
throw (com.google.api.ads.dfp.v201211.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.v201211.Company getCompany(java.lang.Long companyId) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201211.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[3]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "getCompany"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {companyId});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.v201211.Company) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.v201211.Company) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.v201211.Company.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.v201211.ApiException) {
throw (com.google.api.ads.dfp.v201211.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.v201211.Company[] updateCompanies(com.google.api.ads.dfp.v201211.Company[] companies) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201211.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[4]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "updateCompanies"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {companies});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.v201211.Company[]) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.v201211.Company[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.v201211.Company[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.v201211.ApiException) {
throw (com.google.api.ads.dfp.v201211.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.v201211.Company updateCompany(com.google.api.ads.dfp.v201211.Company company) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201211.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[5]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201211", "updateCompany"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {company});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.v201211.Company) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.v201211.Company) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.v201211.Company.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.v201211.ApiException) {
throw (com.google.api.ads.dfp.v201211.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
}
| apache-2.0 |
weiwenqiang/GitHub | SelectWidget/glide-master/library/src/test/java/com/bumptech/glide/load/resource/gif/ByteBufferGifDecoderTest.java | 5106 | package com.bumptech.glide.load.resource.gif;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.bumptech.glide.gifdecoder.GifDecoder;
import com.bumptech.glide.gifdecoder.GifHeader;
import com.bumptech.glide.gifdecoder.GifHeaderParser;
import com.bumptech.glide.load.ImageHeaderParser;
import com.bumptech.glide.load.Options;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.engine.bitmap_recycle.LruArrayPool;
import com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser;
import com.bumptech.glide.tests.GlideShadowLooper;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE, sdk = 18, shadows = GlideShadowLooper.class)
public class ByteBufferGifDecoderTest {
private static final byte[] GIF_HEADER = new byte[] { 0x47, 0x49, 0x46 };
static final int ARRAY_POOL_SIZE_BYTES = 4 * 1024 * 1024;
private ByteBufferGifDecoder decoder;
private GifHeader gifHeader;
private Options options;
@Mock BitmapPool bitmapPool;
@Mock GifHeaderParser parser;
@Mock GifDecoder gifDecoder;
@Mock ByteBufferGifDecoder.GifHeaderParserPool parserPool;
@Mock ByteBufferGifDecoder.GifDecoderFactory decoderFactory;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
gifHeader = Mockito.spy(new GifHeader());
when(parser.parseHeader()).thenReturn(gifHeader);
when(parserPool.obtain(isA(ByteBuffer.class))).thenReturn(parser);
when(decoderFactory.build(isA(GifDecoder.BitmapProvider.class),
eq(gifHeader), isA(ByteBuffer.class), anyInt()))
.thenReturn(gifDecoder);
List<ImageHeaderParser> parsers = new ArrayList<ImageHeaderParser>();
parsers.add(new DefaultImageHeaderParser());
options = new Options();
decoder =
new ByteBufferGifDecoder(
RuntimeEnvironment.application,
parsers,
bitmapPool,
new LruArrayPool(ARRAY_POOL_SIZE_BYTES),
parserPool,
decoderFactory);
}
@Test
public void testDoesNotHandleStreamIfEnabledButNotAGif() throws IOException {
assertThat(decoder.handles(ByteBuffer.allocate(0), options)).isFalse();
}
@Test
public void testHandlesStreamIfContainsGifHeaderAndDisabledIsNotSet() throws IOException {
assertThat(decoder.handles(ByteBuffer.wrap(GIF_HEADER), options)).isTrue();
}
@Test
public void testHandlesStreamIfContainsGifHeaderAndDisabledIsFalse() throws IOException {
options.set(ByteBufferGifDecoder.DISABLE_ANIMATION, false);
assertThat(decoder.handles(ByteBuffer.wrap(GIF_HEADER), options)).isTrue();
}
@Test
public void testDoesNotHandleStreamIfDisabled() throws IOException {
options.set(ByteBufferGifDecoder.DISABLE_ANIMATION, true);
assertThat(decoder.handles(ByteBuffer.wrap(GIF_HEADER), options)).isFalse();
}
@Test
public void testReturnsNullIfParsedHeaderHasZeroFrames() throws IOException {
when(gifHeader.getNumFrames()).thenReturn(0);
assertNull(decoder.decode(ByteBuffer.allocate(10), 100, 100, options));
}
@Test
public void testReturnsNullIfParsedHeaderHasFormatError() {
when(gifHeader.getStatus()).thenReturn(GifDecoder.STATUS_FORMAT_ERROR);
assertNull(decoder.decode(ByteBuffer.allocate(10), 100, 100, options));
}
@Test
public void testReturnsNullIfParsedHeaderHasOpenError() {
when(gifHeader.getStatus()).thenReturn(GifDecoder.STATUS_OPEN_ERROR);
assertNull(decoder.decode(ByteBuffer.allocate(10), 100, 100, options));
}
@Test
public void testReturnsParserToPool() throws IOException {
decoder.decode(ByteBuffer.allocate(10), 100, 100, options);
verify(parserPool).release(eq(parser));
}
@Test
public void testReturnsParserToPoolWhenParserThrows() {
when(parser.parseHeader()).thenThrow(new RuntimeException("Test"));
try {
decoder.decode(ByteBuffer.allocate(10), 100, 100, options);
fail("Failed to receive expected exception");
} catch (RuntimeException e) {
// Expected.
}
verify(parserPool).release(eq(parser));
}
@Test
public void testReturnsNullIfGifDecoderFailsToDecodeFirstFrame() {
when(gifHeader.getNumFrames()).thenReturn(1);
when(gifHeader.getStatus()).thenReturn(GifDecoder.STATUS_OK);
when(gifDecoder.getNextFrame()).thenReturn(null);
assertNull(decoder.decode(ByteBuffer.allocate(10), 100, 100, options));
}
}
| apache-2.0 |
bbevens/drill | contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java | 6631 | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.drill.exec.store.mongo.schema;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import com.google.common.collect.Maps;
import net.hydromatic.optiq.Schema;
import net.hydromatic.optiq.SchemaPlus;
import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.exec.planner.logical.DrillTable;
import org.apache.drill.exec.planner.logical.DynamicDrillTable;
import org.apache.drill.exec.rpc.user.UserSession;
import org.apache.drill.exec.store.AbstractSchema;
import org.apache.drill.exec.store.SchemaFactory;
import org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory;
import org.apache.drill.exec.store.mongo.MongoCnxnManager;
import org.apache.drill.exec.store.mongo.MongoScanSpec;
import org.apache.drill.exec.store.mongo.MongoStoragePlugin;
import org.apache.drill.exec.store.mongo.MongoStoragePluginConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.mongodb.DB;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoClientURI;
import com.mongodb.ReadPreference;
import com.mongodb.ServerAddress;
public class MongoSchemaFactory implements SchemaFactory {
static final Logger logger = LoggerFactory
.getLogger(MongoSchemaFactory.class);
private static final String DATABASES = "databases";
private LoadingCache<String, List<String>> databases;
private LoadingCache<String, List<String>> tableNameLoader;
private final String schemaName;
private final MongoStoragePlugin plugin;
private final List<ServerAddress> addresses;
private final MongoClientOptions options;
public MongoSchemaFactory(MongoStoragePlugin schema, String schemaName)
throws ExecutionSetupException, UnknownHostException {
String connection = schema.getConfig().getConnection();
this.plugin = schema;
this.schemaName = schemaName;
MongoClientURI clientURI = new MongoClientURI(connection);
List<String> hosts = clientURI.getHosts();
addresses = Lists.newArrayList();
for (String host : hosts) {
addresses.add(new ServerAddress(host));
}
options = clientURI.getOptions();
databases = CacheBuilder //
.newBuilder() //
.expireAfterAccess(1, TimeUnit.MINUTES) //
.build(new DatabaseLoader());
tableNameLoader = CacheBuilder //
.newBuilder() //
.expireAfterAccess(1, TimeUnit.MINUTES) //
.build(new TableNameLoader());
}
private class DatabaseLoader extends CacheLoader<String, List<String>> {
@Override
public List<String> load(String key) throws Exception {
if (!DATABASES.equals(key)) {
throw new UnsupportedOperationException();
}
return MongoCnxnManager.getClient(addresses, options).getDatabaseNames();
}
}
private class TableNameLoader extends CacheLoader<String, List<String>> {
@Override
public List<String> load(String dbName) throws Exception {
DB db = MongoCnxnManager.getClient(addresses, options).getDB(dbName);
db.setReadPreference(ReadPreference.nearest());
Set<String> collectionNames = db.getCollectionNames();
return new ArrayList<>(collectionNames);
}
}
@Override
public void registerSchemas(UserSession session, SchemaPlus parent) {
MongoSchema schema = new MongoSchema(schemaName);
SchemaPlus hPlus = parent.add(schemaName, schema);
schema.setHolder(hPlus);
}
class MongoSchema extends AbstractSchema {
private final Map<String, MongoDatabaseSchema> schemaMap = Maps.newHashMap();
public MongoSchema(String name) {
super(ImmutableList.<String> of(), name);
}
@Override
public Schema getSubSchema(String name) {
List<String> tables;
try {
if (! schemaMap.containsKey(name)) {
tables = tableNameLoader.get(name);
schemaMap.put(name, new MongoDatabaseSchema(tables, this, name));
}
return schemaMap.get(name);
//return new MongoDatabaseSchema(tables, this, name);
} catch (ExecutionException e) {
logger.warn("Failure while attempting to access MongoDataBase '{}'.",
name, e.getCause());
return null;
}
}
void setHolder(SchemaPlus plusOfThis) {
for (String s : getSubSchemaNames()) {
plusOfThis.add(s, getSubSchema(s));
}
}
@Override
public boolean showInInformationSchema() {
return false;
}
@Override
public Set<String> getSubSchemaNames() {
try {
List<String> dbs = databases.get(DATABASES);
return Sets.newHashSet(dbs);
} catch (ExecutionException e) {
logger.warn("Failure while getting Mongo database list.", e);
return Collections.emptySet();
}
}
List<String> getTableNames(String dbName) {
try {
return tableNameLoader.get(dbName);
} catch (ExecutionException e) {
logger.warn("Failure while loading table names for database '{}'.",
dbName, e.getCause());
return Collections.emptyList();
}
}
DrillTable getDrillTable(String dbName, String collectionName) {
MongoScanSpec mongoScanSpec = new MongoScanSpec(dbName, collectionName);
return new DynamicDrillTable(plugin, schemaName, mongoScanSpec);
}
@Override
public String getTypeName() {
return MongoStoragePluginConfig.NAME;
}
}
}
| apache-2.0 |
rameshdharan/cloud-bigtable-client | bigtable-client-core-parent/bigtable-protos/src/generated/java/protos/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java | 2425 | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_instance_admin.proto
package com.google.bigtable.admin.v2;
public interface CreateClusterRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateClusterRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* The unique name of the instance in which to create the new cluster.
* Values are of the form
* projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*
* </pre>
*
* <code>optional string parent = 1;</code>
*/
java.lang.String getParent();
/**
* <pre>
* The unique name of the instance in which to create the new cluster.
* Values are of the form
* projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*
* </pre>
*
* <code>optional string parent = 1;</code>
*/
com.google.protobuf.ByteString
getParentBytes();
/**
* <pre>
* The id to be used when referring to the new cluster within its instance,
* e.g. just the "mycluster" section of the full name
* "projects/myproject/instances/myinstance/clusters/mycluster"
* </pre>
*
* <code>optional string cluster_id = 2;</code>
*/
java.lang.String getClusterId();
/**
* <pre>
* The id to be used when referring to the new cluster within its instance,
* e.g. just the "mycluster" section of the full name
* "projects/myproject/instances/myinstance/clusters/mycluster"
* </pre>
*
* <code>optional string cluster_id = 2;</code>
*/
com.google.protobuf.ByteString
getClusterIdBytes();
/**
* <pre>
* The cluster to be created.
* Fields marked "@OutputOnly" must be left blank.
* </pre>
*
* <code>optional .google.bigtable.admin.v2.Cluster cluster = 3;</code>
*/
boolean hasCluster();
/**
* <pre>
* The cluster to be created.
* Fields marked "@OutputOnly" must be left blank.
* </pre>
*
* <code>optional .google.bigtable.admin.v2.Cluster cluster = 3;</code>
*/
com.google.bigtable.admin.v2.Cluster getCluster();
/**
* <pre>
* The cluster to be created.
* Fields marked "@OutputOnly" must be left blank.
* </pre>
*
* <code>optional .google.bigtable.admin.v2.Cluster cluster = 3;</code>
*/
com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder();
}
| apache-2.0 |
sherlock-y/LeetCode | src/main/java/org/sherlockyb/leetcode/array/searchInRotatedSortedArray/Solution.java | 1595 | package org.sherlockyb.leetcode.array.searchInRotatedSortedArray;
import java.util.Arrays;
/**
* Created by yangbing on 2018/11/17.
*/
public class Solution {
public int search(int[] nums, int target) {
if (nums == null || nums.length == 0) {
return -1;
}
if (nums.length == 1) {
return nums[0] == target ? 0: -1;
}
// nums.length >= 2
int pivot = locatePivot(nums, 0, nums.length-1);
int result;
if (pivot == -1) {
result = Arrays.binarySearch(nums, target);
return result >= 0 ? result: -1;
}
int leftIdx = Arrays.binarySearch(nums, 0, pivot, target);
if (leftIdx >= 0) {
return leftIdx;
}
int rightIdx = Arrays.binarySearch(nums, pivot, nums.length, target);
if (rightIdx < 0) {
return -1;
}
return rightIdx;
}
public int locatePivot(int[] nums, int start, int end) {
if (end == start + 1) {
// 只包含两个元素
return nums[start] < nums[end] ? -1: end;
}
int midpoint = (start + end + 1) / 2;
if (nums[start] < nums[midpoint]) {
return locatePivot(nums, midpoint, end);
} else {
return locatePivot(nums, start, midpoint);
}
}
public static void main(String[] args) {
int[] nums = new int[] {5, 1, 2, 3, 4};
System.out.println(new Solution().locatePivot(nums, 0, nums.length-1));
System.out.println(new Solution().search(nums, 2));
}
}
| apache-2.0 |
Alik72/Main-project | proba-mantis/src/test/java/ru/stga/pft/mantis/appmanager/ApplicationManager.java | 1768 | package ru.stga.pft.mantis.appmanager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.BrowserType;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
/**
* Created by Homosapiens on 29.02.2016.
*/
public class ApplicationManager {
private final Properties properties;
private WebDriver wd;
private String browser;
private SoapHelper soapHelper;
public ApplicationManager(String browser) {
this.browser = browser;
properties = new Properties();
}
public void init() throws IOException {
String target = System.getProperty("target", "local");
properties.load(new FileReader(new File(String.format("src/test/resources/%s.properties", target))));
}
public void stop() {
if (wd != null) {
wd.quit();
}
}
public String getProperty(String key) {
return properties.getProperty(key);
}
public WebDriver getDriver() {
if (wd == null) {
if (browser.equals(BrowserType.FIREFOX)) {
wd = new FirefoxDriver();
} else if (browser.equals(BrowserType.CHROME)) {
wd = new ChromeDriver();
} else if (browser.equals(BrowserType.IE)) {
wd = new InternetExplorerDriver();
}
wd.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
wd.get(properties.getProperty("web.baseUrl"));
wd.manage().window().maximize();
}
return wd;
}
public SoapHelper soap(){
if (soapHelper == null){
soapHelper = new SoapHelper(this);
}
return soapHelper;
}
}
| apache-2.0 |
vmilea/libgdx-flare | src/com/vmilea/gdx/flare/tween/Easings.java | 6189 | /*******************************************************************************
* Copyright 2014 Valentin Milea <valentin.milea@gmail.com>
*
* 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.vmilea.gdx.flare.tween;
public final class Easings {
// ease in : accelerating from zero velocity
// ease out : decelerating to zero velocity
// ease in/out : accelerating until halfway, then decelerating
public static final Easing linear = new Easing() {
@Override
public float get(float t) {
return t;
}
@Override
public Easing reversed() { return linear; }
};
public static final Easing easeInQuad = new Easing() {
@Override
public float get(float t) {
return t * t;
}
@Override
public Easing reversed() { return easeOutQuad; }
};
public static final Easing easeOutQuad = new Easing() {
@Override
public float get(float t) {
return t * (2 - t);
}
@Override
public Easing reversed() { return easeInQuad; }
};
public static final Easing easeInOutQuad = new Easing() {
@Override
public float get(float t) {
if (t < 0.5f)
return 2 * t * t;
else
return 2 * t * (2 - t) - 1;
}
@Override
public Easing reversed() { return easeInOutQuad; }
};
public static final Easing easeInCubic = new Easing() {
@Override
public float get(float t) {
return t * t * t;
}
@Override
public Easing reversed() { return easeOutCubic; }
};
public static final Easing easeOutCubic = new Easing() {
@Override
public float get(float t) {
t--;
return 1 + t * t * t;
}
@Override
public Easing reversed() { return easeInCubic; }
};
public static final Easing easeInOutCubic = new Easing() {
@Override
public float get(float t) {
if (t < 0.5f)
return 4 * t * t * t;
else {
t = 2 * t - 2;
return 0.5f * (2 + t * t * t);
}
}
@Override
public Easing reversed() { return easeInOutCubic; }
};
public static final Easing easeInQuart = new Easing() {
@Override
public float get(float t) {
return t * t * t * t;
}
@Override
public Easing reversed() { return easeOutQuart; }
};
public static final Easing easeOutQuart = new Easing() {
@Override
public float get(float t) {
t--;
return 1 - t * t * t * t;
}
@Override
public Easing reversed() { return easeInQuart; }
};
public static final Easing easeInOutQuart = new Easing() {
@Override
public float get(float t) {
if (t < 0.5f)
return 8 * t * t * t * t;
else {
t = 2 * t - 2;
return 0.5f * (2 - t * t * t * t);
}
}
@Override
public Easing reversed() { return easeInOutQuart; }
};
public static final Easing easeInQuint = new Easing() {
@Override
public float get(float t) {
return t * t * t * t * t;
}
@Override
public Easing reversed() { return easeOutQuint; }
};
public static final Easing easeOutQuint = new Easing() {
@Override
public float get(float t) {
t--;
return 1 + t * t * t * t * t;
}
@Override
public Easing reversed() { return easeInQuint; }
};
public static final Easing easeInOutQuint = new Easing() {
@Override
public float get(float t) {
if (t < 0.5f)
return 16 * t * t * t * t * t;
else {
t = 2 * t - 2;
return 0.5f * (2 + t * t * t * t * t);
}
}
@Override
public Easing reversed() { return easeInOutQuint; }
};
public static final Easing easeInSine = new Easing() {
@Override
public float get(float t) {
return 1 - (float) Math.cos(t * 0.5 * Math.PI);
}
@Override
public Easing reversed() { return easeOutSine; }
};
public static final Easing easeOutSine = new Easing() {
@Override
public float get(float t) {
return (float) Math.sin(t * 0.5 * Math.PI);
}
@Override
public Easing reversed() { return easeInSine; }
};
public static final Easing easeInOutSine = new Easing() {
@Override
public float get(float t) {
return 0.5f * (1 - (float) Math.cos(t * Math.PI));
}
@Override
public Easing reversed() { return easeInOutSine; }
};
public static final Easing easeInExpo = new Easing() {
@Override
public float get(float t) {
return (float) Math.pow(2, 10 * (t - 1));
}
@Override
public Easing reversed() { return easeOutExpo; }
};
public static final Easing easeOutExpo = new Easing() {
@Override
public float get(float t) {
return 1 - (float) Math.pow(2, -10 * t);
}
@Override
public Easing reversed() { return easeInExpo; }
};
public static final Easing easeInOutExpo = new Easing() {
@Override
public float get(float t) {
if (t < 0.5f)
return 0.5f * (float) Math.pow(2, 20 * t - 10);
else {
return 0.5f * (2 - (float) Math.pow(2, -20 * t + 10));
}
}
@Override
public Easing reversed() { return easeInOutExpo; }
};
public static final Easing easeInCirc = new Easing() {
@Override
public float get(float t) {
return 1 - (float) Math.sqrt(1 - t * t);
}
@Override
public Easing reversed() { return easeOutCirc; }
};
public static final Easing easeOutCirc = new Easing() {
@Override
public float get(float t) {
return (float) Math.sqrt(t * (2 - t));
}
@Override
public Easing reversed() { return easeInCirc; }
};
public static final Easing easeInOutCirc = new Easing() {
@Override
public float get(float t) {
if (t < 0.5f)
return 0.5f * (1 - (float) Math.sqrt(1 - 4 * t * t));
else {
return 0.5f * (1 + (float) Math.sqrt(t * (8 - 4 * t) - 3));
}
}
@Override
public Easing reversed() { return easeInOutCirc; }
};
}
| apache-2.0 |
nikelin/Redshape-AS | forms/src/main/java/com/redshape/form/IDataFormField.java | 922 | /*
* Copyright 2012 Cyril A. Karpenko
*
* 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.redshape.form;
import com.redshape.form.data.IFieldDataProvider;
/**
* @author Cyril A. Karpenko <self@nikelin.ru>
* @package com.redshape.form
* @date 9/9/11 3:33 PM
*/
public interface IDataFormField<T> extends IFormField<T> {
public void setDataProvider( IFieldDataProvider<T> provider );
}
| apache-2.0 |
citygml4j/module-noise-ade | src/main/java/org/citygml/ade/noise/cityjson/model/NoiseRailwaySegmentAttributes.java | 3020 | /*
* noise-ade-citygml4j - Noise ADE module for citygml4j
* https://github.com/citygml4j/noise-ade-citygml4j
*
* noise-ade-citygml4j is part of the citygml4j project
*
* Copyright 2013-2019 Claus Nagel <claus.nagel@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.citygml.ade.noise.cityjson.model;
import org.citygml4j.cityjson.feature.Attributes;
public class NoiseRailwaySegmentAttributes extends Attributes {
private String railwaySurfaceMaterial;
private MeasureType railwaySurfaceCorrection;
private Boolean bridge;
private Boolean crossing;
private MeasureType curveRadius;
private MeasureType additionalCorrectionSegment;
public boolean isSetRailwaySurfaceMaterial() {
return railwaySurfaceMaterial != null;
}
public String getRailwaySurfaceMaterial() {
return railwaySurfaceMaterial;
}
public void setRailwaySurfaceMaterial(String railwaySurfaceMaterial) {
this.railwaySurfaceMaterial = railwaySurfaceMaterial;
}
public boolean isSetRailwaySurfaceCorrection() {
return railwaySurfaceCorrection != null;
}
public MeasureType getRailwaySurfaceCorrection() {
return railwaySurfaceCorrection;
}
public void setRailwaySurfaceCorrection(MeasureType railwaySurfaceCorrection) {
this.railwaySurfaceCorrection = railwaySurfaceCorrection;
}
public boolean isSetBridge() {
return bridge != null;
}
public Boolean getBridge() {
return bridge;
}
public void setBridge(Boolean bridge) {
this.bridge = bridge;
}
public boolean isSetCrossing() {
return crossing != null;
}
public Boolean getCrossing() {
return crossing;
}
public void setCrossing(Boolean crossing) {
this.crossing = crossing;
}
public boolean isSetCurveRadius() {
return curveRadius != null;
}
public MeasureType getCurveRadius() {
return curveRadius;
}
public void setCurveRadius(MeasureType curveRadius) {
this.curveRadius = curveRadius;
}
public boolean isSetAdditionalCorrectionSegment() {
return additionalCorrectionSegment != null;
}
public MeasureType getAdditionalCorrectionSegment() {
return additionalCorrectionSegment;
}
public void setAdditionalCorrectionSegment(MeasureType additionalCorrectionSegment) {
this.additionalCorrectionSegment = additionalCorrectionSegment;
}
}
| apache-2.0 |
oriontribunal/CoffeeMud | com/planet_ink/coffee_mud/MOBS/Rat.java | 2313 | package com.planet_ink.coffee_mud.MOBS;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2002-2016 Bo Zimmerman
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.
*/
public class Rat extends StdMOB
{
@Override
public String ID()
{
return "Rat";
}
public Rat()
{
super();
username="a rat";
setDescription("A small furry rodent with a long, leathery tail.");
setDisplayText("A rat is here nibbling on something.");
CMLib.factions().setAlignment(this,Faction.Align.NEUTRAL);
setMoney(0);
setWimpHitPoint(2);
basePhyStats().setDamage(1);
baseCharStats().setMyRace(CMClass.getRace("Rat"));
baseCharStats().getMyRace().startRacing(this,false);
basePhyStats().setAbility(0);
basePhyStats().setLevel(1);
basePhyStats().setArmor(90);
baseState.setHitPoints(CMLib.dice().roll(basePhyStats().level(),20,basePhyStats().level()));
recoverMaxState();
resetToMaxState();
recoverPhyStats();
recoverCharStats();
}
}
| apache-2.0 |
adamrduffy/trinidad-1.0.x | trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/PageNavigationTreeRenderer.java | 2660 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.myfaces.trinidadinternal.ui.laf.base.desktop;
import org.apache.myfaces.trinidad.component.UIXHierarchy;
import org.apache.myfaces.trinidad.component.UIXPage;
import org.apache.myfaces.trinidad.model.RowKeySet;
import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
import org.apache.myfaces.trinidadinternal.ui.UINode;
import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.PageRendererUtils;
/**
* Renderer for navigationTree in a page
* @version $Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/laf/base/desktop/PageNavigationTreeRenderer.java#0 $) $Date: 10-nov-2005.18:55:32 $
* @deprecated This class comes from the old Java 1.2 UIX codebase and should not be used anymore.
*/
@Deprecated
public class PageNavigationTreeRenderer extends NavigationTreeRenderer
{
@Override
protected RowKeySet getExpandedRowKeys(UIXHierarchy tree)
{
return ((UIXPage)tree).getDisclosedRowKeys();
}
@Override
protected UIXHierarchy getTree(
UIXRenderingContext context,
UINode node)
{
UINode pageNode = context.getParentContext().getAncestorNode(0);
UIXHierarchy component = (UIXHierarchy) pageNode.getUIComponent();
return component;
}
@Override
protected UINode getStamp(
UIXRenderingContext context,
UINode node)
{
UINode pageNode = context.getParentContext().getAncestorNode(0);
return getNamedChild(context, pageNode, NODE_STAMP_CHILD);
}
@Override
protected boolean setInitialPath(
UIXRenderingContext context,
UINode node,
UIXHierarchy tree)
{
int startLevel = getIntAttributeValue(context, node, START_LEVEL_ATTR, 0);
return PageRendererUtils.setNewPath(context, tree, startLevel);
}
}
| apache-2.0 |
ohun/mpush | mpush-common/src/main/java/com/mpush/common/message/HandshakeOkMessage.java | 2638 | /*
* (C) Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Contributors:
* ohun@live.cn (夜色)
*/
package com.mpush.common.message;
import com.mpush.api.connection.Connection;
import com.mpush.api.protocol.Packet;
import io.netty.buffer.ByteBuf;
import java.util.Arrays;
/**
* Created by ohun on 2015/12/27.
*
* @author ohun@live.cn
*/
public final class HandshakeOkMessage extends ByteBufMessage {
public byte[] serverKey;
public int heartbeat;
public String sessionId;
public long expireTime;
public HandshakeOkMessage(Packet message, Connection connection) {
super(message, connection);
}
@Override
public void decode(ByteBuf body) {
serverKey = decodeBytes(body);
heartbeat = decodeInt(body);
sessionId = decodeString(body);
expireTime = decodeLong(body);
}
@Override
public void encode(ByteBuf body) {
encodeBytes(body, serverKey);
encodeInt(body, heartbeat);
encodeString(body, sessionId);
encodeLong(body, expireTime);
}
public static HandshakeOkMessage from(BaseMessage src) {
return new HandshakeOkMessage(src.createResponse(), src.connection);
}
public HandshakeOkMessage setServerKey(byte[] serverKey) {
this.serverKey = serverKey;
return this;
}
public HandshakeOkMessage setHeartbeat(int heartbeat) {
this.heartbeat = heartbeat;
return this;
}
public HandshakeOkMessage setSessionId(String sessionId) {
this.sessionId = sessionId;
return this;
}
public HandshakeOkMessage setExpireTime(long expireTime) {
this.expireTime = expireTime;
return this;
}
@Override
public String toString() {
return "HandshakeOkMessage{" +
"expireTime=" + expireTime +
", serverKey=" + Arrays.toString(serverKey) +
", heartbeat=" + heartbeat +
", sessionId='" + sessionId + '\'' +
", packet=" + packet +
'}';
}
}
| apache-2.0 |
intel-analytics/BigDL | scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/generated/FGBoostServiceProto.java | 529706 | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: fgboost_service.proto
package com.intel.analytics.bigdl.ppml.generated;
public final class FGBoostServiceProto {
private FGBoostServiceProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface UploadLabelRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.UploadLabelRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
boolean hasData();
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
FlBaseProto.TensorMap getData();
/**
* <code>.TensorMap data = 2;</code>
*/
FlBaseProto.TensorMapOrBuilder getDataOrBuilder();
/**
* <code>string algorithm = 3;</code>
* @return The algorithm.
*/
String getAlgorithm();
/**
* <code>string algorithm = 3;</code>
* @return The bytes for algorithm.
*/
com.google.protobuf.ByteString
getAlgorithmBytes();
}
/**
* Protobuf type {@code fgboost.UploadLabelRequest}
*/
public static final class UploadLabelRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.UploadLabelRequest)
UploadLabelRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use UploadLabelRequest.newBuilder() to construct.
private UploadLabelRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private UploadLabelRequest() {
clientuuid_ = "";
algorithm_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new UploadLabelRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private UploadLabelRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 18: {
FlBaseProto.TensorMap.Builder subBuilder = null;
if (data_ != null) {
subBuilder = data_.toBuilder();
}
data_ = input.readMessage(FlBaseProto.TensorMap.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(data_);
data_ = subBuilder.buildPartial();
}
break;
}
case 26: {
String s = input.readStringRequireUtf8();
algorithm_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadLabelRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadLabelRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadLabelRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DATA_FIELD_NUMBER = 2;
private FlBaseProto.TensorMap data_;
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
@Override
public boolean hasData() {
return data_ != null;
}
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
@Override
public FlBaseProto.TensorMap getData() {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
/**
* <code>.TensorMap data = 2;</code>
*/
@Override
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
return getData();
}
public static final int ALGORITHM_FIELD_NUMBER = 3;
private volatile Object algorithm_;
/**
* <code>string algorithm = 3;</code>
* @return The algorithm.
*/
@Override
public String getAlgorithm() {
Object ref = algorithm_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
algorithm_ = s;
return s;
}
}
/**
* <code>string algorithm = 3;</code>
* @return The bytes for algorithm.
*/
@Override
public com.google.protobuf.ByteString
getAlgorithmBytes() {
Object ref = algorithm_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
algorithm_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
if (data_ != null) {
output.writeMessage(2, getData());
}
if (!getAlgorithmBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, algorithm_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
if (data_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getData());
}
if (!getAlgorithmBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, algorithm_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof UploadLabelRequest)) {
return super.equals(obj);
}
UploadLabelRequest other = (UploadLabelRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (hasData() != other.hasData()) return false;
if (hasData()) {
if (!getData()
.equals(other.getData())) return false;
}
if (!getAlgorithm()
.equals(other.getAlgorithm())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
if (hasData()) {
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getData().hashCode();
}
hash = (37 * hash) + ALGORITHM_FIELD_NUMBER;
hash = (53 * hash) + getAlgorithm().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static UploadLabelRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadLabelRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadLabelRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadLabelRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadLabelRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadLabelRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadLabelRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadLabelRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static UploadLabelRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static UploadLabelRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static UploadLabelRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadLabelRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(UploadLabelRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.UploadLabelRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.UploadLabelRequest)
UploadLabelRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadLabelRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadLabelRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadLabelRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.UploadLabelRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
if (dataBuilder_ == null) {
data_ = null;
} else {
data_ = null;
dataBuilder_ = null;
}
algorithm_ = "";
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_UploadLabelRequest_descriptor;
}
@Override
public UploadLabelRequest getDefaultInstanceForType() {
return UploadLabelRequest.getDefaultInstance();
}
@Override
public UploadLabelRequest build() {
UploadLabelRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public UploadLabelRequest buildPartial() {
UploadLabelRequest result = new UploadLabelRequest(this);
result.clientuuid_ = clientuuid_;
if (dataBuilder_ == null) {
result.data_ = data_;
} else {
result.data_ = dataBuilder_.build();
}
result.algorithm_ = algorithm_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof UploadLabelRequest) {
return mergeFrom((UploadLabelRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(UploadLabelRequest other) {
if (other == UploadLabelRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (other.hasData()) {
mergeData(other.getData());
}
if (!other.getAlgorithm().isEmpty()) {
algorithm_ = other.algorithm_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
UploadLabelRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (UploadLabelRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private FlBaseProto.TensorMap data_;
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder> dataBuilder_;
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
public boolean hasData() {
return dataBuilder_ != null || data_ != null;
}
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
public FlBaseProto.TensorMap getData() {
if (dataBuilder_ == null) {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
} else {
return dataBuilder_.getMessage();
}
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder setData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
} else {
dataBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder setData(
FlBaseProto.TensorMap.Builder builderForValue) {
if (dataBuilder_ == null) {
data_ = builderForValue.build();
onChanged();
} else {
dataBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder mergeData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (data_ != null) {
data_ =
FlBaseProto.TensorMap.newBuilder(data_).mergeFrom(value).buildPartial();
} else {
data_ = value;
}
onChanged();
} else {
dataBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder clearData() {
if (dataBuilder_ == null) {
data_ = null;
onChanged();
} else {
data_ = null;
dataBuilder_ = null;
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public FlBaseProto.TensorMap.Builder getDataBuilder() {
onChanged();
return getDataFieldBuilder().getBuilder();
}
/**
* <code>.TensorMap data = 2;</code>
*/
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
if (dataBuilder_ != null) {
return dataBuilder_.getMessageOrBuilder();
} else {
return data_ == null ?
FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
}
/**
* <code>.TensorMap data = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>
getDataFieldBuilder() {
if (dataBuilder_ == null) {
dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>(
getData(),
getParentForChildren(),
isClean());
data_ = null;
}
return dataBuilder_;
}
private Object algorithm_ = "";
/**
* <code>string algorithm = 3;</code>
* @return The algorithm.
*/
public String getAlgorithm() {
Object ref = algorithm_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
algorithm_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string algorithm = 3;</code>
* @return The bytes for algorithm.
*/
public com.google.protobuf.ByteString
getAlgorithmBytes() {
Object ref = algorithm_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
algorithm_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string algorithm = 3;</code>
* @param value The algorithm to set.
* @return This builder for chaining.
*/
public Builder setAlgorithm(
String value) {
if (value == null) {
throw new NullPointerException();
}
algorithm_ = value;
onChanged();
return this;
}
/**
* <code>string algorithm = 3;</code>
* @return This builder for chaining.
*/
public Builder clearAlgorithm() {
algorithm_ = getDefaultInstance().getAlgorithm();
onChanged();
return this;
}
/**
* <code>string algorithm = 3;</code>
* @param value The bytes for algorithm to set.
* @return This builder for chaining.
*/
public Builder setAlgorithmBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
algorithm_ = value;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.UploadLabelRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.UploadLabelRequest)
private static final UploadLabelRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new UploadLabelRequest();
}
public static UploadLabelRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<UploadLabelRequest>
PARSER = new com.google.protobuf.AbstractParser<UploadLabelRequest>() {
@Override
public UploadLabelRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new UploadLabelRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<UploadLabelRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<UploadLabelRequest> getParserForType() {
return PARSER;
}
@Override
public UploadLabelRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DownloadLabelRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.DownloadLabelRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.MetaData metaData = 1;</code>
* @return Whether the metaData field is set.
*/
boolean hasMetaData();
/**
* <code>.MetaData metaData = 1;</code>
* @return The metaData.
*/
FlBaseProto.MetaData getMetaData();
/**
* <code>.MetaData metaData = 1;</code>
*/
FlBaseProto.MetaDataOrBuilder getMetaDataOrBuilder();
/**
* <code>string algorithm = 2;</code>
* @return The algorithm.
*/
String getAlgorithm();
/**
* <code>string algorithm = 2;</code>
* @return The bytes for algorithm.
*/
com.google.protobuf.ByteString
getAlgorithmBytes();
}
/**
* Protobuf type {@code fgboost.DownloadLabelRequest}
*/
public static final class DownloadLabelRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.DownloadLabelRequest)
DownloadLabelRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use DownloadLabelRequest.newBuilder() to construct.
private DownloadLabelRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DownloadLabelRequest() {
algorithm_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new DownloadLabelRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DownloadLabelRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
FlBaseProto.MetaData.Builder subBuilder = null;
if (metaData_ != null) {
subBuilder = metaData_.toBuilder();
}
metaData_ = input.readMessage(FlBaseProto.MetaData.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(metaData_);
metaData_ = subBuilder.buildPartial();
}
break;
}
case 18: {
String s = input.readStringRequireUtf8();
algorithm_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_DownloadLabelRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_DownloadLabelRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
DownloadLabelRequest.class, Builder.class);
}
public static final int METADATA_FIELD_NUMBER = 1;
private FlBaseProto.MetaData metaData_;
/**
* <code>.MetaData metaData = 1;</code>
* @return Whether the metaData field is set.
*/
@Override
public boolean hasMetaData() {
return metaData_ != null;
}
/**
* <code>.MetaData metaData = 1;</code>
* @return The metaData.
*/
@Override
public FlBaseProto.MetaData getMetaData() {
return metaData_ == null ? FlBaseProto.MetaData.getDefaultInstance() : metaData_;
}
/**
* <code>.MetaData metaData = 1;</code>
*/
@Override
public FlBaseProto.MetaDataOrBuilder getMetaDataOrBuilder() {
return getMetaData();
}
public static final int ALGORITHM_FIELD_NUMBER = 2;
private volatile Object algorithm_;
/**
* <code>string algorithm = 2;</code>
* @return The algorithm.
*/
@Override
public String getAlgorithm() {
Object ref = algorithm_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
algorithm_ = s;
return s;
}
}
/**
* <code>string algorithm = 2;</code>
* @return The bytes for algorithm.
*/
@Override
public com.google.protobuf.ByteString
getAlgorithmBytes() {
Object ref = algorithm_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
algorithm_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (metaData_ != null) {
output.writeMessage(1, getMetaData());
}
if (!getAlgorithmBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, algorithm_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (metaData_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getMetaData());
}
if (!getAlgorithmBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, algorithm_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof DownloadLabelRequest)) {
return super.equals(obj);
}
DownloadLabelRequest other = (DownloadLabelRequest) obj;
if (hasMetaData() != other.hasMetaData()) return false;
if (hasMetaData()) {
if (!getMetaData()
.equals(other.getMetaData())) return false;
}
if (!getAlgorithm()
.equals(other.getAlgorithm())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasMetaData()) {
hash = (37 * hash) + METADATA_FIELD_NUMBER;
hash = (53 * hash) + getMetaData().hashCode();
}
hash = (37 * hash) + ALGORITHM_FIELD_NUMBER;
hash = (53 * hash) + getAlgorithm().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static DownloadLabelRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DownloadLabelRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DownloadLabelRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DownloadLabelRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DownloadLabelRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DownloadLabelRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DownloadLabelRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static DownloadLabelRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static DownloadLabelRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static DownloadLabelRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static DownloadLabelRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static DownloadLabelRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(DownloadLabelRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.DownloadLabelRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.DownloadLabelRequest)
DownloadLabelRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_DownloadLabelRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_DownloadLabelRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
DownloadLabelRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.DownloadLabelRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
if (metaDataBuilder_ == null) {
metaData_ = null;
} else {
metaData_ = null;
metaDataBuilder_ = null;
}
algorithm_ = "";
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_DownloadLabelRequest_descriptor;
}
@Override
public DownloadLabelRequest getDefaultInstanceForType() {
return DownloadLabelRequest.getDefaultInstance();
}
@Override
public DownloadLabelRequest build() {
DownloadLabelRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public DownloadLabelRequest buildPartial() {
DownloadLabelRequest result = new DownloadLabelRequest(this);
if (metaDataBuilder_ == null) {
result.metaData_ = metaData_;
} else {
result.metaData_ = metaDataBuilder_.build();
}
result.algorithm_ = algorithm_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof DownloadLabelRequest) {
return mergeFrom((DownloadLabelRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(DownloadLabelRequest other) {
if (other == DownloadLabelRequest.getDefaultInstance()) return this;
if (other.hasMetaData()) {
mergeMetaData(other.getMetaData());
}
if (!other.getAlgorithm().isEmpty()) {
algorithm_ = other.algorithm_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
DownloadLabelRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (DownloadLabelRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private FlBaseProto.MetaData metaData_;
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.MetaData, FlBaseProto.MetaData.Builder, FlBaseProto.MetaDataOrBuilder> metaDataBuilder_;
/**
* <code>.MetaData metaData = 1;</code>
* @return Whether the metaData field is set.
*/
public boolean hasMetaData() {
return metaDataBuilder_ != null || metaData_ != null;
}
/**
* <code>.MetaData metaData = 1;</code>
* @return The metaData.
*/
public FlBaseProto.MetaData getMetaData() {
if (metaDataBuilder_ == null) {
return metaData_ == null ? FlBaseProto.MetaData.getDefaultInstance() : metaData_;
} else {
return metaDataBuilder_.getMessage();
}
}
/**
* <code>.MetaData metaData = 1;</code>
*/
public Builder setMetaData(FlBaseProto.MetaData value) {
if (metaDataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
metaData_ = value;
onChanged();
} else {
metaDataBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.MetaData metaData = 1;</code>
*/
public Builder setMetaData(
FlBaseProto.MetaData.Builder builderForValue) {
if (metaDataBuilder_ == null) {
metaData_ = builderForValue.build();
onChanged();
} else {
metaDataBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.MetaData metaData = 1;</code>
*/
public Builder mergeMetaData(FlBaseProto.MetaData value) {
if (metaDataBuilder_ == null) {
if (metaData_ != null) {
metaData_ =
FlBaseProto.MetaData.newBuilder(metaData_).mergeFrom(value).buildPartial();
} else {
metaData_ = value;
}
onChanged();
} else {
metaDataBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.MetaData metaData = 1;</code>
*/
public Builder clearMetaData() {
if (metaDataBuilder_ == null) {
metaData_ = null;
onChanged();
} else {
metaData_ = null;
metaDataBuilder_ = null;
}
return this;
}
/**
* <code>.MetaData metaData = 1;</code>
*/
public FlBaseProto.MetaData.Builder getMetaDataBuilder() {
onChanged();
return getMetaDataFieldBuilder().getBuilder();
}
/**
* <code>.MetaData metaData = 1;</code>
*/
public FlBaseProto.MetaDataOrBuilder getMetaDataOrBuilder() {
if (metaDataBuilder_ != null) {
return metaDataBuilder_.getMessageOrBuilder();
} else {
return metaData_ == null ?
FlBaseProto.MetaData.getDefaultInstance() : metaData_;
}
}
/**
* <code>.MetaData metaData = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.MetaData, FlBaseProto.MetaData.Builder, FlBaseProto.MetaDataOrBuilder>
getMetaDataFieldBuilder() {
if (metaDataBuilder_ == null) {
metaDataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.MetaData, FlBaseProto.MetaData.Builder, FlBaseProto.MetaDataOrBuilder>(
getMetaData(),
getParentForChildren(),
isClean());
metaData_ = null;
}
return metaDataBuilder_;
}
private Object algorithm_ = "";
/**
* <code>string algorithm = 2;</code>
* @return The algorithm.
*/
public String getAlgorithm() {
Object ref = algorithm_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
algorithm_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string algorithm = 2;</code>
* @return The bytes for algorithm.
*/
public com.google.protobuf.ByteString
getAlgorithmBytes() {
Object ref = algorithm_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
algorithm_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string algorithm = 2;</code>
* @param value The algorithm to set.
* @return This builder for chaining.
*/
public Builder setAlgorithm(
String value) {
if (value == null) {
throw new NullPointerException();
}
algorithm_ = value;
onChanged();
return this;
}
/**
* <code>string algorithm = 2;</code>
* @return This builder for chaining.
*/
public Builder clearAlgorithm() {
algorithm_ = getDefaultInstance().getAlgorithm();
onChanged();
return this;
}
/**
* <code>string algorithm = 2;</code>
* @param value The bytes for algorithm to set.
* @return This builder for chaining.
*/
public Builder setAlgorithmBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
algorithm_ = value;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.DownloadLabelRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.DownloadLabelRequest)
private static final DownloadLabelRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new DownloadLabelRequest();
}
public static DownloadLabelRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DownloadLabelRequest>
PARSER = new com.google.protobuf.AbstractParser<DownloadLabelRequest>() {
@Override
public DownloadLabelRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DownloadLabelRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DownloadLabelRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<DownloadLabelRequest> getParserForType() {
return PARSER;
}
@Override
public DownloadLabelRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DownloadResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.DownloadResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.TensorMap data = 1;</code>
* @return Whether the data field is set.
*/
boolean hasData();
/**
* <code>.TensorMap data = 1;</code>
* @return The data.
*/
FlBaseProto.TensorMap getData();
/**
* <code>.TensorMap data = 1;</code>
*/
FlBaseProto.TensorMapOrBuilder getDataOrBuilder();
/**
* <code>string response = 2;</code>
* @return The response.
*/
String getResponse();
/**
* <code>string response = 2;</code>
* @return The bytes for response.
*/
com.google.protobuf.ByteString
getResponseBytes();
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
int getCode();
}
/**
* Protobuf type {@code fgboost.DownloadResponse}
*/
public static final class DownloadResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.DownloadResponse)
DownloadResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use DownloadResponse.newBuilder() to construct.
private DownloadResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DownloadResponse() {
response_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new DownloadResponse();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DownloadResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
FlBaseProto.TensorMap.Builder subBuilder = null;
if (data_ != null) {
subBuilder = data_.toBuilder();
}
data_ = input.readMessage(FlBaseProto.TensorMap.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(data_);
data_ = subBuilder.buildPartial();
}
break;
}
case 18: {
String s = input.readStringRequireUtf8();
response_ = s;
break;
}
case 24: {
code_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_DownloadResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_DownloadResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
DownloadResponse.class, Builder.class);
}
public static final int DATA_FIELD_NUMBER = 1;
private FlBaseProto.TensorMap data_;
/**
* <code>.TensorMap data = 1;</code>
* @return Whether the data field is set.
*/
@Override
public boolean hasData() {
return data_ != null;
}
/**
* <code>.TensorMap data = 1;</code>
* @return The data.
*/
@Override
public FlBaseProto.TensorMap getData() {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
/**
* <code>.TensorMap data = 1;</code>
*/
@Override
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
return getData();
}
public static final int RESPONSE_FIELD_NUMBER = 2;
private volatile Object response_;
/**
* <code>string response = 2;</code>
* @return The response.
*/
@Override
public String getResponse() {
Object ref = response_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
}
}
/**
* <code>string response = 2;</code>
* @return The bytes for response.
*/
@Override
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CODE_FIELD_NUMBER = 3;
private int code_;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (data_ != null) {
output.writeMessage(1, getData());
}
if (!getResponseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, response_);
}
if (code_ != 0) {
output.writeInt32(3, code_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (data_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getData());
}
if (!getResponseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, response_);
}
if (code_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, code_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof DownloadResponse)) {
return super.equals(obj);
}
DownloadResponse other = (DownloadResponse) obj;
if (hasData() != other.hasData()) return false;
if (hasData()) {
if (!getData()
.equals(other.getData())) return false;
}
if (!getResponse()
.equals(other.getResponse())) return false;
if (getCode()
!= other.getCode()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasData()) {
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getData().hashCode();
}
hash = (37 * hash) + RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getResponse().hashCode();
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + getCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static DownloadResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DownloadResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DownloadResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DownloadResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DownloadResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DownloadResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DownloadResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static DownloadResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static DownloadResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static DownloadResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static DownloadResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static DownloadResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(DownloadResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.DownloadResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.DownloadResponse)
DownloadResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_DownloadResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_DownloadResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
DownloadResponse.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.DownloadResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
if (dataBuilder_ == null) {
data_ = null;
} else {
data_ = null;
dataBuilder_ = null;
}
response_ = "";
code_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_DownloadResponse_descriptor;
}
@Override
public DownloadResponse getDefaultInstanceForType() {
return DownloadResponse.getDefaultInstance();
}
@Override
public DownloadResponse build() {
DownloadResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public DownloadResponse buildPartial() {
DownloadResponse result = new DownloadResponse(this);
if (dataBuilder_ == null) {
result.data_ = data_;
} else {
result.data_ = dataBuilder_.build();
}
result.response_ = response_;
result.code_ = code_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof DownloadResponse) {
return mergeFrom((DownloadResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(DownloadResponse other) {
if (other == DownloadResponse.getDefaultInstance()) return this;
if (other.hasData()) {
mergeData(other.getData());
}
if (!other.getResponse().isEmpty()) {
response_ = other.response_;
onChanged();
}
if (other.getCode() != 0) {
setCode(other.getCode());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
DownloadResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (DownloadResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private FlBaseProto.TensorMap data_;
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder> dataBuilder_;
/**
* <code>.TensorMap data = 1;</code>
* @return Whether the data field is set.
*/
public boolean hasData() {
return dataBuilder_ != null || data_ != null;
}
/**
* <code>.TensorMap data = 1;</code>
* @return The data.
*/
public FlBaseProto.TensorMap getData() {
if (dataBuilder_ == null) {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
} else {
return dataBuilder_.getMessage();
}
}
/**
* <code>.TensorMap data = 1;</code>
*/
public Builder setData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
} else {
dataBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.TensorMap data = 1;</code>
*/
public Builder setData(
FlBaseProto.TensorMap.Builder builderForValue) {
if (dataBuilder_ == null) {
data_ = builderForValue.build();
onChanged();
} else {
dataBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.TensorMap data = 1;</code>
*/
public Builder mergeData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (data_ != null) {
data_ =
FlBaseProto.TensorMap.newBuilder(data_).mergeFrom(value).buildPartial();
} else {
data_ = value;
}
onChanged();
} else {
dataBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.TensorMap data = 1;</code>
*/
public Builder clearData() {
if (dataBuilder_ == null) {
data_ = null;
onChanged();
} else {
data_ = null;
dataBuilder_ = null;
}
return this;
}
/**
* <code>.TensorMap data = 1;</code>
*/
public FlBaseProto.TensorMap.Builder getDataBuilder() {
onChanged();
return getDataFieldBuilder().getBuilder();
}
/**
* <code>.TensorMap data = 1;</code>
*/
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
if (dataBuilder_ != null) {
return dataBuilder_.getMessageOrBuilder();
} else {
return data_ == null ?
FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
}
/**
* <code>.TensorMap data = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>
getDataFieldBuilder() {
if (dataBuilder_ == null) {
dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>(
getData(),
getParentForChildren(),
isClean());
data_ = null;
}
return dataBuilder_;
}
private Object response_ = "";
/**
* <code>string response = 2;</code>
* @return The response.
*/
public String getResponse() {
Object ref = response_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string response = 2;</code>
* @return The bytes for response.
*/
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string response = 2;</code>
* @param value The response to set.
* @return This builder for chaining.
*/
public Builder setResponse(
String value) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
return this;
}
/**
* <code>string response = 2;</code>
* @return This builder for chaining.
*/
public Builder clearResponse() {
response_ = getDefaultInstance().getResponse();
onChanged();
return this;
}
/**
* <code>string response = 2;</code>
* @param value The bytes for response to set.
* @return This builder for chaining.
*/
public Builder setResponseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
response_ = value;
onChanged();
return this;
}
private int code_ ;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
/**
* <code>int32 code = 3;</code>
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(int value) {
code_ = value;
onChanged();
return this;
}
/**
* <code>int32 code = 3;</code>
* @return This builder for chaining.
*/
public Builder clearCode() {
code_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.DownloadResponse)
}
// @@protoc_insertion_point(class_scope:fgboost.DownloadResponse)
private static final DownloadResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new DownloadResponse();
}
public static DownloadResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DownloadResponse>
PARSER = new com.google.protobuf.AbstractParser<DownloadResponse>() {
@Override
public DownloadResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DownloadResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DownloadResponse> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<DownloadResponse> getParserForType() {
return PARSER;
}
@Override
public DownloadResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface TreeLeafOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.TreeLeaf)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
String getTreeID();
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
com.google.protobuf.ByteString
getTreeIDBytes();
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return A list containing the leafIndex.
*/
java.util.List<Integer> getLeafIndexList();
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return The count of leafIndex.
*/
int getLeafIndexCount();
/**
* <code>repeated int32 leafIndex = 2;</code>
* @param index The index of the element to return.
* @return The leafIndex at the given index.
*/
int getLeafIndex(int index);
/**
* <code>repeated float leafOutput = 3;</code>
* @return A list containing the leafOutput.
*/
java.util.List<Float> getLeafOutputList();
/**
* <code>repeated float leafOutput = 3;</code>
* @return The count of leafOutput.
*/
int getLeafOutputCount();
/**
* <code>repeated float leafOutput = 3;</code>
* @param index The index of the element to return.
* @return The leafOutput at the given index.
*/
float getLeafOutput(int index);
/**
* <code>int32 version = 4;</code>
* @return The version.
*/
int getVersion();
}
/**
* Protobuf type {@code fgboost.TreeLeaf}
*/
public static final class TreeLeaf extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.TreeLeaf)
TreeLeafOrBuilder {
private static final long serialVersionUID = 0L;
// Use TreeLeaf.newBuilder() to construct.
private TreeLeaf(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TreeLeaf() {
treeID_ = "";
leafIndex_ = emptyIntList();
leafOutput_ = emptyFloatList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new TreeLeaf();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TreeLeaf(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
treeID_ = s;
break;
}
case 16: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
leafIndex_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
leafIndex_.addInt(input.readInt32());
break;
}
case 18: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
leafIndex_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
leafIndex_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
}
case 29: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
leafOutput_ = newFloatList();
mutable_bitField0_ |= 0x00000002;
}
leafOutput_.addFloat(input.readFloat());
break;
}
case 26: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
leafOutput_ = newFloatList();
mutable_bitField0_ |= 0x00000002;
}
while (input.getBytesUntilLimit() > 0) {
leafOutput_.addFloat(input.readFloat());
}
input.popLimit(limit);
break;
}
case 32: {
version_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
leafIndex_.makeImmutable(); // C
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
leafOutput_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_TreeLeaf_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_TreeLeaf_fieldAccessorTable
.ensureFieldAccessorsInitialized(
TreeLeaf.class, Builder.class);
}
public static final int TREEID_FIELD_NUMBER = 1;
private volatile Object treeID_;
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
@Override
public String getTreeID() {
Object ref = treeID_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
treeID_ = s;
return s;
}
}
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
@Override
public com.google.protobuf.ByteString
getTreeIDBytes() {
Object ref = treeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
treeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LEAFINDEX_FIELD_NUMBER = 2;
private com.google.protobuf.Internal.IntList leafIndex_;
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return A list containing the leafIndex.
*/
@Override
public java.util.List<Integer>
getLeafIndexList() {
return leafIndex_;
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return The count of leafIndex.
*/
public int getLeafIndexCount() {
return leafIndex_.size();
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @param index The index of the element to return.
* @return The leafIndex at the given index.
*/
public int getLeafIndex(int index) {
return leafIndex_.getInt(index);
}
private int leafIndexMemoizedSerializedSize = -1;
public static final int LEAFOUTPUT_FIELD_NUMBER = 3;
private com.google.protobuf.Internal.FloatList leafOutput_;
/**
* <code>repeated float leafOutput = 3;</code>
* @return A list containing the leafOutput.
*/
@Override
public java.util.List<Float>
getLeafOutputList() {
return leafOutput_;
}
/**
* <code>repeated float leafOutput = 3;</code>
* @return The count of leafOutput.
*/
public int getLeafOutputCount() {
return leafOutput_.size();
}
/**
* <code>repeated float leafOutput = 3;</code>
* @param index The index of the element to return.
* @return The leafOutput at the given index.
*/
public float getLeafOutput(int index) {
return leafOutput_.getFloat(index);
}
private int leafOutputMemoizedSerializedSize = -1;
public static final int VERSION_FIELD_NUMBER = 4;
private int version_;
/**
* <code>int32 version = 4;</code>
* @return The version.
*/
@Override
public int getVersion() {
return version_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (!getTreeIDBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, treeID_);
}
if (getLeafIndexList().size() > 0) {
output.writeUInt32NoTag(18);
output.writeUInt32NoTag(leafIndexMemoizedSerializedSize);
}
for (int i = 0; i < leafIndex_.size(); i++) {
output.writeInt32NoTag(leafIndex_.getInt(i));
}
if (getLeafOutputList().size() > 0) {
output.writeUInt32NoTag(26);
output.writeUInt32NoTag(leafOutputMemoizedSerializedSize);
}
for (int i = 0; i < leafOutput_.size(); i++) {
output.writeFloatNoTag(leafOutput_.getFloat(i));
}
if (version_ != 0) {
output.writeInt32(4, version_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getTreeIDBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, treeID_);
}
{
int dataSize = 0;
for (int i = 0; i < leafIndex_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(leafIndex_.getInt(i));
}
size += dataSize;
if (!getLeafIndexList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
leafIndexMemoizedSerializedSize = dataSize;
}
{
int dataSize = 0;
dataSize = 4 * getLeafOutputList().size();
size += dataSize;
if (!getLeafOutputList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
leafOutputMemoizedSerializedSize = dataSize;
}
if (version_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, version_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof TreeLeaf)) {
return super.equals(obj);
}
TreeLeaf other = (TreeLeaf) obj;
if (!getTreeID()
.equals(other.getTreeID())) return false;
if (!getLeafIndexList()
.equals(other.getLeafIndexList())) return false;
if (!getLeafOutputList()
.equals(other.getLeafOutputList())) return false;
if (getVersion()
!= other.getVersion()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TREEID_FIELD_NUMBER;
hash = (53 * hash) + getTreeID().hashCode();
if (getLeafIndexCount() > 0) {
hash = (37 * hash) + LEAFINDEX_FIELD_NUMBER;
hash = (53 * hash) + getLeafIndexList().hashCode();
}
if (getLeafOutputCount() > 0) {
hash = (37 * hash) + LEAFOUTPUT_FIELD_NUMBER;
hash = (53 * hash) + getLeafOutputList().hashCode();
}
hash = (37 * hash) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + getVersion();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static TreeLeaf parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static TreeLeaf parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static TreeLeaf parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static TreeLeaf parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static TreeLeaf parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static TreeLeaf parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static TreeLeaf parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static TreeLeaf parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static TreeLeaf parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static TreeLeaf parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static TreeLeaf parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static TreeLeaf parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(TreeLeaf prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.TreeLeaf}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.TreeLeaf)
TreeLeafOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_TreeLeaf_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_TreeLeaf_fieldAccessorTable
.ensureFieldAccessorsInitialized(
TreeLeaf.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.TreeLeaf.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
treeID_ = "";
leafIndex_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
leafOutput_ = emptyFloatList();
bitField0_ = (bitField0_ & ~0x00000002);
version_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_TreeLeaf_descriptor;
}
@Override
public TreeLeaf getDefaultInstanceForType() {
return TreeLeaf.getDefaultInstance();
}
@Override
public TreeLeaf build() {
TreeLeaf result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public TreeLeaf buildPartial() {
TreeLeaf result = new TreeLeaf(this);
int from_bitField0_ = bitField0_;
result.treeID_ = treeID_;
if (((bitField0_ & 0x00000001) != 0)) {
leafIndex_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.leafIndex_ = leafIndex_;
if (((bitField0_ & 0x00000002) != 0)) {
leafOutput_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.leafOutput_ = leafOutput_;
result.version_ = version_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof TreeLeaf) {
return mergeFrom((TreeLeaf)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(TreeLeaf other) {
if (other == TreeLeaf.getDefaultInstance()) return this;
if (!other.getTreeID().isEmpty()) {
treeID_ = other.treeID_;
onChanged();
}
if (!other.leafIndex_.isEmpty()) {
if (leafIndex_.isEmpty()) {
leafIndex_ = other.leafIndex_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureLeafIndexIsMutable();
leafIndex_.addAll(other.leafIndex_);
}
onChanged();
}
if (!other.leafOutput_.isEmpty()) {
if (leafOutput_.isEmpty()) {
leafOutput_ = other.leafOutput_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureLeafOutputIsMutable();
leafOutput_.addAll(other.leafOutput_);
}
onChanged();
}
if (other.getVersion() != 0) {
setVersion(other.getVersion());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
TreeLeaf parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (TreeLeaf) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object treeID_ = "";
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
public String getTreeID() {
Object ref = treeID_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
treeID_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
public com.google.protobuf.ByteString
getTreeIDBytes() {
Object ref = treeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
treeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string treeID = 1;</code>
* @param value The treeID to set.
* @return This builder for chaining.
*/
public Builder setTreeID(
String value) {
if (value == null) {
throw new NullPointerException();
}
treeID_ = value;
onChanged();
return this;
}
/**
* <code>string treeID = 1;</code>
* @return This builder for chaining.
*/
public Builder clearTreeID() {
treeID_ = getDefaultInstance().getTreeID();
onChanged();
return this;
}
/**
* <code>string treeID = 1;</code>
* @param value The bytes for treeID to set.
* @return This builder for chaining.
*/
public Builder setTreeIDBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
treeID_ = value;
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList leafIndex_ = emptyIntList();
private void ensureLeafIndexIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
leafIndex_ = mutableCopy(leafIndex_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return A list containing the leafIndex.
*/
public java.util.List<Integer>
getLeafIndexList() {
return ((bitField0_ & 0x00000001) != 0) ?
java.util.Collections.unmodifiableList(leafIndex_) : leafIndex_;
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return The count of leafIndex.
*/
public int getLeafIndexCount() {
return leafIndex_.size();
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @param index The index of the element to return.
* @return The leafIndex at the given index.
*/
public int getLeafIndex(int index) {
return leafIndex_.getInt(index);
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @param index The index to set the value at.
* @param value The leafIndex to set.
* @return This builder for chaining.
*/
public Builder setLeafIndex(
int index, int value) {
ensureLeafIndexIsMutable();
leafIndex_.setInt(index, value);
onChanged();
return this;
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @param value The leafIndex to add.
* @return This builder for chaining.
*/
public Builder addLeafIndex(int value) {
ensureLeafIndexIsMutable();
leafIndex_.addInt(value);
onChanged();
return this;
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @param values The leafIndex to add.
* @return This builder for chaining.
*/
public Builder addAllLeafIndex(
Iterable<? extends Integer> values) {
ensureLeafIndexIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, leafIndex_);
onChanged();
return this;
}
/**
* <code>repeated int32 leafIndex = 2;</code>
* @return This builder for chaining.
*/
public Builder clearLeafIndex() {
leafIndex_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
private com.google.protobuf.Internal.FloatList leafOutput_ = emptyFloatList();
private void ensureLeafOutputIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
leafOutput_ = mutableCopy(leafOutput_);
bitField0_ |= 0x00000002;
}
}
/**
* <code>repeated float leafOutput = 3;</code>
* @return A list containing the leafOutput.
*/
public java.util.List<Float>
getLeafOutputList() {
return ((bitField0_ & 0x00000002) != 0) ?
java.util.Collections.unmodifiableList(leafOutput_) : leafOutput_;
}
/**
* <code>repeated float leafOutput = 3;</code>
* @return The count of leafOutput.
*/
public int getLeafOutputCount() {
return leafOutput_.size();
}
/**
* <code>repeated float leafOutput = 3;</code>
* @param index The index of the element to return.
* @return The leafOutput at the given index.
*/
public float getLeafOutput(int index) {
return leafOutput_.getFloat(index);
}
/**
* <code>repeated float leafOutput = 3;</code>
* @param index The index to set the value at.
* @param value The leafOutput to set.
* @return This builder for chaining.
*/
public Builder setLeafOutput(
int index, float value) {
ensureLeafOutputIsMutable();
leafOutput_.setFloat(index, value);
onChanged();
return this;
}
/**
* <code>repeated float leafOutput = 3;</code>
* @param value The leafOutput to add.
* @return This builder for chaining.
*/
public Builder addLeafOutput(float value) {
ensureLeafOutputIsMutable();
leafOutput_.addFloat(value);
onChanged();
return this;
}
/**
* <code>repeated float leafOutput = 3;</code>
* @param values The leafOutput to add.
* @return This builder for chaining.
*/
public Builder addAllLeafOutput(
Iterable<? extends Float> values) {
ensureLeafOutputIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, leafOutput_);
onChanged();
return this;
}
/**
* <code>repeated float leafOutput = 3;</code>
* @return This builder for chaining.
*/
public Builder clearLeafOutput() {
leafOutput_ = emptyFloatList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
private int version_ ;
/**
* <code>int32 version = 4;</code>
* @return The version.
*/
@Override
public int getVersion() {
return version_;
}
/**
* <code>int32 version = 4;</code>
* @param value The version to set.
* @return This builder for chaining.
*/
public Builder setVersion(int value) {
version_ = value;
onChanged();
return this;
}
/**
* <code>int32 version = 4;</code>
* @return This builder for chaining.
*/
public Builder clearVersion() {
version_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.TreeLeaf)
}
// @@protoc_insertion_point(class_scope:fgboost.TreeLeaf)
private static final TreeLeaf DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new TreeLeaf();
}
public static TreeLeaf getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TreeLeaf>
PARSER = new com.google.protobuf.AbstractParser<TreeLeaf>() {
@Override
public TreeLeaf parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TreeLeaf(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<TreeLeaf> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<TreeLeaf> getParserForType() {
return PARSER;
}
@Override
public TreeLeaf getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface UploadTreeLeafRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.UploadTreeLeafRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
* @return Whether the treeLeaf field is set.
*/
boolean hasTreeLeaf();
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
* @return The treeLeaf.
*/
TreeLeaf getTreeLeaf();
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
TreeLeafOrBuilder getTreeLeafOrBuilder();
}
/**
* Protobuf type {@code fgboost.UploadTreeLeafRequest}
*/
public static final class UploadTreeLeafRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.UploadTreeLeafRequest)
UploadTreeLeafRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use UploadTreeLeafRequest.newBuilder() to construct.
private UploadTreeLeafRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private UploadTreeLeafRequest() {
clientuuid_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new UploadTreeLeafRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private UploadTreeLeafRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 18: {
TreeLeaf.Builder subBuilder = null;
if (treeLeaf_ != null) {
subBuilder = treeLeaf_.toBuilder();
}
treeLeaf_ = input.readMessage(TreeLeaf.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(treeLeaf_);
treeLeaf_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeLeafRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeLeafRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadTreeLeafRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TREELEAF_FIELD_NUMBER = 2;
private TreeLeaf treeLeaf_;
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
* @return Whether the treeLeaf field is set.
*/
@Override
public boolean hasTreeLeaf() {
return treeLeaf_ != null;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
* @return The treeLeaf.
*/
@Override
public TreeLeaf getTreeLeaf() {
return treeLeaf_ == null ? TreeLeaf.getDefaultInstance() : treeLeaf_;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
@Override
public TreeLeafOrBuilder getTreeLeafOrBuilder() {
return getTreeLeaf();
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
if (treeLeaf_ != null) {
output.writeMessage(2, getTreeLeaf());
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
if (treeLeaf_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getTreeLeaf());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof UploadTreeLeafRequest)) {
return super.equals(obj);
}
UploadTreeLeafRequest other = (UploadTreeLeafRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (hasTreeLeaf() != other.hasTreeLeaf()) return false;
if (hasTreeLeaf()) {
if (!getTreeLeaf()
.equals(other.getTreeLeaf())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
if (hasTreeLeaf()) {
hash = (37 * hash) + TREELEAF_FIELD_NUMBER;
hash = (53 * hash) + getTreeLeaf().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static UploadTreeLeafRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadTreeLeafRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadTreeLeafRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadTreeLeafRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadTreeLeafRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadTreeLeafRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadTreeLeafRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadTreeLeafRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static UploadTreeLeafRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static UploadTreeLeafRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static UploadTreeLeafRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadTreeLeafRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(UploadTreeLeafRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.UploadTreeLeafRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.UploadTreeLeafRequest)
UploadTreeLeafRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeLeafRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeLeafRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadTreeLeafRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.UploadTreeLeafRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
if (treeLeafBuilder_ == null) {
treeLeaf_ = null;
} else {
treeLeaf_ = null;
treeLeafBuilder_ = null;
}
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeLeafRequest_descriptor;
}
@Override
public UploadTreeLeafRequest getDefaultInstanceForType() {
return UploadTreeLeafRequest.getDefaultInstance();
}
@Override
public UploadTreeLeafRequest build() {
UploadTreeLeafRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public UploadTreeLeafRequest buildPartial() {
UploadTreeLeafRequest result = new UploadTreeLeafRequest(this);
result.clientuuid_ = clientuuid_;
if (treeLeafBuilder_ == null) {
result.treeLeaf_ = treeLeaf_;
} else {
result.treeLeaf_ = treeLeafBuilder_.build();
}
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof UploadTreeLeafRequest) {
return mergeFrom((UploadTreeLeafRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(UploadTreeLeafRequest other) {
if (other == UploadTreeLeafRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (other.hasTreeLeaf()) {
mergeTreeLeaf(other.getTreeLeaf());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
UploadTreeLeafRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (UploadTreeLeafRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private TreeLeaf treeLeaf_;
private com.google.protobuf.SingleFieldBuilderV3<
TreeLeaf, TreeLeaf.Builder, TreeLeafOrBuilder> treeLeafBuilder_;
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
* @return Whether the treeLeaf field is set.
*/
public boolean hasTreeLeaf() {
return treeLeafBuilder_ != null || treeLeaf_ != null;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
* @return The treeLeaf.
*/
public TreeLeaf getTreeLeaf() {
if (treeLeafBuilder_ == null) {
return treeLeaf_ == null ? TreeLeaf.getDefaultInstance() : treeLeaf_;
} else {
return treeLeafBuilder_.getMessage();
}
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
public Builder setTreeLeaf(TreeLeaf value) {
if (treeLeafBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
treeLeaf_ = value;
onChanged();
} else {
treeLeafBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
public Builder setTreeLeaf(
TreeLeaf.Builder builderForValue) {
if (treeLeafBuilder_ == null) {
treeLeaf_ = builderForValue.build();
onChanged();
} else {
treeLeafBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
public Builder mergeTreeLeaf(TreeLeaf value) {
if (treeLeafBuilder_ == null) {
if (treeLeaf_ != null) {
treeLeaf_ =
TreeLeaf.newBuilder(treeLeaf_).mergeFrom(value).buildPartial();
} else {
treeLeaf_ = value;
}
onChanged();
} else {
treeLeafBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
public Builder clearTreeLeaf() {
if (treeLeafBuilder_ == null) {
treeLeaf_ = null;
onChanged();
} else {
treeLeaf_ = null;
treeLeafBuilder_ = null;
}
return this;
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
public TreeLeaf.Builder getTreeLeafBuilder() {
onChanged();
return getTreeLeafFieldBuilder().getBuilder();
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
public TreeLeafOrBuilder getTreeLeafOrBuilder() {
if (treeLeafBuilder_ != null) {
return treeLeafBuilder_.getMessageOrBuilder();
} else {
return treeLeaf_ == null ?
TreeLeaf.getDefaultInstance() : treeLeaf_;
}
}
/**
* <code>.fgboost.TreeLeaf treeLeaf = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
TreeLeaf, TreeLeaf.Builder, TreeLeafOrBuilder>
getTreeLeafFieldBuilder() {
if (treeLeafBuilder_ == null) {
treeLeafBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
TreeLeaf, TreeLeaf.Builder, TreeLeafOrBuilder>(
getTreeLeaf(),
getParentForChildren(),
isClean());
treeLeaf_ = null;
}
return treeLeafBuilder_;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.UploadTreeLeafRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.UploadTreeLeafRequest)
private static final UploadTreeLeafRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new UploadTreeLeafRequest();
}
public static UploadTreeLeafRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<UploadTreeLeafRequest>
PARSER = new com.google.protobuf.AbstractParser<UploadTreeLeafRequest>() {
@Override
public UploadTreeLeafRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new UploadTreeLeafRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<UploadTreeLeafRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<UploadTreeLeafRequest> getParserForType() {
return PARSER;
}
@Override
public UploadTreeLeafRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DataSplitOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.DataSplit)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
String getTreeID();
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
com.google.protobuf.ByteString
getTreeIDBytes();
/**
* <code>string nodeID = 2;</code>
* @return The nodeID.
*/
String getNodeID();
/**
* <code>string nodeID = 2;</code>
* @return The bytes for nodeID.
*/
com.google.protobuf.ByteString
getNodeIDBytes();
/**
* <code>int32 featureID = 3;</code>
* @return The featureID.
*/
int getFeatureID();
/**
* <code>float splitValue = 4;</code>
* @return The splitValue.
*/
float getSplitValue();
/**
* <code>float gain = 5;</code>
* @return The gain.
*/
float getGain();
/**
* <code>int32 setLength = 6;</code>
* @return The setLength.
*/
int getSetLength();
/**
* <code>repeated int32 itemSet = 7;</code>
* @return A list containing the itemSet.
*/
java.util.List<Integer> getItemSetList();
/**
* <code>repeated int32 itemSet = 7;</code>
* @return The count of itemSet.
*/
int getItemSetCount();
/**
* <code>repeated int32 itemSet = 7;</code>
* @param index The index of the element to return.
* @return The itemSet at the given index.
*/
int getItemSet(int index);
/**
* <code>string clientUid = 8;</code>
* @return The clientUid.
*/
String getClientUid();
/**
* <code>string clientUid = 8;</code>
* @return The bytes for clientUid.
*/
com.google.protobuf.ByteString
getClientUidBytes();
/**
* <code>int32 version = 9;</code>
* @return The version.
*/
int getVersion();
}
/**
* Protobuf type {@code fgboost.DataSplit}
*/
public static final class DataSplit extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.DataSplit)
DataSplitOrBuilder {
private static final long serialVersionUID = 0L;
// Use DataSplit.newBuilder() to construct.
private DataSplit(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DataSplit() {
treeID_ = "";
nodeID_ = "";
itemSet_ = emptyIntList();
clientUid_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new DataSplit();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DataSplit(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
treeID_ = s;
break;
}
case 18: {
String s = input.readStringRequireUtf8();
nodeID_ = s;
break;
}
case 24: {
featureID_ = input.readInt32();
break;
}
case 37: {
splitValue_ = input.readFloat();
break;
}
case 45: {
gain_ = input.readFloat();
break;
}
case 48: {
setLength_ = input.readInt32();
break;
}
case 56: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
itemSet_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
itemSet_.addInt(input.readInt32());
break;
}
case 58: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
itemSet_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
itemSet_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
}
case 66: {
String s = input.readStringRequireUtf8();
clientUid_ = s;
break;
}
case 72: {
version_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
itemSet_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_DataSplit_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_DataSplit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
DataSplit.class, Builder.class);
}
public static final int TREEID_FIELD_NUMBER = 1;
private volatile Object treeID_;
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
@Override
public String getTreeID() {
Object ref = treeID_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
treeID_ = s;
return s;
}
}
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
@Override
public com.google.protobuf.ByteString
getTreeIDBytes() {
Object ref = treeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
treeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NODEID_FIELD_NUMBER = 2;
private volatile Object nodeID_;
/**
* <code>string nodeID = 2;</code>
* @return The nodeID.
*/
@Override
public String getNodeID() {
Object ref = nodeID_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
nodeID_ = s;
return s;
}
}
/**
* <code>string nodeID = 2;</code>
* @return The bytes for nodeID.
*/
@Override
public com.google.protobuf.ByteString
getNodeIDBytes() {
Object ref = nodeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
nodeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FEATUREID_FIELD_NUMBER = 3;
private int featureID_;
/**
* <code>int32 featureID = 3;</code>
* @return The featureID.
*/
@Override
public int getFeatureID() {
return featureID_;
}
public static final int SPLITVALUE_FIELD_NUMBER = 4;
private float splitValue_;
/**
* <code>float splitValue = 4;</code>
* @return The splitValue.
*/
@Override
public float getSplitValue() {
return splitValue_;
}
public static final int GAIN_FIELD_NUMBER = 5;
private float gain_;
/**
* <code>float gain = 5;</code>
* @return The gain.
*/
@Override
public float getGain() {
return gain_;
}
public static final int SETLENGTH_FIELD_NUMBER = 6;
private int setLength_;
/**
* <code>int32 setLength = 6;</code>
* @return The setLength.
*/
@Override
public int getSetLength() {
return setLength_;
}
public static final int ITEMSET_FIELD_NUMBER = 7;
private com.google.protobuf.Internal.IntList itemSet_;
/**
* <code>repeated int32 itemSet = 7;</code>
* @return A list containing the itemSet.
*/
@Override
public java.util.List<Integer>
getItemSetList() {
return itemSet_;
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @return The count of itemSet.
*/
public int getItemSetCount() {
return itemSet_.size();
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @param index The index of the element to return.
* @return The itemSet at the given index.
*/
public int getItemSet(int index) {
return itemSet_.getInt(index);
}
private int itemSetMemoizedSerializedSize = -1;
public static final int CLIENTUID_FIELD_NUMBER = 8;
private volatile Object clientUid_;
/**
* <code>string clientUid = 8;</code>
* @return The clientUid.
*/
@Override
public String getClientUid() {
Object ref = clientUid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientUid_ = s;
return s;
}
}
/**
* <code>string clientUid = 8;</code>
* @return The bytes for clientUid.
*/
@Override
public com.google.protobuf.ByteString
getClientUidBytes() {
Object ref = clientUid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientUid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VERSION_FIELD_NUMBER = 9;
private int version_;
/**
* <code>int32 version = 9;</code>
* @return The version.
*/
@Override
public int getVersion() {
return version_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (!getTreeIDBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, treeID_);
}
if (!getNodeIDBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nodeID_);
}
if (featureID_ != 0) {
output.writeInt32(3, featureID_);
}
if (splitValue_ != 0F) {
output.writeFloat(4, splitValue_);
}
if (gain_ != 0F) {
output.writeFloat(5, gain_);
}
if (setLength_ != 0) {
output.writeInt32(6, setLength_);
}
if (getItemSetList().size() > 0) {
output.writeUInt32NoTag(58);
output.writeUInt32NoTag(itemSetMemoizedSerializedSize);
}
for (int i = 0; i < itemSet_.size(); i++) {
output.writeInt32NoTag(itemSet_.getInt(i));
}
if (!getClientUidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, clientUid_);
}
if (version_ != 0) {
output.writeInt32(9, version_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getTreeIDBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, treeID_);
}
if (!getNodeIDBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nodeID_);
}
if (featureID_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, featureID_);
}
if (splitValue_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(4, splitValue_);
}
if (gain_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(5, gain_);
}
if (setLength_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, setLength_);
}
{
int dataSize = 0;
for (int i = 0; i < itemSet_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(itemSet_.getInt(i));
}
size += dataSize;
if (!getItemSetList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
itemSetMemoizedSerializedSize = dataSize;
}
if (!getClientUidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, clientUid_);
}
if (version_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(9, version_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof DataSplit)) {
return super.equals(obj);
}
DataSplit other = (DataSplit) obj;
if (!getTreeID()
.equals(other.getTreeID())) return false;
if (!getNodeID()
.equals(other.getNodeID())) return false;
if (getFeatureID()
!= other.getFeatureID()) return false;
if (Float.floatToIntBits(getSplitValue())
!= Float.floatToIntBits(
other.getSplitValue())) return false;
if (Float.floatToIntBits(getGain())
!= Float.floatToIntBits(
other.getGain())) return false;
if (getSetLength()
!= other.getSetLength()) return false;
if (!getItemSetList()
.equals(other.getItemSetList())) return false;
if (!getClientUid()
.equals(other.getClientUid())) return false;
if (getVersion()
!= other.getVersion()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TREEID_FIELD_NUMBER;
hash = (53 * hash) + getTreeID().hashCode();
hash = (37 * hash) + NODEID_FIELD_NUMBER;
hash = (53 * hash) + getNodeID().hashCode();
hash = (37 * hash) + FEATUREID_FIELD_NUMBER;
hash = (53 * hash) + getFeatureID();
hash = (37 * hash) + SPLITVALUE_FIELD_NUMBER;
hash = (53 * hash) + Float.floatToIntBits(
getSplitValue());
hash = (37 * hash) + GAIN_FIELD_NUMBER;
hash = (53 * hash) + Float.floatToIntBits(
getGain());
hash = (37 * hash) + SETLENGTH_FIELD_NUMBER;
hash = (53 * hash) + getSetLength();
if (getItemSetCount() > 0) {
hash = (37 * hash) + ITEMSET_FIELD_NUMBER;
hash = (53 * hash) + getItemSetList().hashCode();
}
hash = (37 * hash) + CLIENTUID_FIELD_NUMBER;
hash = (53 * hash) + getClientUid().hashCode();
hash = (37 * hash) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + getVersion();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static DataSplit parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DataSplit parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DataSplit parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DataSplit parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DataSplit parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static DataSplit parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static DataSplit parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static DataSplit parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static DataSplit parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static DataSplit parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static DataSplit parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static DataSplit parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(DataSplit prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.DataSplit}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.DataSplit)
DataSplitOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_DataSplit_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_DataSplit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
DataSplit.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.DataSplit.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
treeID_ = "";
nodeID_ = "";
featureID_ = 0;
splitValue_ = 0F;
gain_ = 0F;
setLength_ = 0;
itemSet_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
clientUid_ = "";
version_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_DataSplit_descriptor;
}
@Override
public DataSplit getDefaultInstanceForType() {
return DataSplit.getDefaultInstance();
}
@Override
public DataSplit build() {
DataSplit result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public DataSplit buildPartial() {
DataSplit result = new DataSplit(this);
int from_bitField0_ = bitField0_;
result.treeID_ = treeID_;
result.nodeID_ = nodeID_;
result.featureID_ = featureID_;
result.splitValue_ = splitValue_;
result.gain_ = gain_;
result.setLength_ = setLength_;
if (((bitField0_ & 0x00000001) != 0)) {
itemSet_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.itemSet_ = itemSet_;
result.clientUid_ = clientUid_;
result.version_ = version_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof DataSplit) {
return mergeFrom((DataSplit)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(DataSplit other) {
if (other == DataSplit.getDefaultInstance()) return this;
if (!other.getTreeID().isEmpty()) {
treeID_ = other.treeID_;
onChanged();
}
if (!other.getNodeID().isEmpty()) {
nodeID_ = other.nodeID_;
onChanged();
}
if (other.getFeatureID() != 0) {
setFeatureID(other.getFeatureID());
}
if (other.getSplitValue() != 0F) {
setSplitValue(other.getSplitValue());
}
if (other.getGain() != 0F) {
setGain(other.getGain());
}
if (other.getSetLength() != 0) {
setSetLength(other.getSetLength());
}
if (!other.itemSet_.isEmpty()) {
if (itemSet_.isEmpty()) {
itemSet_ = other.itemSet_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureItemSetIsMutable();
itemSet_.addAll(other.itemSet_);
}
onChanged();
}
if (!other.getClientUid().isEmpty()) {
clientUid_ = other.clientUid_;
onChanged();
}
if (other.getVersion() != 0) {
setVersion(other.getVersion());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
DataSplit parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (DataSplit) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object treeID_ = "";
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
public String getTreeID() {
Object ref = treeID_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
treeID_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
public com.google.protobuf.ByteString
getTreeIDBytes() {
Object ref = treeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
treeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string treeID = 1;</code>
* @param value The treeID to set.
* @return This builder for chaining.
*/
public Builder setTreeID(
String value) {
if (value == null) {
throw new NullPointerException();
}
treeID_ = value;
onChanged();
return this;
}
/**
* <code>string treeID = 1;</code>
* @return This builder for chaining.
*/
public Builder clearTreeID() {
treeID_ = getDefaultInstance().getTreeID();
onChanged();
return this;
}
/**
* <code>string treeID = 1;</code>
* @param value The bytes for treeID to set.
* @return This builder for chaining.
*/
public Builder setTreeIDBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
treeID_ = value;
onChanged();
return this;
}
private Object nodeID_ = "";
/**
* <code>string nodeID = 2;</code>
* @return The nodeID.
*/
public String getNodeID() {
Object ref = nodeID_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
nodeID_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string nodeID = 2;</code>
* @return The bytes for nodeID.
*/
public com.google.protobuf.ByteString
getNodeIDBytes() {
Object ref = nodeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
nodeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string nodeID = 2;</code>
* @param value The nodeID to set.
* @return This builder for chaining.
*/
public Builder setNodeID(
String value) {
if (value == null) {
throw new NullPointerException();
}
nodeID_ = value;
onChanged();
return this;
}
/**
* <code>string nodeID = 2;</code>
* @return This builder for chaining.
*/
public Builder clearNodeID() {
nodeID_ = getDefaultInstance().getNodeID();
onChanged();
return this;
}
/**
* <code>string nodeID = 2;</code>
* @param value The bytes for nodeID to set.
* @return This builder for chaining.
*/
public Builder setNodeIDBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
nodeID_ = value;
onChanged();
return this;
}
private int featureID_ ;
/**
* <code>int32 featureID = 3;</code>
* @return The featureID.
*/
@Override
public int getFeatureID() {
return featureID_;
}
/**
* <code>int32 featureID = 3;</code>
* @param value The featureID to set.
* @return This builder for chaining.
*/
public Builder setFeatureID(int value) {
featureID_ = value;
onChanged();
return this;
}
/**
* <code>int32 featureID = 3;</code>
* @return This builder for chaining.
*/
public Builder clearFeatureID() {
featureID_ = 0;
onChanged();
return this;
}
private float splitValue_ ;
/**
* <code>float splitValue = 4;</code>
* @return The splitValue.
*/
@Override
public float getSplitValue() {
return splitValue_;
}
/**
* <code>float splitValue = 4;</code>
* @param value The splitValue to set.
* @return This builder for chaining.
*/
public Builder setSplitValue(float value) {
splitValue_ = value;
onChanged();
return this;
}
/**
* <code>float splitValue = 4;</code>
* @return This builder for chaining.
*/
public Builder clearSplitValue() {
splitValue_ = 0F;
onChanged();
return this;
}
private float gain_ ;
/**
* <code>float gain = 5;</code>
* @return The gain.
*/
@Override
public float getGain() {
return gain_;
}
/**
* <code>float gain = 5;</code>
* @param value The gain to set.
* @return This builder for chaining.
*/
public Builder setGain(float value) {
gain_ = value;
onChanged();
return this;
}
/**
* <code>float gain = 5;</code>
* @return This builder for chaining.
*/
public Builder clearGain() {
gain_ = 0F;
onChanged();
return this;
}
private int setLength_ ;
/**
* <code>int32 setLength = 6;</code>
* @return The setLength.
*/
@Override
public int getSetLength() {
return setLength_;
}
/**
* <code>int32 setLength = 6;</code>
* @param value The setLength to set.
* @return This builder for chaining.
*/
public Builder setSetLength(int value) {
setLength_ = value;
onChanged();
return this;
}
/**
* <code>int32 setLength = 6;</code>
* @return This builder for chaining.
*/
public Builder clearSetLength() {
setLength_ = 0;
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList itemSet_ = emptyIntList();
private void ensureItemSetIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
itemSet_ = mutableCopy(itemSet_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @return A list containing the itemSet.
*/
public java.util.List<Integer>
getItemSetList() {
return ((bitField0_ & 0x00000001) != 0) ?
java.util.Collections.unmodifiableList(itemSet_) : itemSet_;
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @return The count of itemSet.
*/
public int getItemSetCount() {
return itemSet_.size();
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @param index The index of the element to return.
* @return The itemSet at the given index.
*/
public int getItemSet(int index) {
return itemSet_.getInt(index);
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @param index The index to set the value at.
* @param value The itemSet to set.
* @return This builder for chaining.
*/
public Builder setItemSet(
int index, int value) {
ensureItemSetIsMutable();
itemSet_.setInt(index, value);
onChanged();
return this;
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @param value The itemSet to add.
* @return This builder for chaining.
*/
public Builder addItemSet(int value) {
ensureItemSetIsMutable();
itemSet_.addInt(value);
onChanged();
return this;
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @param values The itemSet to add.
* @return This builder for chaining.
*/
public Builder addAllItemSet(
Iterable<? extends Integer> values) {
ensureItemSetIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, itemSet_);
onChanged();
return this;
}
/**
* <code>repeated int32 itemSet = 7;</code>
* @return This builder for chaining.
*/
public Builder clearItemSet() {
itemSet_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
private Object clientUid_ = "";
/**
* <code>string clientUid = 8;</code>
* @return The clientUid.
*/
public String getClientUid() {
Object ref = clientUid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientUid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientUid = 8;</code>
* @return The bytes for clientUid.
*/
public com.google.protobuf.ByteString
getClientUidBytes() {
Object ref = clientUid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientUid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientUid = 8;</code>
* @param value The clientUid to set.
* @return This builder for chaining.
*/
public Builder setClientUid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientUid_ = value;
onChanged();
return this;
}
/**
* <code>string clientUid = 8;</code>
* @return This builder for chaining.
*/
public Builder clearClientUid() {
clientUid_ = getDefaultInstance().getClientUid();
onChanged();
return this;
}
/**
* <code>string clientUid = 8;</code>
* @param value The bytes for clientUid to set.
* @return This builder for chaining.
*/
public Builder setClientUidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientUid_ = value;
onChanged();
return this;
}
private int version_ ;
/**
* <code>int32 version = 9;</code>
* @return The version.
*/
@Override
public int getVersion() {
return version_;
}
/**
* <code>int32 version = 9;</code>
* @param value The version to set.
* @return This builder for chaining.
*/
public Builder setVersion(int value) {
version_ = value;
onChanged();
return this;
}
/**
* <code>int32 version = 9;</code>
* @return This builder for chaining.
*/
public Builder clearVersion() {
version_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.DataSplit)
}
// @@protoc_insertion_point(class_scope:fgboost.DataSplit)
private static final DataSplit DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new DataSplit();
}
public static DataSplit getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DataSplit>
PARSER = new com.google.protobuf.AbstractParser<DataSplit>() {
@Override
public DataSplit parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DataSplit(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DataSplit> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<DataSplit> getParserForType() {
return PARSER;
}
@Override
public DataSplit getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface UploadResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.UploadResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string response = 1;</code>
* @return The response.
*/
String getResponse();
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
com.google.protobuf.ByteString
getResponseBytes();
/**
* <code>int32 code = 2;</code>
* @return The code.
*/
int getCode();
}
/**
* Protobuf type {@code fgboost.UploadResponse}
*/
public static final class UploadResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.UploadResponse)
UploadResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use UploadResponse.newBuilder() to construct.
private UploadResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private UploadResponse() {
response_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new UploadResponse();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private UploadResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
response_ = s;
break;
}
case 16: {
code_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadResponse.class, Builder.class);
}
public static final int RESPONSE_FIELD_NUMBER = 1;
private volatile Object response_;
/**
* <code>string response = 1;</code>
* @return The response.
*/
@Override
public String getResponse() {
Object ref = response_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
@Override
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CODE_FIELD_NUMBER = 2;
private int code_;
/**
* <code>int32 code = 2;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getResponseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_);
}
if (code_ != 0) {
output.writeInt32(2, code_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getResponseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_);
}
if (code_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, code_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof UploadResponse)) {
return super.equals(obj);
}
UploadResponse other = (UploadResponse) obj;
if (!getResponse()
.equals(other.getResponse())) return false;
if (getCode()
!= other.getCode()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getResponse().hashCode();
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + getCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static UploadResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static UploadResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static UploadResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static UploadResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(UploadResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.UploadResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.UploadResponse)
UploadResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadResponse.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.UploadResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
response_ = "";
code_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_UploadResponse_descriptor;
}
@Override
public UploadResponse getDefaultInstanceForType() {
return UploadResponse.getDefaultInstance();
}
@Override
public UploadResponse build() {
UploadResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public UploadResponse buildPartial() {
UploadResponse result = new UploadResponse(this);
result.response_ = response_;
result.code_ = code_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof UploadResponse) {
return mergeFrom((UploadResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(UploadResponse other) {
if (other == UploadResponse.getDefaultInstance()) return this;
if (!other.getResponse().isEmpty()) {
response_ = other.response_;
onChanged();
}
if (other.getCode() != 0) {
setCode(other.getCode());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
UploadResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (UploadResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object response_ = "";
/**
* <code>string response = 1;</code>
* @return The response.
*/
public String getResponse() {
Object ref = response_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string response = 1;</code>
* @param value The response to set.
* @return This builder for chaining.
*/
public Builder setResponse(
String value) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @return This builder for chaining.
*/
public Builder clearResponse() {
response_ = getDefaultInstance().getResponse();
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @param value The bytes for response to set.
* @return This builder for chaining.
*/
public Builder setResponseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
response_ = value;
onChanged();
return this;
}
private int code_ ;
/**
* <code>int32 code = 2;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
/**
* <code>int32 code = 2;</code>
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(int value) {
code_ = value;
onChanged();
return this;
}
/**
* <code>int32 code = 2;</code>
* @return This builder for chaining.
*/
public Builder clearCode() {
code_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.UploadResponse)
}
// @@protoc_insertion_point(class_scope:fgboost.UploadResponse)
private static final UploadResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new UploadResponse();
}
public static UploadResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<UploadResponse>
PARSER = new com.google.protobuf.AbstractParser<UploadResponse>() {
@Override
public UploadResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new UploadResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<UploadResponse> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<UploadResponse> getParserForType() {
return PARSER;
}
@Override
public UploadResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface TreePredictOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.TreePredict)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
String getTreeID();
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
com.google.protobuf.ByteString
getTreeIDBytes();
/**
* <code>repeated bool predicts = 2;</code>
* @return A list containing the predicts.
*/
java.util.List<Boolean> getPredictsList();
/**
* <code>repeated bool predicts = 2;</code>
* @return The count of predicts.
*/
int getPredictsCount();
/**
* <code>repeated bool predicts = 2;</code>
* @param index The index of the element to return.
* @return The predicts at the given index.
*/
boolean getPredicts(int index);
}
/**
* Protobuf type {@code fgboost.TreePredict}
*/
public static final class TreePredict extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.TreePredict)
TreePredictOrBuilder {
private static final long serialVersionUID = 0L;
// Use TreePredict.newBuilder() to construct.
private TreePredict(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TreePredict() {
treeID_ = "";
predicts_ = emptyBooleanList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new TreePredict();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TreePredict(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
treeID_ = s;
break;
}
case 16: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
predicts_ = newBooleanList();
mutable_bitField0_ |= 0x00000001;
}
predicts_.addBoolean(input.readBool());
break;
}
case 18: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
predicts_ = newBooleanList();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
predicts_.addBoolean(input.readBool());
}
input.popLimit(limit);
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
predicts_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_TreePredict_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_TreePredict_fieldAccessorTable
.ensureFieldAccessorsInitialized(
TreePredict.class, Builder.class);
}
public static final int TREEID_FIELD_NUMBER = 1;
private volatile Object treeID_;
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
@Override
public String getTreeID() {
Object ref = treeID_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
treeID_ = s;
return s;
}
}
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
@Override
public com.google.protobuf.ByteString
getTreeIDBytes() {
Object ref = treeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
treeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PREDICTS_FIELD_NUMBER = 2;
private com.google.protobuf.Internal.BooleanList predicts_;
/**
* <code>repeated bool predicts = 2;</code>
* @return A list containing the predicts.
*/
@Override
public java.util.List<Boolean>
getPredictsList() {
return predicts_;
}
/**
* <code>repeated bool predicts = 2;</code>
* @return The count of predicts.
*/
public int getPredictsCount() {
return predicts_.size();
}
/**
* <code>repeated bool predicts = 2;</code>
* @param index The index of the element to return.
* @return The predicts at the given index.
*/
public boolean getPredicts(int index) {
return predicts_.getBoolean(index);
}
private int predictsMemoizedSerializedSize = -1;
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (!getTreeIDBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, treeID_);
}
if (getPredictsList().size() > 0) {
output.writeUInt32NoTag(18);
output.writeUInt32NoTag(predictsMemoizedSerializedSize);
}
for (int i = 0; i < predicts_.size(); i++) {
output.writeBoolNoTag(predicts_.getBoolean(i));
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getTreeIDBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, treeID_);
}
{
int dataSize = 0;
dataSize = 1 * getPredictsList().size();
size += dataSize;
if (!getPredictsList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
predictsMemoizedSerializedSize = dataSize;
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof TreePredict)) {
return super.equals(obj);
}
TreePredict other = (TreePredict) obj;
if (!getTreeID()
.equals(other.getTreeID())) return false;
if (!getPredictsList()
.equals(other.getPredictsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TREEID_FIELD_NUMBER;
hash = (53 * hash) + getTreeID().hashCode();
if (getPredictsCount() > 0) {
hash = (37 * hash) + PREDICTS_FIELD_NUMBER;
hash = (53 * hash) + getPredictsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static TreePredict parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static TreePredict parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static TreePredict parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static TreePredict parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static TreePredict parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static TreePredict parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static TreePredict parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static TreePredict parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static TreePredict parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static TreePredict parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static TreePredict parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static TreePredict parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(TreePredict prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.TreePredict}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.TreePredict)
TreePredictOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_TreePredict_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_TreePredict_fieldAccessorTable
.ensureFieldAccessorsInitialized(
TreePredict.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.TreePredict.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
treeID_ = "";
predicts_ = emptyBooleanList();
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_TreePredict_descriptor;
}
@Override
public TreePredict getDefaultInstanceForType() {
return TreePredict.getDefaultInstance();
}
@Override
public TreePredict build() {
TreePredict result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public TreePredict buildPartial() {
TreePredict result = new TreePredict(this);
int from_bitField0_ = bitField0_;
result.treeID_ = treeID_;
if (((bitField0_ & 0x00000001) != 0)) {
predicts_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.predicts_ = predicts_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof TreePredict) {
return mergeFrom((TreePredict)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(TreePredict other) {
if (other == TreePredict.getDefaultInstance()) return this;
if (!other.getTreeID().isEmpty()) {
treeID_ = other.treeID_;
onChanged();
}
if (!other.predicts_.isEmpty()) {
if (predicts_.isEmpty()) {
predicts_ = other.predicts_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePredictsIsMutable();
predicts_.addAll(other.predicts_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
TreePredict parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (TreePredict) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object treeID_ = "";
/**
* <code>string treeID = 1;</code>
* @return The treeID.
*/
public String getTreeID() {
Object ref = treeID_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
treeID_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string treeID = 1;</code>
* @return The bytes for treeID.
*/
public com.google.protobuf.ByteString
getTreeIDBytes() {
Object ref = treeID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
treeID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string treeID = 1;</code>
* @param value The treeID to set.
* @return This builder for chaining.
*/
public Builder setTreeID(
String value) {
if (value == null) {
throw new NullPointerException();
}
treeID_ = value;
onChanged();
return this;
}
/**
* <code>string treeID = 1;</code>
* @return This builder for chaining.
*/
public Builder clearTreeID() {
treeID_ = getDefaultInstance().getTreeID();
onChanged();
return this;
}
/**
* <code>string treeID = 1;</code>
* @param value The bytes for treeID to set.
* @return This builder for chaining.
*/
public Builder setTreeIDBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
treeID_ = value;
onChanged();
return this;
}
private com.google.protobuf.Internal.BooleanList predicts_ = emptyBooleanList();
private void ensurePredictsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
predicts_ = mutableCopy(predicts_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated bool predicts = 2;</code>
* @return A list containing the predicts.
*/
public java.util.List<Boolean>
getPredictsList() {
return ((bitField0_ & 0x00000001) != 0) ?
java.util.Collections.unmodifiableList(predicts_) : predicts_;
}
/**
* <code>repeated bool predicts = 2;</code>
* @return The count of predicts.
*/
public int getPredictsCount() {
return predicts_.size();
}
/**
* <code>repeated bool predicts = 2;</code>
* @param index The index of the element to return.
* @return The predicts at the given index.
*/
public boolean getPredicts(int index) {
return predicts_.getBoolean(index);
}
/**
* <code>repeated bool predicts = 2;</code>
* @param index The index to set the value at.
* @param value The predicts to set.
* @return This builder for chaining.
*/
public Builder setPredicts(
int index, boolean value) {
ensurePredictsIsMutable();
predicts_.setBoolean(index, value);
onChanged();
return this;
}
/**
* <code>repeated bool predicts = 2;</code>
* @param value The predicts to add.
* @return This builder for chaining.
*/
public Builder addPredicts(boolean value) {
ensurePredictsIsMutable();
predicts_.addBoolean(value);
onChanged();
return this;
}
/**
* <code>repeated bool predicts = 2;</code>
* @param values The predicts to add.
* @return This builder for chaining.
*/
public Builder addAllPredicts(
Iterable<? extends Boolean> values) {
ensurePredictsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, predicts_);
onChanged();
return this;
}
/**
* <code>repeated bool predicts = 2;</code>
* @return This builder for chaining.
*/
public Builder clearPredicts() {
predicts_ = emptyBooleanList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.TreePredict)
}
// @@protoc_insertion_point(class_scope:fgboost.TreePredict)
private static final TreePredict DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new TreePredict();
}
public static TreePredict getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TreePredict>
PARSER = new com.google.protobuf.AbstractParser<TreePredict>() {
@Override
public TreePredict parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TreePredict(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<TreePredict> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<TreePredict> getParserForType() {
return PARSER;
}
@Override
public TreePredict getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface BoostPredictOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.BoostPredict)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
java.util.List<TreePredict>
getPredictsList();
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
TreePredict getPredicts(int index);
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
int getPredictsCount();
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
java.util.List<? extends TreePredictOrBuilder>
getPredictsOrBuilderList();
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
TreePredictOrBuilder getPredictsOrBuilder(
int index);
}
/**
* Protobuf type {@code fgboost.BoostPredict}
*/
public static final class BoostPredict extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.BoostPredict)
BoostPredictOrBuilder {
private static final long serialVersionUID = 0L;
// Use BoostPredict.newBuilder() to construct.
private BoostPredict(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private BoostPredict() {
predicts_ = java.util.Collections.emptyList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new BoostPredict();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private BoostPredict(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
predicts_ = new java.util.ArrayList<TreePredict>();
mutable_bitField0_ |= 0x00000001;
}
predicts_.add(
input.readMessage(TreePredict.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
predicts_ = java.util.Collections.unmodifiableList(predicts_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_BoostPredict_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_BoostPredict_fieldAccessorTable
.ensureFieldAccessorsInitialized(
BoostPredict.class, Builder.class);
}
public static final int PREDICTS_FIELD_NUMBER = 1;
private java.util.List<TreePredict> predicts_;
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
@Override
public java.util.List<TreePredict> getPredictsList() {
return predicts_;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
@Override
public java.util.List<? extends TreePredictOrBuilder>
getPredictsOrBuilderList() {
return predicts_;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
@Override
public int getPredictsCount() {
return predicts_.size();
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
@Override
public TreePredict getPredicts(int index) {
return predicts_.get(index);
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
@Override
public TreePredictOrBuilder getPredictsOrBuilder(
int index) {
return predicts_.get(index);
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < predicts_.size(); i++) {
output.writeMessage(1, predicts_.get(i));
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < predicts_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, predicts_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof BoostPredict)) {
return super.equals(obj);
}
BoostPredict other = (BoostPredict) obj;
if (!getPredictsList()
.equals(other.getPredictsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getPredictsCount() > 0) {
hash = (37 * hash) + PREDICTS_FIELD_NUMBER;
hash = (53 * hash) + getPredictsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static BoostPredict parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static BoostPredict parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static BoostPredict parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static BoostPredict parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static BoostPredict parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static BoostPredict parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static BoostPredict parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static BoostPredict parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static BoostPredict parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static BoostPredict parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static BoostPredict parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static BoostPredict parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(BoostPredict prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.BoostPredict}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.BoostPredict)
BoostPredictOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_BoostPredict_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_BoostPredict_fieldAccessorTable
.ensureFieldAccessorsInitialized(
BoostPredict.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.BoostPredict.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getPredictsFieldBuilder();
}
}
@Override
public Builder clear() {
super.clear();
if (predictsBuilder_ == null) {
predicts_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
predictsBuilder_.clear();
}
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_BoostPredict_descriptor;
}
@Override
public BoostPredict getDefaultInstanceForType() {
return BoostPredict.getDefaultInstance();
}
@Override
public BoostPredict build() {
BoostPredict result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public BoostPredict buildPartial() {
BoostPredict result = new BoostPredict(this);
int from_bitField0_ = bitField0_;
if (predictsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
predicts_ = java.util.Collections.unmodifiableList(predicts_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.predicts_ = predicts_;
} else {
result.predicts_ = predictsBuilder_.build();
}
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof BoostPredict) {
return mergeFrom((BoostPredict)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(BoostPredict other) {
if (other == BoostPredict.getDefaultInstance()) return this;
if (predictsBuilder_ == null) {
if (!other.predicts_.isEmpty()) {
if (predicts_.isEmpty()) {
predicts_ = other.predicts_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePredictsIsMutable();
predicts_.addAll(other.predicts_);
}
onChanged();
}
} else {
if (!other.predicts_.isEmpty()) {
if (predictsBuilder_.isEmpty()) {
predictsBuilder_.dispose();
predictsBuilder_ = null;
predicts_ = other.predicts_;
bitField0_ = (bitField0_ & ~0x00000001);
predictsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getPredictsFieldBuilder() : null;
} else {
predictsBuilder_.addAllMessages(other.predicts_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
BoostPredict parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (BoostPredict) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<TreePredict> predicts_ =
java.util.Collections.emptyList();
private void ensurePredictsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
predicts_ = new java.util.ArrayList<TreePredict>(predicts_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
TreePredict, TreePredict.Builder, TreePredictOrBuilder> predictsBuilder_;
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public java.util.List<TreePredict> getPredictsList() {
if (predictsBuilder_ == null) {
return java.util.Collections.unmodifiableList(predicts_);
} else {
return predictsBuilder_.getMessageList();
}
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public int getPredictsCount() {
if (predictsBuilder_ == null) {
return predicts_.size();
} else {
return predictsBuilder_.getCount();
}
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public TreePredict getPredicts(int index) {
if (predictsBuilder_ == null) {
return predicts_.get(index);
} else {
return predictsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder setPredicts(
int index, TreePredict value) {
if (predictsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePredictsIsMutable();
predicts_.set(index, value);
onChanged();
} else {
predictsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder setPredicts(
int index, TreePredict.Builder builderForValue) {
if (predictsBuilder_ == null) {
ensurePredictsIsMutable();
predicts_.set(index, builderForValue.build());
onChanged();
} else {
predictsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder addPredicts(TreePredict value) {
if (predictsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePredictsIsMutable();
predicts_.add(value);
onChanged();
} else {
predictsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder addPredicts(
int index, TreePredict value) {
if (predictsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePredictsIsMutable();
predicts_.add(index, value);
onChanged();
} else {
predictsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder addPredicts(
TreePredict.Builder builderForValue) {
if (predictsBuilder_ == null) {
ensurePredictsIsMutable();
predicts_.add(builderForValue.build());
onChanged();
} else {
predictsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder addPredicts(
int index, TreePredict.Builder builderForValue) {
if (predictsBuilder_ == null) {
ensurePredictsIsMutable();
predicts_.add(index, builderForValue.build());
onChanged();
} else {
predictsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder addAllPredicts(
Iterable<? extends TreePredict> values) {
if (predictsBuilder_ == null) {
ensurePredictsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, predicts_);
onChanged();
} else {
predictsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder clearPredicts() {
if (predictsBuilder_ == null) {
predicts_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
predictsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public Builder removePredicts(int index) {
if (predictsBuilder_ == null) {
ensurePredictsIsMutable();
predicts_.remove(index);
onChanged();
} else {
predictsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public TreePredict.Builder getPredictsBuilder(
int index) {
return getPredictsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public TreePredictOrBuilder getPredictsOrBuilder(
int index) {
if (predictsBuilder_ == null) {
return predicts_.get(index); } else {
return predictsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public java.util.List<? extends TreePredictOrBuilder>
getPredictsOrBuilderList() {
if (predictsBuilder_ != null) {
return predictsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(predicts_);
}
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public TreePredict.Builder addPredictsBuilder() {
return getPredictsFieldBuilder().addBuilder(
TreePredict.getDefaultInstance());
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public TreePredict.Builder addPredictsBuilder(
int index) {
return getPredictsFieldBuilder().addBuilder(
index, TreePredict.getDefaultInstance());
}
/**
* <code>repeated .fgboost.TreePredict predicts = 1;</code>
*/
public java.util.List<TreePredict.Builder>
getPredictsBuilderList() {
return getPredictsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
TreePredict, TreePredict.Builder, TreePredictOrBuilder>
getPredictsFieldBuilder() {
if (predictsBuilder_ == null) {
predictsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
TreePredict, TreePredict.Builder, TreePredictOrBuilder>(
predicts_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
predicts_ = null;
}
return predictsBuilder_;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.BoostPredict)
}
// @@protoc_insertion_point(class_scope:fgboost.BoostPredict)
private static final BoostPredict DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new BoostPredict();
}
public static BoostPredict getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<BoostPredict>
PARSER = new com.google.protobuf.AbstractParser<BoostPredict>() {
@Override
public BoostPredict parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new BoostPredict(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<BoostPredict> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<BoostPredict> getParserForType() {
return PARSER;
}
@Override
public BoostPredict getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface BoostEvalOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.BoostEval)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
java.util.List<TreePredict>
getEvaluatesList();
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
TreePredict getEvaluates(int index);
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
int getEvaluatesCount();
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
java.util.List<? extends TreePredictOrBuilder>
getEvaluatesOrBuilderList();
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
TreePredictOrBuilder getEvaluatesOrBuilder(
int index);
}
/**
* Protobuf type {@code fgboost.BoostEval}
*/
public static final class BoostEval extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.BoostEval)
BoostEvalOrBuilder {
private static final long serialVersionUID = 0L;
// Use BoostEval.newBuilder() to construct.
private BoostEval(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private BoostEval() {
evaluates_ = java.util.Collections.emptyList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new BoostEval();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private BoostEval(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
evaluates_ = new java.util.ArrayList<TreePredict>();
mutable_bitField0_ |= 0x00000001;
}
evaluates_.add(
input.readMessage(TreePredict.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
evaluates_ = java.util.Collections.unmodifiableList(evaluates_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_BoostEval_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_BoostEval_fieldAccessorTable
.ensureFieldAccessorsInitialized(
BoostEval.class, Builder.class);
}
public static final int EVALUATES_FIELD_NUMBER = 1;
private java.util.List<TreePredict> evaluates_;
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
@Override
public java.util.List<TreePredict> getEvaluatesList() {
return evaluates_;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
@Override
public java.util.List<? extends TreePredictOrBuilder>
getEvaluatesOrBuilderList() {
return evaluates_;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
@Override
public int getEvaluatesCount() {
return evaluates_.size();
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
@Override
public TreePredict getEvaluates(int index) {
return evaluates_.get(index);
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
@Override
public TreePredictOrBuilder getEvaluatesOrBuilder(
int index) {
return evaluates_.get(index);
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < evaluates_.size(); i++) {
output.writeMessage(1, evaluates_.get(i));
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < evaluates_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, evaluates_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof BoostEval)) {
return super.equals(obj);
}
BoostEval other = (BoostEval) obj;
if (!getEvaluatesList()
.equals(other.getEvaluatesList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getEvaluatesCount() > 0) {
hash = (37 * hash) + EVALUATES_FIELD_NUMBER;
hash = (53 * hash) + getEvaluatesList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static BoostEval parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static BoostEval parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static BoostEval parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static BoostEval parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static BoostEval parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static BoostEval parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static BoostEval parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static BoostEval parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static BoostEval parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static BoostEval parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static BoostEval parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static BoostEval parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(BoostEval prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.BoostEval}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.BoostEval)
BoostEvalOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_BoostEval_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_BoostEval_fieldAccessorTable
.ensureFieldAccessorsInitialized(
BoostEval.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.BoostEval.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getEvaluatesFieldBuilder();
}
}
@Override
public Builder clear() {
super.clear();
if (evaluatesBuilder_ == null) {
evaluates_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
evaluatesBuilder_.clear();
}
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_BoostEval_descriptor;
}
@Override
public BoostEval getDefaultInstanceForType() {
return BoostEval.getDefaultInstance();
}
@Override
public BoostEval build() {
BoostEval result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public BoostEval buildPartial() {
BoostEval result = new BoostEval(this);
int from_bitField0_ = bitField0_;
if (evaluatesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
evaluates_ = java.util.Collections.unmodifiableList(evaluates_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.evaluates_ = evaluates_;
} else {
result.evaluates_ = evaluatesBuilder_.build();
}
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof BoostEval) {
return mergeFrom((BoostEval)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(BoostEval other) {
if (other == BoostEval.getDefaultInstance()) return this;
if (evaluatesBuilder_ == null) {
if (!other.evaluates_.isEmpty()) {
if (evaluates_.isEmpty()) {
evaluates_ = other.evaluates_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureEvaluatesIsMutable();
evaluates_.addAll(other.evaluates_);
}
onChanged();
}
} else {
if (!other.evaluates_.isEmpty()) {
if (evaluatesBuilder_.isEmpty()) {
evaluatesBuilder_.dispose();
evaluatesBuilder_ = null;
evaluates_ = other.evaluates_;
bitField0_ = (bitField0_ & ~0x00000001);
evaluatesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getEvaluatesFieldBuilder() : null;
} else {
evaluatesBuilder_.addAllMessages(other.evaluates_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
BoostEval parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (BoostEval) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<TreePredict> evaluates_ =
java.util.Collections.emptyList();
private void ensureEvaluatesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
evaluates_ = new java.util.ArrayList<TreePredict>(evaluates_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
TreePredict, TreePredict.Builder, TreePredictOrBuilder> evaluatesBuilder_;
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public java.util.List<TreePredict> getEvaluatesList() {
if (evaluatesBuilder_ == null) {
return java.util.Collections.unmodifiableList(evaluates_);
} else {
return evaluatesBuilder_.getMessageList();
}
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public int getEvaluatesCount() {
if (evaluatesBuilder_ == null) {
return evaluates_.size();
} else {
return evaluatesBuilder_.getCount();
}
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public TreePredict getEvaluates(int index) {
if (evaluatesBuilder_ == null) {
return evaluates_.get(index);
} else {
return evaluatesBuilder_.getMessage(index);
}
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder setEvaluates(
int index, TreePredict value) {
if (evaluatesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEvaluatesIsMutable();
evaluates_.set(index, value);
onChanged();
} else {
evaluatesBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder setEvaluates(
int index, TreePredict.Builder builderForValue) {
if (evaluatesBuilder_ == null) {
ensureEvaluatesIsMutable();
evaluates_.set(index, builderForValue.build());
onChanged();
} else {
evaluatesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder addEvaluates(TreePredict value) {
if (evaluatesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEvaluatesIsMutable();
evaluates_.add(value);
onChanged();
} else {
evaluatesBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder addEvaluates(
int index, TreePredict value) {
if (evaluatesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEvaluatesIsMutable();
evaluates_.add(index, value);
onChanged();
} else {
evaluatesBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder addEvaluates(
TreePredict.Builder builderForValue) {
if (evaluatesBuilder_ == null) {
ensureEvaluatesIsMutable();
evaluates_.add(builderForValue.build());
onChanged();
} else {
evaluatesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder addEvaluates(
int index, TreePredict.Builder builderForValue) {
if (evaluatesBuilder_ == null) {
ensureEvaluatesIsMutable();
evaluates_.add(index, builderForValue.build());
onChanged();
} else {
evaluatesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder addAllEvaluates(
Iterable<? extends TreePredict> values) {
if (evaluatesBuilder_ == null) {
ensureEvaluatesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, evaluates_);
onChanged();
} else {
evaluatesBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder clearEvaluates() {
if (evaluatesBuilder_ == null) {
evaluates_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
evaluatesBuilder_.clear();
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public Builder removeEvaluates(int index) {
if (evaluatesBuilder_ == null) {
ensureEvaluatesIsMutable();
evaluates_.remove(index);
onChanged();
} else {
evaluatesBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public TreePredict.Builder getEvaluatesBuilder(
int index) {
return getEvaluatesFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public TreePredictOrBuilder getEvaluatesOrBuilder(
int index) {
if (evaluatesBuilder_ == null) {
return evaluates_.get(index); } else {
return evaluatesBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public java.util.List<? extends TreePredictOrBuilder>
getEvaluatesOrBuilderList() {
if (evaluatesBuilder_ != null) {
return evaluatesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(evaluates_);
}
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public TreePredict.Builder addEvaluatesBuilder() {
return getEvaluatesFieldBuilder().addBuilder(
TreePredict.getDefaultInstance());
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public TreePredict.Builder addEvaluatesBuilder(
int index) {
return getEvaluatesFieldBuilder().addBuilder(
index, TreePredict.getDefaultInstance());
}
/**
* <code>repeated .fgboost.TreePredict evaluates = 1;</code>
*/
public java.util.List<TreePredict.Builder>
getEvaluatesBuilderList() {
return getEvaluatesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
TreePredict, TreePredict.Builder, TreePredictOrBuilder>
getEvaluatesFieldBuilder() {
if (evaluatesBuilder_ == null) {
evaluatesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
TreePredict, TreePredict.Builder, TreePredictOrBuilder>(
evaluates_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
evaluates_ = null;
}
return evaluatesBuilder_;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.BoostEval)
}
// @@protoc_insertion_point(class_scope:fgboost.BoostEval)
private static final BoostEval DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new BoostEval();
}
public static BoostEval getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<BoostEval>
PARSER = new com.google.protobuf.AbstractParser<BoostEval>() {
@Override
public BoostEval parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new BoostEval(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<BoostEval> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<BoostEval> getParserForType() {
return PARSER;
}
@Override
public BoostEval getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface RegisterRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.RegisterRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>string token = 2;</code>
* @return The token.
*/
String getToken();
/**
* <code>string token = 2;</code>
* @return The bytes for token.
*/
com.google.protobuf.ByteString
getTokenBytes();
}
/**
* Protobuf type {@code fgboost.RegisterRequest}
*/
public static final class RegisterRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.RegisterRequest)
RegisterRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use RegisterRequest.newBuilder() to construct.
private RegisterRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private RegisterRequest() {
clientuuid_ = "";
token_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new RegisterRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RegisterRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 18: {
String s = input.readStringRequireUtf8();
token_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_RegisterRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_RegisterRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
RegisterRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TOKEN_FIELD_NUMBER = 2;
private volatile Object token_;
/**
* <code>string token = 2;</code>
* @return The token.
*/
@Override
public String getToken() {
Object ref = token_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
token_ = s;
return s;
}
}
/**
* <code>string token = 2;</code>
* @return The bytes for token.
*/
@Override
public com.google.protobuf.ByteString
getTokenBytes() {
Object ref = token_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
token_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
if (!getTokenBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, token_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
if (!getTokenBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, token_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof RegisterRequest)) {
return super.equals(obj);
}
RegisterRequest other = (RegisterRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (!getToken()
.equals(other.getToken())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
hash = (37 * hash) + TOKEN_FIELD_NUMBER;
hash = (53 * hash) + getToken().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static RegisterRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static RegisterRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static RegisterRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static RegisterRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static RegisterRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static RegisterRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static RegisterRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static RegisterRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static RegisterRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static RegisterRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static RegisterRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static RegisterRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(RegisterRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.RegisterRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.RegisterRequest)
RegisterRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_RegisterRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_RegisterRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
RegisterRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.RegisterRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
token_ = "";
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_RegisterRequest_descriptor;
}
@Override
public RegisterRequest getDefaultInstanceForType() {
return RegisterRequest.getDefaultInstance();
}
@Override
public RegisterRequest build() {
RegisterRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public RegisterRequest buildPartial() {
RegisterRequest result = new RegisterRequest(this);
result.clientuuid_ = clientuuid_;
result.token_ = token_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof RegisterRequest) {
return mergeFrom((RegisterRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(RegisterRequest other) {
if (other == RegisterRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (!other.getToken().isEmpty()) {
token_ = other.token_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
RegisterRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (RegisterRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private Object token_ = "";
/**
* <code>string token = 2;</code>
* @return The token.
*/
public String getToken() {
Object ref = token_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
token_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string token = 2;</code>
* @return The bytes for token.
*/
public com.google.protobuf.ByteString
getTokenBytes() {
Object ref = token_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
token_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string token = 2;</code>
* @param value The token to set.
* @return This builder for chaining.
*/
public Builder setToken(
String value) {
if (value == null) {
throw new NullPointerException();
}
token_ = value;
onChanged();
return this;
}
/**
* <code>string token = 2;</code>
* @return This builder for chaining.
*/
public Builder clearToken() {
token_ = getDefaultInstance().getToken();
onChanged();
return this;
}
/**
* <code>string token = 2;</code>
* @param value The bytes for token to set.
* @return This builder for chaining.
*/
public Builder setTokenBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
token_ = value;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.RegisterRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.RegisterRequest)
private static final RegisterRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new RegisterRequest();
}
public static RegisterRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<RegisterRequest>
PARSER = new com.google.protobuf.AbstractParser<RegisterRequest>() {
@Override
public RegisterRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RegisterRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<RegisterRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<RegisterRequest> getParserForType() {
return PARSER;
}
@Override
public RegisterRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface RegisterResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.RegisterResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string response = 1;</code>
* @return The response.
*/
String getResponse();
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
com.google.protobuf.ByteString
getResponseBytes();
/**
* <code>int32 code = 2;</code>
* @return The code.
*/
int getCode();
}
/**
* Protobuf type {@code fgboost.RegisterResponse}
*/
public static final class RegisterResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.RegisterResponse)
RegisterResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use RegisterResponse.newBuilder() to construct.
private RegisterResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private RegisterResponse() {
response_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new RegisterResponse();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RegisterResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
response_ = s;
break;
}
case 16: {
code_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_RegisterResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_RegisterResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
RegisterResponse.class, Builder.class);
}
public static final int RESPONSE_FIELD_NUMBER = 1;
private volatile Object response_;
/**
* <code>string response = 1;</code>
* @return The response.
*/
@Override
public String getResponse() {
Object ref = response_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
@Override
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CODE_FIELD_NUMBER = 2;
private int code_;
/**
* <code>int32 code = 2;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getResponseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_);
}
if (code_ != 0) {
output.writeInt32(2, code_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getResponseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_);
}
if (code_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, code_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof RegisterResponse)) {
return super.equals(obj);
}
RegisterResponse other = (RegisterResponse) obj;
if (!getResponse()
.equals(other.getResponse())) return false;
if (getCode()
!= other.getCode()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getResponse().hashCode();
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + getCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static RegisterResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static RegisterResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static RegisterResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static RegisterResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static RegisterResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static RegisterResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static RegisterResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static RegisterResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static RegisterResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static RegisterResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static RegisterResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static RegisterResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(RegisterResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.RegisterResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.RegisterResponse)
RegisterResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_RegisterResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_RegisterResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
RegisterResponse.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.RegisterResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
response_ = "";
code_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_RegisterResponse_descriptor;
}
@Override
public RegisterResponse getDefaultInstanceForType() {
return RegisterResponse.getDefaultInstance();
}
@Override
public RegisterResponse build() {
RegisterResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public RegisterResponse buildPartial() {
RegisterResponse result = new RegisterResponse(this);
result.response_ = response_;
result.code_ = code_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof RegisterResponse) {
return mergeFrom((RegisterResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(RegisterResponse other) {
if (other == RegisterResponse.getDefaultInstance()) return this;
if (!other.getResponse().isEmpty()) {
response_ = other.response_;
onChanged();
}
if (other.getCode() != 0) {
setCode(other.getCode());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
RegisterResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (RegisterResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object response_ = "";
/**
* <code>string response = 1;</code>
* @return The response.
*/
public String getResponse() {
Object ref = response_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string response = 1;</code>
* @param value The response to set.
* @return This builder for chaining.
*/
public Builder setResponse(
String value) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @return This builder for chaining.
*/
public Builder clearResponse() {
response_ = getDefaultInstance().getResponse();
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @param value The bytes for response to set.
* @return This builder for chaining.
*/
public Builder setResponseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
response_ = value;
onChanged();
return this;
}
private int code_ ;
/**
* <code>int32 code = 2;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
/**
* <code>int32 code = 2;</code>
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(int value) {
code_ = value;
onChanged();
return this;
}
/**
* <code>int32 code = 2;</code>
* @return This builder for chaining.
*/
public Builder clearCode() {
code_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.RegisterResponse)
}
// @@protoc_insertion_point(class_scope:fgboost.RegisterResponse)
private static final RegisterResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new RegisterResponse();
}
public static RegisterResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<RegisterResponse>
PARSER = new com.google.protobuf.AbstractParser<RegisterResponse>() {
@Override
public RegisterResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RegisterResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<RegisterResponse> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<RegisterResponse> getParserForType() {
return PARSER;
}
@Override
public RegisterResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface UploadTreeEvalRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.UploadTreeEvalRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>int32 version = 2;</code>
* @return The version.
*/
int getVersion();
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
java.util.List<BoostEval>
getTreeEvalList();
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
BoostEval getTreeEval(int index);
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
int getTreeEvalCount();
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList();
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
BoostEvalOrBuilder getTreeEvalOrBuilder(
int index);
}
/**
* Protobuf type {@code fgboost.UploadTreeEvalRequest}
*/
public static final class UploadTreeEvalRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.UploadTreeEvalRequest)
UploadTreeEvalRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use UploadTreeEvalRequest.newBuilder() to construct.
private UploadTreeEvalRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private UploadTreeEvalRequest() {
clientuuid_ = "";
treeEval_ = java.util.Collections.emptyList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new UploadTreeEvalRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private UploadTreeEvalRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 16: {
version_ = input.readInt32();
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
treeEval_ = new java.util.ArrayList<BoostEval>();
mutable_bitField0_ |= 0x00000001;
}
treeEval_.add(
input.readMessage(BoostEval.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
treeEval_ = java.util.Collections.unmodifiableList(treeEval_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeEvalRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeEvalRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadTreeEvalRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VERSION_FIELD_NUMBER = 2;
private int version_;
/**
* <code>int32 version = 2;</code>
* @return The version.
*/
@Override
public int getVersion() {
return version_;
}
public static final int TREEEVAL_FIELD_NUMBER = 3;
private java.util.List<BoostEval> treeEval_;
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
@Override
public java.util.List<BoostEval> getTreeEvalList() {
return treeEval_;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
@Override
public java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList() {
return treeEval_;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
@Override
public int getTreeEvalCount() {
return treeEval_.size();
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
@Override
public BoostEval getTreeEval(int index) {
return treeEval_.get(index);
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
@Override
public BoostEvalOrBuilder getTreeEvalOrBuilder(
int index) {
return treeEval_.get(index);
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
if (version_ != 0) {
output.writeInt32(2, version_);
}
for (int i = 0; i < treeEval_.size(); i++) {
output.writeMessage(3, treeEval_.get(i));
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
if (version_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, version_);
}
for (int i = 0; i < treeEval_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, treeEval_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof UploadTreeEvalRequest)) {
return super.equals(obj);
}
UploadTreeEvalRequest other = (UploadTreeEvalRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (getVersion()
!= other.getVersion()) return false;
if (!getTreeEvalList()
.equals(other.getTreeEvalList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
hash = (37 * hash) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + getVersion();
if (getTreeEvalCount() > 0) {
hash = (37 * hash) + TREEEVAL_FIELD_NUMBER;
hash = (53 * hash) + getTreeEvalList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static UploadTreeEvalRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadTreeEvalRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadTreeEvalRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadTreeEvalRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadTreeEvalRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static UploadTreeEvalRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static UploadTreeEvalRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadTreeEvalRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static UploadTreeEvalRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static UploadTreeEvalRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static UploadTreeEvalRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static UploadTreeEvalRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(UploadTreeEvalRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.UploadTreeEvalRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.UploadTreeEvalRequest)
UploadTreeEvalRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeEvalRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeEvalRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
UploadTreeEvalRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.UploadTreeEvalRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getTreeEvalFieldBuilder();
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
version_ = 0;
if (treeEvalBuilder_ == null) {
treeEval_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
treeEvalBuilder_.clear();
}
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_UploadTreeEvalRequest_descriptor;
}
@Override
public UploadTreeEvalRequest getDefaultInstanceForType() {
return UploadTreeEvalRequest.getDefaultInstance();
}
@Override
public UploadTreeEvalRequest build() {
UploadTreeEvalRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public UploadTreeEvalRequest buildPartial() {
UploadTreeEvalRequest result = new UploadTreeEvalRequest(this);
int from_bitField0_ = bitField0_;
result.clientuuid_ = clientuuid_;
result.version_ = version_;
if (treeEvalBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
treeEval_ = java.util.Collections.unmodifiableList(treeEval_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.treeEval_ = treeEval_;
} else {
result.treeEval_ = treeEvalBuilder_.build();
}
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof UploadTreeEvalRequest) {
return mergeFrom((UploadTreeEvalRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(UploadTreeEvalRequest other) {
if (other == UploadTreeEvalRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (other.getVersion() != 0) {
setVersion(other.getVersion());
}
if (treeEvalBuilder_ == null) {
if (!other.treeEval_.isEmpty()) {
if (treeEval_.isEmpty()) {
treeEval_ = other.treeEval_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureTreeEvalIsMutable();
treeEval_.addAll(other.treeEval_);
}
onChanged();
}
} else {
if (!other.treeEval_.isEmpty()) {
if (treeEvalBuilder_.isEmpty()) {
treeEvalBuilder_.dispose();
treeEvalBuilder_ = null;
treeEval_ = other.treeEval_;
bitField0_ = (bitField0_ & ~0x00000001);
treeEvalBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getTreeEvalFieldBuilder() : null;
} else {
treeEvalBuilder_.addAllMessages(other.treeEval_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
UploadTreeEvalRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (UploadTreeEvalRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private int version_ ;
/**
* <code>int32 version = 2;</code>
* @return The version.
*/
@Override
public int getVersion() {
return version_;
}
/**
* <code>int32 version = 2;</code>
* @param value The version to set.
* @return This builder for chaining.
*/
public Builder setVersion(int value) {
version_ = value;
onChanged();
return this;
}
/**
* <code>int32 version = 2;</code>
* @return This builder for chaining.
*/
public Builder clearVersion() {
version_ = 0;
onChanged();
return this;
}
private java.util.List<BoostEval> treeEval_ =
java.util.Collections.emptyList();
private void ensureTreeEvalIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
treeEval_ = new java.util.ArrayList<BoostEval>(treeEval_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder> treeEvalBuilder_;
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public java.util.List<BoostEval> getTreeEvalList() {
if (treeEvalBuilder_ == null) {
return java.util.Collections.unmodifiableList(treeEval_);
} else {
return treeEvalBuilder_.getMessageList();
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public int getTreeEvalCount() {
if (treeEvalBuilder_ == null) {
return treeEval_.size();
} else {
return treeEvalBuilder_.getCount();
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public BoostEval getTreeEval(int index) {
if (treeEvalBuilder_ == null) {
return treeEval_.get(index);
} else {
return treeEvalBuilder_.getMessage(index);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder setTreeEval(
int index, BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.set(index, value);
onChanged();
} else {
treeEvalBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder setTreeEval(
int index, BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.set(index, builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder addTreeEval(BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.add(value);
onChanged();
} else {
treeEvalBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder addTreeEval(
int index, BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.add(index, value);
onChanged();
} else {
treeEvalBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder addTreeEval(
BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.add(builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder addTreeEval(
int index, BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.add(index, builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder addAllTreeEval(
Iterable<? extends BoostEval> values) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, treeEval_);
onChanged();
} else {
treeEvalBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder clearTreeEval() {
if (treeEvalBuilder_ == null) {
treeEval_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
treeEvalBuilder_.clear();
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public Builder removeTreeEval(int index) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.remove(index);
onChanged();
} else {
treeEvalBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public BoostEval.Builder getTreeEvalBuilder(
int index) {
return getTreeEvalFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public BoostEvalOrBuilder getTreeEvalOrBuilder(
int index) {
if (treeEvalBuilder_ == null) {
return treeEval_.get(index); } else {
return treeEvalBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList() {
if (treeEvalBuilder_ != null) {
return treeEvalBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(treeEval_);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public BoostEval.Builder addTreeEvalBuilder() {
return getTreeEvalFieldBuilder().addBuilder(
BoostEval.getDefaultInstance());
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public BoostEval.Builder addTreeEvalBuilder(
int index) {
return getTreeEvalFieldBuilder().addBuilder(
index, BoostEval.getDefaultInstance());
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 3;</code>
*/
public java.util.List<BoostEval.Builder>
getTreeEvalBuilderList() {
return getTreeEvalFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder>
getTreeEvalFieldBuilder() {
if (treeEvalBuilder_ == null) {
treeEvalBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder>(
treeEval_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
treeEval_ = null;
}
return treeEvalBuilder_;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.UploadTreeEvalRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.UploadTreeEvalRequest)
private static final UploadTreeEvalRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new UploadTreeEvalRequest();
}
public static UploadTreeEvalRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<UploadTreeEvalRequest>
PARSER = new com.google.protobuf.AbstractParser<UploadTreeEvalRequest>() {
@Override
public UploadTreeEvalRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new UploadTreeEvalRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<UploadTreeEvalRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<UploadTreeEvalRequest> getParserForType() {
return PARSER;
}
@Override
public UploadTreeEvalRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface EvaluateRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.EvaluateRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
java.util.List<BoostEval>
getTreeEvalList();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
BoostEval getTreeEval(int index);
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
int getTreeEvalCount();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
BoostEvalOrBuilder getTreeEvalOrBuilder(
int index);
/**
* <code>int32 bsVersion = 3;</code>
* @return The bsVersion.
*/
int getBsVersion();
}
/**
* Protobuf type {@code fgboost.EvaluateRequest}
*/
public static final class EvaluateRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.EvaluateRequest)
EvaluateRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use EvaluateRequest.newBuilder() to construct.
private EvaluateRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private EvaluateRequest() {
clientuuid_ = "";
treeEval_ = java.util.Collections.emptyList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new EvaluateRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private EvaluateRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
treeEval_ = new java.util.ArrayList<BoostEval>();
mutable_bitField0_ |= 0x00000001;
}
treeEval_.add(
input.readMessage(BoostEval.parser(), extensionRegistry));
break;
}
case 24: {
bsVersion_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
treeEval_ = java.util.Collections.unmodifiableList(treeEval_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
EvaluateRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TREEEVAL_FIELD_NUMBER = 2;
private java.util.List<BoostEval> treeEval_;
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public java.util.List<BoostEval> getTreeEvalList() {
return treeEval_;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList() {
return treeEval_;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public int getTreeEvalCount() {
return treeEval_.size();
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public BoostEval getTreeEval(int index) {
return treeEval_.get(index);
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public BoostEvalOrBuilder getTreeEvalOrBuilder(
int index) {
return treeEval_.get(index);
}
public static final int BSVERSION_FIELD_NUMBER = 3;
private int bsVersion_;
/**
* <code>int32 bsVersion = 3;</code>
* @return The bsVersion.
*/
@Override
public int getBsVersion() {
return bsVersion_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
for (int i = 0; i < treeEval_.size(); i++) {
output.writeMessage(2, treeEval_.get(i));
}
if (bsVersion_ != 0) {
output.writeInt32(3, bsVersion_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
for (int i = 0; i < treeEval_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, treeEval_.get(i));
}
if (bsVersion_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, bsVersion_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof EvaluateRequest)) {
return super.equals(obj);
}
EvaluateRequest other = (EvaluateRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (!getTreeEvalList()
.equals(other.getTreeEvalList())) return false;
if (getBsVersion()
!= other.getBsVersion()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
if (getTreeEvalCount() > 0) {
hash = (37 * hash) + TREEEVAL_FIELD_NUMBER;
hash = (53 * hash) + getTreeEvalList().hashCode();
}
hash = (37 * hash) + BSVERSION_FIELD_NUMBER;
hash = (53 * hash) + getBsVersion();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static EvaluateRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static EvaluateRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static EvaluateRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static EvaluateRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static EvaluateRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static EvaluateRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static EvaluateRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static EvaluateRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static EvaluateRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static EvaluateRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static EvaluateRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static EvaluateRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(EvaluateRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.EvaluateRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.EvaluateRequest)
EvaluateRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
EvaluateRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.EvaluateRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getTreeEvalFieldBuilder();
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
if (treeEvalBuilder_ == null) {
treeEval_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
treeEvalBuilder_.clear();
}
bsVersion_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateRequest_descriptor;
}
@Override
public EvaluateRequest getDefaultInstanceForType() {
return EvaluateRequest.getDefaultInstance();
}
@Override
public EvaluateRequest build() {
EvaluateRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public EvaluateRequest buildPartial() {
EvaluateRequest result = new EvaluateRequest(this);
int from_bitField0_ = bitField0_;
result.clientuuid_ = clientuuid_;
if (treeEvalBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
treeEval_ = java.util.Collections.unmodifiableList(treeEval_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.treeEval_ = treeEval_;
} else {
result.treeEval_ = treeEvalBuilder_.build();
}
result.bsVersion_ = bsVersion_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof EvaluateRequest) {
return mergeFrom((EvaluateRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(EvaluateRequest other) {
if (other == EvaluateRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (treeEvalBuilder_ == null) {
if (!other.treeEval_.isEmpty()) {
if (treeEval_.isEmpty()) {
treeEval_ = other.treeEval_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureTreeEvalIsMutable();
treeEval_.addAll(other.treeEval_);
}
onChanged();
}
} else {
if (!other.treeEval_.isEmpty()) {
if (treeEvalBuilder_.isEmpty()) {
treeEvalBuilder_.dispose();
treeEvalBuilder_ = null;
treeEval_ = other.treeEval_;
bitField0_ = (bitField0_ & ~0x00000001);
treeEvalBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getTreeEvalFieldBuilder() : null;
} else {
treeEvalBuilder_.addAllMessages(other.treeEval_);
}
}
}
if (other.getBsVersion() != 0) {
setBsVersion(other.getBsVersion());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
EvaluateRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (EvaluateRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private java.util.List<BoostEval> treeEval_ =
java.util.Collections.emptyList();
private void ensureTreeEvalIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
treeEval_ = new java.util.ArrayList<BoostEval>(treeEval_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder> treeEvalBuilder_;
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public java.util.List<BoostEval> getTreeEvalList() {
if (treeEvalBuilder_ == null) {
return java.util.Collections.unmodifiableList(treeEval_);
} else {
return treeEvalBuilder_.getMessageList();
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public int getTreeEvalCount() {
if (treeEvalBuilder_ == null) {
return treeEval_.size();
} else {
return treeEvalBuilder_.getCount();
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval getTreeEval(int index) {
if (treeEvalBuilder_ == null) {
return treeEval_.get(index);
} else {
return treeEvalBuilder_.getMessage(index);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder setTreeEval(
int index, BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.set(index, value);
onChanged();
} else {
treeEvalBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder setTreeEval(
int index, BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.set(index, builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.add(value);
onChanged();
} else {
treeEvalBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(
int index, BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.add(index, value);
onChanged();
} else {
treeEvalBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(
BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.add(builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(
int index, BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.add(index, builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addAllTreeEval(
Iterable<? extends BoostEval> values) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, treeEval_);
onChanged();
} else {
treeEvalBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder clearTreeEval() {
if (treeEvalBuilder_ == null) {
treeEval_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
treeEvalBuilder_.clear();
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder removeTreeEval(int index) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.remove(index);
onChanged();
} else {
treeEvalBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval.Builder getTreeEvalBuilder(
int index) {
return getTreeEvalFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEvalOrBuilder getTreeEvalOrBuilder(
int index) {
if (treeEvalBuilder_ == null) {
return treeEval_.get(index); } else {
return treeEvalBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList() {
if (treeEvalBuilder_ != null) {
return treeEvalBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(treeEval_);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval.Builder addTreeEvalBuilder() {
return getTreeEvalFieldBuilder().addBuilder(
BoostEval.getDefaultInstance());
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval.Builder addTreeEvalBuilder(
int index) {
return getTreeEvalFieldBuilder().addBuilder(
index, BoostEval.getDefaultInstance());
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public java.util.List<BoostEval.Builder>
getTreeEvalBuilderList() {
return getTreeEvalFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder>
getTreeEvalFieldBuilder() {
if (treeEvalBuilder_ == null) {
treeEvalBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder>(
treeEval_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
treeEval_ = null;
}
return treeEvalBuilder_;
}
private int bsVersion_ ;
/**
* <code>int32 bsVersion = 3;</code>
* @return The bsVersion.
*/
@Override
public int getBsVersion() {
return bsVersion_;
}
/**
* <code>int32 bsVersion = 3;</code>
* @param value The bsVersion to set.
* @return This builder for chaining.
*/
public Builder setBsVersion(int value) {
bsVersion_ = value;
onChanged();
return this;
}
/**
* <code>int32 bsVersion = 3;</code>
* @return This builder for chaining.
*/
public Builder clearBsVersion() {
bsVersion_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.EvaluateRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.EvaluateRequest)
private static final EvaluateRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new EvaluateRequest();
}
public static EvaluateRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<EvaluateRequest>
PARSER = new com.google.protobuf.AbstractParser<EvaluateRequest>() {
@Override
public EvaluateRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new EvaluateRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<EvaluateRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<EvaluateRequest> getParserForType() {
return PARSER;
}
@Override
public EvaluateRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface EvaluateResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.EvaluateResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string response = 1;</code>
* @return The response.
*/
String getResponse();
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
com.google.protobuf.ByteString
getResponseBytes();
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
boolean hasData();
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
FlBaseProto.TensorMap getData();
/**
* <code>.TensorMap data = 2;</code>
*/
FlBaseProto.TensorMapOrBuilder getDataOrBuilder();
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
int getCode();
/**
* <code>string message = 4;</code>
* @return The message.
*/
String getMessage();
/**
* <code>string message = 4;</code>
* @return The bytes for message.
*/
com.google.protobuf.ByteString
getMessageBytes();
}
/**
* Protobuf type {@code fgboost.EvaluateResponse}
*/
public static final class EvaluateResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.EvaluateResponse)
EvaluateResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use EvaluateResponse.newBuilder() to construct.
private EvaluateResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private EvaluateResponse() {
response_ = "";
message_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new EvaluateResponse();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private EvaluateResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
response_ = s;
break;
}
case 18: {
FlBaseProto.TensorMap.Builder subBuilder = null;
if (data_ != null) {
subBuilder = data_.toBuilder();
}
data_ = input.readMessage(FlBaseProto.TensorMap.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(data_);
data_ = subBuilder.buildPartial();
}
break;
}
case 24: {
code_ = input.readInt32();
break;
}
case 34: {
String s = input.readStringRequireUtf8();
message_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
EvaluateResponse.class, Builder.class);
}
public static final int RESPONSE_FIELD_NUMBER = 1;
private volatile Object response_;
/**
* <code>string response = 1;</code>
* @return The response.
*/
@Override
public String getResponse() {
Object ref = response_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
@Override
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DATA_FIELD_NUMBER = 2;
private FlBaseProto.TensorMap data_;
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
@Override
public boolean hasData() {
return data_ != null;
}
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
@Override
public FlBaseProto.TensorMap getData() {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
/**
* <code>.TensorMap data = 2;</code>
*/
@Override
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
return getData();
}
public static final int CODE_FIELD_NUMBER = 3;
private int code_;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
public static final int MESSAGE_FIELD_NUMBER = 4;
private volatile Object message_;
/**
* <code>string message = 4;</code>
* @return The message.
*/
@Override
public String getMessage() {
Object ref = message_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
message_ = s;
return s;
}
}
/**
* <code>string message = 4;</code>
* @return The bytes for message.
*/
@Override
public com.google.protobuf.ByteString
getMessageBytes() {
Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getResponseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_);
}
if (data_ != null) {
output.writeMessage(2, getData());
}
if (code_ != 0) {
output.writeInt32(3, code_);
}
if (!getMessageBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, message_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getResponseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_);
}
if (data_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getData());
}
if (code_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, code_);
}
if (!getMessageBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, message_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof EvaluateResponse)) {
return super.equals(obj);
}
EvaluateResponse other = (EvaluateResponse) obj;
if (!getResponse()
.equals(other.getResponse())) return false;
if (hasData() != other.hasData()) return false;
if (hasData()) {
if (!getData()
.equals(other.getData())) return false;
}
if (getCode()
!= other.getCode()) return false;
if (!getMessage()
.equals(other.getMessage())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getResponse().hashCode();
if (hasData()) {
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getData().hashCode();
}
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + getCode();
hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getMessage().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static EvaluateResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static EvaluateResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static EvaluateResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static EvaluateResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static EvaluateResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static EvaluateResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static EvaluateResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static EvaluateResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static EvaluateResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static EvaluateResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static EvaluateResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static EvaluateResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(EvaluateResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.EvaluateResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.EvaluateResponse)
EvaluateResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
EvaluateResponse.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.EvaluateResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
response_ = "";
if (dataBuilder_ == null) {
data_ = null;
} else {
data_ = null;
dataBuilder_ = null;
}
code_ = 0;
message_ = "";
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_EvaluateResponse_descriptor;
}
@Override
public EvaluateResponse getDefaultInstanceForType() {
return EvaluateResponse.getDefaultInstance();
}
@Override
public EvaluateResponse build() {
EvaluateResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public EvaluateResponse buildPartial() {
EvaluateResponse result = new EvaluateResponse(this);
result.response_ = response_;
if (dataBuilder_ == null) {
result.data_ = data_;
} else {
result.data_ = dataBuilder_.build();
}
result.code_ = code_;
result.message_ = message_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof EvaluateResponse) {
return mergeFrom((EvaluateResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(EvaluateResponse other) {
if (other == EvaluateResponse.getDefaultInstance()) return this;
if (!other.getResponse().isEmpty()) {
response_ = other.response_;
onChanged();
}
if (other.hasData()) {
mergeData(other.getData());
}
if (other.getCode() != 0) {
setCode(other.getCode());
}
if (!other.getMessage().isEmpty()) {
message_ = other.message_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
EvaluateResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (EvaluateResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object response_ = "";
/**
* <code>string response = 1;</code>
* @return The response.
*/
public String getResponse() {
Object ref = response_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string response = 1;</code>
* @param value The response to set.
* @return This builder for chaining.
*/
public Builder setResponse(
String value) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @return This builder for chaining.
*/
public Builder clearResponse() {
response_ = getDefaultInstance().getResponse();
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @param value The bytes for response to set.
* @return This builder for chaining.
*/
public Builder setResponseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
response_ = value;
onChanged();
return this;
}
private FlBaseProto.TensorMap data_;
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder> dataBuilder_;
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
public boolean hasData() {
return dataBuilder_ != null || data_ != null;
}
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
public FlBaseProto.TensorMap getData() {
if (dataBuilder_ == null) {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
} else {
return dataBuilder_.getMessage();
}
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder setData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
} else {
dataBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder setData(
FlBaseProto.TensorMap.Builder builderForValue) {
if (dataBuilder_ == null) {
data_ = builderForValue.build();
onChanged();
} else {
dataBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder mergeData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (data_ != null) {
data_ =
FlBaseProto.TensorMap.newBuilder(data_).mergeFrom(value).buildPartial();
} else {
data_ = value;
}
onChanged();
} else {
dataBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder clearData() {
if (dataBuilder_ == null) {
data_ = null;
onChanged();
} else {
data_ = null;
dataBuilder_ = null;
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public FlBaseProto.TensorMap.Builder getDataBuilder() {
onChanged();
return getDataFieldBuilder().getBuilder();
}
/**
* <code>.TensorMap data = 2;</code>
*/
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
if (dataBuilder_ != null) {
return dataBuilder_.getMessageOrBuilder();
} else {
return data_ == null ?
FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
}
/**
* <code>.TensorMap data = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>
getDataFieldBuilder() {
if (dataBuilder_ == null) {
dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>(
getData(),
getParentForChildren(),
isClean());
data_ = null;
}
return dataBuilder_;
}
private int code_ ;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
/**
* <code>int32 code = 3;</code>
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(int value) {
code_ = value;
onChanged();
return this;
}
/**
* <code>int32 code = 3;</code>
* @return This builder for chaining.
*/
public Builder clearCode() {
code_ = 0;
onChanged();
return this;
}
private Object message_ = "";
/**
* <code>string message = 4;</code>
* @return The message.
*/
public String getMessage() {
Object ref = message_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
message_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string message = 4;</code>
* @return The bytes for message.
*/
public com.google.protobuf.ByteString
getMessageBytes() {
Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string message = 4;</code>
* @param value The message to set.
* @return This builder for chaining.
*/
public Builder setMessage(
String value) {
if (value == null) {
throw new NullPointerException();
}
message_ = value;
onChanged();
return this;
}
/**
* <code>string message = 4;</code>
* @return This builder for chaining.
*/
public Builder clearMessage() {
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
/**
* <code>string message = 4;</code>
* @param value The bytes for message to set.
* @return This builder for chaining.
*/
public Builder setMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
message_ = value;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.EvaluateResponse)
}
// @@protoc_insertion_point(class_scope:fgboost.EvaluateResponse)
private static final EvaluateResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new EvaluateResponse();
}
public static EvaluateResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<EvaluateResponse>
PARSER = new com.google.protobuf.AbstractParser<EvaluateResponse>() {
@Override
public EvaluateResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new EvaluateResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<EvaluateResponse> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<EvaluateResponse> getParserForType() {
return PARSER;
}
@Override
public EvaluateResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface PredictRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.PredictRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
java.util.List<BoostEval>
getTreeEvalList();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
BoostEval getTreeEval(int index);
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
int getTreeEvalCount();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList();
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
BoostEvalOrBuilder getTreeEvalOrBuilder(
int index);
/**
* <code>int32 bsVersion = 3;</code>
* @return The bsVersion.
*/
int getBsVersion();
}
/**
* Protobuf type {@code fgboost.PredictRequest}
*/
public static final class PredictRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.PredictRequest)
PredictRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use PredictRequest.newBuilder() to construct.
private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private PredictRequest() {
clientuuid_ = "";
treeEval_ = java.util.Collections.emptyList();
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new PredictRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PredictRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
treeEval_ = new java.util.ArrayList<BoostEval>();
mutable_bitField0_ |= 0x00000001;
}
treeEval_.add(
input.readMessage(BoostEval.parser(), extensionRegistry));
break;
}
case 24: {
bsVersion_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
treeEval_ = java.util.Collections.unmodifiableList(treeEval_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_PredictRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_PredictRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
PredictRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TREEEVAL_FIELD_NUMBER = 2;
private java.util.List<BoostEval> treeEval_;
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public java.util.List<BoostEval> getTreeEvalList() {
return treeEval_;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList() {
return treeEval_;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public int getTreeEvalCount() {
return treeEval_.size();
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public BoostEval getTreeEval(int index) {
return treeEval_.get(index);
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
@Override
public BoostEvalOrBuilder getTreeEvalOrBuilder(
int index) {
return treeEval_.get(index);
}
public static final int BSVERSION_FIELD_NUMBER = 3;
private int bsVersion_;
/**
* <code>int32 bsVersion = 3;</code>
* @return The bsVersion.
*/
@Override
public int getBsVersion() {
return bsVersion_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
for (int i = 0; i < treeEval_.size(); i++) {
output.writeMessage(2, treeEval_.get(i));
}
if (bsVersion_ != 0) {
output.writeInt32(3, bsVersion_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
for (int i = 0; i < treeEval_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, treeEval_.get(i));
}
if (bsVersion_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, bsVersion_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PredictRequest)) {
return super.equals(obj);
}
PredictRequest other = (PredictRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (!getTreeEvalList()
.equals(other.getTreeEvalList())) return false;
if (getBsVersion()
!= other.getBsVersion()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
if (getTreeEvalCount() > 0) {
hash = (37 * hash) + TREEEVAL_FIELD_NUMBER;
hash = (53 * hash) + getTreeEvalList().hashCode();
}
hash = (37 * hash) + BSVERSION_FIELD_NUMBER;
hash = (53 * hash) + getBsVersion();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static PredictRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static PredictRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static PredictRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static PredictRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static PredictRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static PredictRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static PredictRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static PredictRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static PredictRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static PredictRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static PredictRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static PredictRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(PredictRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.PredictRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.PredictRequest)
PredictRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_PredictRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_PredictRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
PredictRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.PredictRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getTreeEvalFieldBuilder();
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
if (treeEvalBuilder_ == null) {
treeEval_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
treeEvalBuilder_.clear();
}
bsVersion_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_PredictRequest_descriptor;
}
@Override
public PredictRequest getDefaultInstanceForType() {
return PredictRequest.getDefaultInstance();
}
@Override
public PredictRequest build() {
PredictRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public PredictRequest buildPartial() {
PredictRequest result = new PredictRequest(this);
int from_bitField0_ = bitField0_;
result.clientuuid_ = clientuuid_;
if (treeEvalBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
treeEval_ = java.util.Collections.unmodifiableList(treeEval_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.treeEval_ = treeEval_;
} else {
result.treeEval_ = treeEvalBuilder_.build();
}
result.bsVersion_ = bsVersion_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof PredictRequest) {
return mergeFrom((PredictRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(PredictRequest other) {
if (other == PredictRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (treeEvalBuilder_ == null) {
if (!other.treeEval_.isEmpty()) {
if (treeEval_.isEmpty()) {
treeEval_ = other.treeEval_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureTreeEvalIsMutable();
treeEval_.addAll(other.treeEval_);
}
onChanged();
}
} else {
if (!other.treeEval_.isEmpty()) {
if (treeEvalBuilder_.isEmpty()) {
treeEvalBuilder_.dispose();
treeEvalBuilder_ = null;
treeEval_ = other.treeEval_;
bitField0_ = (bitField0_ & ~0x00000001);
treeEvalBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getTreeEvalFieldBuilder() : null;
} else {
treeEvalBuilder_.addAllMessages(other.treeEval_);
}
}
}
if (other.getBsVersion() != 0) {
setBsVersion(other.getBsVersion());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
PredictRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (PredictRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private java.util.List<BoostEval> treeEval_ =
java.util.Collections.emptyList();
private void ensureTreeEvalIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
treeEval_ = new java.util.ArrayList<BoostEval>(treeEval_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder> treeEvalBuilder_;
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public java.util.List<BoostEval> getTreeEvalList() {
if (treeEvalBuilder_ == null) {
return java.util.Collections.unmodifiableList(treeEval_);
} else {
return treeEvalBuilder_.getMessageList();
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public int getTreeEvalCount() {
if (treeEvalBuilder_ == null) {
return treeEval_.size();
} else {
return treeEvalBuilder_.getCount();
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval getTreeEval(int index) {
if (treeEvalBuilder_ == null) {
return treeEval_.get(index);
} else {
return treeEvalBuilder_.getMessage(index);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder setTreeEval(
int index, BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.set(index, value);
onChanged();
} else {
treeEvalBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder setTreeEval(
int index, BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.set(index, builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.add(value);
onChanged();
} else {
treeEvalBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(
int index, BoostEval value) {
if (treeEvalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTreeEvalIsMutable();
treeEval_.add(index, value);
onChanged();
} else {
treeEvalBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(
BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.add(builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addTreeEval(
int index, BoostEval.Builder builderForValue) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.add(index, builderForValue.build());
onChanged();
} else {
treeEvalBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder addAllTreeEval(
Iterable<? extends BoostEval> values) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, treeEval_);
onChanged();
} else {
treeEvalBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder clearTreeEval() {
if (treeEvalBuilder_ == null) {
treeEval_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
treeEvalBuilder_.clear();
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public Builder removeTreeEval(int index) {
if (treeEvalBuilder_ == null) {
ensureTreeEvalIsMutable();
treeEval_.remove(index);
onChanged();
} else {
treeEvalBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval.Builder getTreeEvalBuilder(
int index) {
return getTreeEvalFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEvalOrBuilder getTreeEvalOrBuilder(
int index) {
if (treeEvalBuilder_ == null) {
return treeEval_.get(index); } else {
return treeEvalBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public java.util.List<? extends BoostEvalOrBuilder>
getTreeEvalOrBuilderList() {
if (treeEvalBuilder_ != null) {
return treeEvalBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(treeEval_);
}
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval.Builder addTreeEvalBuilder() {
return getTreeEvalFieldBuilder().addBuilder(
BoostEval.getDefaultInstance());
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public BoostEval.Builder addTreeEvalBuilder(
int index) {
return getTreeEvalFieldBuilder().addBuilder(
index, BoostEval.getDefaultInstance());
}
/**
* <code>repeated .fgboost.BoostEval treeEval = 2;</code>
*/
public java.util.List<BoostEval.Builder>
getTreeEvalBuilderList() {
return getTreeEvalFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder>
getTreeEvalFieldBuilder() {
if (treeEvalBuilder_ == null) {
treeEvalBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
BoostEval, BoostEval.Builder, BoostEvalOrBuilder>(
treeEval_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
treeEval_ = null;
}
return treeEvalBuilder_;
}
private int bsVersion_ ;
/**
* <code>int32 bsVersion = 3;</code>
* @return The bsVersion.
*/
@Override
public int getBsVersion() {
return bsVersion_;
}
/**
* <code>int32 bsVersion = 3;</code>
* @param value The bsVersion to set.
* @return This builder for chaining.
*/
public Builder setBsVersion(int value) {
bsVersion_ = value;
onChanged();
return this;
}
/**
* <code>int32 bsVersion = 3;</code>
* @return This builder for chaining.
*/
public Builder clearBsVersion() {
bsVersion_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.PredictRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.PredictRequest)
private static final PredictRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new PredictRequest();
}
public static PredictRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<PredictRequest>
PARSER = new com.google.protobuf.AbstractParser<PredictRequest>() {
@Override
public PredictRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new PredictRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<PredictRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<PredictRequest> getParserForType() {
return PARSER;
}
@Override
public PredictRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface SplitRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.SplitRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
String getClientuuid();
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
com.google.protobuf.ByteString
getClientuuidBytes();
/**
* <code>.fgboost.DataSplit split = 2;</code>
* @return Whether the split field is set.
*/
boolean hasSplit();
/**
* <code>.fgboost.DataSplit split = 2;</code>
* @return The split.
*/
DataSplit getSplit();
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
DataSplitOrBuilder getSplitOrBuilder();
}
/**
* Protobuf type {@code fgboost.SplitRequest}
*/
public static final class SplitRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.SplitRequest)
SplitRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use SplitRequest.newBuilder() to construct.
private SplitRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private SplitRequest() {
clientuuid_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new SplitRequest();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SplitRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
clientuuid_ = s;
break;
}
case 18: {
DataSplit.Builder subBuilder = null;
if (split_ != null) {
subBuilder = split_.toBuilder();
}
split_ = input.readMessage(DataSplit.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(split_);
split_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_SplitRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_SplitRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
SplitRequest.class, Builder.class);
}
public static final int CLIENTUUID_FIELD_NUMBER = 1;
private volatile Object clientuuid_;
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
@Override
public String getClientuuid() {
Object ref = clientuuid_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
@Override
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SPLIT_FIELD_NUMBER = 2;
private DataSplit split_;
/**
* <code>.fgboost.DataSplit split = 2;</code>
* @return Whether the split field is set.
*/
@Override
public boolean hasSplit() {
return split_ != null;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
* @return The split.
*/
@Override
public DataSplit getSplit() {
return split_ == null ? DataSplit.getDefaultInstance() : split_;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
@Override
public DataSplitOrBuilder getSplitOrBuilder() {
return getSplit();
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getClientuuidBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_);
}
if (split_ != null) {
output.writeMessage(2, getSplit());
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getClientuuidBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_);
}
if (split_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getSplit());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof SplitRequest)) {
return super.equals(obj);
}
SplitRequest other = (SplitRequest) obj;
if (!getClientuuid()
.equals(other.getClientuuid())) return false;
if (hasSplit() != other.hasSplit()) return false;
if (hasSplit()) {
if (!getSplit()
.equals(other.getSplit())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER;
hash = (53 * hash) + getClientuuid().hashCode();
if (hasSplit()) {
hash = (37 * hash) + SPLIT_FIELD_NUMBER;
hash = (53 * hash) + getSplit().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static SplitRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SplitRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SplitRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SplitRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SplitRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SplitRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SplitRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static SplitRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static SplitRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static SplitRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static SplitRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static SplitRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(SplitRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.SplitRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.SplitRequest)
SplitRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_SplitRequest_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_SplitRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
SplitRequest.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.SplitRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
clientuuid_ = "";
if (splitBuilder_ == null) {
split_ = null;
} else {
split_ = null;
splitBuilder_ = null;
}
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_SplitRequest_descriptor;
}
@Override
public SplitRequest getDefaultInstanceForType() {
return SplitRequest.getDefaultInstance();
}
@Override
public SplitRequest build() {
SplitRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public SplitRequest buildPartial() {
SplitRequest result = new SplitRequest(this);
result.clientuuid_ = clientuuid_;
if (splitBuilder_ == null) {
result.split_ = split_;
} else {
result.split_ = splitBuilder_.build();
}
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof SplitRequest) {
return mergeFrom((SplitRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(SplitRequest other) {
if (other == SplitRequest.getDefaultInstance()) return this;
if (!other.getClientuuid().isEmpty()) {
clientuuid_ = other.clientuuid_;
onChanged();
}
if (other.hasSplit()) {
mergeSplit(other.getSplit());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
SplitRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (SplitRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object clientuuid_ = "";
/**
* <code>string clientuuid = 1;</code>
* @return The clientuuid.
*/
public String getClientuuid() {
Object ref = clientuuid_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
clientuuid_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @return The bytes for clientuuid.
*/
public com.google.protobuf.ByteString
getClientuuidBytes() {
Object ref = clientuuid_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
clientuuid_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string clientuuid = 1;</code>
* @param value The clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuid(
String value) {
if (value == null) {
throw new NullPointerException();
}
clientuuid_ = value;
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @return This builder for chaining.
*/
public Builder clearClientuuid() {
clientuuid_ = getDefaultInstance().getClientuuid();
onChanged();
return this;
}
/**
* <code>string clientuuid = 1;</code>
* @param value The bytes for clientuuid to set.
* @return This builder for chaining.
*/
public Builder setClientuuidBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
clientuuid_ = value;
onChanged();
return this;
}
private DataSplit split_;
private com.google.protobuf.SingleFieldBuilderV3<
DataSplit, DataSplit.Builder, DataSplitOrBuilder> splitBuilder_;
/**
* <code>.fgboost.DataSplit split = 2;</code>
* @return Whether the split field is set.
*/
public boolean hasSplit() {
return splitBuilder_ != null || split_ != null;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
* @return The split.
*/
public DataSplit getSplit() {
if (splitBuilder_ == null) {
return split_ == null ? DataSplit.getDefaultInstance() : split_;
} else {
return splitBuilder_.getMessage();
}
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
public Builder setSplit(DataSplit value) {
if (splitBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
split_ = value;
onChanged();
} else {
splitBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
public Builder setSplit(
DataSplit.Builder builderForValue) {
if (splitBuilder_ == null) {
split_ = builderForValue.build();
onChanged();
} else {
splitBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
public Builder mergeSplit(DataSplit value) {
if (splitBuilder_ == null) {
if (split_ != null) {
split_ =
DataSplit.newBuilder(split_).mergeFrom(value).buildPartial();
} else {
split_ = value;
}
onChanged();
} else {
splitBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
public Builder clearSplit() {
if (splitBuilder_ == null) {
split_ = null;
onChanged();
} else {
split_ = null;
splitBuilder_ = null;
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
public DataSplit.Builder getSplitBuilder() {
onChanged();
return getSplitFieldBuilder().getBuilder();
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
public DataSplitOrBuilder getSplitOrBuilder() {
if (splitBuilder_ != null) {
return splitBuilder_.getMessageOrBuilder();
} else {
return split_ == null ?
DataSplit.getDefaultInstance() : split_;
}
}
/**
* <code>.fgboost.DataSplit split = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
DataSplit, DataSplit.Builder, DataSplitOrBuilder>
getSplitFieldBuilder() {
if (splitBuilder_ == null) {
splitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
DataSplit, DataSplit.Builder, DataSplitOrBuilder>(
getSplit(),
getParentForChildren(),
isClean());
split_ = null;
}
return splitBuilder_;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.SplitRequest)
}
// @@protoc_insertion_point(class_scope:fgboost.SplitRequest)
private static final SplitRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new SplitRequest();
}
public static SplitRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<SplitRequest>
PARSER = new com.google.protobuf.AbstractParser<SplitRequest>() {
@Override
public SplitRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SplitRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<SplitRequest> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<SplitRequest> getParserForType() {
return PARSER;
}
@Override
public SplitRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface PredictResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.PredictResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string response = 1;</code>
* @return The response.
*/
String getResponse();
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
com.google.protobuf.ByteString
getResponseBytes();
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
boolean hasData();
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
FlBaseProto.TensorMap getData();
/**
* <code>.TensorMap data = 2;</code>
*/
FlBaseProto.TensorMapOrBuilder getDataOrBuilder();
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
int getCode();
}
/**
* Protobuf type {@code fgboost.PredictResponse}
*/
public static final class PredictResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.PredictResponse)
PredictResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use PredictResponse.newBuilder() to construct.
private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private PredictResponse() {
response_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new PredictResponse();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PredictResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
response_ = s;
break;
}
case 18: {
FlBaseProto.TensorMap.Builder subBuilder = null;
if (data_ != null) {
subBuilder = data_.toBuilder();
}
data_ = input.readMessage(FlBaseProto.TensorMap.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(data_);
data_ = subBuilder.buildPartial();
}
break;
}
case 24: {
code_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_PredictResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_PredictResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
PredictResponse.class, Builder.class);
}
public static final int RESPONSE_FIELD_NUMBER = 1;
private volatile Object response_;
/**
* <code>string response = 1;</code>
* @return The response.
*/
@Override
public String getResponse() {
Object ref = response_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
@Override
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DATA_FIELD_NUMBER = 2;
private FlBaseProto.TensorMap data_;
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
@Override
public boolean hasData() {
return data_ != null;
}
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
@Override
public FlBaseProto.TensorMap getData() {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
/**
* <code>.TensorMap data = 2;</code>
*/
@Override
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
return getData();
}
public static final int CODE_FIELD_NUMBER = 3;
private int code_;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getResponseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_);
}
if (data_ != null) {
output.writeMessage(2, getData());
}
if (code_ != 0) {
output.writeInt32(3, code_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getResponseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_);
}
if (data_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getData());
}
if (code_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, code_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PredictResponse)) {
return super.equals(obj);
}
PredictResponse other = (PredictResponse) obj;
if (!getResponse()
.equals(other.getResponse())) return false;
if (hasData() != other.hasData()) return false;
if (hasData()) {
if (!getData()
.equals(other.getData())) return false;
}
if (getCode()
!= other.getCode()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getResponse().hashCode();
if (hasData()) {
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getData().hashCode();
}
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + getCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static PredictResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static PredictResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static PredictResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static PredictResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static PredictResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static PredictResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static PredictResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static PredictResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static PredictResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static PredictResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static PredictResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static PredictResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(PredictResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.PredictResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.PredictResponse)
PredictResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_PredictResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_PredictResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
PredictResponse.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.PredictResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
response_ = "";
if (dataBuilder_ == null) {
data_ = null;
} else {
data_ = null;
dataBuilder_ = null;
}
code_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_PredictResponse_descriptor;
}
@Override
public PredictResponse getDefaultInstanceForType() {
return PredictResponse.getDefaultInstance();
}
@Override
public PredictResponse build() {
PredictResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public PredictResponse buildPartial() {
PredictResponse result = new PredictResponse(this);
result.response_ = response_;
if (dataBuilder_ == null) {
result.data_ = data_;
} else {
result.data_ = dataBuilder_.build();
}
result.code_ = code_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof PredictResponse) {
return mergeFrom((PredictResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(PredictResponse other) {
if (other == PredictResponse.getDefaultInstance()) return this;
if (!other.getResponse().isEmpty()) {
response_ = other.response_;
onChanged();
}
if (other.hasData()) {
mergeData(other.getData());
}
if (other.getCode() != 0) {
setCode(other.getCode());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
PredictResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (PredictResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private Object response_ = "";
/**
* <code>string response = 1;</code>
* @return The response.
*/
public String getResponse() {
Object ref = response_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string response = 1;</code>
* @return The bytes for response.
*/
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string response = 1;</code>
* @param value The response to set.
* @return This builder for chaining.
*/
public Builder setResponse(
String value) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @return This builder for chaining.
*/
public Builder clearResponse() {
response_ = getDefaultInstance().getResponse();
onChanged();
return this;
}
/**
* <code>string response = 1;</code>
* @param value The bytes for response to set.
* @return This builder for chaining.
*/
public Builder setResponseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
response_ = value;
onChanged();
return this;
}
private FlBaseProto.TensorMap data_;
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder> dataBuilder_;
/**
* <code>.TensorMap data = 2;</code>
* @return Whether the data field is set.
*/
public boolean hasData() {
return dataBuilder_ != null || data_ != null;
}
/**
* <code>.TensorMap data = 2;</code>
* @return The data.
*/
public FlBaseProto.TensorMap getData() {
if (dataBuilder_ == null) {
return data_ == null ? FlBaseProto.TensorMap.getDefaultInstance() : data_;
} else {
return dataBuilder_.getMessage();
}
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder setData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
} else {
dataBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder setData(
FlBaseProto.TensorMap.Builder builderForValue) {
if (dataBuilder_ == null) {
data_ = builderForValue.build();
onChanged();
} else {
dataBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder mergeData(FlBaseProto.TensorMap value) {
if (dataBuilder_ == null) {
if (data_ != null) {
data_ =
FlBaseProto.TensorMap.newBuilder(data_).mergeFrom(value).buildPartial();
} else {
data_ = value;
}
onChanged();
} else {
dataBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public Builder clearData() {
if (dataBuilder_ == null) {
data_ = null;
onChanged();
} else {
data_ = null;
dataBuilder_ = null;
}
return this;
}
/**
* <code>.TensorMap data = 2;</code>
*/
public FlBaseProto.TensorMap.Builder getDataBuilder() {
onChanged();
return getDataFieldBuilder().getBuilder();
}
/**
* <code>.TensorMap data = 2;</code>
*/
public FlBaseProto.TensorMapOrBuilder getDataOrBuilder() {
if (dataBuilder_ != null) {
return dataBuilder_.getMessageOrBuilder();
} else {
return data_ == null ?
FlBaseProto.TensorMap.getDefaultInstance() : data_;
}
}
/**
* <code>.TensorMap data = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>
getDataFieldBuilder() {
if (dataBuilder_ == null) {
dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
FlBaseProto.TensorMap, FlBaseProto.TensorMap.Builder, FlBaseProto.TensorMapOrBuilder>(
getData(),
getParentForChildren(),
isClean());
data_ = null;
}
return dataBuilder_;
}
private int code_ ;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
/**
* <code>int32 code = 3;</code>
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(int value) {
code_ = value;
onChanged();
return this;
}
/**
* <code>int32 code = 3;</code>
* @return This builder for chaining.
*/
public Builder clearCode() {
code_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.PredictResponse)
}
// @@protoc_insertion_point(class_scope:fgboost.PredictResponse)
private static final PredictResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new PredictResponse();
}
public static PredictResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<PredictResponse>
PARSER = new com.google.protobuf.AbstractParser<PredictResponse>() {
@Override
public PredictResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new PredictResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<PredictResponse> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<PredictResponse> getParserForType() {
return PARSER;
}
@Override
public PredictResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface SplitResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:fgboost.SplitResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.fgboost.DataSplit split = 1;</code>
* @return Whether the split field is set.
*/
boolean hasSplit();
/**
* <code>.fgboost.DataSplit split = 1;</code>
* @return The split.
*/
DataSplit getSplit();
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
DataSplitOrBuilder getSplitOrBuilder();
/**
* <code>string response = 2;</code>
* @return The response.
*/
String getResponse();
/**
* <code>string response = 2;</code>
* @return The bytes for response.
*/
com.google.protobuf.ByteString
getResponseBytes();
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
int getCode();
}
/**
* Protobuf type {@code fgboost.SplitResponse}
*/
public static final class SplitResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:fgboost.SplitResponse)
SplitResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use SplitResponse.newBuilder() to construct.
private SplitResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private SplitResponse() {
response_ = "";
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(
UnusedPrivateParameter unused) {
return new SplitResponse();
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SplitResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
DataSplit.Builder subBuilder = null;
if (split_ != null) {
subBuilder = split_.toBuilder();
}
split_ = input.readMessage(DataSplit.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(split_);
split_ = subBuilder.buildPartial();
}
break;
}
case 18: {
String s = input.readStringRequireUtf8();
response_ = s;
break;
}
case 24: {
code_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_SplitResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_SplitResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
SplitResponse.class, Builder.class);
}
public static final int SPLIT_FIELD_NUMBER = 1;
private DataSplit split_;
/**
* <code>.fgboost.DataSplit split = 1;</code>
* @return Whether the split field is set.
*/
@Override
public boolean hasSplit() {
return split_ != null;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
* @return The split.
*/
@Override
public DataSplit getSplit() {
return split_ == null ? DataSplit.getDefaultInstance() : split_;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
@Override
public DataSplitOrBuilder getSplitOrBuilder() {
return getSplit();
}
public static final int RESPONSE_FIELD_NUMBER = 2;
private volatile Object response_;
/**
* <code>string response = 2;</code>
* @return The response.
*/
@Override
public String getResponse() {
Object ref = response_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
}
}
/**
* <code>string response = 2;</code>
* @return The bytes for response.
*/
@Override
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CODE_FIELD_NUMBER = 3;
private int code_;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (split_ != null) {
output.writeMessage(1, getSplit());
}
if (!getResponseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, response_);
}
if (code_ != 0) {
output.writeInt32(3, code_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (split_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getSplit());
}
if (!getResponseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, response_);
}
if (code_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, code_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof SplitResponse)) {
return super.equals(obj);
}
SplitResponse other = (SplitResponse) obj;
if (hasSplit() != other.hasSplit()) return false;
if (hasSplit()) {
if (!getSplit()
.equals(other.getSplit())) return false;
}
if (!getResponse()
.equals(other.getResponse())) return false;
if (getCode()
!= other.getCode()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasSplit()) {
hash = (37 * hash) + SPLIT_FIELD_NUMBER;
hash = (53 * hash) + getSplit().hashCode();
}
hash = (37 * hash) + RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getResponse().hashCode();
hash = (37 * hash) + CODE_FIELD_NUMBER;
hash = (53 * hash) + getCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static SplitResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SplitResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SplitResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SplitResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SplitResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SplitResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SplitResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static SplitResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static SplitResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static SplitResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static SplitResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static SplitResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(SplitResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code fgboost.SplitResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:fgboost.SplitResponse)
SplitResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return FGBoostServiceProto.internal_static_fgboost_SplitResponse_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return FGBoostServiceProto.internal_static_fgboost_SplitResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
SplitResponse.class, Builder.class);
}
// Construct using com.intel.analytics.bigdl.ppml.generated.FGBoostServiceProto.SplitResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
if (splitBuilder_ == null) {
split_ = null;
} else {
split_ = null;
splitBuilder_ = null;
}
response_ = "";
code_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return FGBoostServiceProto.internal_static_fgboost_SplitResponse_descriptor;
}
@Override
public SplitResponse getDefaultInstanceForType() {
return SplitResponse.getDefaultInstance();
}
@Override
public SplitResponse build() {
SplitResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public SplitResponse buildPartial() {
SplitResponse result = new SplitResponse(this);
if (splitBuilder_ == null) {
result.split_ = split_;
} else {
result.split_ = splitBuilder_.build();
}
result.response_ = response_;
result.code_ = code_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof SplitResponse) {
return mergeFrom((SplitResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(SplitResponse other) {
if (other == SplitResponse.getDefaultInstance()) return this;
if (other.hasSplit()) {
mergeSplit(other.getSplit());
}
if (!other.getResponse().isEmpty()) {
response_ = other.response_;
onChanged();
}
if (other.getCode() != 0) {
setCode(other.getCode());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
SplitResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (SplitResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private DataSplit split_;
private com.google.protobuf.SingleFieldBuilderV3<
DataSplit, DataSplit.Builder, DataSplitOrBuilder> splitBuilder_;
/**
* <code>.fgboost.DataSplit split = 1;</code>
* @return Whether the split field is set.
*/
public boolean hasSplit() {
return splitBuilder_ != null || split_ != null;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
* @return The split.
*/
public DataSplit getSplit() {
if (splitBuilder_ == null) {
return split_ == null ? DataSplit.getDefaultInstance() : split_;
} else {
return splitBuilder_.getMessage();
}
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
public Builder setSplit(DataSplit value) {
if (splitBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
split_ = value;
onChanged();
} else {
splitBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
public Builder setSplit(
DataSplit.Builder builderForValue) {
if (splitBuilder_ == null) {
split_ = builderForValue.build();
onChanged();
} else {
splitBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
public Builder mergeSplit(DataSplit value) {
if (splitBuilder_ == null) {
if (split_ != null) {
split_ =
DataSplit.newBuilder(split_).mergeFrom(value).buildPartial();
} else {
split_ = value;
}
onChanged();
} else {
splitBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
public Builder clearSplit() {
if (splitBuilder_ == null) {
split_ = null;
onChanged();
} else {
split_ = null;
splitBuilder_ = null;
}
return this;
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
public DataSplit.Builder getSplitBuilder() {
onChanged();
return getSplitFieldBuilder().getBuilder();
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
public DataSplitOrBuilder getSplitOrBuilder() {
if (splitBuilder_ != null) {
return splitBuilder_.getMessageOrBuilder();
} else {
return split_ == null ?
DataSplit.getDefaultInstance() : split_;
}
}
/**
* <code>.fgboost.DataSplit split = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
DataSplit, DataSplit.Builder, DataSplitOrBuilder>
getSplitFieldBuilder() {
if (splitBuilder_ == null) {
splitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
DataSplit, DataSplit.Builder, DataSplitOrBuilder>(
getSplit(),
getParentForChildren(),
isClean());
split_ = null;
}
return splitBuilder_;
}
private Object response_ = "";
/**
* <code>string response = 2;</code>
* @return The response.
*/
public String getResponse() {
Object ref = response_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
response_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>string response = 2;</code>
* @return The bytes for response.
*/
public com.google.protobuf.ByteString
getResponseBytes() {
Object ref = response_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
response_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string response = 2;</code>
* @param value The response to set.
* @return This builder for chaining.
*/
public Builder setResponse(
String value) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
return this;
}
/**
* <code>string response = 2;</code>
* @return This builder for chaining.
*/
public Builder clearResponse() {
response_ = getDefaultInstance().getResponse();
onChanged();
return this;
}
/**
* <code>string response = 2;</code>
* @param value The bytes for response to set.
* @return This builder for chaining.
*/
public Builder setResponseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
response_ = value;
onChanged();
return this;
}
private int code_ ;
/**
* <code>int32 code = 3;</code>
* @return The code.
*/
@Override
public int getCode() {
return code_;
}
/**
* <code>int32 code = 3;</code>
* @param value The code to set.
* @return This builder for chaining.
*/
public Builder setCode(int value) {
code_ = value;
onChanged();
return this;
}
/**
* <code>int32 code = 3;</code>
* @return This builder for chaining.
*/
public Builder clearCode() {
code_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:fgboost.SplitResponse)
}
// @@protoc_insertion_point(class_scope:fgboost.SplitResponse)
private static final SplitResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new SplitResponse();
}
public static SplitResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<SplitResponse>
PARSER = new com.google.protobuf.AbstractParser<SplitResponse>() {
@Override
public SplitResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SplitResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<SplitResponse> parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser<SplitResponse> getParserForType() {
return PARSER;
}
@Override
public SplitResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_UploadLabelRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_UploadLabelRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_DownloadLabelRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_DownloadLabelRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_DownloadResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_DownloadResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_TreeLeaf_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_TreeLeaf_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_UploadTreeLeafRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_UploadTreeLeafRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_DataSplit_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_DataSplit_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_UploadResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_UploadResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_TreePredict_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_TreePredict_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_BoostPredict_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_BoostPredict_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_BoostEval_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_BoostEval_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_RegisterRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_RegisterRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_RegisterResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_RegisterResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_UploadTreeEvalRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_UploadTreeEvalRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_EvaluateRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_EvaluateRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_EvaluateResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_EvaluateResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_PredictRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_PredictRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_SplitRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_SplitRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_PredictResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_PredictResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_fgboost_SplitResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_fgboost_SplitResponse_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
String[] descriptorData = {
"\n\025fgboost_service.proto\022\007fgboost\032\rfl_bas" +
"e.proto\"U\n\022UploadLabelRequest\022\022\n\nclientu" +
"uid\030\001 \001(\t\022\030\n\004data\030\002 \001(\0132\n.TensorMap\022\021\n\ta" +
"lgorithm\030\003 \001(\t\"F\n\024DownloadLabelRequest\022\033" +
"\n\010metaData\030\001 \001(\0132\t.MetaData\022\021\n\talgorithm" +
"\030\002 \001(\t\"L\n\020DownloadResponse\022\030\n\004data\030\001 \001(\013" +
"2\n.TensorMap\022\020\n\010response\030\002 \001(\t\022\014\n\004code\030\003" +
" \001(\005\"R\n\010TreeLeaf\022\016\n\006treeID\030\001 \001(\t\022\021\n\tleaf" +
"Index\030\002 \003(\005\022\022\n\nleafOutput\030\003 \003(\002\022\017\n\007versi" +
"on\030\004 \001(\005\"P\n\025UploadTreeLeafRequest\022\022\n\ncli" +
"entuuid\030\001 \001(\t\022#\n\010treeLeaf\030\002 \001(\0132\021.fgboos" +
"t.TreeLeaf\"\250\001\n\tDataSplit\022\016\n\006treeID\030\001 \001(\t" +
"\022\016\n\006nodeID\030\002 \001(\t\022\021\n\tfeatureID\030\003 \001(\005\022\022\n\ns" +
"plitValue\030\004 \001(\002\022\014\n\004gain\030\005 \001(\002\022\021\n\tsetLeng" +
"th\030\006 \001(\005\022\017\n\007itemSet\030\007 \003(\005\022\021\n\tclientUid\030\010" +
" \001(\t\022\017\n\007version\030\t \001(\005\"0\n\016UploadResponse\022" +
"\020\n\010response\030\001 \001(\t\022\014\n\004code\030\002 \001(\005\"/\n\013TreeP" +
"redict\022\016\n\006treeID\030\001 \001(\t\022\020\n\010predicts\030\002 \003(\010" +
"\"6\n\014BoostPredict\022&\n\010predicts\030\001 \003(\0132\024.fgb" +
"oost.TreePredict\"4\n\tBoostEval\022\'\n\tevaluat" +
"es\030\001 \003(\0132\024.fgboost.TreePredict\"4\n\017Regist" +
"erRequest\022\022\n\nclientuuid\030\001 \001(\t\022\r\n\005token\030\002" +
" \001(\t\"2\n\020RegisterResponse\022\020\n\010response\030\001 \001" +
"(\t\022\014\n\004code\030\002 \001(\005\"b\n\025UploadTreeEvalReques" +
"t\022\022\n\nclientuuid\030\001 \001(\t\022\017\n\007version\030\002 \001(\005\022$" +
"\n\010treeEval\030\003 \003(\0132\022.fgboost.BoostEval\"^\n\017" +
"EvaluateRequest\022\022\n\nclientuuid\030\001 \001(\t\022$\n\010t" +
"reeEval\030\002 \003(\0132\022.fgboost.BoostEval\022\021\n\tbsV" +
"ersion\030\003 \001(\005\"]\n\020EvaluateResponse\022\020\n\010resp" +
"onse\030\001 \001(\t\022\030\n\004data\030\002 \001(\0132\n.TensorMap\022\014\n\004" +
"code\030\003 \001(\005\022\017\n\007message\030\004 \001(\t\"]\n\016PredictRe" +
"quest\022\022\n\nclientuuid\030\001 \001(\t\022$\n\010treeEval\030\002 " +
"\003(\0132\022.fgboost.BoostEval\022\021\n\tbsVersion\030\003 \001" +
"(\005\"E\n\014SplitRequest\022\022\n\nclientuuid\030\001 \001(\t\022!" +
"\n\005split\030\002 \001(\0132\022.fgboost.DataSplit\"K\n\017Pre" +
"dictResponse\022\020\n\010response\030\001 \001(\t\022\030\n\004data\030\002" +
" \001(\0132\n.TensorMap\022\014\n\004code\030\003 \001(\005\"R\n\rSplitR" +
"esponse\022!\n\005split\030\001 \001(\0132\022.fgboost.DataSpl" +
"it\022\020\n\010response\030\002 \001(\t\022\014\n\004code\030\003 \001(\0052\361\003\n\016F" +
"GBoostService\022E\n\013uploadLabel\022\033.fgboost.U" +
"ploadLabelRequest\032\027.fgboost.UploadRespon" +
"se\"\000\022K\n\rdownloadLabel\022\035.fgboost.Download" +
"LabelRequest\032\031.fgboost.DownloadResponse\"" +
"\000\0228\n\005split\022\025.fgboost.SplitRequest\032\026.fgbo" +
"ost.SplitResponse\"\000\022A\n\010register\022\030.fgboos" +
"t.RegisterRequest\032\031.fgboost.RegisterResp" +
"onse\"\000\022K\n\016uploadTreeLeaf\022\036.fgboost.Uploa" +
"dTreeLeafRequest\032\027.fgboost.UploadRespons" +
"e\"\000\022A\n\010evaluate\022\030.fgboost.EvaluateReques" +
"t\032\031.fgboost.EvaluateResponse\"\000\022>\n\007predic" +
"t\022\027.fgboost.PredictRequest\032\030.fgboost.Pre" +
"dictResponse\"\000B?\n(com.intel.analytics.bi" +
"gdl.ppml.generatedB\023FGBoostServiceProtob" +
"\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
FlBaseProto.getDescriptor(),
});
internal_static_fgboost_UploadLabelRequest_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_fgboost_UploadLabelRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_UploadLabelRequest_descriptor,
new String[] { "Clientuuid", "Data", "Algorithm", });
internal_static_fgboost_DownloadLabelRequest_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_fgboost_DownloadLabelRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_DownloadLabelRequest_descriptor,
new String[] { "MetaData", "Algorithm", });
internal_static_fgboost_DownloadResponse_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_fgboost_DownloadResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_DownloadResponse_descriptor,
new String[] { "Data", "Response", "Code", });
internal_static_fgboost_TreeLeaf_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_fgboost_TreeLeaf_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_TreeLeaf_descriptor,
new String[] { "TreeID", "LeafIndex", "LeafOutput", "Version", });
internal_static_fgboost_UploadTreeLeafRequest_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_fgboost_UploadTreeLeafRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_UploadTreeLeafRequest_descriptor,
new String[] { "Clientuuid", "TreeLeaf", });
internal_static_fgboost_DataSplit_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_fgboost_DataSplit_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_DataSplit_descriptor,
new String[] { "TreeID", "NodeID", "FeatureID", "SplitValue", "Gain", "SetLength", "ItemSet", "ClientUid", "Version", });
internal_static_fgboost_UploadResponse_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_fgboost_UploadResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_UploadResponse_descriptor,
new String[] { "Response", "Code", });
internal_static_fgboost_TreePredict_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_fgboost_TreePredict_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_TreePredict_descriptor,
new String[] { "TreeID", "Predicts", });
internal_static_fgboost_BoostPredict_descriptor =
getDescriptor().getMessageTypes().get(8);
internal_static_fgboost_BoostPredict_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_BoostPredict_descriptor,
new String[] { "Predicts", });
internal_static_fgboost_BoostEval_descriptor =
getDescriptor().getMessageTypes().get(9);
internal_static_fgboost_BoostEval_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_BoostEval_descriptor,
new String[] { "Evaluates", });
internal_static_fgboost_RegisterRequest_descriptor =
getDescriptor().getMessageTypes().get(10);
internal_static_fgboost_RegisterRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_RegisterRequest_descriptor,
new String[] { "Clientuuid", "Token", });
internal_static_fgboost_RegisterResponse_descriptor =
getDescriptor().getMessageTypes().get(11);
internal_static_fgboost_RegisterResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_RegisterResponse_descriptor,
new String[] { "Response", "Code", });
internal_static_fgboost_UploadTreeEvalRequest_descriptor =
getDescriptor().getMessageTypes().get(12);
internal_static_fgboost_UploadTreeEvalRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_UploadTreeEvalRequest_descriptor,
new String[] { "Clientuuid", "Version", "TreeEval", });
internal_static_fgboost_EvaluateRequest_descriptor =
getDescriptor().getMessageTypes().get(13);
internal_static_fgboost_EvaluateRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_EvaluateRequest_descriptor,
new String[] { "Clientuuid", "TreeEval", "BsVersion", });
internal_static_fgboost_EvaluateResponse_descriptor =
getDescriptor().getMessageTypes().get(14);
internal_static_fgboost_EvaluateResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_EvaluateResponse_descriptor,
new String[] { "Response", "Data", "Code", "Message", });
internal_static_fgboost_PredictRequest_descriptor =
getDescriptor().getMessageTypes().get(15);
internal_static_fgboost_PredictRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_PredictRequest_descriptor,
new String[] { "Clientuuid", "TreeEval", "BsVersion", });
internal_static_fgboost_SplitRequest_descriptor =
getDescriptor().getMessageTypes().get(16);
internal_static_fgboost_SplitRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_SplitRequest_descriptor,
new String[] { "Clientuuid", "Split", });
internal_static_fgboost_PredictResponse_descriptor =
getDescriptor().getMessageTypes().get(17);
internal_static_fgboost_PredictResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_PredictResponse_descriptor,
new String[] { "Response", "Data", "Code", });
internal_static_fgboost_SplitResponse_descriptor =
getDescriptor().getMessageTypes().get(18);
internal_static_fgboost_SplitResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_fgboost_SplitResponse_descriptor,
new String[] { "Split", "Response", "Code", });
FlBaseProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| apache-2.0 |
legend0702/zhq | zhq-core/src/test/java/cn/zhuhongqing/ref/MethodReference.java | 1370 | package cn.zhuhongqing.ref;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
public class MethodReference extends ClassReference<Method> {
public MethodReference(Class<?> clazz) {
super(clazz);
}
@Override
void init(Class<?> clazz) {
Class<?> target = clazz;
do {
addAll(target.getDeclaredMethods());
target = target.getSuperclass();
} while (!target.equals(Object.class));
}
@Override
Set<Integer> createMemberHashCode(Method member) {
Set<Integer> hashSet = new HashSet<Integer>();
String name = member.getName();
// name
hashSet.add(name.hashCode());
// name+paramTypes
hashSet.add(createMemberSoftReferenceHashCode(member));
// name+annotation[0] ... name+annotation[n]
for (Annotation annotation : member.getAnnotations())
hashSet.add(createHashCode(name, annotation.annotationType()));
// annotation[0]...annotation[n]
for (Annotation annotation : member.getAnnotations())
hashSet.add(createHashCode(annotation.annotationType()));
return hashSet;
}
@Override
int createMemberSoftReferenceHashCode(Method referent) {
StringBuffer sb = new StringBuffer();
sb.append(referent.getName());
Class<?>[] params = referent.getParameterTypes();
for (Class<?> param : params)
sb.append(param);
return sb.toString().hashCode();
}
}
| apache-2.0 |
ilya-klyuchnikov/buck | src/com/facebook/buck/distributed/RecordingProjectFileHashCache.java | 16349 | /*
* Copyright 2016-present Facebook, Inc.
*
* 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.facebook.buck.distributed;
import com.facebook.buck.distributed.thrift.BuildJobStateFileHashEntry;
import com.facebook.buck.distributed.thrift.PathWithUnixSeparators;
import com.facebook.buck.io.ArchiveMemberPath;
import com.facebook.buck.io.file.MorePaths;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.log.Logger;
import com.facebook.buck.util.cache.FileHashCacheVerificationResult;
import com.facebook.buck.util.cache.ProjectFileHashCache;
import com.facebook.buck.util.types.Pair;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.hash.HashCode;
import java.io.IOException;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.Queue;
import javax.annotation.concurrent.GuardedBy;
/**
* Decorator class the records information about the paths being hashed as a side effect of
* producing file hashes required for rule key computation.
*/
public class RecordingProjectFileHashCache implements ProjectFileHashCache {
private static final Logger LOG = Logger.get(RecordingProjectFileHashCache.class);
private static final int MAX_SYMLINK_DEPTH = 1000;
private final ProjectFileHashCache delegate;
private final ProjectFilesystem projectFilesystem;
private final ImmutableSet<Path> cellPaths;
@GuardedBy("this")
private final RecordedFileHashes remoteFileHashes;
private final boolean allRecordedPathsAreAbsolute;
private boolean materializeCurrentFileDuringPreloading = false;
public static RecordingProjectFileHashCache createForCellRoot(
ProjectFileHashCache decoratedCache,
RecordedFileHashes remoteFileHashes,
DistBuildConfig distBuildConfig) {
return new RecordingProjectFileHashCache(
decoratedCache, remoteFileHashes, Optional.of(distBuildConfig));
}
public static RecordingProjectFileHashCache createForNonCellRoot(
ProjectFileHashCache decoratedCache, RecordedFileHashes remoteFileHashes) {
return new RecordingProjectFileHashCache(decoratedCache, remoteFileHashes, Optional.empty());
}
private RecordingProjectFileHashCache(
ProjectFileHashCache delegate,
RecordedFileHashes remoteFileHashes,
Optional<DistBuildConfig> distBuildConfig) {
this.allRecordedPathsAreAbsolute = !distBuildConfig.isPresent();
this.delegate = delegate;
this.projectFilesystem = delegate.getFilesystem();
this.remoteFileHashes = remoteFileHashes;
ImmutableSet.Builder<Path> cellPaths = ImmutableSet.builder();
cellPaths.add(MorePaths.normalize(projectFilesystem.getRootPath()));
distBuildConfig.ifPresent(
config ->
config
.getBuckConfig()
.getCellPathResolver()
.getCellPaths()
.values()
.forEach(p -> cellPaths.add(MorePaths.normalize(p))));
this.cellPaths = cellPaths.build();
// TODO(alisdair,ruibm): Capture all .buckconfig dependencies automatically.
distBuildConfig.ifPresent(this::recordWhitelistedPaths);
}
/**
* Returns true if symlinks resolves to a target inside the known cell roots, and false if it
* points outside of all known cell root.
*/
private boolean isSymlinkInternalToKnownCellRoots(Path relPath) {
return getCellRootForAbsolutePath(findSafeRealPath(projectFilesystem.resolve(relPath)))
.isPresent();
}
/**
* Check if the given absolute path is inside any of the known cells, and if yes, return the
* corresponding the root path of the cell to which it belongs. Does not resolve/follow symlinks.
*/
private Optional<Path> getCellRootForAbsolutePath(Path absPath) {
absPath = MorePaths.normalize(absPath);
Preconditions.checkState(absPath.isAbsolute());
for (Path cellRoot : cellPaths) {
if (absPath.startsWith(cellRoot)) {
return Optional.of(cellRoot);
}
}
return Optional.empty();
}
@Override
public HashCode get(Path relPath) throws IOException {
checkIsRelative(relPath);
Queue<Path> remainingPaths = new LinkedList<>();
remainingPaths.add(relPath);
while (remainingPaths.size() > 0) {
Path nextPath = remainingPaths.remove();
Optional<HashCode> hashCode = Optional.empty();
List<PathWithUnixSeparators> children = ImmutableList.of();
if (isSymlinkInternalToKnownCellRoots(nextPath)) {
hashCode = Optional.of(delegate.get(nextPath));
if (projectFilesystem.isDirectory(nextPath)) {
children = processDirectory(nextPath, remainingPaths);
}
}
record(nextPath, Optional.empty(), hashCode, children);
}
return delegate.get(relPath);
}
private List<PathWithUnixSeparators> processDirectory(Path path, Queue<Path> remainingPaths)
throws IOException {
List<PathWithUnixSeparators> childrenRelativePaths = new ArrayList<>();
for (Path relativeChildPath : projectFilesystem.getDirectoryContents(path)) {
childrenRelativePaths.add(
new PathWithUnixSeparators()
.setPath(MorePaths.pathWithUnixSeparators(relativeChildPath)));
remainingPaths.add(relativeChildPath);
}
return childrenRelativePaths;
}
@Override
public long getSize(Path path) throws IOException {
return delegate.getSize(path);
}
@Override
public Optional<HashCode> getIfPresent(Path path) {
throw new UnsupportedOperationException();
}
private static void checkIsRelative(Path path) {
Preconditions.checkArgument(
!path.isAbsolute(), "Path must be relative. Found [%s] instead.", path);
}
/**
* This method does the same job as {@link Path#toRealPath}, except that: 1. It doesn't care once
* the resolved target is outside of known cell roots. 2. The final target need not exist. We'll
* resolve the links as far as we can.
*/
private Path findSafeRealPath(Path symlinkPath) {
return findSafeRealPathHelper(symlinkPath, 0);
}
private Path findSafeRealPathHelper(Path symlinkPath, int levelsProcessed) {
Path symlinkAbsPath = MorePaths.normalize(symlinkPath.toAbsolutePath());
if (levelsProcessed > MAX_SYMLINK_DEPTH) {
throw new RuntimeException(
String.format("Too many levels of symbolic links in path [%s].", symlinkAbsPath));
}
Optional<Path> cellRoot = getCellRootForAbsolutePath(symlinkAbsPath);
if (!cellRoot.isPresent()) {
return symlinkAbsPath;
}
int projectRootLength = cellRoot.get().getNameCount();
for (int index = projectRootLength + 1; index <= symlinkAbsPath.getNameCount(); ++index) {
// Note: subpath(..) does not return a rooted path, so we need to prepend an additional '/'.
Path subpath = symlinkAbsPath.getRoot().resolve(symlinkAbsPath.subpath(0, index));
if (!projectFilesystem.exists(subpath, LinkOption.NOFOLLOW_LINKS)) {
return symlinkAbsPath;
}
if (projectFilesystem.isSymLink(subpath)) {
try {
return findSafeRealPathHelper(
subpath
.getParent()
.resolve(projectFilesystem.readSymLink(subpath))
.resolve(subpath.relativize(symlinkAbsPath)),
levelsProcessed + 1);
} catch (IOException e) {
throw new RuntimeException(
String.format("Unexpected error in reading symlink [%s].", subpath), e);
}
}
}
return symlinkAbsPath;
}
// For given symlink, finds the highest level symlink in the path that points outside the
// project. This is to avoid collisions/redundant symlink creation during re-materialization.
// Example notes:
// In the below examples, /a is the root of the project, and /e is outside the project.
// Example 1:
// /a/b/symlink_to_x_y/d -> /e/f/x/y/d
// (where /a/b -> /e/f, and /e/f/symlink_to_x_y -> /e/f/x/y)
// returns /a/b -> /e/f
// Example 2:
// /a/b/symlink_to_c/d -> /e/f/d
// (where /a/b/symlink_to_c -> /a/b/c and /a/b/c -> /e/f)
// returns /a/b/symlink_to_c -> /e/f
// Note: when re-materializing symlinks we skip any intermediate symlinks inside the project
// (in Example 2 we will re-materialize /a/b/symlink_to_c -> /e/f, and skip /a/b/c).
private Pair<Path, Path> findExternalSymlinkRoot(Path symlinkPath) {
int projectPathComponents = projectFilesystem.getRootPath().getNameCount();
for (int pathEndIndex = (projectPathComponents + 1);
pathEndIndex <= symlinkPath.getNameCount();
pathEndIndex++) {
// Note: subpath(..) does not return a rooted path, so we need to prepend an additional '/'.
Path symlinkSubpath = symlinkPath.getRoot().resolve(symlinkPath.subpath(0, pathEndIndex));
Path realSubpath = findSafeRealPath(symlinkSubpath);
boolean realPathOutsideProject = !getCellRootForAbsolutePath(realSubpath).isPresent();
if (realPathOutsideProject) {
return new Pair<>(
projectFilesystem.getPathRelativeToProjectRoot(symlinkSubpath).get(), realSubpath);
}
}
throw new RuntimeException(
String.format(
"Failed to find root symlink pointing outside the project for symlink with path [%s].",
symlinkPath.toAbsolutePath()));
}
private synchronized void record(ArchiveMemberPath relPath, Optional<HashCode> hashCode)
throws IOException {
if (!remoteFileHashes.containsAndAddPath(relPath)) {
record(
relPath.getArchivePath(),
Optional.of(relPath.getMemberPath().toString()),
hashCode,
new LinkedList<>());
}
}
private synchronized void record(
Path relPath,
Optional<String> memberRelPath,
Optional<HashCode> hashCode,
List<PathWithUnixSeparators> children)
throws IOException {
relPath = MorePaths.normalize(relPath);
if (remoteFileHashes.containsAndAddPath(relPath)) {
return;
}
LOG.verbose("Recording path: [%s]", projectFilesystem.resolve(relPath));
boolean isRealPathInsideProject = isSymlinkInternalToKnownCellRoots(relPath);
if (isRealPathInsideProject && !hashCode.isPresent()) {
throw new RuntimeException(
String.format("Path [%s] is not an external symlink and HashCode was not set.", relPath));
}
BuildJobStateFileHashEntry fileHashEntry = new BuildJobStateFileHashEntry();
boolean pathIsAbsolute = allRecordedPathsAreAbsolute;
fileHashEntry.setPathIsAbsolute(pathIsAbsolute);
Path entryKey = pathIsAbsolute ? projectFilesystem.resolve(relPath) : relPath;
boolean isDirectory = isRealPathInsideProject && projectFilesystem.isDirectory(relPath);
// Symlink handling:
// 1) Symlink points inside a known cell root:
// - We treat it like a regular file when uploading/re-materializing.
// 2) Symlink points outside the project:
// - We find the highest level part of the path that points outside the project and upload
// meta-data about this before it is re-materialized. See findExternalSymlinkRoot() for more
// details.
if (!isRealPathInsideProject && !pathIsAbsolute) {
Pair<Path, Path> symLinkRootAndTarget =
findExternalSymlinkRoot(projectFilesystem.resolve(relPath).toAbsolutePath());
Path symLinkRoot =
projectFilesystem.getPathRelativeToProjectRoot(symLinkRootAndTarget.getFirst()).get();
fileHashEntry.setRootSymLink(
new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(symLinkRoot)));
fileHashEntry.setRootSymLinkTarget(
new PathWithUnixSeparators()
.setPath(
MorePaths.pathWithUnixSeparators(
symLinkRootAndTarget.getSecond().toAbsolutePath())));
}
fileHashEntry.setIsDirectory(isDirectory);
fileHashEntry.setPath(
new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(entryKey)));
if (memberRelPath.isPresent()) {
fileHashEntry.setArchiveMemberPath(memberRelPath.get());
}
if (hashCode.isPresent()) {
fileHashEntry.setSha1(hashCode.get().toString());
}
if (!isDirectory && !pathIsAbsolute && isRealPathInsideProject) {
Path absPath = projectFilesystem.resolve(relPath).toAbsolutePath();
fileHashEntry.setIsExecutable(absPath.toFile().canExecute());
} else if (isDirectory && !pathIsAbsolute && isRealPathInsideProject) {
fileHashEntry.setChildren(children);
}
fileHashEntry.setMaterializeDuringPreloading(materializeCurrentFileDuringPreloading);
// TODO(alisdair): handling for symlink to internal directory (including infinite loop).
remoteFileHashes.addEntry(fileHashEntry);
}
@Override
public HashCode get(ArchiveMemberPath relPath) throws IOException {
checkIsRelative(relPath.getArchivePath());
HashCode hashCode = delegate.get(relPath);
record(relPath, Optional.of(hashCode));
return hashCode;
}
private synchronized void recordWhitelistedPaths(DistBuildConfig distBuildConfig) {
// TODO(alisdair,shivanker): KnownBuildRuleTypes always loads java compilers if they are
// defined in a .buckconfig, regardless of what type of build is taking place. Unless peforming
// a Java build, they are not added to the build graph, and as such Stampede needs to be told
// about them directly via the whitelist.
Optional<ImmutableList<String>> whitelist = distBuildConfig.getOptionalPathWhitelist();
if (!whitelist.isPresent()) {
return;
}
LOG.info(
"Stampede always_materialize_whitelist=[%s] cell=[%s].",
whitelist.isPresent() ? Joiner.on(", ").join(whitelist.get()) : "",
delegate.getFilesystem().getRootPath().toString());
try {
// We want to materialize files during pre-loading for .buckconfig entries
materializeCurrentFileDuringPreloading = true;
for (String entry : whitelist.get()) {
Path relPath = projectFilesystem.getPath(entry);
if (isIgnored(relPath)) {
LOG.info("Not recording file because it's an ignored path: [%s].", relPath);
continue;
}
if (!isSymlinkInternalToKnownCellRoots(relPath)) {
LOG.info(
"Not recording file because it's a symlink external to known cell roots: [%s].",
relPath);
record(relPath, Optional.empty(), Optional.empty(), ImmutableList.of());
continue;
}
if (!willGet(relPath)) {
LOG.warn("Unable to record file: [%s].", relPath);
continue;
}
get(relPath);
}
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
materializeCurrentFileDuringPreloading = false;
}
}
@Override
public ProjectFilesystem getFilesystem() {
return projectFilesystem;
}
@Override
public boolean willGet(Path relPath) {
return delegate.willGet(relPath);
}
@Override
public boolean willGet(ArchiveMemberPath archiveMemberRelPath) {
return delegate.willGet(archiveMemberRelPath);
}
@Override
public boolean isIgnored(Path path) {
return delegate.isIgnored(path);
}
@Override
public void invalidate(Path path) {
delegate.invalidate(path);
}
@Override
public void invalidateAll() {
delegate.invalidateAll();
}
@Override
public void set(Path path, HashCode hashCode) throws IOException {
delegate.set(path, hashCode);
}
@Override
public FileHashCacheVerificationResult verify() throws IOException {
return delegate.verify();
}
}
| apache-2.0 |
naver/pinpoint | collector/src/main/java/com/navercorp/pinpoint/collector/sender/FlinkTcpDataSender.java | 2768 | /*
* Copyright 2018 NAVER Corp.
*
* 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.navercorp.pinpoint.collector.sender;
import com.navercorp.pinpoint.io.request.FlinkRequest;
import com.navercorp.pinpoint.profiler.sender.TcpDataSender;
import com.navercorp.pinpoint.rpc.client.PinpointClientFactory;
import com.navercorp.pinpoint.thrift.io.FlinkHeaderTBaseSerializer;
import org.apache.thrift.TBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import java.util.HashMap;
import java.util.Objects;
/**
* @author minwoo.jung
*/
public class FlinkTcpDataSender extends TcpDataSender<TBase<?, ?>> {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final FlinkHeaderTBaseSerializer flinkHeaderTBaseSerializer;
private final FlinkRequestFactory flinkRequestFactory;
public FlinkTcpDataSender(String name, String host, int port, PinpointClientFactory clientFactory, FlinkHeaderTBaseSerializer serializer, FlinkRequestFactory flinkRequestFactory) {
super(name, host, port, clientFactory);
Assert.hasLength(name, "name");
Assert.hasLength(host, "host");
Objects.requireNonNull(clientFactory, "clientFactory");
this.flinkHeaderTBaseSerializer = Objects.requireNonNull(serializer, "serializer");
this.flinkRequestFactory = Objects.requireNonNull(flinkRequestFactory, "clientFactory");
}
@Override
public boolean send(TBase<?, ?> data) {
FlinkRequest flinkRequest = flinkRequestFactory.createFlinkRequest(data, new HashMap<>(0));
return executor.execute(flinkRequest);
}
@Override
protected void sendPacket(Object flinkRequest) {
try {
if (flinkRequest instanceof FlinkRequest) {
byte[] copy = flinkHeaderTBaseSerializer.serialize((FlinkRequest) flinkRequest);
if (copy == null) {
return;
}
doSend(copy);
} else {
logger.error("sendPacket fail. invalid dto type:{}", flinkRequest.getClass());
}
} catch (Exception e) {
logger.warn("tcp send fail. Caused:{}", e.getMessage(), e);
}
}
}
| apache-2.0 |
multi-os-engine/moe-core | moe.apple/moe.platform.ios/src/main/java/apple/audiotoolbox/struct/MIDIChannelMessage.java | 2475 | /*
Copyright 2014-2016 Intel Corporation
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 apple.audiotoolbox.struct;
import org.moe.natj.c.StructObject;
import org.moe.natj.c.ann.Structure;
import org.moe.natj.c.ann.StructureField;
import org.moe.natj.general.NatJ;
import org.moe.natj.general.Pointer;
import org.moe.natj.general.ann.Generated;
@Generated
@Structure()
public final class MIDIChannelMessage extends StructObject {
private static long __natjCache;
static {
NatJ.register();
}
@Generated
public MIDIChannelMessage() {
super(MIDIChannelMessage.class);
}
@Generated
protected MIDIChannelMessage(Pointer peer) {
super(peer);
}
@Generated
public MIDIChannelMessage(byte status, byte data1, byte data2, byte reserved) {
super(MIDIChannelMessage.class);
setStatus(status);
setData1(data1);
setData2(data2);
setReserved(reserved);
}
/**
* contains message and channel
*/
@Generated
@StructureField(order = 0, isGetter = true)
public native byte status();
/**
* contains message and channel
*/
@Generated
@StructureField(order = 0, isGetter = false)
public native void setStatus(byte value);
/**
* message specific data
*/
@Generated
@StructureField(order = 1, isGetter = true)
public native byte data1();
/**
* message specific data
*/
@Generated
@StructureField(order = 1, isGetter = false)
public native void setData1(byte value);
@Generated
@StructureField(order = 2, isGetter = true)
public native byte data2();
@Generated
@StructureField(order = 2, isGetter = false)
public native void setData2(byte value);
@Generated
@StructureField(order = 3, isGetter = true)
public native byte reserved();
@Generated
@StructureField(order = 3, isGetter = false)
public native void setReserved(byte value);
}
| apache-2.0 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/io/UnicodeReader.java | 5514 | /*
* Copyright 1997-2011 teatrove.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.teatrove.trove.io;
import java.io.*;
/**
* This reader handles unicode escapes in a character stream as defined by
* <i>The Java Language Specification</i>.
*
* <p>A unicode escape consists of six characters: '\' and 'u' followed by
* four hexadecimal digits. If the format of the escape is not correct, then
* the escape is unprocessed. To prevent a correctly formatted unicode escape
* from being processed, preceed it with another '\'.
*
* @author Brian S O'Neill
*/
public class UnicodeReader extends EscapeReader {
/** Just a temporary buffer for holding the four hexadecimal digits. */
private char[] mMinibuf = new char[4];
private boolean mEscaped;
/**
* A UnicodeReader needs an underlying source Reader.
*
* @param source the source PositionReader
*/
public UnicodeReader(Reader source) {
super(source, 6);
}
public int read() throws IOException {
int c = mSource.read();
if (c != '\\' || !mEscapesEnabled) {
mEscaped = false;
return c;
}
c = mSource.read();
// Have scanned "\\"? (two backslashes)
if (c == '\\') {
mEscaped = !mEscaped;
mSource.unread();
return '\\';
}
// Have not scanned '\', 'u'?
if (c != 'u') {
mSource.unread();
return '\\';
}
// At this point, have scanned '\', 'u'.
// If previously escaped, then don't process unicode escape.
if (mEscaped) {
mEscaped = false;
mSource.unread();
return '\\';
}
int len = mSource.read(mMinibuf, 0, 4);
if (len == 4) {
try {
int val =
Integer.valueOf(new String(mMinibuf, 0, 4), 16).intValue();
return val;
}
catch (NumberFormatException e) {
// If the number is not a parseable as hexadecimal, then
// treat this as a bad format and do not process the
// unicode escape.
}
}
// Unread the four hexadecimal characters and the leading 'u'.
if (len >= 0) {
mSource.unread(len + 1);
}
return '\\';
}
public static void main(String[] arg) throws Exception {
Tester.test(arg);
}
private static class Tester {
public static void test(String[] arg) throws Exception {
String str =
"This is \\" + "u0061 test.\n" +
"This is \\" + "u00612 test.\n" +
"This is \\" + "u0061" + "\\" + "u0061" + " test.\n" +
"This is \\" + "u061 test.\n" +
"This is \\\\" + "u0061 test.\n" +
"This is \\" + "a test.\n";
System.out.println("\nOriginal:\n");
Reader reader = new StringReader(str);
int c;
while ( (c = reader.read()) >= 0 ) {
System.out.print((char)c);
}
System.out.println("\nConverted:\n");
reader = new StringReader(str);
reader = new UnicodeReader(reader);
while ( (c = reader.read()) != -1 ) {
System.out.print((char)c);
}
System.out.println("\nUnread test 1:\n");
reader = new StringReader(str);
PushbackPositionReader pr =
new PushbackPositionReader(new UnicodeReader(reader), 1);
while ( (c = pr.read()) != -1 ) {
pr.unread();
c = pr.read();
System.out.print((char)c);
}
System.out.println("\nUnread test 2:\n");
reader = new StringReader(str);
pr = new PushbackPositionReader(new UnicodeReader(reader), 2);
int i = 0;
while ( (c = pr.read()) != -1 ) {
if ( (i++ % 5) == 0 ) {
c = pr.read();
pr.unread();
pr.unread();
c = pr.read();
}
System.out.print((char)c);
}
System.out.println("\nUnread position test:\n");
reader = new StringReader(str);
pr = new PushbackPositionReader(new UnicodeReader(reader), 2);
System.out.print(pr.getNextPosition() + "\t");
i = 0;
while ( (c = pr.read()) != -1 ) {
if ( (i++ % 5) == 0 ) {
c = pr.read();
pr.unread();
pr.unread();
c = pr.read();
}
System.out.println((char)c);
System.out.print(pr.getNextPosition() + "\t");
}
}
}
}
| apache-2.0 |
android-art-intel/Nougat | art-extension/opttests/src/OptimizationTests/ShortMethodsInliningNonVirtualInvokes/InvokeSuperAObjectThrowNullGet_002/Main.java | 1383 | /*
* Copyright (C) 2016 Intel Corporation
*
* 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 OptimizationTests.ShortMethodsInliningNonVirtualInvokes.InvokeSuperAObjectThrowNullGet_002;
// The test checks that stack after NullPointerException occurs is correct despite inlining
class Main {
final static int iterations = 10;
public static void main(String[] args) {
Test test = new Test(iterations);
Foo nextThingy = new Foo(-1);
for(int i = 0; i < iterations; i++) {
SuperTest.thingiesArray[i] = new Foo(i);
}
for(int i = 0; i < iterations; i++) {
if (i == iterations - 1)
SuperTest.thingiesArray = null;
nextThingy = test.getThingies(SuperTest.thingiesArray, i);
test.setThingies(SuperTest.thingiesArray, nextThingy, i);
}
}
}
| apache-2.0 |
McLeodMoores/starling | projects/analytics/src/main/java/com/opengamma/analytics/financial/model/option/parameters/BlackSmileCapInflationYearOnYearParameters.java | 8083 | /**
* Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.analytics.financial.model.option.parameters;
import org.apache.commons.lang.ObjectUtils;
import com.opengamma.analytics.financial.instrument.index.IndexPrice;
import com.opengamma.analytics.financial.model.interestrate.definition.InflationYearOnYearCapFloorParameters;
import com.opengamma.analytics.financial.model.volatility.VolatilityModel;
import com.opengamma.analytics.math.interpolation.GridInterpolator2D;
import com.opengamma.analytics.math.interpolation.Interpolator1D;
import com.opengamma.analytics.math.interpolation.Interpolator2D;
import com.opengamma.analytics.math.interpolation.factory.FlatExtrapolator1dAdapter;
import com.opengamma.analytics.math.interpolation.factory.LinearInterpolator1dAdapter;
import com.opengamma.analytics.math.interpolation.factory.NamedInterpolator1dFactory;
import com.opengamma.analytics.math.surface.InterpolatedDoublesSurface;
import com.opengamma.util.ArgumentChecker;
import com.opengamma.util.tuple.DoublesPair;
/**
* Class describing the Black volatility surface used in inflation year on year cap/floor modeling. The inflation year on year rate
* (\{CPI(T_{i+1})}{CPI(T_{i})})rate is assumed to be normal.
*/
public class BlackSmileCapInflationYearOnYearParameters implements VolatilityModel<double[]> {
/**
* The volatility surface. The dimensions are the expiration and the strike. Not null.
*/
private final InterpolatedDoublesSurface _volatility;
/**
* The index price for which the volatility is valid. Not null.
*/
private final IndexPrice _index;
/**
* Constructor from the parameter surfaces.
*
* @param volatility
* The Black volatility curve.
* @param index
* The index price for which the volatility is valid.
*/
public BlackSmileCapInflationYearOnYearParameters(final InterpolatedDoublesSurface volatility, final IndexPrice index) {
ArgumentChecker.notNull(volatility, "volatility");
ArgumentChecker.notNull(index, "index");
_volatility = volatility;
_index = index;
}
/**
* Constructor from the parameter surfaces.
*
* @param expiryTimes
* The Black volatility curve.
* @param strikes
* The Black volatility curve.
* @param volatility
* The Black volatility cube.
* @param interpolator
* The interpolator necessary to Black volatility surface from the black volatility cube.
* @param index
* The index price for which the volatility is valid.
*/
public BlackSmileCapInflationYearOnYearParameters(final double[] expiryTimes, final double[] strikes, final double[][] volatility,
final Interpolator2D interpolator, final IndexPrice index) {
ArgumentChecker.notNull(volatility, "volatility");
ArgumentChecker.notNull(expiryTimes, "expiryTimes");
ArgumentChecker.notNull(strikes, "strikes");
ArgumentChecker.notNull(index, "index");
ArgumentChecker.isTrue(expiryTimes.length == volatility.length, null);
ArgumentChecker.isTrue(strikes.length == volatility[0].length, null);
final DoublesPair[] xyData = new DoublesPair[expiryTimes.length * strikes.length];
final double[] volatilityVector = new double[expiryTimes.length * strikes.length];
for (int i = 0; i < expiryTimes.length; i++) {
for (int j = 0; j < strikes.length; j++) {
xyData[i + j * expiryTimes.length] = DoublesPair.of(expiryTimes[i], strikes[j]);
volatilityVector[i + j * expiryTimes.length] = volatility[i][j];
}
}
_volatility = InterpolatedDoublesSurface.from(xyData, volatilityVector, interpolator);
_index = index;
}
/**
* Constructor from the parameter surfaces.
*
* @param parameters
* The Black volatility curve.
* @param interpolator
* The Black volatility curve.
*/
public BlackSmileCapInflationYearOnYearParameters(final InflationYearOnYearCapFloorParameters parameters, final Interpolator2D interpolator) {
ArgumentChecker.notNull(interpolator, "interpolator");
final double[] expiryTimes = parameters.getExpiryTimes();
final double[] strikes = parameters.getStrikes();
final double[][] volatility = parameters.getVolatility();
final DoublesPair[] xyData = new DoublesPair[expiryTimes.length * strikes.length];
final double[] volatilityVector = new double[expiryTimes.length * strikes.length];
for (int i = 0; i < expiryTimes.length; i++) {
for (int j = 0; j < strikes.length; j++) {
xyData[i + j * expiryTimes.length] = DoublesPair.of(expiryTimes[i], strikes[j]);
volatilityVector[i + j * expiryTimes.length] = volatility[i][j];
}
}
_volatility = InterpolatedDoublesSurface.from(xyData, volatilityVector, interpolator);
_index = parameters.getIndex();
}
/**
* Constructor from the parameter surfaces and default interpolator.
*
* @param parameters
* The Black volatility curve.
*/
public BlackSmileCapInflationYearOnYearParameters(final InflationYearOnYearCapFloorParameters parameters) {
final double[] expiryTimes = parameters.getExpiryTimes();
final double[] strikes = parameters.getStrikes();
final double[][] volatility = parameters.getVolatility();
final DoublesPair[] xyData = new DoublesPair[expiryTimes.length * strikes.length];
final double[] volatilityVector = new double[expiryTimes.length * strikes.length];
for (int i = 0; i < expiryTimes.length; i++) {
for (int j = 0; j < strikes.length; j++) {
xyData[i + j * expiryTimes.length] = DoublesPair.of(expiryTimes[i], strikes[j]);
volatilityVector[i + j * expiryTimes.length] = volatility[i][j];
}
}
final Interpolator1D linearFlat = NamedInterpolator1dFactory.of(LinearInterpolator1dAdapter.NAME, FlatExtrapolator1dAdapter.NAME,
FlatExtrapolator1dAdapter.NAME);
final GridInterpolator2D interpolator = new GridInterpolator2D(linearFlat, linearFlat);
_volatility = InterpolatedDoublesSurface.from(xyData, volatilityVector, interpolator);
_index = parameters.getIndex();
}
/**
* Return the volatility for a time to expiration and strike.
*
* @param expiration
* The time to expiration.
* @param strike
* The strike.
* @return The volatility.
*/
public double getVolatility(final double expiration, final double strike) {
return _volatility.getZValue(expiration, strike);
}
/**
* Return the volatility surface.
*
* @return The volatility surface.
*/
public InterpolatedDoublesSurface getVolatilitySurface() {
return _volatility;
}
@Override
/**
* Return the volatility for a expiration tenor array.
*
* @param data
* An array of one doubles with the expiration.
* @return The volatility.
*/
public Double getVolatility(final double[] data) {
ArgumentChecker.notNull(data, "data");
ArgumentChecker.isTrue(data.length == 2, "data should have two components (expiration and strike)");
return getVolatility(data[0], data[1]);
}
/**
* Gets the Ibor index for which the volatility is valid.
*
* @return The index.
*/
public IndexPrice getIndex() {
return _index;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + _index.hashCode();
result = prime * result + _volatility.hashCode();
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof BlackSmileCapInflationYearOnYearParameters)) {
return false;
}
final BlackSmileCapInflationYearOnYearParameters other = (BlackSmileCapInflationYearOnYearParameters) obj;
if (!ObjectUtils.equals(_index, other._index)) {
return false;
}
if (!ObjectUtils.equals(_volatility, other._volatility)) {
return false;
}
return true;
}
}
| apache-2.0 |
jmnarloch/spring-cloud-commons | spring-cloud-context/src/main/java/org/springframework/cloud/context/encrypt/EncryptorFactory.java | 1482 | /*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.context.encrypt;
import org.springframework.security.crypto.encrypt.Encryptors;
import org.springframework.security.crypto.encrypt.TextEncryptor;
import org.springframework.security.rsa.crypto.RsaSecretEncryptor;
/**
* @author Dave Syer
*
*/
public class EncryptorFactory {
// TODO: expose as config property
private static final String SALT = "deadbeef";
public TextEncryptor create(String data) {
TextEncryptor encryptor;
if (data.contains("RSA PRIVATE KEY")) {
try {
encryptor = new RsaSecretEncryptor(data);
}
catch (IllegalArgumentException e) {
throw new KeyFormatException();
}
}
else if (data.startsWith("ssh-rsa") || data.contains("RSA PUBLIC KEY")) {
throw new KeyFormatException();
}
else {
encryptor = Encryptors.text(data, SALT);
}
return encryptor;
}
}
| apache-2.0 |
sacjaya/siddhi-3 | modules/siddhi-core/src/main/java/org/wso2/siddhi/core/query/output/callback/QueryCallback.java | 1857 | /*
* Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.siddhi.core.query.output.callback;
import org.wso2.siddhi.core.event.Event;
import org.wso2.siddhi.core.event.StreamEvent;
import org.wso2.siddhi.query.api.definition.StreamDefinition;
public abstract class QueryCallback {
private StreamDefinition streamDefinition;
public StreamDefinition getStreamDefinition() {
return streamDefinition;
}
public void receiveStreamEvent(long timeStamp, StreamEvent currentEvent, StreamEvent expiredEvent) {
send(timeStamp, currentEvent, expiredEvent);
}
private void send(long timeStamp, StreamEvent currentEvent, StreamEvent expiredEvent) {
if (currentEvent != null) {
receive(timeStamp, currentEvent.toArray(), null);
} else if (expiredEvent != null) {
receive(timeStamp, null, expiredEvent.toArray());
} else {
receive(timeStamp, null, null);
}
}
public abstract void receive(long timeStamp, Event[] inEvents,
Event[] removeEvents);
public void setStreamDefinition(StreamDefinition streamDefinition) {
this.streamDefinition = streamDefinition;
}
}
| apache-2.0 |
papoose/papoose-core | core/src/main/java/org/papoose/core/util/FileUtils.java | 3722 | /**
*
* Copyright 2008-2009 (C) The original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.papoose.core.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.osgi.framework.BundleException;
/**
*
*/
public class FileUtils
{
private final static String CLASS_NAME = FileUtils.class.getName();
private final static Logger LOGGER = Logger.getLogger(CLASS_NAME);
public static boolean buildDirectoriesFromFilePath(File root, String path, char regex)
{
int lastIndex = Math.max(0, path.lastIndexOf(regex));
return buildDirectories(root, path.substring(0, lastIndex), regex);
}
public static boolean buildDirectories(File root, String path, char regex)
{
for (String directory : path.split(String.valueOf(regex))) root = new File(root, directory);
return root.mkdirs();
}
public static File buildPath(File root, Object... elements)
{
for (Object element : elements) root = new File(root, element.toString());
return root;
}
public static boolean delete(File file)
{
LOGGER.entering(CLASS_NAME, "delete", file);
boolean result = true;
try
{
if (!isSymlink(file) && file.isDirectory())
{
if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine(file + " is a directory");
for (File f : file.listFiles()) result &= delete(f);
}
}
catch (IOException e)
{
LOGGER.log(Level.WARNING, "Unable to test if file is symlink: " + file, e);
result = false;
}
result &= file.delete();
LOGGER.exiting(CLASS_NAME, "delete", result);
return result;
}
public static InputStream safeStream(File file) throws BundleException
{
try
{
return new FileInputStream(file);
}
catch (FileNotFoundException ioe)
{
throw new BundleException("Unable to obtain input stream", ioe);
}
}
/**
* Determines whether the specified file is a link rather than an actual file.
* Will not return true if there is a symlink anywhere in the path, only if the specific
* file is.
*
* @param file the file to check
* @return true iff the file is a symlink
* @throws IOException if an IO error occurs while checking the file
*/
public static boolean isSymlink(File file) throws IOException
{
if (file == null) throw new IllegalArgumentException("File must not be null");
File fileInCanonicalDir;
if (file.getParent() == null)
{
fileInCanonicalDir = file;
}
else
{
File canonicalDir = file.getParentFile().getCanonicalFile();
fileInCanonicalDir = new File(canonicalDir, file.getName());
}
return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());
}
private FileUtils() {}
}
| apache-2.0 |
gdenning/pushsignal-server | src/main/java/com/pushsignal/controllers/InviteController.java | 4016 | package com.pushsignal.controllers;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.pushsignal.domain.EventInvite;
import com.pushsignal.domain.EventMember;
import com.pushsignal.logic.InviteLogic;
import com.pushsignal.xml.jaxb.DeleteResultDTO;
import com.pushsignal.xml.jaxb.EventInviteDTO;
import com.pushsignal.xml.jaxb.EventInviteSetDTO;
import com.pushsignal.xml.jaxb.EventMemberDTO;
@Scope("singleton")
@Controller
public class InviteController extends AbstractController {
@Autowired
private InviteLogic inviteLogic;
/**
* Get a list of all open invites for the logged-in user.
*
* @return XML model of a set of EventInvites.
*/
@RequestMapping(value="/invites/all")
public ModelAndView getAllInvites(final HttpServletResponse response) {
try {
final Set<EventInvite> eventInvites = inviteLogic.getAllInvites(getAuthenticatedEmail());
final EventInviteSetDTO eventInviteDTOs = new EventInviteSetDTO();
for (EventInvite eventInvite : eventInvites) {
eventInviteDTOs.getEventInvites().add(new EventInviteDTO(eventInvite));
}
return getXMLModelAndView("invites", eventInviteDTOs);
} catch (final Exception ex) {
return getErrorModelAndView(response, ex);
}
}
/**
* Get details about a particular invite.
*
* @param inviteId
* @return XML model of the invite.
*/
@RequestMapping(value="/invites/{inviteId}")
public ModelAndView getInvite(final HttpServletResponse response,
@PathVariable final long inviteId) {
try {
final EventInvite eventInvite = inviteLogic.getInvite(getAuthenticatedEmail(), inviteId);
return getXMLModelAndView("invite", new EventInviteDTO(eventInvite));
} catch (final Exception ex) {
return getErrorModelAndView(response, ex);
}
}
/**
* Invite another user to an event that you are a member of.
*
* @param eventId
* @param email
* @return XML model of the EventInvite.
*/
@RequestMapping(value="/invites/create", method = RequestMethod.POST)
public ModelAndView createInvite(final HttpServletResponse response,
@RequestParam final long eventId,
@RequestParam final String email) {
try {
final EventInvite eventInvite = inviteLogic.createInvite(getAuthenticatedEmail(), eventId, email);
return getXMLModelAndView("invite", new EventInviteDTO(eventInvite));
} catch (final Exception ex) {
return getErrorModelAndView(response, ex);
}
}
/**
* Accept an invite that was sent to you.
*
* @param inviteId
* @return XML model of the EventMember.
*/
@RequestMapping(value="/invites/{inviteId}/accept", method = RequestMethod.POST)
public ModelAndView acceptInvite(final HttpServletResponse response,
@PathVariable final long inviteId) {
try {
final EventMember eventMember = inviteLogic.acceptInvite(getAuthenticatedEmail(), inviteId);
return getXMLModelAndView("eventMember", new EventMemberDTO(eventMember));
} catch (final Exception ex) {
return getErrorModelAndView(response, ex);
}
}
/**
* Decline an invite that was sent to you.
*
* @param inviteId
* @return XML model of the DeleteResult.
*/
@RequestMapping(value="/invites/{inviteId}", method = RequestMethod.DELETE)
public ModelAndView declineInvite(final HttpServletResponse response,
@PathVariable final long inviteId) {
try {
inviteLogic.declineInvite(getAuthenticatedEmail(), inviteId);
return getXMLModelAndView("eventInvite", new DeleteResultDTO("eventInvite"));
} catch (final Exception ex) {
return getErrorModelAndView(response, ex);
}
}
}
| apache-2.0 |
michaelliao/openweixin | wxapi/src/main/java/com/itranswarp/wxapi/token/AccessToken.java | 297 | package com.itranswarp.wxapi.token;
/**
* Simple JavaBean to deserialize from JSON string returned by weixin.
*
* @author michael
*/
public class AccessToken {
/**
* The access token string.
*/
public String access_token;
/**
* Expires in seconds.
*/
public int expires_in;
}
| apache-2.0 |
CheapTravelWorld/CheapTravelBestWorld | app/src/main/java/com/qyzsj/models/PostV2.java | 105 | package com.qyzsj.models;
/**
* Created by Administrator on 2016/9/23.
*
*/
public class PostV2 {
}
| apache-2.0 |
OSEHRA-Sandbox/MOCHA | src/gov/va/med/pharmacy/peps/external/common/drugdatavendor/capability/PerformDrugChecksCapability.java | 715 | /**
* Copyright 2007, Southwest Research Institute
*/
package gov.va.med.pharmacy.peps.external.common.drugdatavendor.capability;
import gov.va.med.pharmacy.peps.common.vo.OrderCheckResultsVo;
import gov.va.med.pharmacy.peps.common.vo.OrderCheckVo;
/**
* Call the drug data vendor capabilities to perform the checks.
*/
public interface PerformDrugChecksCapability {
/**
* Convert drugs into FDB ScreenDrugs and call the individual
* drug check capabilities to perform the checks.
*
* @param requestVo OrderCheckVo requesting checks
* @return OrderCheckResultsVo with results from drug data vendor
*/
OrderCheckResultsVo performDrugChecks(OrderCheckVo requestVo);
} | apache-2.0 |
floodlight/loxigen-artifacts | openflowj/gen-src/main/java/org/projectfloodlight/openflow/protocol/ver15/OFBsnTlvBucketVer15.java | 8931 | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_class.java
// Do not modify
package org.projectfloodlight.openflow.protocol.ver15;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import com.google.common.collect.ImmutableList;
import java.util.Set;
import io.netty.buffer.ByteBuf;
import com.google.common.hash.PrimitiveSink;
import com.google.common.hash.Funnel;
class OFBsnTlvBucketVer15 implements OFBsnTlvBucket {
private static final Logger logger = LoggerFactory.getLogger(OFBsnTlvBucketVer15.class);
// version: 1.5
final static byte WIRE_VERSION = 6;
final static int MINIMUM_LENGTH = 4;
// maximum OF message length: 16 bit, unsigned
final static int MAXIMUM_LENGTH = 0xFFFF;
private final static List<OFBsnTlv> DEFAULT_VALUE = ImmutableList.<OFBsnTlv>of();
// OF message fields
private final List<OFBsnTlv> value;
//
// Immutable default instance
final static OFBsnTlvBucketVer15 DEFAULT = new OFBsnTlvBucketVer15(
DEFAULT_VALUE
);
// package private constructor - used by readers, builders, and factory
OFBsnTlvBucketVer15(List<OFBsnTlv> value) {
if(value == null) {
throw new NullPointerException("OFBsnTlvBucketVer15: property value cannot be null");
}
this.value = value;
}
// Accessors for OF message fields
@Override
public int getType() {
return 0x40;
}
@Override
public List<OFBsnTlv> getValue() {
return value;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_15;
}
public OFBsnTlvBucket.Builder createBuilder() {
return new BuilderWithParent(this);
}
static class BuilderWithParent implements OFBsnTlvBucket.Builder {
final OFBsnTlvBucketVer15 parentMessage;
// OF message fields
private boolean valueSet;
private List<OFBsnTlv> value;
BuilderWithParent(OFBsnTlvBucketVer15 parentMessage) {
this.parentMessage = parentMessage;
}
@Override
public int getType() {
return 0x40;
}
@Override
public List<OFBsnTlv> getValue() {
return value;
}
@Override
public OFBsnTlvBucket.Builder setValue(List<OFBsnTlv> value) {
this.value = value;
this.valueSet = true;
return this;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_15;
}
@Override
public OFBsnTlvBucket build() {
List<OFBsnTlv> value = this.valueSet ? this.value : parentMessage.value;
if(value == null)
throw new NullPointerException("Property value must not be null");
//
return new OFBsnTlvBucketVer15(
value
);
}
}
static class Builder implements OFBsnTlvBucket.Builder {
// OF message fields
private boolean valueSet;
private List<OFBsnTlv> value;
@Override
public int getType() {
return 0x40;
}
@Override
public List<OFBsnTlv> getValue() {
return value;
}
@Override
public OFBsnTlvBucket.Builder setValue(List<OFBsnTlv> value) {
this.value = value;
this.valueSet = true;
return this;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_15;
}
//
@Override
public OFBsnTlvBucket build() {
List<OFBsnTlv> value = this.valueSet ? this.value : DEFAULT_VALUE;
if(value == null)
throw new NullPointerException("Property value must not be null");
return new OFBsnTlvBucketVer15(
value
);
}
}
final static Reader READER = new Reader();
static class Reader implements OFMessageReader<OFBsnTlvBucket> {
@Override
public OFBsnTlvBucket readFrom(ByteBuf bb) throws OFParseError {
int start = bb.readerIndex();
// fixed value property type == 0x40
short type = bb.readShort();
if(type != (short) 0x40)
throw new OFParseError("Wrong type: Expected=0x40(0x40), got="+type);
int length = U16.f(bb.readShort());
if(length < MINIMUM_LENGTH)
throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
// Buffer does not have all data yet
bb.readerIndex(start);
return null;
}
if(logger.isTraceEnabled())
logger.trace("readFrom - length={}", length);
List<OFBsnTlv> value = ChannelUtils.readList(bb, length - (bb.readerIndex() - start), OFBsnTlvVer15.READER);
OFBsnTlvBucketVer15 bsnTlvBucketVer15 = new OFBsnTlvBucketVer15(
value
);
if(logger.isTraceEnabled())
logger.trace("readFrom - read={}", bsnTlvBucketVer15);
return bsnTlvBucketVer15;
}
}
public void putTo(PrimitiveSink sink) {
FUNNEL.funnel(this, sink);
}
final static OFBsnTlvBucketVer15Funnel FUNNEL = new OFBsnTlvBucketVer15Funnel();
static class OFBsnTlvBucketVer15Funnel implements Funnel<OFBsnTlvBucketVer15> {
private static final long serialVersionUID = 1L;
@Override
public void funnel(OFBsnTlvBucketVer15 message, PrimitiveSink sink) {
// fixed value property type = 0x40
sink.putShort((short) 0x40);
// FIXME: skip funnel of length
FunnelUtils.putList(message.value, sink);
}
}
public void writeTo(ByteBuf bb) {
WRITER.write(bb, this);
}
final static Writer WRITER = new Writer();
static class Writer implements OFMessageWriter<OFBsnTlvBucketVer15> {
@Override
public void write(ByteBuf bb, OFBsnTlvBucketVer15 message) {
int startIndex = bb.writerIndex();
// fixed value property type = 0x40
bb.writeShort((short) 0x40);
// length is length of variable message, will be updated at the end
int lengthIndex = bb.writerIndex();
bb.writeShort(U16.t(0));
ChannelUtils.writeList(bb, message.value);
// update length field
int length = bb.writerIndex() - startIndex;
if (length > MAXIMUM_LENGTH) {
throw new IllegalArgumentException("OFBsnTlvBucketVer15: message length (" + length + ") exceeds maximum (0xFFFF)");
}
bb.setShort(lengthIndex, length);
}
}
@Override
public String toString() {
StringBuilder b = new StringBuilder("OFBsnTlvBucketVer15(");
b.append("value=").append(value);
b.append(")");
return b.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OFBsnTlvBucketVer15 other = (OFBsnTlvBucketVer15) obj;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
}
| apache-2.0 |
nalin-adhikari/springboot-rest-mongo | src/main/java/com/nalin/springbootmongo/controller/TestController.java | 447 | /**
*
*/
package com.nalin.springbootmongo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @author nalin
*
*/
@RestController
@RequestMapping("/")
public class TestController {
@RequestMapping(method=RequestMethod.GET)
public String home(){
return "Server is running !";
}
}
| apache-2.0 |
danielmitterdorfer/elasticsearch | plugins/repository-azure/src/test/java/org/elasticsearch/cloud/azure/storage/AzureStorageSettingsFilterTests.java | 3277 | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.cloud.azure.storage;
import org.elasticsearch.common.inject.ModuleTestCase;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.plugin.repository.azure.AzureRepositoryPlugin;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.FakeRestRequest;
import java.io.IOException;
import static org.hamcrest.Matchers.contains;
public class AzureStorageSettingsFilterTests extends ESTestCase {
static final Settings settings = Settings.builder()
.put("cloud.azure.storage.azure1.account", "myaccount1")
.put("cloud.azure.storage.azure1.key", "mykey1")
.put("cloud.azure.storage.azure1.default", true)
.put("cloud.azure.storage.azure2.account", "myaccount2")
.put("cloud.azure.storage.azure2.key", "mykey2")
.put("cloud.azure.storage.azure3.account", "myaccount3")
.put("cloud.azure.storage.azure3.key", "mykey3")
.build();
public void testSettingsFiltering() throws IOException {
AzureRepositoryPlugin p = new AzureRepositoryPlugin(Settings.EMPTY);
SettingsModule module = new SettingsModule(Settings.EMPTY, p.getSettings(), p.getSettingsFilter());
SettingsFilter settingsFilter = ModuleTestCase.bindAndGetInstance(module, SettingsFilter.class);
// Test using direct filtering
Settings filteredSettings = settingsFilter.filter(settings);
assertThat(filteredSettings.getAsMap().keySet(), contains("cloud.azure.storage.azure1.default"));
// Test using toXContent filtering
RestRequest request = new FakeRestRequest();
settingsFilter.addFilterSettingParams(request);
XContentBuilder xContentBuilder = XContentBuilder.builder(JsonXContent.jsonXContent);
xContentBuilder.startObject();
settings.toXContent(xContentBuilder, request);
xContentBuilder.endObject();
String filteredSettingsString = xContentBuilder.string();
filteredSettings = Settings.builder().loadFromSource(filteredSettingsString).build();
assertThat(filteredSettings.getAsMap().keySet(), contains("cloud.azure.storage.azure1.default"));
}
}
| apache-2.0 |
droiddeveloper1/android-wear-gestures-recognition | wear/build/generated/source/r/debug/com/dmt/gestureproject_1/R.java | 53211 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.dmt.gestureproject_1;
public final class R {
public static final class attr {
/** <p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int cameraBearing=0x7f01000a;
/** <p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int cameraTargetLat=0x7f01000b;
/** <p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int cameraTargetLng=0x7f01000c;
/** <p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int cameraTilt=0x7f01000d;
/** <p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int cameraZoom=0x7f01000e;
/** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int circle_border_color=0x7f010005;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int circle_border_width=0x7f010004;
/** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int circle_color=0x7f010001;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int circle_padding=0x7f010006;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int circle_radius=0x7f010002;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int circle_radius_pressed=0x7f010003;
/** <p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>left</code></td><td>0x01</td><td></td></tr>
<tr><td><code>top</code></td><td>0x02</td><td></td></tr>
<tr><td><code>right</code></td><td>0x04</td><td></td></tr>
<tr><td><code>bottom</code></td><td>0x08</td><td></td></tr>
<tr><td><code>all</code></td><td>0x0F</td><td></td></tr>
</table>
*/
public static final int layout_box=0x7f010000;
/** <p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>normal</code></td><td>1</td><td></td></tr>
<tr><td><code>satellite</code></td><td>2</td><td></td></tr>
<tr><td><code>terrain</code></td><td>3</td><td></td></tr>
<tr><td><code>hybrid</code></td><td>4</td><td></td></tr>
</table>
*/
public static final int mapType=0x7f010009;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int rectLayout=0x7f010017;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int roundLayout=0x7f010018;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int shadow_width=0x7f010007;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int uiCompass=0x7f01000f;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int uiRotateGestures=0x7f010010;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int uiScrollGestures=0x7f010011;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int uiTiltGestures=0x7f010012;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int uiZoomControls=0x7f010013;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int uiZoomGestures=0x7f010014;
/** <p>Must be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int update_interval=0x7f010008;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int useViewLifecycle=0x7f010015;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int zOrderOnTop=0x7f010016;
}
public static final class color {
public static final int black=0x7f040000;
public static final int blue=0x7f040001;
public static final int common_action_bar_splitter=0x7f040002;
public static final int common_signin_btn_dark_text_default=0x7f040003;
public static final int common_signin_btn_dark_text_disabled=0x7f040004;
public static final int common_signin_btn_dark_text_focused=0x7f040005;
public static final int common_signin_btn_dark_text_pressed=0x7f040006;
public static final int common_signin_btn_default_background=0x7f040007;
public static final int common_signin_btn_light_text_default=0x7f040008;
public static final int common_signin_btn_light_text_disabled=0x7f040009;
public static final int common_signin_btn_light_text_focused=0x7f04000a;
public static final int common_signin_btn_light_text_pressed=0x7f04000b;
public static final int common_signin_btn_text_dark=0x7f04001e;
public static final int common_signin_btn_text_light=0x7f04001f;
public static final int dark_blue=0x7f04000c;
public static final int disabled_text_light=0x7f04000d;
public static final int dismiss_close=0x7f04000e;
public static final int dismiss_close_pressed=0x7f04000f;
public static final int dismiss_overlay_bg=0x7f040010;
public static final int green=0x7f040011;
public static final int grey=0x7f040012;
public static final int light_grey=0x7f040013;
public static final int lime_green=0x7f040014;
public static final int opaque_red=0x7f040015;
public static final int orange=0x7f040016;
public static final int primary_text_dark=0x7f040017;
public static final int primary_text_light=0x7f040018;
public static final int red=0x7f040019;
public static final int secondary_text_light=0x7f04001a;
public static final int semitransparent_grey=0x7f04001b;
public static final int translucent_red=0x7f04001c;
public static final int white=0x7f04001d;
}
public static final class dimen {
public static final int card_content_padding_rect_left=0x7f060000;
public static final int card_content_padding_rect_right=0x7f060001;
public static final int card_content_padding_rect_top=0x7f060002;
public static final int close_button_diameter=0x7f060003;
public static final int dismiss_padding=0x7f060004;
}
public static final class drawable {
public static final int card_background=0x7f020000;
public static final int card_frame=0x7f020001;
public static final int card_frame_pressed=0x7f020002;
public static final int close_button=0x7f020003;
public static final int common_full_open_on_phone=0x7f020004;
public static final int common_ic_googleplayservices=0x7f020005;
public static final int common_signin_btn_icon_dark=0x7f020006;
public static final int common_signin_btn_icon_disabled_dark=0x7f020007;
public static final int common_signin_btn_icon_disabled_focus_dark=0x7f020008;
public static final int common_signin_btn_icon_disabled_focus_light=0x7f020009;
public static final int common_signin_btn_icon_disabled_light=0x7f02000a;
public static final int common_signin_btn_icon_focus_dark=0x7f02000b;
public static final int common_signin_btn_icon_focus_light=0x7f02000c;
public static final int common_signin_btn_icon_light=0x7f02000d;
public static final int common_signin_btn_icon_normal_dark=0x7f02000e;
public static final int common_signin_btn_icon_normal_light=0x7f02000f;
public static final int common_signin_btn_icon_pressed_dark=0x7f020010;
public static final int common_signin_btn_icon_pressed_light=0x7f020011;
public static final int common_signin_btn_text_dark=0x7f020012;
public static final int common_signin_btn_text_disabled_dark=0x7f020013;
public static final int common_signin_btn_text_disabled_focus_dark=0x7f020014;
public static final int common_signin_btn_text_disabled_focus_light=0x7f020015;
public static final int common_signin_btn_text_disabled_light=0x7f020016;
public static final int common_signin_btn_text_focus_dark=0x7f020017;
public static final int common_signin_btn_text_focus_light=0x7f020018;
public static final int common_signin_btn_text_light=0x7f020019;
public static final int common_signin_btn_text_normal_dark=0x7f02001a;
public static final int common_signin_btn_text_normal_light=0x7f02001b;
public static final int common_signin_btn_text_pressed_dark=0x7f02001c;
public static final int common_signin_btn_text_pressed_light=0x7f02001d;
public static final int confirmation_animation=0x7f02001e;
public static final int generic_confirmation_00163=0x7f02001f;
public static final int generic_confirmation_00164=0x7f020020;
public static final int generic_confirmation_00165=0x7f020021;
public static final int generic_confirmation_00166=0x7f020022;
public static final int generic_confirmation_00167=0x7f020023;
public static final int generic_confirmation_00168=0x7f020024;
public static final int generic_confirmation_00169=0x7f020025;
public static final int generic_confirmation_00170=0x7f020026;
public static final int generic_confirmation_00171=0x7f020027;
public static final int generic_confirmation_00172=0x7f020028;
public static final int generic_confirmation_00173=0x7f020029;
public static final int generic_confirmation_00174=0x7f02002a;
public static final int generic_confirmation_00175=0x7f02002b;
public static final int generic_confirmation_00176=0x7f02002c;
public static final int generic_confirmation_00177=0x7f02002d;
public static final int generic_confirmation_00178=0x7f02002e;
public static final int generic_confirmation_00179=0x7f02002f;
public static final int generic_confirmation_00180=0x7f020030;
public static final int generic_confirmation_00181=0x7f020031;
public static final int generic_confirmation_00182=0x7f020032;
public static final int generic_confirmation_00183=0x7f020033;
public static final int generic_confirmation_00184=0x7f020034;
public static final int generic_confirmation_00185=0x7f020035;
public static final int generic_confirmation_00186=0x7f020036;
public static final int generic_confirmation_00187=0x7f020037;
public static final int generic_confirmation_00188=0x7f020038;
public static final int generic_confirmation_00189=0x7f020039;
public static final int generic_confirmation_00190=0x7f02003a;
public static final int generic_confirmation_00191=0x7f02003b;
public static final int generic_confirmation_00192=0x7f02003c;
public static final int generic_confirmation_00193=0x7f02003d;
public static final int go_to_phone_00156=0x7f02003e;
public static final int go_to_phone_00157=0x7f02003f;
public static final int go_to_phone_00158=0x7f020040;
public static final int go_to_phone_00159=0x7f020041;
public static final int go_to_phone_00160=0x7f020042;
public static final int go_to_phone_00161=0x7f020043;
public static final int go_to_phone_00162=0x7f020044;
public static final int go_to_phone_00163=0x7f020045;
public static final int go_to_phone_00164=0x7f020046;
public static final int go_to_phone_00165=0x7f020047;
public static final int go_to_phone_00166=0x7f020048;
public static final int go_to_phone_00167=0x7f020049;
public static final int go_to_phone_00168=0x7f02004a;
public static final int go_to_phone_00169=0x7f02004b;
public static final int go_to_phone_00170=0x7f02004c;
public static final int go_to_phone_00171=0x7f02004d;
public static final int go_to_phone_00172=0x7f02004e;
public static final int go_to_phone_00173=0x7f02004f;
public static final int go_to_phone_00174=0x7f020050;
public static final int go_to_phone_00175=0x7f020051;
public static final int go_to_phone_00176=0x7f020052;
public static final int go_to_phone_00177=0x7f020053;
public static final int go_to_phone_00178=0x7f020054;
public static final int go_to_phone_00185=0x7f020055;
public static final int go_to_phone_00186=0x7f020056;
public static final int go_to_phone_00187=0x7f020057;
public static final int go_to_phone_00188=0x7f020058;
public static final int go_to_phone_00189=0x7f020059;
public static final int go_to_phone_00190=0x7f02005a;
public static final int go_to_phone_00191=0x7f02005b;
public static final int go_to_phone_00192=0x7f02005c;
public static final int go_to_phone_00193=0x7f02005d;
public static final int go_to_phone_00194=0x7f02005e;
public static final int go_to_phone_00195=0x7f02005f;
public static final int go_to_phone_00196=0x7f020060;
public static final int go_to_phone_00197=0x7f020061;
public static final int go_to_phone_00198=0x7f020062;
public static final int go_to_phone_00199=0x7f020063;
public static final int go_to_phone_00200=0x7f020064;
public static final int go_to_phone_00210=0x7f020065;
public static final int go_to_phone_00211=0x7f020066;
public static final int go_to_phone_00212=0x7f020067;
public static final int go_to_phone_00213=0x7f020068;
public static final int go_to_phone_00214=0x7f020069;
public static final int go_to_phone_00215=0x7f02006a;
public static final int go_to_phone_00216=0x7f02006b;
public static final int go_to_phone_00217=0x7f02006c;
public static final int go_to_phone_00218=0x7f02006d;
public static final int go_to_phone_00219=0x7f02006e;
public static final int go_to_phone_00220=0x7f02006f;
public static final int go_to_phone_00221=0x7f020070;
public static final int go_to_phone_00222=0x7f020071;
public static final int go_to_phone_00223=0x7f020072;
public static final int go_to_phone_00224=0x7f020073;
public static final int go_to_phone_animation=0x7f020074;
public static final int ic_full_cancel=0x7f020075;
public static final int ic_full_sad=0x7f020076;
public static final int ic_launcher=0x7f020077;
public static final int ic_plusone_medium_off_client=0x7f020078;
public static final int ic_plusone_small_off_client=0x7f020079;
public static final int ic_plusone_standard_off_client=0x7f02007a;
public static final int ic_plusone_tall_off_client=0x7f02007b;
public static final int powered_by_google_dark=0x7f02007c;
public static final int powered_by_google_light=0x7f02007d;
}
public static final class id {
public static final int action_error=0x7f05000b;
public static final int action_success=0x7f05000d;
public static final int all=0x7f050004;
public static final int animation=0x7f05000e;
public static final int bottom=0x7f050003;
public static final int btn_send=0x7f050018;
public static final int dismiss_overlay_button=0x7f050011;
public static final int dismiss_overlay_explain=0x7f050010;
public static final int error_message=0x7f05000c;
public static final int hybrid=0x7f050009;
public static final int left=0x7f050000;
public static final int message=0x7f05000f;
public static final int none=0x7f050005;
public static final int normal=0x7f050006;
public static final int rect_activity_main_activity_wear=0x7f050012;
public static final int right=0x7f050002;
public static final int round_activity_main_activity_wear=0x7f050019;
public static final int satellite=0x7f050007;
public static final int switch_filter=0x7f050014;
public static final int terrain=0x7f050008;
public static final int text=0x7f05001a;
public static final int title=0x7f050013;
public static final int top=0x7f050001;
public static final int watch_view_stub=0x7f05000a;
public static final int x_accel=0x7f050015;
public static final int y_accel=0x7f050016;
public static final int z_accel=0x7f050017;
}
public static final class integer {
public static final int google_play_services_version=0x7f070000;
}
public static final class layout {
public static final int activity_main_activity_wear=0x7f030000;
public static final int confirmation_activity_layout=0x7f030001;
public static final int dismiss_overlay=0x7f030002;
public static final int rect_activity_main_activity_wear=0x7f030003;
public static final int round_activity_main_activity_wear=0x7f030004;
public static final int watch_card_content=0x7f030005;
}
public static final class string {
public static final int accel_demo=0x7f080000;
public static final int app_name=0x7f080001;
public static final int common_android_wear_notification_needs_update_text=0x7f080002;
public static final int common_android_wear_update_text=0x7f080003;
public static final int common_android_wear_update_title=0x7f080004;
public static final int common_google_play_services_enable_button=0x7f080005;
public static final int common_google_play_services_enable_text=0x7f080006;
public static final int common_google_play_services_enable_title=0x7f080007;
public static final int common_google_play_services_error_notification_requested_by_msg=0x7f080008;
public static final int common_google_play_services_install_button=0x7f080009;
public static final int common_google_play_services_install_text_phone=0x7f08000a;
public static final int common_google_play_services_install_text_tablet=0x7f08000b;
public static final int common_google_play_services_install_title=0x7f08000c;
public static final int common_google_play_services_invalid_account_text=0x7f08000d;
public static final int common_google_play_services_invalid_account_title=0x7f08000e;
public static final int common_google_play_services_needs_enabling_title=0x7f08000f;
public static final int common_google_play_services_network_error_text=0x7f080010;
public static final int common_google_play_services_network_error_title=0x7f080011;
public static final int common_google_play_services_notification_needs_installation_title=0x7f080012;
public static final int common_google_play_services_notification_needs_update_title=0x7f080013;
public static final int common_google_play_services_notification_ticker=0x7f080014;
public static final int common_google_play_services_unknown_issue=0x7f080015;
public static final int common_google_play_services_unsupported_text=0x7f080016;
public static final int common_google_play_services_unsupported_title=0x7f080017;
public static final int common_google_play_services_update_button=0x7f080018;
public static final int common_google_play_services_update_text=0x7f080019;
public static final int common_google_play_services_update_title=0x7f08001a;
public static final int common_open_on_phone=0x7f08001b;
public static final int common_signin_button_text=0x7f08001c;
public static final int common_signin_button_text_long=0x7f08001d;
public static final int hello_round=0x7f08001e;
public static final int hello_square=0x7f08001f;
public static final int send_data=0x7f080020;
}
public static final class style {
public static final int CardContent=0x7f090000;
public static final int CardText=0x7f090001;
public static final int CardTitle=0x7f090002;
public static final int DismissOverlayText=0x7f090003;
public static final int TextAppearance_Wearable_Large=0x7f090004;
public static final int TextAppearance_Wearable_Medium=0x7f090005;
public static final int TextAppearance_Wearable_Small=0x7f090006;
public static final int TextView_Large=0x7f090007;
public static final int TextView_Large_Light=0x7f090008;
public static final int TextView_Medium=0x7f090009;
public static final int TextView_Medium_Light=0x7f09000a;
public static final int TextView_Small=0x7f09000b;
public static final int TextView_Small_Light=0x7f09000c;
public static final int Theme_Wearable=0x7f09000d;
public static final int Theme_Wearable_Modal=0x7f09000e;
}
public static final class styleable {
/** Attributes that can be used with a BoxInsetLayout.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #BoxInsetLayout_layout_box com.dmt.gestureproject_1:layout_box}</code></td><td></td></tr>
</table>
@see #BoxInsetLayout_layout_box
*/
public static final int[] BoxInsetLayout = {
0x7f010000
};
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#layout_box}
attribute's value can be found in the {@link #BoxInsetLayout} array.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>left</code></td><td>0x01</td><td></td></tr>
<tr><td><code>top</code></td><td>0x02</td><td></td></tr>
<tr><td><code>right</code></td><td>0x04</td><td></td></tr>
<tr><td><code>bottom</code></td><td>0x08</td><td></td></tr>
<tr><td><code>all</code></td><td>0x0F</td><td></td></tr>
</table>
@attr name com.dmt.gestureproject_1:layout_box
*/
public static final int BoxInsetLayout_layout_box = 0;
/** Attributes that can be used with a CircledImageView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #CircledImageView_android_src android:src}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_circle_border_color com.dmt.gestureproject_1:circle_border_color}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_circle_border_width com.dmt.gestureproject_1:circle_border_width}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_circle_color com.dmt.gestureproject_1:circle_color}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_circle_padding com.dmt.gestureproject_1:circle_padding}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_circle_radius com.dmt.gestureproject_1:circle_radius}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_circle_radius_pressed com.dmt.gestureproject_1:circle_radius_pressed}</code></td><td></td></tr>
<tr><td><code>{@link #CircledImageView_shadow_width com.dmt.gestureproject_1:shadow_width}</code></td><td></td></tr>
</table>
@see #CircledImageView_android_src
@see #CircledImageView_circle_border_color
@see #CircledImageView_circle_border_width
@see #CircledImageView_circle_color
@see #CircledImageView_circle_padding
@see #CircledImageView_circle_radius
@see #CircledImageView_circle_radius_pressed
@see #CircledImageView_shadow_width
*/
public static final int[] CircledImageView = {
0x01010119, 0x7f010001, 0x7f010002, 0x7f010003,
0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007
};
/**
<p>This symbol is the offset where the {@link android.R.attr#src}
attribute's value can be found in the {@link #CircledImageView} array.
@attr name android:src
*/
public static final int CircledImageView_android_src = 0;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#circle_border_color}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:circle_border_color
*/
public static final int CircledImageView_circle_border_color = 5;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#circle_border_width}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:circle_border_width
*/
public static final int CircledImageView_circle_border_width = 4;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#circle_color}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:circle_color
*/
public static final int CircledImageView_circle_color = 1;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#circle_padding}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:circle_padding
*/
public static final int CircledImageView_circle_padding = 6;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#circle_radius}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:circle_radius
*/
public static final int CircledImageView_circle_radius = 2;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#circle_radius_pressed}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:circle_radius_pressed
*/
public static final int CircledImageView_circle_radius_pressed = 3;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#shadow_width}
attribute's value can be found in the {@link #CircledImageView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:shadow_width
*/
public static final int CircledImageView_shadow_width = 7;
/** Attributes that can be used with a DelayedConfirmationView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #DelayedConfirmationView_update_interval com.dmt.gestureproject_1:update_interval}</code></td><td></td></tr>
</table>
@see #DelayedConfirmationView_update_interval
*/
public static final int[] DelayedConfirmationView = {
0x7f010008
};
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#update_interval}
attribute's value can be found in the {@link #DelayedConfirmationView} array.
<p>Must be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:update_interval
*/
public static final int DelayedConfirmationView_update_interval = 0;
/** Attributes that can be used with a MapAttrs.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MapAttrs_cameraBearing com.dmt.gestureproject_1:cameraBearing}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_cameraTargetLat com.dmt.gestureproject_1:cameraTargetLat}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_cameraTargetLng com.dmt.gestureproject_1:cameraTargetLng}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_cameraTilt com.dmt.gestureproject_1:cameraTilt}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_cameraZoom com.dmt.gestureproject_1:cameraZoom}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_mapType com.dmt.gestureproject_1:mapType}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_uiCompass com.dmt.gestureproject_1:uiCompass}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_uiRotateGestures com.dmt.gestureproject_1:uiRotateGestures}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_uiScrollGestures com.dmt.gestureproject_1:uiScrollGestures}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_uiTiltGestures com.dmt.gestureproject_1:uiTiltGestures}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_uiZoomControls com.dmt.gestureproject_1:uiZoomControls}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_uiZoomGestures com.dmt.gestureproject_1:uiZoomGestures}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_useViewLifecycle com.dmt.gestureproject_1:useViewLifecycle}</code></td><td></td></tr>
<tr><td><code>{@link #MapAttrs_zOrderOnTop com.dmt.gestureproject_1:zOrderOnTop}</code></td><td></td></tr>
</table>
@see #MapAttrs_cameraBearing
@see #MapAttrs_cameraTargetLat
@see #MapAttrs_cameraTargetLng
@see #MapAttrs_cameraTilt
@see #MapAttrs_cameraZoom
@see #MapAttrs_mapType
@see #MapAttrs_uiCompass
@see #MapAttrs_uiRotateGestures
@see #MapAttrs_uiScrollGestures
@see #MapAttrs_uiTiltGestures
@see #MapAttrs_uiZoomControls
@see #MapAttrs_uiZoomGestures
@see #MapAttrs_useViewLifecycle
@see #MapAttrs_zOrderOnTop
*/
public static final int[] MapAttrs = {
0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c,
0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010,
0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014,
0x7f010015, 0x7f010016
};
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#cameraBearing}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:cameraBearing
*/
public static final int MapAttrs_cameraBearing = 1;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#cameraTargetLat}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:cameraTargetLat
*/
public static final int MapAttrs_cameraTargetLat = 2;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#cameraTargetLng}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:cameraTargetLng
*/
public static final int MapAttrs_cameraTargetLng = 3;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#cameraTilt}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:cameraTilt
*/
public static final int MapAttrs_cameraTilt = 4;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#cameraZoom}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:cameraZoom
*/
public static final int MapAttrs_cameraZoom = 5;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#mapType}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>normal</code></td><td>1</td><td></td></tr>
<tr><td><code>satellite</code></td><td>2</td><td></td></tr>
<tr><td><code>terrain</code></td><td>3</td><td></td></tr>
<tr><td><code>hybrid</code></td><td>4</td><td></td></tr>
</table>
@attr name com.dmt.gestureproject_1:mapType
*/
public static final int MapAttrs_mapType = 0;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#uiCompass}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:uiCompass
*/
public static final int MapAttrs_uiCompass = 6;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#uiRotateGestures}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:uiRotateGestures
*/
public static final int MapAttrs_uiRotateGestures = 7;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#uiScrollGestures}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:uiScrollGestures
*/
public static final int MapAttrs_uiScrollGestures = 8;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#uiTiltGestures}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:uiTiltGestures
*/
public static final int MapAttrs_uiTiltGestures = 9;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#uiZoomControls}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:uiZoomControls
*/
public static final int MapAttrs_uiZoomControls = 10;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#uiZoomGestures}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:uiZoomGestures
*/
public static final int MapAttrs_uiZoomGestures = 11;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#useViewLifecycle}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:useViewLifecycle
*/
public static final int MapAttrs_useViewLifecycle = 12;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#zOrderOnTop}
attribute's value can be found in the {@link #MapAttrs} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.dmt.gestureproject_1:zOrderOnTop
*/
public static final int MapAttrs_zOrderOnTop = 13;
/** Attributes that can be used with a WatchViewStub.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #WatchViewStub_rectLayout com.dmt.gestureproject_1:rectLayout}</code></td><td></td></tr>
<tr><td><code>{@link #WatchViewStub_roundLayout com.dmt.gestureproject_1:roundLayout}</code></td><td></td></tr>
</table>
@see #WatchViewStub_rectLayout
@see #WatchViewStub_roundLayout
*/
public static final int[] WatchViewStub = {
0x7f010017, 0x7f010018
};
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#rectLayout}
attribute's value can be found in the {@link #WatchViewStub} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.dmt.gestureproject_1:rectLayout
*/
public static final int WatchViewStub_rectLayout = 0;
/**
<p>This symbol is the offset where the {@link com.dmt.gestureproject_1.R.attr#roundLayout}
attribute's value can be found in the {@link #WatchViewStub} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.dmt.gestureproject_1:roundLayout
*/
public static final int WatchViewStub_roundLayout = 1;
};
}
| apache-2.0 |