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

cdc.perfs.instrument.ExtendedYesNo Maven / Gradle / Ivy

There is a newer version: 0.52.0
Show newest version
package cdc.perfs.instrument;

public enum ExtendedYesNo {
    STRONG_NO,
    WEAK_NO,
    STRONG_YES,
    WEAK_YES,
    INHERITED;

    public boolean isYes() {
        return this == STRONG_YES || this == WEAK_YES;
    }

    public boolean isNo() {
        return this == STRONG_NO || this == WEAK_NO;
    }

    public boolean isStrong() {
        return this == STRONG_NO || this == STRONG_YES;
    }

    public boolean isWeak() {
        return this == WEAK_NO || this == WEAK_YES;
    }

    public ExtendedYesNo mergeWithChild(ExtendedYesNo child) {
        if (isStrong()) {
            return this;
        } else if (isWeak()) {
            if (child == INHERITED) {
                return this;
            } else {
                return child;
            }
        } else {
            throw new IllegalArgumentException();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy