io.qt.core.QCommandLineOption Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Defines a possible command-line option
* Java wrapper for Qt class QCommandLineOption
*/
public class QCommandLineOption extends QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QCommandLineOption::Flag
*
* @see Flags
*/
public enum Flag implements QtFlagEnumerator {
/**
* Representing QCommandLineOption:: HiddenFromHelp
*/
HiddenFromHelp(1),
/**
* Representing QCommandLineOption:: ShortOptionStyle
*/
ShortOptionStyle(2);
static {
QtJambi_LibraryUtilities.initialize();
}
private Flag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
@Override
public @NonNull Flags asFlags() {
return new Flags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull Flags combined(@NonNull Flag 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 Flags cleared(@NonNull Flag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link Flags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull Flags flags(@Nullable Flag @NonNull... values) {
return new Flags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull Flag resolve(int value) {
switch (value) {
case 1: return HiddenFromHelp;
case 2: return ShortOptionStyle;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link Flag}
*/
public static final class Flags extends QFlags implements Comparable {
private static final long serialVersionUID = 0x92d9bce6c929c1c6L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new Flags where the flags in args
are set.
* @param args enum entries
*/
public Flags(@Nullable Flag @NonNull... args){
super(args);
}
/**
* Creates a new Flags with given value
.
* @param value
*/
public Flags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new Flags
*/
@Override
public final @NonNull Flags combined(@StrictNonNull Flag e){
return new Flags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
@Override
public final @NonNull Flags setFlag(@Nullable Flag e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
@Override
public final @NonNull Flags setFlag(@Nullable Flag 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 Flags.
* @return array of enum entries
*/
@Override
public final @NonNull Flag @NonNull[] flags(){
return super.flags(Flag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull Flags clone(){
return new Flags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull Flags other){
return Integer.compare(value(), other.value());
}
}
/**
* See QCommandLineOption:: QCommandLineOption(QCommandLineOption)
*/
public QCommandLineOption(io.qt.core.@NonNull QCommandLineOption other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QCommandLineOption instance, io.qt.core.QCommandLineOption other);
/**
* See QCommandLineOption:: QCommandLineOption(QString)
*/
public QCommandLineOption(java.lang.@NonNull String name){
super((QPrivateConstructor)null);
initialize_native(this, name);
}
private native static void initialize_native(QCommandLineOption instance, java.lang.String name);
/**
* See QCommandLineOption:: QCommandLineOption(QString, QString, QString, QString)
*/
public QCommandLineOption(java.lang.@NonNull String name, java.lang.@NonNull String description, java.lang.@NonNull String valueName, java.lang.@NonNull String defaultValue){
super((QPrivateConstructor)null);
initialize_native(this, name, description, valueName, defaultValue);
}
private native static void initialize_native(QCommandLineOption instance, java.lang.String name, java.lang.String description, java.lang.String valueName, java.lang.String defaultValue);
/**
* See QCommandLineOption:: QCommandLineOption(QStringList)
*/
public QCommandLineOption(java.util.@NonNull Collection names){
super((QPrivateConstructor)null);
initialize_native(this, names);
}
private native static void initialize_native(QCommandLineOption instance, java.util.Collection names);
/**
* See QCommandLineOption:: QCommandLineOption(QStringList, QString, QString, QString)
*/
public QCommandLineOption(java.util.@NonNull Collection names, java.lang.@NonNull String description, java.lang.@NonNull String valueName, java.lang.@NonNull String defaultValue){
super((QPrivateConstructor)null);
initialize_native(this, names, description, valueName, defaultValue);
}
private native static void initialize_native(QCommandLineOption instance, java.util.Collection names, java.lang.String description, java.lang.String valueName, java.lang.String defaultValue);
/**
* See QCommandLineOption:: defaultValues()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QStringList defaultValues(){
return defaultValues_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QStringList defaultValues_native_constfct(long __this__nativeId);
/**
* See QCommandLineOption:: description()const
*/
@QtUninvokable
public final java.lang.@NonNull String description(){
return description_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String description_native_constfct(long __this__nativeId);
/**
* See QCommandLineOption:: flags()const
*/
@QtUninvokable
public final io.qt.core.QCommandLineOption.@NonNull Flags flags(){
return new io.qt.core.QCommandLineOption.Flags(flags_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int flags_native_constfct(long __this__nativeId);
/**
* See QCommandLineOption:: names()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QStringList names(){
return names_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QStringList names_native_constfct(long __this__nativeId);
/**
* See QCommandLineOption:: operator=(QCommandLineOption)
*/
@QtUninvokable
public final void assign(io.qt.core.@NonNull QCommandLineOption other){
assign_native_cref_QCommandLineOption(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void assign_native_cref_QCommandLineOption(long __this__nativeId, long other);
/**
* See QCommandLineOption:: setDefaultValue(QString)
*/
@QtUninvokable
public final void setDefaultValue(java.lang.@NonNull String defaultValue){
setDefaultValue_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), defaultValue);
}
@QtUninvokable
private native void setDefaultValue_native_cref_QString(long __this__nativeId, java.lang.String defaultValue);
/**
* See QCommandLineOption:: setDefaultValues(QStringList)
*/
@QtUninvokable
public final void setDefaultValues(java.util.@NonNull Collection defaultValues){
setDefaultValues_native_cref_QStringList(QtJambi_LibraryUtilities.internal.nativeId(this), defaultValues);
}
@QtUninvokable
private native void setDefaultValues_native_cref_QStringList(long __this__nativeId, java.util.Collection defaultValues);
/**
* See QCommandLineOption:: setDescription(QString)
*/
@QtUninvokable
public final void setDescription(java.lang.@NonNull String description){
setDescription_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), description);
}
@QtUninvokable
private native void setDescription_native_cref_QString(long __this__nativeId, java.lang.String description);
/**
* See QCommandLineOption:: setFlags(QCommandLineOption::Flags)
*/
@QtUninvokable
public final void setFlags(io.qt.core.QCommandLineOption.@NonNull Flags aflags){
setFlags_native_QCommandLineOption_Flags(QtJambi_LibraryUtilities.internal.nativeId(this), aflags.value());
}
@QtUninvokable
private native void setFlags_native_QCommandLineOption_Flags(long __this__nativeId, int aflags);
/**
* See QCommandLineOption:: setValueName(QString)
*/
@QtUninvokable
public final void setValueName(java.lang.@NonNull String name){
setValueName_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), name);
}
@QtUninvokable
private native void setValueName_native_cref_QString(long __this__nativeId, java.lang.String name);
/**
* See QCommandLineOption:: swap(QCommandLineOption&)
*/
@QtUninvokable
public final void swap(io.qt.core.@StrictNonNull QCommandLineOption other){
java.util.Objects.requireNonNull(other, "Argument 'other': null not expected.");
swap_native_ref_QCommandLineOption(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void swap_native_ref_QCommandLineOption(long __this__nativeId, long other);
/**
* See QCommandLineOption:: valueName()const
*/
@QtUninvokable
public final java.lang.@NonNull String valueName(){
return valueName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String valueName_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QCommandLineOption(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QCommandLineOption:: QCommandLineOption(QCommandLineOption)
*/
@QtUninvokable
@Override
public QCommandLineOption clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QCommandLineOption clone_native(long __this_nativeId);
/**
* Overloaded constructor for {@link #QCommandLineOption(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}
* with defaultValue = (String)null
.
*/
public QCommandLineOption(java.lang.@NonNull String name, java.lang.@NonNull String description, java.lang.@NonNull String valueName) {
this(name, description, valueName, (String)null);
}
/**
* Overloaded constructor for {@link #QCommandLineOption(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}
* with:
* valueName = (String)null
* defaultValue = (String)null
*
*/
public QCommandLineOption(java.lang.@NonNull String name, java.lang.@NonNull String description) {
this(name, description, (String)null, (String)null);
}
/**
* Overloaded constructor for {@link #QCommandLineOption(java.util.Collection, java.lang.String, java.lang.String, java.lang.String)}
* with defaultValue = (String)null
.
*/
public QCommandLineOption(java.util.@NonNull Collection names, java.lang.@NonNull String description, java.lang.@NonNull String valueName) {
this(names, description, valueName, (String)null);
}
/**
* Overloaded constructor for {@link #QCommandLineOption(java.util.Collection, java.lang.String, java.lang.String, java.lang.String)}
* with:
* valueName = (String)null
* defaultValue = (String)null
*
*/
public QCommandLineOption(java.util.@NonNull Collection names, java.lang.@NonNull String description) {
this(names, description, (String)null, (String)null);
}
/**
* Overloaded function for {@link #setFlags(io.qt.core.QCommandLineOption.Flags)}.
*/
@QtUninvokable
public final void setFlags(io.qt.core.QCommandLineOption.@NonNull Flag @NonNull... aflags) {
setFlags(new io.qt.core.QCommandLineOption.Flags(aflags));
}
}