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

com.github.muratkaragozgil.netmera4j.constant.TargetCondition Maven / Gradle / Ivy

There is a newer version: 1.6
Show newest version
package com.github.muratkaragozgil.netmera4j.constant;

import java.util.Arrays;

/**
 * @author Murat Karagözgil
 */
public enum TargetCondition {
    AND("$and"),
    OR("$or"),
    NOT("$not");

    private String name;

    TargetCondition(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public static TargetCondition getTargetCondition(String name) {
        return Arrays.stream(values())
                .filter(bl -> bl.name.equalsIgnoreCase(name))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException("Unknown target condition identifier. [" + name + "]"));
    }

    @Override
    public String toString() {
        return this.name;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy