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

io.protostuff.compiler.model.EnumContainer Maven / Gradle / Ivy

There is a newer version: 3.1.40
Show newest version
package io.protostuff.compiler.model;

import java.util.List;

import javax.annotation.Nullable;

/**
 * @author Kostiantyn Shchepanovskyi
 */
public interface EnumContainer {

    List getEnums();

    /**
     * Get enum that is declared under this container.
     *
     * @param name the enum short name
     * @return enum instance or null if message with given name is not declared under
     * this container
     */
    @Nullable
    default Enum getEnum(String name) {
        for (Enum anEnum : getEnums()) {
            if (name.equals(anEnum.getName())) {
                return anEnum;
            }
        }
        return null;
    }

    void addEnum(Enum e);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy