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