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

com.swak.frame.enums.Married Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
package com.swak.frame.enums;

import java.util.Objects;

public enum Married {
	YES(1),
	NO(0);

	private Integer value;

	private Married(Integer value) {
		this.value = value;
	}

	public Integer getValue() {
		return value;
	}

	public static boolean isTrue(Integer value) {
		return Objects.equals(YES.value, value);
	}

	public static boolean isTrue(Boolean value) {
		if(Objects.isNull(value)) {
			return false;
		}
		return value.booleanValue();
	}

	public static Integer convert(Boolean value) {
		if (value == null) {
			return Married.NO.getValue();
		}
		return value ? Married.YES.getValue() : Married.NO.getValue();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy