INT-41: Restore old woody interfaces (#26)

This commit is contained in:
Baikov Dmitrii 2022-01-19 00:38:26 -08:00 committed by GitHub
parent 378529478f
commit 6c2e819e79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 92 additions and 64 deletions

View File

@ -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>

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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>