io.qt.internal.EnumFlags Maven / Gradle / Ivy
package io.qt.internal;
/**
* Java wrapper for Qt enum EnumFlags
*/
public enum EnumFlags implements io.qt.QtFlagEnumerator {
EnumIsFlag(1),
EnumIsScoped(2);
private EnumFlags(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public EnumAttributes asFlags() {
return new EnumAttributes(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public EnumAttributes combined(EnumFlags e) {
return new EnumAttributes(this, e);
}
/**
* Creates a new {@link EnumAttributes} from the entries.
* @param values entries
* @return new flag
*/
public static EnumAttributes flags(EnumFlags ... values) {
return new EnumAttributes(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static EnumFlags resolve(int value) {
switch (value) {
case 1: return EnumIsFlag;
case 2: return EnumIsScoped;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy