mirror of
https://github.com/valitydev/woody_java.git
synced 2024-11-06 08:15:21 +00:00
INT-41: Restore old woody interfaces (#26)
This commit is contained in:
parent
378529478f
commit
6c2e819e79
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>woody</artifactId>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -22,10 +22,14 @@ package org.apache.thrift.meta_data;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
public class EnumMetaData extends FieldValueMetaData {
|
||||
public final Class<? extends TEnum> enumClass;
|
||||
|
||||
public EnumMetaData(byte type, Class<? extends TEnum> sClass){
|
||||
super(type);
|
||||
this.enumClass = sClass;
|
||||
}
|
||||
public final Class<? extends TEnum> enumClass;
|
||||
|
||||
public EnumMetaData(byte type, Class<? extends TEnum> sClass){
|
||||
super(type);
|
||||
this.enumClass = sClass;
|
||||
}
|
||||
|
||||
public Class<? extends TEnum> getEnumClass() {
|
||||
return enumClass;
|
||||
}
|
||||
}
|
||||
|
@ -26,47 +26,51 @@ import org.apache.thrift.protocol.TType;
|
||||
* the value(s) of a field
|
||||
*/
|
||||
public class FieldValueMetaData implements java.io.Serializable {
|
||||
public final byte type;
|
||||
public final byte type;
|
||||
|
||||
private final boolean isTypedefType;
|
||||
private final String typedefName;
|
||||
private final boolean isBinary;
|
||||
private final boolean isTypedefType;
|
||||
private final String typedefName;
|
||||
private final boolean isBinary;
|
||||
|
||||
public FieldValueMetaData(byte type, boolean binary) {
|
||||
this.type = type;
|
||||
this.isTypedefType = false;
|
||||
this.typedefName = null;
|
||||
this.isBinary = binary;
|
||||
}
|
||||
public FieldValueMetaData(byte type, boolean binary) {
|
||||
this.type = type;
|
||||
this.isTypedefType = false;
|
||||
this.typedefName = null;
|
||||
this.isBinary = binary;
|
||||
}
|
||||
|
||||
public FieldValueMetaData(byte type) {
|
||||
this(type, false);
|
||||
}
|
||||
public FieldValueMetaData(byte type) {
|
||||
this(type, false);
|
||||
}
|
||||
|
||||
public FieldValueMetaData(byte type, String typedefName) {
|
||||
this.type = type;
|
||||
this.isTypedefType = true;
|
||||
this.typedefName = typedefName;
|
||||
this.isBinary = false;
|
||||
}
|
||||
public FieldValueMetaData(byte type, String typedefName) {
|
||||
this.type = type;
|
||||
this.isTypedefType = true;
|
||||
this.typedefName = typedefName;
|
||||
this.isBinary = false;
|
||||
}
|
||||
|
||||
public boolean isTypedef() {
|
||||
return isTypedefType;
|
||||
}
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getTypedefName() {
|
||||
return typedefName;
|
||||
}
|
||||
public boolean isTypedef() {
|
||||
return isTypedefType;
|
||||
}
|
||||
|
||||
public boolean isStruct() {
|
||||
return type == TType.STRUCT;
|
||||
}
|
||||
public String getTypedefName() {
|
||||
return typedefName;
|
||||
}
|
||||
|
||||
public boolean isContainer() {
|
||||
return type == TType.LIST || type == TType.MAP || type == TType.SET;
|
||||
}
|
||||
public boolean isStruct() {
|
||||
return type == TType.STRUCT;
|
||||
}
|
||||
|
||||
public boolean isBinary() {
|
||||
return isBinary;
|
||||
}
|
||||
public boolean isContainer() {
|
||||
return type == TType.LIST || type == TType.MAP || type == TType.SET;
|
||||
}
|
||||
|
||||
public boolean isBinary() {
|
||||
return isBinary;
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,16 @@
|
||||
package org.apache.thrift.meta_data;
|
||||
|
||||
public class ListMetaData extends FieldValueMetaData {
|
||||
public final FieldValueMetaData elemMetaData;
|
||||
|
||||
public ListMetaData(byte type, FieldValueMetaData eMetaData){
|
||||
super(type);
|
||||
this.elemMetaData = eMetaData;
|
||||
}
|
||||
|
||||
public final FieldValueMetaData elemMetaData;
|
||||
|
||||
public ListMetaData(byte type, FieldValueMetaData eMetaData) {
|
||||
super(type);
|
||||
this.elemMetaData = eMetaData;
|
||||
}
|
||||
|
||||
public FieldValueMetaData getElementMetaData() {
|
||||
return elemMetaData;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,12 +20,22 @@
|
||||
package org.apache.thrift.meta_data;
|
||||
|
||||
public class MapMetaData extends FieldValueMetaData {
|
||||
public final FieldValueMetaData keyMetaData;
|
||||
public final FieldValueMetaData valueMetaData;
|
||||
|
||||
public MapMetaData(byte type, FieldValueMetaData kMetaData, FieldValueMetaData vMetaData){
|
||||
super(type);
|
||||
this.keyMetaData = kMetaData;
|
||||
this.valueMetaData = vMetaData;
|
||||
}
|
||||
|
||||
public final FieldValueMetaData keyMetaData;
|
||||
public final FieldValueMetaData valueMetaData;
|
||||
|
||||
public MapMetaData(byte type, FieldValueMetaData kMetaData, FieldValueMetaData vMetaData) {
|
||||
super(type);
|
||||
this.keyMetaData = kMetaData;
|
||||
this.valueMetaData = vMetaData;
|
||||
}
|
||||
|
||||
public FieldValueMetaData getKeyMetaData() {
|
||||
return keyMetaData;
|
||||
}
|
||||
|
||||
public FieldValueMetaData getValueMetaData() {
|
||||
return valueMetaData;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,10 +22,14 @@ package org.apache.thrift.meta_data;
|
||||
import org.apache.thrift.TBase;
|
||||
|
||||
public class StructMetaData extends FieldValueMetaData {
|
||||
public final Class<? extends TBase> structClass;
|
||||
|
||||
public StructMetaData(byte type, Class<? extends TBase> sClass){
|
||||
super(type);
|
||||
this.structClass = sClass;
|
||||
}
|
||||
public final Class<? extends TBase> structClass;
|
||||
|
||||
public StructMetaData(byte type, Class<? extends TBase> sClass){
|
||||
super(type);
|
||||
this.structClass = sClass;
|
||||
}
|
||||
|
||||
public Class<? extends TBase> getStructClass() {
|
||||
return structClass;
|
||||
}
|
||||
}
|
||||
|
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
||||
<packaging>pom</packaging>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
<artifactId>woody</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3</version>
|
||||
|
||||
<name>Woody Java</name>
|
||||
<description>Java implementation for Woody spec</description>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>woody</artifactId>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>woody</artifactId>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user