All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.internal.MetaObjectFlags Maven / Gradle / Ivy

There is a newer version: 6.8.0
Show newest version
package io.qt.internal;

import io.qt.*;

/**
 * @hidden
 */
public final class MetaObjectFlags extends QFlags<@NonNull MetaObjectFlag> implements Comparable<@NonNull MetaObjectFlags> {
    private static final long serialVersionUID = 0xd7188d44a26bc4a3L;
    static {
        QtJambi_LibraryUtilities.initialize();
    }

    /**
     * Creates a new MetaObjectFlags where the flags in args are set.
     * @param args enum entries
     */
    public MetaObjectFlags(@Nullable MetaObjectFlag @NonNull... args){
        super(args);
    }

    /**
     * Creates a new MetaObjectFlags with given value.
     * @param value
     */
    public MetaObjectFlags(int value) {
        super(value);
    }

    /**
     * Combines this flags with enum entry.
     * @param e enum entry
     * @return new MetaObjectFlags
     */
    @Override
    public final @NonNull MetaObjectFlags combined(@StrictNonNull MetaObjectFlag e){
        return new MetaObjectFlags(value() | e.value());
    }

    /**
     * Sets the flag e
     * @param e enum entry
     * @return this
     */
    public final @NonNull MetaObjectFlags setFlag(@Nullable MetaObjectFlag 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 MetaObjectFlags setFlag(@Nullable MetaObjectFlag e, boolean on){
        if (e!=null) {
            if (on) {
            	setValue(value() | e.value());
            }else {
        	    setValue(value() & ~e.value());
            }
        }
        return this;
    }

    /**
     * Returns an array of flag objects represented by this MetaObjectFlags.
     * @return array of enum entries
     */
    @Override
    public final @NonNull MetaObjectFlag @NonNull[] flags(){
        return super.flags(MetaObjectFlag.values());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final @NonNull MetaObjectFlags clone(){
        return new MetaObjectFlags(value());
    }

    /**
     * Compares this flag with the specified flag for order.
     * {@inheritDoc}
     */
    @Override
    public final int compareTo(@StrictNonNull MetaObjectFlags other){
        return Integer.compare(value(), other.value());
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy