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

io.smallrye.graphql.schema.model.EnumValue Maven / Gradle / Ivy

There is a newer version: 2.11.0
Show newest version
package io.smallrye.graphql.schema.model;

import java.util.List;

/**
 * Represents one of an enum's values. Is part of {@link EnumType}.
 *
 * @author Felix König ([email protected])
 */
public final class EnumValue {

    private String description;
    private String value;
    private List directiveInstances;

    public EnumValue() {
    }

    public EnumValue(String description, String value, List directiveInstances) {
        this.description = description;
        this.value = value;
        this.directiveInstances = directiveInstances;
    }

    public String getDescription() {
        return description;
    }

    public String getValue() {
        return value;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "EnumValue{" +
                "description=" + description +
                ", value=" + value +
                ", directiveInstances=" + directiveInstances +
                '}';
    }

    public boolean hasDirectiveInstances() {
        return directiveInstances != null && !directiveInstances.isEmpty();
    }

    public List getDirectiveInstances() {
        return directiveInstances;
    }

    public void setDirectiveInstances(List directiveInstances) {
        this.directiveInstances = directiveInstances;
    }

    public void addDirectiveInstance(DirectiveInstance directiveInstance) {
        this.directiveInstances.add(directiveInstance);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy