Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
format sources under base/ (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao authored Mar 5, 2019
1 parent ffa86ba commit dcbbb5e
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 376 deletions.
1 change: 1 addition & 0 deletions scripts/format-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SRC_FILES=(src/main/java/com/xiaomi/infra/pegasus/client/*.java
src/main/java/com/xiaomi/infra/pegasus/rpc/async/*.java
src/main/java/com/xiaomi/infra/pegasus/operator/*.java
src/main/java/com/xiaomi/infra/pegasus/tools/*.java
src/main/java/com/xiaomi/infra/pegasus/base/*.java
src/test/java/com/xiaomi/infra/pegasus/client/*.java
src/test/java/com/xiaomi/infra/pegasus/metrics/*.java
src/test/java/com/xiaomi/infra/pegasus/rpc/async/*.java
Expand Down
73 changes: 29 additions & 44 deletions src/main/java/com/xiaomi/infra/pegasus/base/blob.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,32 @@
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* <p>DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.xiaomi.infra.pegasus.base;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.xiaomi.infra.pegasus.thrift.*;
import com.xiaomi.infra.pegasus.thrift.async.*;
import com.xiaomi.infra.pegasus.thrift.meta_data.*;
import com.xiaomi.infra.pegasus.thrift.transport.*;
import com.xiaomi.infra.pegasus.thrift.protocol.*;
import com.xiaomi.infra.pegasus.thrift.transport.*;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public class blob implements TBase<blob, blob._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("blob");
public byte[] data;


/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
/**
* The set of fields this struct contains, along with convenience methods for finding and
* manipulating them.
*/
public enum _Fields implements TFieldIdEnum {
;
;

private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Expand All @@ -46,29 +39,23 @@ public enum _Fields implements TFieldIdEnum {
}
}

/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
/** Find the _Fields constant that matches fieldId, or null if its not found. */
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
switch (fieldId) {
default:
return null;
}
}

/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
/** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
if (fields == null)
throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}

/**
* Find the _Fields constant that matches name, or null if its not found.
*/
/** Find the _Fields constant that matches name, or null if its not found. */
public static _Fields findByName(String name) {
return byName.get(name);
}
Expand All @@ -89,7 +76,9 @@ public String getFieldName() {
return _fieldName;
}
}

public static final Map<_Fields, FieldMetaData> metaDataMap;

static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
Expand All @@ -103,9 +92,7 @@ public blob() {
public blob(byte[] data) {
this.data = data;
}
/**
* Performs a deep copy on <i>other</i>.
*/
/** Performs a deep copy on <i>other</i>. */
public blob(blob other) {
this.data = other.data;
}
Expand All @@ -130,7 +117,10 @@ public Object getFieldValue(_Fields field) {
throw new IllegalStateException();
}

/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
/**
* Returns true if field corresponding to fieldID is set (has been asigned a value) and false
* otherwise
*/
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
Expand All @@ -143,16 +133,13 @@ public boolean isSet(_Fields field) {

@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof blob)
return this.equals((blob)that);
if (that == null) return false;
if (that instanceof blob) return this.equals((blob) that);
return false;
}

public boolean equals(blob that) {
if (that == null)
return false;
if (that == null) return false;
return this.data.equals(that.data);
}

Expand Down Expand Up @@ -198,6 +185,4 @@ public String toString() {
public void validate() throws TException {
// check for required fields
}

}

Loading

0 comments on commit dcbbb5e

Please sign in to comment.