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

io.qt.internal.MethodAttributes 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 MethodAttributes extends QFlags<@NonNull MethodFlags> implements Comparable<@NonNull MethodAttributes> {
    private static final long serialVersionUID = 0x3ae03817d7c6c40eL;
    static {
        QtJambi_LibraryUtilities.initialize();
    }

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

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

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

    /**
     * Sets the flag e
     * @param e enum entry
     * @return this
     */
    public final @NonNull MethodAttributes setFlag(@Nullable MethodFlags 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 MethodAttributes setFlag(@Nullable MethodFlags 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 MethodAttributes.
     * @return array of enum entries
     */
    @Override
    public final @NonNull MethodFlags @NonNull[] flags(){
        return super.flags(MethodFlags.values());
    }

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy