com.sinch.sdk.core.utils.EnumDynamic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sinch-sdk-java Show documentation
Show all versions of sinch-sdk-java Show documentation
SDK providing a Java API for the Sinch REST APIs.
package com.sinch.sdk.core.utils;
/**
* Abstract class providing common definition to extendable enums
*
* @param Type of value
* @param Enum type
*/
public abstract class EnumDynamic> {
private final T value;
protected EnumDynamic(T value) {
this.value = value;
}
/**
* Get enum value as String
*
* @return Enum value
*/
public T value() {
return value;
}
@Override
public String toString() {
return value().toString();
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof EnumDynamic)) {
return false;
}
return java.util.Objects.equals(this.value, ((EnumDynamic, ?>) o).value());
}
@Override
public int hashCode() {
return value.hashCode();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy