net.gdface.sdk.decorator.CompareResult Maven / Gradle / Ivy
// ______________________________________________________
// 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;
import com.gitee.l0km.xthrift.thrift.TypeTransformer;
/**
* 人脸特征1:N比较结果对象
* 用于保存{@link net.gdface.sdk.FaceApi#compareFaces(byte[], byte[], int)}方法调用的返回结果
* @author guyadong
* ========================================
* decorator pattern 装饰者模式代理{@link net.gdface.sdk.CompareResult}
* 代理对象必须有默认构造方法,必须是普通类型,不可以有@ThriftStruct注释
* 转发所有{@link net.gdface.sdk.CompareResult}get/set方法到{@link #delegate()}指定的实例,
* 计算机生成代码(generated by automated tools ThriftServiceDecoratorGenerator @author guyadong)
*
*/
@ThriftStruct
public final class CompareResult implements ThriftDecorator {
private final net.gdface.sdk.CompareResult delegate;
public CompareResult(){
this(new net.gdface.sdk.CompareResult());
}
public CompareResult(net.gdface.sdk.CompareResult 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.CompareResult}实例
*/
@Override
public net.gdface.sdk.CompareResult 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 codes
*/
@ThriftField(value = 1,name = "codes",requiredness=Requiredness.OPTIONAL)
public java.util.List getCodes(){
return TypeTransformer.getInstance().to(
delegate().getCodes(),
net.gdface.sdk.CodeInfo.class,
CodeInfo.class);
}
/**
* @param codes 要设置的 codes
*/
@ThriftField
public void setCodes(java.util.List codes){
delegate().setCodes(TypeTransformer.getInstance().toArray(
codes,
CodeInfo.class,
net.gdface.sdk.CodeInfo.class));
}
/**
* @return similartys
*/
@ThriftField(value = 2,name = "similartys",requiredness=Requiredness.OPTIONAL)
public java.util.List getSimilartys(){
return TypeTransformer.getInstance().to(
delegate().getSimilartys(),
double.class,
double.class);
}
/**
* @param similartys 要设置的 similartys
*/
@ThriftField
public void setSimilartys(java.util.List similartys){
delegate().setSimilartys(TypeTransformer.getInstance().todoubleArray(
similartys,
double.class,
double.class));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy