io.qt.core.QBluetoothPermission Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Access Bluetooth peripherals
* Java wrapper for Qt class QBluetoothPermission
*/
public class QBluetoothPermission extends QPermission
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QBluetoothPermission.class);
/**
* Java wrapper for Qt enum QBluetoothPermission::CommunicationMode
*
* @see CommunicationModes
*/
public enum CommunicationMode implements QtByteFlagEnumerator {
/**
* Representing QBluetoothPermission:: Access
*/
Access((byte)1),
/**
* Representing QBluetoothPermission:: Advertise
*/
Advertise((byte)2),
/**
* Representing QBluetoothPermission:: Default
*/
Default((byte)3);
static {
QtJambi_LibraryUtilities.initialize();
}
private CommunicationMode(byte value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public byte value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull CommunicationModes asFlags() {
return new CommunicationModes(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull CommunicationModes combined(@NonNull CommunicationMode e) {
return asFlags().setFlag(e, true);
}
/**
* Excludes other enum entry from a flag of this entry.
* @param e enum entry
* @return new flag
*/
public @NonNull CommunicationModes cleared(@NonNull CommunicationMode e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link CommunicationModes} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull CommunicationModes flags(@Nullable CommunicationMode @NonNull... values) {
return new CommunicationModes(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull CommunicationMode resolve(byte value) {
switch (value) {
case 1: return Access;
case 2: return Advertise;
case 3: return Default;
default: throw new QNoSuchEnumValueException(value);
}
}
private final byte value;
}
/**
* {@link QFlags} type for enum {@link CommunicationMode}
*/
public static final class CommunicationModes extends QFlags implements Comparable {
private static final long serialVersionUID = 0x152f17af830c82cL;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new CommunicationModes where the flags in args
are set.
* @param args enum entries
*/
public CommunicationModes(@Nullable CommunicationMode @NonNull... args){
super(args);
}
/**
* Creates a new CommunicationModes with given value
.
* @param value
*/
public CommunicationModes(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new CommunicationModes
*/
@Override
public final @NonNull CommunicationModes combined(@StrictNonNull CommunicationMode e){
return new CommunicationModes(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull CommunicationModes setFlag(@Nullable CommunicationMode e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final @NonNull CommunicationModes setFlag(@Nullable CommunicationMode e, boolean on){
if (on) {
setValue(value() | e.value());
}else {
setValue(value() & ~e.value());
}
return this;
}
/**
* Returns an array of flag objects represented by this CommunicationModes.
* @return array of enum entries
*/
@Override
public final @NonNull CommunicationMode @NonNull[] flags(){
return super.flags(CommunicationMode.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull CommunicationModes clone(){
return new CommunicationModes(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull CommunicationModes other){
return Integer.compare(value(), other.value());
}
}
/**
* See QBluetoothPermission:: QBluetoothPermission()
*/
public QBluetoothPermission(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QBluetoothPermission instance);
/**
* See QBluetoothPermission:: QBluetoothPermission(QBluetoothPermission)
*/
public QBluetoothPermission(io.qt.core.@NonNull QBluetoothPermission other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QBluetoothPermission instance, io.qt.core.QBluetoothPermission other);
/**
* See QBluetoothPermission:: communicationModes()const
*/
@QtUninvokable
public final io.qt.core.QBluetoothPermission.@NonNull CommunicationModes communicationModes(){
return new io.qt.core.QBluetoothPermission.CommunicationModes(communicationModes_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int communicationModes_native_constfct(long __this__nativeId);
/**
* See QBluetoothPermission:: operator=(QBluetoothPermission)
*/
@QtUninvokable
public final void assign(io.qt.core.@NonNull QBluetoothPermission other){
assign_native_cref_QBluetoothPermission(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void assign_native_cref_QBluetoothPermission(long __this__nativeId, long other);
/**
* See operator==(QBluetoothPermission, QBluetoothPermission)
*/
@QtUninvokable
public final boolean equals(io.qt.core.@NonNull QBluetoothPermission arg__2){
return equals_native_cref_QBluetoothPermission(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__2));
}
@QtUninvokable
private native boolean equals_native_cref_QBluetoothPermission(long __this__nativeId, long arg__2);
/**
* See QBluetoothPermission:: setCommunicationModes(QBluetoothPermission::CommunicationModes)
*/
@QtUninvokable
public final void setCommunicationModes(io.qt.core.QBluetoothPermission.@NonNull CommunicationModes modes){
setCommunicationModes_native_QBluetoothPermission_CommunicationModes(QtJambi_LibraryUtilities.internal.nativeId(this), modes.value());
}
@QtUninvokable
private native void setCommunicationModes_native_QBluetoothPermission_CommunicationModes(long __this__nativeId, int modes);
/**
* See QBluetoothPermission:: swap(QBluetoothPermission&)
*/
@QtUninvokable
public final void swap(io.qt.core.@StrictNonNull QBluetoothPermission other){
java.util.Objects.requireNonNull(other, "Argument 'other': null not expected.");
swap_native_ref_QBluetoothPermission(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void swap_native_ref_QBluetoothPermission(long __this__nativeId, long other);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QBluetoothPermission(QPrivateConstructor p) { super(p); }
/**
* See operator==(QBluetoothPermission, QBluetoothPermission)
*/
@Override
@QtUninvokable
public boolean equals(Object other) {
if (other instanceof io.qt.core.QBluetoothPermission) {
return equals((io.qt.core.QBluetoothPermission) other);
}
return false;
}
/**
* Returns the objects's hash code computed by qHash(QBluetoothPermission)
.
*/
@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 QBluetoothPermission:: QBluetoothPermission(QBluetoothPermission)
*/
@QtUninvokable
@Override
public QBluetoothPermission clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QBluetoothPermission clone_native(long __this_nativeId);
/**
* Overloaded function for {@link #setCommunicationModes(io.qt.core.QBluetoothPermission.CommunicationModes)}.
*/
@QtUninvokable
public final void setCommunicationModes(io.qt.core.QBluetoothPermission.@NonNull CommunicationMode @NonNull... modes) {
setCommunicationModes(new io.qt.core.QBluetoothPermission.CommunicationModes(modes));
}
}