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

com.github.useful_solutions.tosamara_sdk.classifier.pojo.Affiliation Maven / Gradle / Ivy

There is a newer version: 1.5
Show newest version
package com.github.useful_solutions.tosamara_sdk.classifier.pojo;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.stream.Stream;

public enum Affiliation {

    MUNICIPAL("Городской муниципальный маршрут"),
    COMMERCIAL("Городской коммерческий маршрут"),
    SUBURBAN("Пригородный маршрут"),
    SEASON("Сезонный (дачный) маршрут"),
    SPECIAL("Специальный маршрут"),
    INTERURBAN("Междугородний маршрут");

    private String description;

    Affiliation(String description) {
        this.description = description;
    }

    @Nullable
    public static Affiliation convert(String description) {
        return Stream.of(Affiliation.values())
                .filter(tt -> tt.description.equals(description))
                .findFirst().orElse(null);
    }

    public static String convert(@NotNull Affiliation affiliation) {
        return affiliation.description;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy