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

org.gnome.gtk.SorterOrder Maven / Gradle / Ivy

There is a newer version: 0.11.2
Show newest version
// This file was automatically generated by Java-GI. Do not edit this file
// directly! Visit  for more information.
//
// The API documentation in this file was derived from GObject-Introspection
// metadata and may include text or comments from the original C sources.
//
// Copyright (c), upstream authors as identified in the GObject-Introspection
// metadata.
//
// This generated file is distributed under the same license as the original
// GObject-Introspection data, unless otherwise specified. Users of this file
// are responsible for complying with any licenses or terms required by the
// original authors.
//
// THIS FILE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
//
package org.gnome.gtk;

import io.github.jwharm.javagi.base.Enumeration;
import io.github.jwharm.javagi.interop.Interop;
import java.lang.IllegalStateException;
import java.lang.Override;
import javax.annotation.processing.Generated;
import org.gnome.glib.Type;

/**
 * Describes the type of order that a {@code GtkSorter} may produce.
 */
@Generated("io.github.jwharm.JavaGI")
public enum SorterOrder implements Enumeration {
    /**
     * A partial order. Any {@code GtkOrdering} is possible.
     */
    PARTIAL(0),

    /**
     * No order, all elements are considered equal.
     *   gtk_sorter_compare() will only return {@link org.gnome.gtk.Ordering#EQUAL}.
     */
    NONE(1),

    /**
     * A total order. gtk_sorter_compare() will only
     *   return {@link org.gnome.gtk.Ordering#EQUAL} if an item is compared with itself. Two
     *   different items will never cause this value to be returned.
     */
    TOTAL(2);

    static {
        Gtk.javagi$ensureInitialized();
    }

    private final int value;

    /**
     * Create a new SorterOrder for the provided value
     *
     * @param value the enum value
     */
    private SorterOrder(int value) {
        this.value = value;
    }

    /**
     * Create a new SorterOrder for the provided value
     *
     * @param value the enum value
     * @return the enum for the provided value
     */
    public static SorterOrder of(int value) {
        return switch(value) {
            case 0 -> PARTIAL;
            case 1 -> NONE;
            case 2 -> TOTAL;
            default -> throw new IllegalStateException("Unexpected value: " + value);
        } ;
    }

    /**
     * Get the numeric value of this enum
     *
     * @return the enum value
     */
    @Override
    public int getValue() {
        return value;
    }

    /**
     * Get the GType of the SorterOrder class
     *
     * @return the GType
     */
    public static Type getType() {
        return Interop.getType("gtk_sorter_order_get_type");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy