All Downloads are FREE. Search and download functionalities are using the official Maven repository.

thrift.test.original.TestInterface Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package thrift.test.original;

import java.net.URI;
import java.net.URL;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.facebook.swift.codec.ThriftField;
import com.facebook.swift.codec.ThriftStruct;
import com.gitee.l0km.codegen.annotations.ServicePort;

/**
 * just for testing only
 * @author guyadong
 *
 */
public interface TestInterface {
	public TestBeanA testBean(TestBeanB input);
	public float list(String strInput,int intInput,Date dateInput,byte[] binary, Long longInput);
	public byte[] byteTest(byte[] input) throws TestException;
	public List testList(Map input);
	public List testArray(long[] input);
	public Integer[] testThriftStruct(Setinput);
	@ServicePort(suffix="Url")
	public URL[] testURIURL(URI input);
	public URL[] testURIURL(String input);
	public Float testFloat(Float input);
	public EnumTest testEnum(EnumTest input);
	public void testVoid(int input);
	public enum EnumTest{HELLO,WORLD}
	public static class TestBeanA{
		private byte[] binary;
		private int[] intArray;
		private Map values;
		private List longList;
		private List urls;
		private Float rate;
		private List list;
		private boolean _new;
		public byte[] getBinary() {
			return binary;
		}
		public void setBinary(byte[] binary) {
			this.binary = binary;
		}
		public int[] getIntArray() {
			return intArray;
		}
		public void setIntArray(int[] intArray) {
			this.intArray = intArray;
		}
		public Map getValues() {
			return values;
		}
		public void setValues(Map values) {
			this.values = values;
		}
		public List getLongList() {
			return longList;
		}
		public void setLongList(List longList) {
			this.longList = longList;
		}
		public List getUrls() {
			return urls;
		}
		public void setUrls(List urls) {
			this.urls = urls;
		}
		public Float getRate() {
			return rate;
		}
		public void setRate(Float rate) {
			this.rate = rate;
		}
		public List getList() {
			return list;
		}
		public void setList(List list) {
			this.list = list;
		}
		public boolean isNew() {
			return _new;
		}
		public void setNew(boolean _new) {
			this._new = _new;
		}		
	}
	@ThriftStruct
	public static final class TestBeanB{
		private ByteBuffer buffer;
		private List intArray;
		private Map values;
		private Set doubleList;
		@ThriftField(value = 1)
		public ByteBuffer getBuffer() {
			return buffer;
		}
		@ThriftField
		public void setBuffer(ByteBuffer buffer) {
			this.buffer = buffer;
		}
		@ThriftField(value = 2)
		public List getIntArray() {
			return intArray;
		}
		@ThriftField
		public void setIntArray(List intArray) {
			this.intArray = intArray;
		}
		@ThriftField(value = 3)
		public Map getValues() {
			return values;
		}
		@ThriftField
		public void setValues(Map values) {
			this.values = values;
		}
		@ThriftField(value = 4)
		public Set getDoubleList() {
			return doubleList;
		}
		@ThriftField
		public void setDoubleList(Set doubleList) {
			this.doubleList = doubleList;
		}
	}
	public static class TestException extends Exception{
		private static final long serialVersionUID = 1L;

		public TestException() {
			super();
		}

		public TestException(String arg0, Throwable arg1) {
			super(arg0, arg1);
		}

		public TestException(String arg0) {
			super(arg0);
		}

		public TestException(Throwable arg0) {
			super(arg0);
		}
		
	}
	public static class BaseImpl implements TestInterface{

		@Override
		public float list(String strInput, int intInput, Date dateInput, byte[] binary, Long longInput) {
			return 0;
		}

		@Override
		public byte[] byteTest(byte[] input) throws TestException{
			return null;
		}

		@Override
		public List testList(Map input) {
			return null;
		}

		@Override
		public Integer[] testThriftStruct(Set input) {
			return null;
		}

		@Override
		public List testArray(long[] input) {
			return null;
		}

		@Override
		public URL[] testURIURL(URI input) {
			return null;
		}

		@Override
		public URL[] testURIURL(String input) {
			return null;
		}

		@Override
		public Float testFloat(Float input) {
			return null;
		}

		@Override
		public EnumTest testEnum(EnumTest input) {
			return null;
		}

		@Override
		public TestBeanA testBean(TestBeanB input) {
			return null;
		}

		@Override
		public void testVoid(int input) {
			// TODO 自动生成的方法存根
			
		}
		
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy