io.qt.serialbus.QModbusResponse Maven / Gradle / Ivy
Show all versions of qtjambi-serialbus Show documentation
package io.qt.serialbus;
import io.qt.*;
/**
* Container class containing the function code and payload that is stored inside a Modbus ADU
* Java wrapper for Qt class QModbusResponse
*/
public class QModbusResponse extends io.qt.serialbus.QModbusPdu
implements java.lang.Cloneable
{
/**
* Java wrapper for Qt callable QtJambiAPI::FunctionType<int,const QModbusResponse&>::type
*/
@FunctionalInterface
public interface CalcFunction extends QtObjectInterface, java.util.function.ToIntFunction {
@Override
public int applyAsInt(io.qt.serialbus.@NonNull QModbusResponse arg__1);
/**
* @hidden
* Implementor class for interface {@link CalcFunction}
*/
public static abstract class Impl extends QtObject implements CalcFunction{
static {
QtJambi_LibraryUtilities.initialize();
}
public Impl(){
super((QPrivateConstructor)null);
initialize_native(this);
}
protected Impl(QPrivateConstructor p){
super(p);
}
private static native void initialize_native(CalcFunction instance);
@NativeAccess
private final static class ConcreteWrapper extends Impl {
private ConcreteWrapper(QPrivateConstructor c){
super(c);
}
@Override
public int applyAsInt(io.qt.serialbus.@NonNull QModbusResponse arg__1){
return applyAsInt_native(QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
private native int applyAsInt_native(long arg__1);
}
}
}
/**
* See QModbusResponse:: QModbusResponse()
*/
public QModbusResponse(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QModbusResponse instance);
/**
* See QModbusResponse:: QModbusResponse(QModbusPdu)
*/
public QModbusResponse(io.qt.serialbus.@NonNull QModbusPdu pdu){
super((QPrivateConstructor)null);
initialize_native(this, pdu);
}
private native static void initialize_native(QModbusResponse instance, io.qt.serialbus.QModbusPdu pdu);
/**
* See QModbusResponse:: QModbusResponse(QModbusPdu::FunctionCode, QByteArray)
*/
public QModbusResponse(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode code, io.qt.core.@NonNull QByteArray newData){
super((QPrivateConstructor)null);
initialize_native(this, code, newData);
}
private native static void initialize_native(QModbusResponse instance, io.qt.serialbus.QModbusPdu.FunctionCode code, io.qt.core.QByteArray newData);
/**
* See QModbusResponse:: QModbusResponse(QModbusResponse)
*/
public QModbusResponse(io.qt.serialbus.@NonNull QModbusResponse other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QModbusResponse instance, io.qt.serialbus.QModbusResponse other);
/**
* See operator<<(QDataStream&, QModbusResponse)
*/
@QtUninvokable
public void writeTo(io.qt.core.@StrictNonNull QDataStream stream){
java.util.Objects.requireNonNull(stream, "Argument 'stream': null not expected.");
writeTo_native_ref_QDataStream(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(stream));
}
@QtUninvokable
private native void writeTo_native_ref_QDataStream(long __this__nativeId, long stream);
/**
* See operator==(QModbusResponse, QModbusResponse)
*/
@QtUninvokable
public final boolean equals(io.qt.serialbus.@NonNull QModbusResponse value2){
return equals_native_cref_QModbusResponse(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(value2));
}
@QtUninvokable
private native boolean equals_native_cref_QModbusResponse(long __this__nativeId, long value2);
/**
* See operator>>(QDataStream&, QModbusResponse&)
*/
@QtUninvokable
public void readFrom(io.qt.core.@StrictNonNull QDataStream stream){
java.util.Objects.requireNonNull(stream, "Argument 'stream': null not expected.");
readFrom_native_ref_QDataStream(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(stream));
}
@QtUninvokable
private native void readFrom_native_ref_QDataStream(long __this__nativeId, long stream);
/**
* See QModbusResponse:: calculateDataSize(QModbusResponse)
*/
public static int calculateDataSize(io.qt.serialbus.@NonNull QModbusResponse pdu){
return calculateDataSize_native_cref_QModbusResponse(QtJambi_LibraryUtilities.internal.checkedNativeId(pdu));
}
private native static int calculateDataSize_native_cref_QModbusResponse(long pdu);
/**
* See QModbusResponse:: minimumDataSize(QModbusResponse)
*/
public static int minimumDataSize(io.qt.serialbus.@NonNull QModbusResponse pdu){
return minimumDataSize_native_cref_QModbusResponse(QtJambi_LibraryUtilities.internal.checkedNativeId(pdu));
}
private native static int minimumDataSize_native_cref_QModbusResponse(long pdu);
/**
* See QModbusResponse:: registerDataSizeCalculator(QModbusPdu::FunctionCode, QModbusResponse::CalcFuncPtr)
*/
public static void registerDataSizeCalculator(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode fc, io.qt.serialbus.QModbusResponse.@Nullable CalcFunction func){
registerDataSizeCalculator_native_QModbusPdu_FunctionCode_QModbusResponse_CalcFuncPtr(fc.value(), func);
}
private native static void registerDataSizeCalculator_native_QModbusPdu_FunctionCode_QModbusResponse_CalcFuncPtr(int fc, io.qt.serialbus.QModbusResponse.CalcFunction func);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QModbusResponse(QPrivateConstructor p) { super(p); }
/**
* See operator==(QModbusResponse, QModbusResponse)
*/
@Override
@QtUninvokable
public boolean equals(Object other) {
if (other==null || other instanceof io.qt.serialbus.QModbusResponse) {
return equals((io.qt.serialbus.QModbusResponse) other);
}
return false;
}
/**
* Returns the objects's hash code computed by qHash(QModbusResponse)
.
*/
@QtUninvokable
@Override
public int hashCode() {
return hashCode_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native static int hashCode_native(long __this_nativeId);
/**
* Creates and returns a copy of this object.
See QModbusResponse:: QModbusResponse(QModbusResponse)
*/
@QtUninvokable
@Override
public QModbusResponse clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QModbusResponse clone_native(long __this_nativeId);
/**
* Overloaded constructor for {@link #QModbusResponse(io.qt.serialbus.QModbusPdu.FunctionCode, io.qt.core.QByteArray)}
* with newData = new io.qt.core.QByteArray()
.
*/
public QModbusResponse(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode code) {
this(code, new io.qt.core.QByteArray());
}
/**
* Overloaded constructor for {@link #QModbusResponse(io.qt.serialbus.QModbusPdu.FunctionCode, io.qt.core.QByteArray)}.
*/
public QModbusResponse(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode code, byte @NonNull[] newData) {
this(code, new io.qt.core.QByteArray(newData));
}
}