net.gdface.sdk.decorator.FInt2 Maven / Gradle / Ivy
The newest version!
// ______________________________________________________
// Generated by codegen - https://gitee.com/l0km/codegen
// template: thrift/service/perstruct/bean.decorator.class.vm
// ______________________________________________________
package net.gdface.sdk.decorator;
import com.gitee.l0km.xthrift.base.ThriftDecorator;
import com.facebook.swift.codec.ThriftStruct;
import com.facebook.swift.codec.ThriftField;
import com.facebook.swift.codec.ThriftField.Requiredness;
/**
* 通用整数2维向量对象(表示坐标,尺寸)
* @author guyadong
* ========================================
* decorator pattern 装饰者模式代理{@link net.gdface.sdk.FInt2}
* 代理对象必须有默认构造方法,必须是普通类型,不可以有@ThriftStruct注释
* 转发所有{@link net.gdface.sdk.FInt2}get/set方法到{@link #delegate()}指定的实例,
* 计算机生成代码(generated by automated tools ThriftServiceDecoratorGenerator @author guyadong)
*
*/
@ThriftStruct
public final class FInt2 implements ThriftDecorator {
private final net.gdface.sdk.FInt2 delegate;
public FInt2(){
this(new net.gdface.sdk.FInt2());
}
public FInt2(net.gdface.sdk.FInt2 delegate) {
if(null == delegate){
throw new NullPointerException("delegate is null");
}
// 检查被装饰类是否有@ThriftStruct注释
if(delegate.getClass().isAnnotationPresent(ThriftStruct.class)){
throw new IllegalArgumentException(
String.format("NOT ALLOW %s have @ThriftStruct annotation",delegate.getClass().getName()));
}
this.delegate = delegate;
}
/**
* 返回被装饰的{@link net.gdface.sdk.FInt2}实例
*/
@Override
public net.gdface.sdk.FInt2 delegate() {
return delegate;
}
@Override
public int hashCode() {
return delegate().hashCode();
}
@Override
public boolean equals(Object obj) {
return delegate().equals(obj);
}
@Override
public String toString() {
return delegate().toString();
}
/**
* @return x
*/
@ThriftField(value = 1,name = "x",requiredness=Requiredness.REQUIRED)
public int getX(){
return delegate().getX();
}
/**
* @param x 要设置的 x
*/
@ThriftField
public void setX(int x){
delegate().setX(x);
}
/**
* @return y
*/
@ThriftField(value = 2,name = "y",requiredness=Requiredness.REQUIRED)
public int getY(){
return delegate().getY();
}
/**
* @param y 要设置的 y
*/
@ThriftField
public void setY(int y){
delegate().setY(y);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy