package com.ywt.alipaympapi.models.enums;

//与本人关系枚举
public enum RelationshipEnum {
    MYSELF("本人", 1),
    FAMILY("家庭成员", 2),
    KINSFOLK("亲戚", 3),
    FRIEND("朋友", 4),
    OTHER("其他", 5),
    PARENTS("父母", 6),
    CHILDREN("子女", 7),
    ;

    private final String displayName;
    private final int value;

    RelationshipEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static RelationshipEnum valueOf(int value) {
        for (RelationshipEnum item : RelationshipEnum.values()) {
            if (item.getValue() == value) {
                return item;
            }
        }
        return OTHER;
    }
}
