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

com.github.yin.flags.FlagMetadata Maven / Gradle / Ivy

Go to download

Easy to use command-line parser, which enables you to define cmdline flags directly the class they are used in.

There is a newer version: 0.3.0-beta2
Show newest version
package com.github.yin.flags;

import com.google.auto.value.AutoValue;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Stores description and other flag attributes.
 * @author yin
 */
@AutoValue
public abstract class FlagMetadata implements Comparable {
    public static  FlagMetadata create(String className, String flagName, String desc, Flag flag) {
        return new AutoValue_FlagMetadata(FlagID.create(className, flagName), desc, flag);
    }
    public abstract FlagID flagID();
    @Nullable public abstract String desc();
    public abstract Flag flag();

    public final int compareTo(@Nonnull FlagMetadata that) {
        return this.flagID().compareTo(that.flagID());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy