io.qt.serialbus.QModbusRequest 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 QModbusRequest
*/
public class QModbusRequest extends io.qt.serialbus.QModbusPdu
implements java.lang.Cloneable
{
/**
* Java wrapper for Qt callable QtJambiAPI::FunctionType<int,const QModbusRequest&>::type
*/
@FunctionalInterface
public interface CalcFunction extends QtObjectInterface, java.util.function.ToIntFunction {
@Override
public int applyAsInt(io.qt.serialbus.@NonNull QModbusRequest 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 QModbusRequest arg__1){
return applyAsInt_native(QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
private native int applyAsInt_native(long arg__1);
}
}
}
/**
* See QModbusRequest:: QModbusRequest()
*/
public QModbusRequest(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QModbusRequest instance);
/**
* See QModbusRequest:: QModbusRequest(QModbusPdu)
*/
public QModbusRequest(io.qt.serialbus.@NonNull QModbusPdu pdu){
super((QPrivateConstructor)null);
initialize_native(this, pdu);
}
private native static void initialize_native(QModbusRequest instance, io.qt.serialbus.QModbusPdu pdu);
/**
* See QModbusRequest:: QModbusRequest(QModbusPdu::FunctionCode, QByteArray)
*/
public QModbusRequest(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(QModbusRequest instance, io.qt.serialbus.QModbusPdu.FunctionCode code, io.qt.core.QByteArray newData);
/**
* See QModbusRequest:: QModbusRequest(QModbusRequest)
*/
public QModbusRequest(io.qt.serialbus.@NonNull QModbusRequest other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QModbusRequest instance, io.qt.serialbus.QModbusRequest other);
/**
* See operator<<(QDataStream&, QModbusRequest)
*/
@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==(QModbusRequest, QModbusRequest)
*/
@QtUninvokable
public final boolean equals(io.qt.serialbus.@NonNull QModbusRequest value2){
return equals_native_cref_QModbusRequest(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(value2));
}
@QtUninvokable
private native boolean equals_native_cref_QModbusRequest(long __this__nativeId, long value2);
/**
* See operator>>(QDataStream&, QModbusRequest&)
*/
@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 QModbusRequest:: calculateDataSize(QModbusRequest)
*/
public static int calculateDataSize(io.qt.serialbus.@NonNull QModbusRequest pdu){
return calculateDataSize_native_cref_QModbusRequest(QtJambi_LibraryUtilities.internal.checkedNativeId(pdu));
}
private native static int calculateDataSize_native_cref_QModbusRequest(long pdu);
/**
* See QModbusRequest:: minimumDataSize(QModbusRequest)
*/
public static int minimumDataSize(io.qt.serialbus.@NonNull QModbusRequest pdu){
return minimumDataSize_native_cref_QModbusRequest(QtJambi_LibraryUtilities.internal.checkedNativeId(pdu));
}
private native static int minimumDataSize_native_cref_QModbusRequest(long pdu);
/**
* See QModbusRequest:: registerDataSizeCalculator(QModbusPdu::FunctionCode, QModbusRequest::CalcFuncPtr)
*/
public static void registerDataSizeCalculator(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode fc, io.qt.serialbus.QModbusRequest.@Nullable CalcFunction func){
registerDataSizeCalculator_native_QModbusPdu_FunctionCode_QModbusRequest_CalcFuncPtr(fc.value(), func);
}
private native static void registerDataSizeCalculator_native_QModbusPdu_FunctionCode_QModbusRequest_CalcFuncPtr(int fc, io.qt.serialbus.QModbusRequest.CalcFunction func);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QModbusRequest(QPrivateConstructor p) { super(p); }
/**
* See operator==(QModbusRequest, QModbusRequest)
*/
@Override
@QtUninvokable
public boolean equals(Object other) {
if (other==null || other instanceof io.qt.serialbus.QModbusRequest) {
return equals((io.qt.serialbus.QModbusRequest) other);
}
return false;
}
/**
* Returns the objects's hash code computed by qHash(QModbusRequest)
.
*/
@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 QModbusRequest:: QModbusRequest(QModbusRequest)
*/
@QtUninvokable
@Override
public QModbusRequest clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QModbusRequest clone_native(long __this_nativeId);
/**
* Overloaded constructor for {@link #QModbusRequest(io.qt.serialbus.QModbusPdu.FunctionCode, io.qt.core.QByteArray)}
* with newData = new io.qt.core.QByteArray()
.
*/
public QModbusRequest(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode code) {
this(code, new io.qt.core.QByteArray());
}
/**
* Overloaded constructor for {@link #QModbusRequest(io.qt.serialbus.QModbusPdu.FunctionCode, io.qt.core.QByteArray)}.
*/
public QModbusRequest(io.qt.serialbus.QModbusPdu.@NonNull FunctionCode code, byte @NonNull[] newData) {
this(code, new io.qt.core.QByteArray(newData));
}
}